Commit 73dcbd9c92168b4a21d6c0a3b4295dcce25d24c8

Authored by youxiw2000
1 parent 670f5354

m

trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarUser.java
@@ -70,6 +70,7 @@ public class GarUser implements Serializable { @@ -70,6 +70,7 @@ public class GarUser implements Serializable {
70 * 备注 70 * 备注
71 */ 71 */
72 private String garRemark; 72 private String garRemark;
  73 + private String password;
73 74
74 @TableField(exist = false) 75 @TableField(exist = false)
75 private static final long serialVersionUID = 1L; 76 private static final long serialVersionUID = 1L;
@@ -208,5 +209,15 @@ public class GarUser implements Serializable { @@ -208,5 +209,15 @@ public class GarUser implements Serializable {
208 public static long getSerialversionuid() { 209 public static long getSerialversionuid() {
209 return serialVersionUID; 210 return serialVersionUID;
210 } 211 }
  212 +
  213 + public String getPassword() {
  214 + return password;
  215 + }
  216 +
  217 + public void setPassword(String password) {
  218 + this.password = password;
  219 + }
  220 +
  221 +
211 222
212 } 223 }
213 \ No newline at end of file 224 \ No newline at end of file
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/LoginDto.java
@@ -17,6 +17,21 @@ public class LoginDto { @@ -17,6 +17,21 @@ public class LoginDto {
17 private Integer loginType; 17 private Integer loginType;
18 private String encryptedData; 18 private String encryptedData;
19 private String iv; 19 private String iv;
  20 + private String password;
  21 + private int signin;
  22 +
  23 + public int getSignin() {
  24 + return signin;
  25 + }
  26 + public void setSignin(int signin) {
  27 + this.signin = signin;
  28 + }
  29 + public String getPassword() {
  30 + return password;
  31 + }
  32 + public void setPassword(String password) {
  33 + this.password = password;
  34 + }
20 public String getTel() { 35 public String getTel() {
21 return tel; 36 return tel;
22 } 37 }
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
@@ -25,6 +25,7 @@ import org.apache.commons.collections4.CollectionUtils; @@ -25,6 +25,7 @@ import org.apache.commons.collections4.CollectionUtils;
25 import org.springframework.beans.factory.annotation.Autowired; 25 import org.springframework.beans.factory.annotation.Autowired;
26 import org.springframework.security.core.authority.SimpleGrantedAuthority; 26 import org.springframework.security.core.authority.SimpleGrantedAuthority;
27 import org.springframework.security.core.userdetails.UsernameNotFoundException; 27 import org.springframework.security.core.userdetails.UsernameNotFoundException;
  28 +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
28 import org.springframework.stereotype.Service; 29 import org.springframework.stereotype.Service;
29 import org.springframework.transaction.annotation.Transactional; 30 import org.springframework.transaction.annotation.Transactional;
30 31
@@ -112,9 +113,18 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> @@ -112,9 +113,18 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser>
112 @Override 113 @Override
113 public LoginVo login(LoginDto loginDto) { 114 public LoginVo login(LoginDto loginDto) {
114 LoginVo vo = new LoginVo(); 115 LoginVo vo = new LoginVo();
  116 +
  117 + if(loginDto.getSignin() == 1){
  118 + QueryWrapper<GarUser> qw = new QueryWrapper<>();
  119 + GarUser nUser = null;
  120 + qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel());
  121 + nUser = this.getOne(qw);
  122 + if (nUser != null) {
  123 + throw new UsernameNotFoundException("当前用户已存在!");
  124 + }
  125 + }
115 126
116 vo.setLoginPhone(loginDto.getTel()); 127 vo.setLoginPhone(loginDto.getTel());
117 -  
118 if (Objects.isNull(loginDto)) { 128 if (Objects.isNull(loginDto)) {
119 throw new UsernameNotFoundException("当前用户不存在!"); 129 throw new UsernameNotFoundException("当前用户不存在!");
120 } 130 }
@@ -130,22 +140,35 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt; @@ -130,22 +140,35 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
130 throw new BizException(ResultCode.CODE_500, "解密失败"); 140 throw new BizException(ResultCode.CODE_500, "解密失败");
131 } 141 }
132 } 142 }
133 - // 验证码验证  
134 - String code = redisCache.getCacheObject(GlobalRedisProperties.REDIS_USER_CODE.getValue() + loginDto.getTel());  
135 - if (loginDto.getCode() == null || !loginDto.getCode().equals(code)) {  
136 - throw new BizException(ResultCode.CODE_400, "验证码错误!!");  
137 - } 143 +
138 // 查询用户 144 // 查询用户
139 QueryWrapper<GarUser> qw = new QueryWrapper<>(); 145 QueryWrapper<GarUser> qw = new QueryWrapper<>();
  146 + GarUser nUser = null;
140 qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel()); 147 qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel());
141 - GarUser nUser = this.getOne(qw); 148 + if(loginDto.getCode() == null && loginDto.getPassword() != null){
  149 + qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel());
  150 + qw.lambda().eq(GarUser::getPassword, new BCryptPasswordEncoder().encode(loginDto.getPassword()));
  151 + }else{
  152 + // 验证码验证
  153 + String code = redisCache.getCacheObject(GlobalRedisProperties.REDIS_USER_CODE.getValue() + loginDto.getTel());
  154 + if (loginDto.getCode() == null || !loginDto.getCode().equals(code)) {
  155 + throw new BizException(ResultCode.CODE_400, "验证码错误!!");
  156 + }
  157 + nUser = this.getOne(qw);
  158 + }
  159 +
142 if (Objects.isNull(nUser)) { 160 if (Objects.isNull(nUser)) {
143 // 不存在就创建用户 161 // 不存在就创建用户
144 nUser = new GarUser(); 162 nUser = new GarUser();
145 nUser.setGarUserTel(loginDto.getTel()); 163 nUser.setGarUserTel(loginDto.getTel());
146 nUser.setGarUserDelFlag(GlobalStatus.DEL_FLAG_NO); 164 nUser.setGarUserDelFlag(GlobalStatus.DEL_FLAG_NO);
  165 +
  166 + if(loginDto.getSignin() == 1){
  167 + nUser.setGarUserName(loginDto.getNickname());
  168 + nUser.setPassword(new BCryptPasswordEncoder().encode(loginDto.getPassword()));
  169 + }
  170 +
147 nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription()); 171 nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription());
148 - this.save(nUser);  
149 } 172 }
150 //是否是投放点用户 173 //是否是投放点用户
151 List<DropPointInfo> list = dropPointInfoService.selectDropPointInfoListByPhone(loginDto.getTel()); 174 List<DropPointInfo> list = dropPointInfoService.selectDropPointInfoListByPhone(loginDto.getTel());
@@ -185,6 +208,8 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt; @@ -185,6 +208,8 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
185 ruleVo = new LoginVo.RuleVo(); 208 ruleVo = new LoginVo.RuleVo();
186 ruleVo.setTransportCompanyName(detail.getCompanyName()); 209 ruleVo.setTransportCompanyName(detail.getCompanyName());
187 ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.DRIVER_USER.getDescription()); 210 ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.DRIVER_USER.getDescription());
  211 + nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.DRIVER_USER.getDescription());
  212 + nUser.setGarUserName(detail.getName());
188 vo.getRuleVos().add(ruleVo); 213 vo.getRuleVos().add(ruleVo);
189 vo.setName(detail.getName()); 214 vo.setName(detail.getName());
190 } 215 }
@@ -195,6 +220,8 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt; @@ -195,6 +220,8 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
195 ruleVo = new LoginVo.RuleVo(); 220 ruleVo = new LoginVo.RuleVo();
196 ruleVo.setTransportCompanyName(detail.getCompanyName()); 221 ruleVo.setTransportCompanyName(detail.getCompanyName());
197 ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.RESPONSIBLE_USER.getDescription()); 222 ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.RESPONSIBLE_USER.getDescription());
  223 + nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.RESPONSIBLE_USER.getDescription());
  224 + nUser.setGarUserName(detail.getCompanyName());
198 vo.getRuleVos().add(ruleVo); 225 vo.getRuleVos().add(ruleVo);
199 } 226 }
200 227
@@ -204,6 +231,8 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt; @@ -204,6 +231,8 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
204 ruleVo = new LoginVo.RuleVo(); 231 ruleVo = new LoginVo.RuleVo();
205 ruleVo.setTransportCompanyName(detail.getName()); 232 ruleVo.setTransportCompanyName(detail.getName());
206 ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.DISPOSAL_SITE_USER.getDescription()); 233 ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.DISPOSAL_SITE_USER.getDescription());
  234 + nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.DISPOSAL_SITE_USER.getDescription());
  235 + nUser.setGarUserName(detail.getName());
207 vo.getRuleVos().add(ruleVo); 236 vo.getRuleVos().add(ruleVo);
208 237
209 } 238 }
@@ -213,6 +242,9 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt; @@ -213,6 +242,9 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
213 vo.setTestUser(true); 242 vo.setTestUser(true);
214 } 243 }
215 } 244 }
  245 +
  246 +
  247 + this.saveOrUpdate(nUser);
216 return vo; 248 return vo;
217 } 249 }
218 250
trash-ui/src/views/gar/user/index.vue
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 <el-table v-loading="loading" :data="GarUserList" @selection-change="handleSelectionChange"> 30 <el-table v-loading="loading" :data="GarUserList" @selection-change="handleSelectionChange">
31 <el-table-column type="selection" width="55" align="center" /> 31 <el-table-column type="selection" width="55" align="center" />
32 <el-table-column label="手机号" align="center" prop="garUserTel" /> 32 <el-table-column label="手机号" align="center" prop="garUserTel" />
33 -<!-- <el-table-column label="用户名" align="center" prop="garUserName" />--> 33 + <el-table-column label="用户名" align="center" prop="garUserName" />
34 <el-table-column label="用户类型" align="center" prop="garUserType" /> 34 <el-table-column label="用户类型" align="center" prop="garUserType" />
35 <el-table-column label="创建时间" align="center" prop="garCreateTime" width="180"> 35 <el-table-column label="创建时间" align="center" prop="garCreateTime" width="180">
36 <template slot-scope="scope"> 36 <template slot-scope="scope">
trash-workFlow/src/main/java/com/trash/business/service/impl/SupervisionThreestepServiceImpl.java
@@ -12,6 +12,7 @@ import java.util.concurrent.TimeUnit; @@ -12,6 +12,7 @@ import java.util.concurrent.TimeUnit;
12 12
13 import org.apache.commons.collections4.map.HashedMap; 13 import org.apache.commons.collections4.map.HashedMap;
14 import org.springframework.beans.factory.annotation.Autowired; 14 import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.expression.spel.ast.NullLiteral;
15 import org.springframework.stereotype.Service; 16 import org.springframework.stereotype.Service;
16 import org.springframework.transaction.annotation.Transactional; 17 import org.springframework.transaction.annotation.Transactional;
17 import org.springframework.web.multipart.MultipartFile; 18 import org.springframework.web.multipart.MultipartFile;
@@ -166,8 +167,8 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -166,8 +167,8 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
166 JSONObject json = (JSONObject) obj; 167 JSONObject json = (JSONObject) obj;
167 if (cArea.indexOf(json.getString("areaCode")) > -1) { 168 if (cArea.indexOf(json.getString("areaCode")) > -1) {
168 if(companyName != null){ 169 if(companyName != null){
169 - if(json.getString("transportCompany").equals(companyName)  
170 - || json.getString("unitCompanyName").contains(companyName)){ 170 + if((json.get("transportCompany") != null && json.getString("transportCompany").equals(companyName))
  171 + || (json.get("unitCompanyName") != null && json.getString("unitCompanyName").contains(companyName))){
171 ids.add(json.getString("id")); 172 ids.add(json.getString("id"));
172 } 173 }
173 }else{ 174 }else{
@@ -1014,8 +1015,6 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -1014,8 +1015,6 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
1014 JSONObject truckObject = (JSONObject) object; 1015 JSONObject truckObject = (JSONObject) object;
1015 1016
1016 for (TruckActivate ta : taList) { 1017 for (TruckActivate ta : taList) {
1017 -  
1018 -  
1019 if (truckObject.getString("vehicleId").equals(ta.getObjectId())) { 1018 if (truckObject.getString("vehicleId").equals(ta.getObjectId())) {
1020 1019
1021 if (truckObject.getInteger("vehicleStatus") == 1) { 1020 if (truckObject.getInteger("vehicleStatus") == 1) {
trash-workFlow/src/main/java/com/trash/casefile/service/impl/ViolationWarningInformationServiceImpl.java
@@ -430,8 +430,21 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning @@ -430,8 +430,21 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning
430 return null; 430 return null;
431 } 431 }
432 432
  433 +
433 434
434 List<ViolationWarningInformation> list = violationWarningInformationMapper.selectViolationWarningInformationListLessTime(violationWarningInformation); 435 List<ViolationWarningInformation> list = violationWarningInformationMapper.selectViolationWarningInformationListLessTime(violationWarningInformation);
  436 +
  437 + List<SysDictData> caseType = SpringUtils.getBean(ISysDictTypeService.class).selectDictDataByType("vio_warning");
  438 + for(SysDictData type:caseType){
  439 + for(ViolationWarningInformation file:list){
  440 + if(type.getDictValue().equals(file.getViolationType())){
  441 +
  442 + file.setViolationType(type.getDictLabel());
  443 + }
  444 + }
  445 + }
  446 +
  447 +
435 Map<String, List> data = new HashMap<>(); 448 Map<String, List> data = new HashMap<>();
436 449
437 450
@@ -533,6 +546,15 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning @@ -533,6 +546,15 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning
533 546
534 list = violationWarningInformationMapper.selectViolationWarningInformationListLessTime(violationWarningInformation); 547 list = violationWarningInformationMapper.selectViolationWarningInformationListLessTime(violationWarningInformation);
535 548
  549 + for(SysDictData type:caseType){
  550 + for(ViolationWarningInformation file:list){
  551 + if(type.getDictValue().equals(file.getViolationType())){
  552 +
  553 + file.setViolationType(type.getDictLabel());
  554 + }
  555 + }
  556 + }
  557 +
536 558
537 List<Map> years = new ArrayList<Map>(); 559 List<Map> years = new ArrayList<Map>();
538 List<Map> months = new ArrayList<Map>(); 560 List<Map> months = new ArrayList<Map>();
@@ -580,7 +602,17 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning @@ -580,7 +602,17 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning
580 602
581 violationWarningInformation.setCreateTime(now); 603 violationWarningInformation.setCreateTime(now);
582 list = violationWarningInformationMapper.selectViolationWarningInformationListLessTime(violationWarningInformation); 604 list = violationWarningInformationMapper.selectViolationWarningInformationListLessTime(violationWarningInformation);
583 - 605 +
  606 + for(SysDictData type:caseType){
  607 + for(ViolationWarningInformation file:list){
  608 + if(type.getDictValue().equals(file.getViolationType())){
  609 +
  610 + file.setViolationType(type.getDictLabel());
  611 + }
  612 + }
  613 + }
  614 +
  615 +
584 for(int i = 0;i<list.size();i++){ 616 for(int i = 0;i<list.size();i++){
585 int count = 0; 617 int count = 0;
586 int typeCount = 0; 618 int typeCount = 0;