Commit a6380ae9a74769ca4b1ea60bd80619c9d2df630d

Authored by 2c2c2c
1 parent 86f7ad9d

装修垃圾清运 取消普通用户,只让投放点管理员登录

trash-garbage/src/main/java/com/trash/garbage/pojo/vo/LoginVo.java
... ... @@ -12,6 +12,19 @@ public class LoginVo {
12 12 private String name;
13 13 private List<RuleVo> ruleVos;
14 14  
  15 + /**
  16 + * 是否内测用户
  17 + */
  18 + private boolean testUser;
  19 +
  20 + public boolean getTestUser() {
  21 + return testUser;
  22 + }
  23 +
  24 + public void setTestUser(boolean testUser) {
  25 + this.testUser = testUser;
  26 + }
  27 +
15 28 public String getName() {
16 29 return name;
17 30 }
... ...
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
... ... @@ -138,24 +138,17 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
138 138 qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel());
139 139 GarUser nUser = this.getOne(qw);
140 140 if (Objects.isNull(nUser)) {
141   - // 不存在就创建用户,普通用户暂时关闭注册
142   -// nUser = new GarUser();
143   -// nUser.setGarUserTel(loginDto.getTel());
144   -// nUser.setGarUserDelFlag(GlobalStatus.DEL_FLAG_NO);
145   -// nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription());
146   -// this.save(nUser);
147   - //不存在,则查询是否是投放点用户
148   - List<DropPointInfo> list = dropPointInfoService.selectDropPointInfoListByPhone(loginDto.getTel());
149   - if (CollectionUtil.isNotEmpty(list)) {
150   - nUser = new GarUser();
151   - nUser.setGarUserTel(loginDto.getTel());
152   - nUser.setGarUserDelFlag(GlobalStatus.DEL_FLAG_NO);
153   - nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription());
154   - this.save(nUser);
155   - }else{
156   - throw new UsernameNotFoundException("当前用户不存在!");
157   - }
  141 + // 不存在就创建用户
  142 + nUser = new GarUser();
  143 + nUser.setGarUserTel(loginDto.getTel());
  144 + nUser.setGarUserDelFlag(GlobalStatus.DEL_FLAG_NO);
  145 + nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription());
  146 + this.save(nUser);
158 147 }
  148 + //是否是投放点用户
  149 + List<DropPointInfo> list = dropPointInfoService.selectDropPointInfoListByPhone(loginDto.getTel());
  150 + vo.setTestUser(CollectionUtil.isNotEmpty(list));
  151 +
159 152 LoginUser loginUser = new LoginUser();
160 153 ArrayList<SimpleGrantedAuthority> authorities = new ArrayList<SimpleGrantedAuthority>();
161 154 loginUser.setAuthorities(authorities);
... ... @@ -225,6 +218,12 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
225 218  
226 219 // vo.setName(disposalSite.getConstructionUnitPerson());
227 220 }
  221 + for (LoginVo.RuleVo r : vo.getRuleVos()){
  222 + //排除驾驶员、企业负责人、处理场所
  223 + if(r.getUserType().equals(GlobalStatus.GarUserStatusEnum.DISPOSAL_SITE_USER.getDescription()) || r.getUserType().equals(GlobalStatus.GarUserStatusEnum.DRIVER_USER.getDescription()) || r.getUserType().equals(GlobalStatus.GarUserStatusEnum.RESPONSIBLE_USER.getDescription())){
  224 + vo.setTestUser(true);
  225 + }
  226 + }
228 227 return vo;
229 228 }
230 229  
... ...