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 70 * 备注
71 71 */
72 72 private String garRemark;
  73 + private String password;
73 74  
74 75 @TableField(exist = false)
75 76 private static final long serialVersionUID = 1L;
... ... @@ -208,5 +209,15 @@ public class GarUser implements Serializable {
208 209 public static long getSerialversionuid() {
209 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 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 17 private Integer loginType;
18 18 private String encryptedData;
19 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 35 public String getTel() {
21 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 25 import org.springframework.beans.factory.annotation.Autowired;
26 26 import org.springframework.security.core.authority.SimpleGrantedAuthority;
27 27 import org.springframework.security.core.userdetails.UsernameNotFoundException;
  28 +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
28 29 import org.springframework.stereotype.Service;
29 30 import org.springframework.transaction.annotation.Transactional;
30 31  
... ... @@ -112,9 +113,18 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser>
112 113 @Override
113 114 public LoginVo login(LoginDto loginDto) {
114 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 127 vo.setLoginPhone(loginDto.getTel());
117   -
118 128 if (Objects.isNull(loginDto)) {
119 129 throw new UsernameNotFoundException("当前用户不存在!");
120 130 }
... ... @@ -130,22 +140,35 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
130 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 145 QueryWrapper<GarUser> qw = new QueryWrapper<>();
  146 + GarUser nUser = null;
140 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 160 if (Objects.isNull(nUser)) {
143 161 // 不存在就创建用户
144 162 nUser = new GarUser();
145 163 nUser.setGarUserTel(loginDto.getTel());
146 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 171 nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription());
148   - this.save(nUser);
149 172 }
150 173 //是否是投放点用户
151 174 List<DropPointInfo> list = dropPointInfoService.selectDropPointInfoListByPhone(loginDto.getTel());
... ... @@ -185,6 +208,8 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
185 208 ruleVo = new LoginVo.RuleVo();
186 209 ruleVo.setTransportCompanyName(detail.getCompanyName());
187 210 ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.DRIVER_USER.getDescription());
  211 + nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.DRIVER_USER.getDescription());
  212 + nUser.setGarUserName(detail.getName());
188 213 vo.getRuleVos().add(ruleVo);
189 214 vo.setName(detail.getName());
190 215 }
... ... @@ -195,6 +220,8 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
195 220 ruleVo = new LoginVo.RuleVo();
196 221 ruleVo.setTransportCompanyName(detail.getCompanyName());
197 222 ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.RESPONSIBLE_USER.getDescription());
  223 + nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.RESPONSIBLE_USER.getDescription());
  224 + nUser.setGarUserName(detail.getCompanyName());
198 225 vo.getRuleVos().add(ruleVo);
199 226 }
200 227  
... ... @@ -204,6 +231,8 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
204 231 ruleVo = new LoginVo.RuleVo();
205 232 ruleVo.setTransportCompanyName(detail.getName());
206 233 ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.DISPOSAL_SITE_USER.getDescription());
  234 + nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.DISPOSAL_SITE_USER.getDescription());
  235 + nUser.setGarUserName(detail.getName());
207 236 vo.getRuleVos().add(ruleVo);
208 237  
209 238 }
... ... @@ -213,6 +242,9 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
213 242 vo.setTestUser(true);
214 243 }
215 244 }
  245 +
  246 +
  247 + this.saveOrUpdate(nUser);
216 248 return vo;
217 249 }
218 250  
... ...
trash-ui/src/views/gar/user/index.vue
... ... @@ -30,7 +30,7 @@
30 30 <el-table v-loading="loading" :data="GarUserList" @selection-change="handleSelectionChange">
31 31 <el-table-column type="selection" width="55" align="center" />
32 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 34 <el-table-column label="用户类型" align="center" prop="garUserType" />
35 35 <el-table-column label="创建时间" align="center" prop="garCreateTime" width="180">
36 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 12  
13 13 import org.apache.commons.collections4.map.HashedMap;
14 14 import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.expression.spel.ast.NullLiteral;
15 16 import org.springframework.stereotype.Service;
16 17 import org.springframework.transaction.annotation.Transactional;
17 18 import org.springframework.web.multipart.MultipartFile;
... ... @@ -166,8 +167,8 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
166 167 JSONObject json = (JSONObject) obj;
167 168 if (cArea.indexOf(json.getString("areaCode")) > -1) {
168 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 172 ids.add(json.getString("id"));
172 173 }
173 174 }else{
... ... @@ -1014,8 +1015,6 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
1014 1015 JSONObject truckObject = (JSONObject) object;
1015 1016  
1016 1017 for (TruckActivate ta : taList) {
1017   -
1018   -
1019 1018 if (truckObject.getString("vehicleId").equals(ta.getObjectId())) {
1020 1019  
1021 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 430 return null;
431 431 }
432 432  
  433 +
433 434  
434 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 448 Map<String, List> data = new HashMap<>();
436 449  
437 450  
... ... @@ -533,6 +546,15 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning
533 546  
534 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 559 List<Map> years = new ArrayList<Map>();
538 560 List<Map> months = new ArrayList<Map>();
... ... @@ -580,7 +602,17 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning
580 602  
581 603 violationWarningInformation.setCreateTime(now);
582 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 616 for(int i = 0;i<list.size();i++){
585 617 int count = 0;
586 618 int typeCount = 0;
... ...