Commit 1e3b15f9e19fe440a1e994d73b57dcfaddb78fe4
1 parent
bdac1fed
feat: 新增处理场所角色
Showing
2 changed files
with
22 additions
and
3 deletions
trash-garbage/src/main/java/com/trash/garbage/global/GlobalStatus.java
| @@ -36,9 +36,10 @@ public class GlobalStatus { | @@ -36,9 +36,10 @@ public class GlobalStatus { | ||
| 36 | * 普通登录 | 36 | * 普通登录 |
| 37 | */ | 37 | */ |
| 38 | NORMAL_LOGIN(0, "普通登录"), | 38 | NORMAL_LOGIN(0, "普通登录"), |
| 39 | - NORMAL_USER(0, "居民用户"), | ||
| 40 | - DRIVER_USER(1, "运输驾驶员"), | ||
| 41 | - RESPONSIBLE_USER(2, "企业负责人"); | 39 | + NORMAL_USER(0, "用户"), |
| 40 | + DISPOSAL_SITE_USER(1, "处理场所负责人"), | ||
| 41 | + DRIVER_USER(2, "清运车辆驾驶员"), | ||
| 42 | + RESPONSIBLE_USER(3, "运输企业负责人"); | ||
| 42 | 43 | ||
| 43 | private Integer status; | 44 | private Integer status; |
| 44 | private String description; | 45 | private String description; |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
| @@ -15,6 +15,8 @@ import javax.crypto.spec.IvParameterSpec; | @@ -15,6 +15,8 @@ import javax.crypto.spec.IvParameterSpec; | ||
| 15 | import javax.crypto.spec.SecretKeySpec; | 15 | import javax.crypto.spec.SecretKeySpec; |
| 16 | import javax.servlet.http.HttpServletRequest; | 16 | import javax.servlet.http.HttpServletRequest; |
| 17 | 17 | ||
| 18 | +import com.trash.disposalSite.domain.DisposalSite; | ||
| 19 | +import com.trash.disposalSite.service.IDisposalSiteService; | ||
| 18 | import org.apache.commons.codec.binary.Base64; | 20 | import org.apache.commons.codec.binary.Base64; |
| 19 | import org.springframework.beans.factory.annotation.Autowired; | 21 | import org.springframework.beans.factory.annotation.Autowired; |
| 20 | import org.springframework.security.core.authority.SimpleGrantedAuthority; | 22 | import org.springframework.security.core.authority.SimpleGrantedAuthority; |
| @@ -75,6 +77,9 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | @@ -75,6 +77,9 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | ||
| 75 | private GarAddressService garAddressService; | 77 | private GarAddressService garAddressService; |
| 76 | 78 | ||
| 77 | @Autowired | 79 | @Autowired |
| 80 | + private IDisposalSiteService disposalSiteService; | ||
| 81 | + | ||
| 82 | + @Autowired | ||
| 78 | private IDriverService driverService; | 83 | private IDriverService driverService; |
| 79 | 84 | ||
| 80 | @Autowired | 85 | @Autowired |
| @@ -171,6 +176,19 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | @@ -171,6 +176,19 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | ||
| 171 | ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.RESPONSIBLE_USER.getDescription()); | 176 | ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.RESPONSIBLE_USER.getDescription()); |
| 172 | vo.getRuleVos().add(ruleVo); | 177 | vo.getRuleVos().add(ruleVo); |
| 173 | } | 178 | } |
| 179 | + | ||
| 180 | + // 处理场所 TODO | ||
| 181 | + // 查询条件 | ||
| 182 | + DisposalSite site = new DisposalSite(); | ||
| 183 | + site.setConstructionUnitPersonPhone(loginDto.getTel()); | ||
| 184 | + List<DisposalSite> disposalSites = disposalSiteService.selectDisposalSiteList(site); | ||
| 185 | + if (CollectionUtil.isNotEmpty(disposalSites)) { | ||
| 186 | + DisposalSite disposalSite = disposalSites.get(0); | ||
| 187 | + ruleVo = new LoginVo.RuleVo(); | ||
| 188 | + ruleVo.setTransportCompanyName(disposalSite.getName()); | ||
| 189 | + ruleVo.setUserType(GlobalStatus.GarUserStatusEnum.DISPOSAL_SITE_USER.getDescription()); | ||
| 190 | + vo.getRuleVos().add(ruleVo); | ||
| 191 | + } | ||
| 174 | return vo; | 192 | return vo; |
| 175 | } | 193 | } |
| 176 | 194 |