Browse Source

Merge branch 'master' of http://121.42.41.42:7070/r/epmet-cloud into dev_dingding

master
yinzuomei 3 years ago
parent
commit
a83595dc99
  1. 28
      epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java
  2. 26
      epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java
  3. 48
      epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgByAccountFormDTO.java
  4. 43
      epmet-auth/src/main/java/com/epmet/dto/form/StaffOrgByAccountFormDTO.java
  5. 48
      epmet-auth/src/main/java/com/epmet/dto/form/ThirdStaffOrgByAccountFormDTO.java
  6. 47
      epmet-auth/src/main/java/com/epmet/dto/form/ThirdWxmpEnteOrgByAccountFormDTO.java
  7. 22
      epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  8. 9
      epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java
  9. 23
      epmet-auth/src/main/java/com/epmet/service/GovLoginService.java
  10. 18
      epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java
  11. 87
      epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java
  12. 125
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  13. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  14. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  15. 5
      epmet-module/epmet-job/epmet-job-server/pom.xml
  16. 17
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/PliPowerService.java
  17. 31
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/PliPowerServiceImpl.java
  18. 41
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PliVisitorLogoutTask.java
  19. 87
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffPyFromDTO.java
  20. 82
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitAccountFromDTO.java
  21. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java
  22. 111
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java
  23. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java
  24. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java
  25. 27
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
  26. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  27. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java
  28. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  29. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
  30. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
  31. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
  32. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  33. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  34. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  35. 58
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  36. 13
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
  37. 45
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  38. 17
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml
  39. 1
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java
  40. 9
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml
  41. 2
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemGroupDTO.java
  42. 2
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java
  43. 2
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java
  44. 9
      epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.39__itemgroup_child.sql
  45. 3
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml
  46. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java
  47. 15
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcBirthRecordDTO.java
  48. 14
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java
  49. 36
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffByAccountFormDTO.java
  50. 24
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ThirdCustomerStaffByAccountFormDTO.java
  51. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java
  52. 30
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatPieResultDTO.java
  53. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java
  54. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java
  55. 47
      epmet-user/epmet-user-client/src/main/java/com/epmet/enums/NatPieColorEnum.java
  56. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  57. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  58. 85
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  59. 44
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java
  60. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  61. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  62. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java
  63. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java
  64. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java
  65. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java
  66. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java
  67. 40
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatHistoryExportExcel.java
  68. 43
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java
  69. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java
  70. 196
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  71. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcBirthRecordServiceImpl.java
  72. 144
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java
  73. 25
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java
  74. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectVisitorServiceImpl.java
  75. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  76. 2
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.62__alter_customer_staff.sql
  77. 3
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.69__alter_ic_epidemic_special_attention.sql
  78. 5
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.70__default_ic_epidemic_special_attention.sql
  79. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx
  80. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls
  81. 38
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml
  82. 95
      epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml
  83. 7
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

28
epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java

@ -83,6 +83,20 @@ public class GovLoginController {
return new Result<UserTokenResultDTO>().ok(userTokenResultDTO);
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.UserTokenResultDTO>
* @Author zhy
* @Description 4选择组织进入首页
* @Date 2020/4/20 13:07
**/
@PostMapping(value = "/loginwxmp/enterorgbyaccount")
public Result<UserTokenResultDTO> enterOrgByAccount(@RequestBody GovWxmpEnteOrgByAccountFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO,GovWxmpEnteOrgByAccountFormDTO.AddUserShowGroup.class,GovWxmpEnteOrgByAccountFormDTO.AddUserInternalGroup.class);
UserTokenResultDTO userTokenResultDTO=govLoginService.enterOrgByAccount(formDTO);
return new Result<UserTokenResultDTO>().ok(userTokenResultDTO);
}
/**
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result
@ -121,5 +135,19 @@ public class GovLoginController {
List<StaffOrgsResultDTO> staffOrgs = govLoginService.getMyOrgByPassword(formDTO);
return new Result<List<StaffOrgsResultDTO>>().ok(staffOrgs);
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.StaffOrgsResultDTO>>
* @author zhy
* @description 6账户密码获取组织
* @Date 2020/6/30 22:43
**/
@PostMapping(value = "/getmyorgbyaccount")
public Result<List<StaffOrgsResultDTO>> getMyOrgByAccount(@RequestBody StaffOrgByAccountFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, StaffOrgByAccountFormDTO.AddUserShowGroup.class, StaffOrgByAccountFormDTO.GetMyOrgByPassWordGroup.class);
List<StaffOrgsResultDTO> staffOrgs = govLoginService.getMyOrgByAccount(formDTO);
return new Result<List<StaffOrgsResultDTO>>().ok(staffOrgs);
}
}

26
epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java

@ -61,6 +61,19 @@ public class ThirdLoginController {
return new Result<UserTokenResultDTO>().ok(userTokenResultDTO);
}
/**
* @param formDTO
* @return
* @Author zhy
* @Description 单客户-选择组织进入首页
**/
@PostMapping(value = "enterorgbyaccount")
public Result<UserTokenResultDTO> enterOrgByAccount(@RequestBody ThirdWxmpEnteOrgByAccountFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO,ThirdWxmpEnteOrgFormDTO.AddUserShowGroup.class,ThirdWxmpEnteOrgFormDTO.AddUserInternalGroup.class);
UserTokenResultDTO userTokenResultDTO=thirdLoginService.enterOrgByAccount(formDTO);
return new Result<UserTokenResultDTO>().ok(userTokenResultDTO);
}
/**
* @param formDTO
* @return
@ -87,6 +100,19 @@ public class ThirdLoginController {
return new Result<List<StaffOrgsResultDTO>>().ok(staffOrgs);
}
/**
* @param formDTO
* @return
* @author zhy
* @description 单客户-账号密码获取组织
**/
@PostMapping(value = "/getmyorgbyaccount")
public Result<List<StaffOrgsResultDTO>> getMyOrgByAccount(@RequestBody ThirdStaffOrgByAccountFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, StaffOrgByAccountFormDTO.AddUserShowGroup.class, StaffOrgByAccountFormDTO.GetMyOrgByPassWordGroup.class);
List<StaffOrgsResultDTO> staffOrgs = thirdLoginService.getMyOrgByAccount(formDTO);
return new Result<List<StaffOrgsResultDTO>>().ok(staffOrgs);
}
/**
* @param formDTO
* @return

48
epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgByAccountFormDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 选择组织进入首页入参Dto
* @Author yinzuomei
* @Date 2020/4/20 13:03
*/
@Data
public class GovWxmpEnteOrgByAccountFormDTO implements Serializable {
public interface AddUserInternalGroup {}
public interface AddUserShowGroup extends CustomerClientShowGroup {}
/**
* wxCode
*/
@NotBlank(message = "wxCode不能为空",groups = {AddUserInternalGroup.class})
private String wxCode;
/**
* 手机号
*/
@NotBlank(message = "账号不能为空",groups = {AddUserShowGroup.class})
private String userAccount;
/**
* 选择的组织所属的id
*/
@NotBlank(message = "客户id不能为空",groups = {AddUserInternalGroup.class})
private String customerId;
/**
* 选择的要进入的组织(根组织id)
*/
@NotBlank(message = "组织id不能为空",groups = {AddUserInternalGroup.class})
private String rootAgencyId;
/**
* desc:小程序appId
*/
private String appId;
}

43
epmet-auth/src/main/java/com/epmet/dto/form/StaffOrgByAccountFormDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 手机验证码获取组织接口入参
* @Author zhy
* @Date 2020/4/18 10:38
*/
@Data
public class StaffOrgByAccountFormDTO implements Serializable {
private static final long serialVersionUID = 4193133227120225342L;
/**
* 添加用户操作的用户可见异常分组
* 该分组用于校验需要返回给前端错误信息提示的列需要继承CustomerClientShowGroup
* 返回错误码为8999提示信息为DTO中具体的列的校验注解message的内容
*/
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
public interface GetMyOrgByPassWordGroup extends CustomerClientShowGroup {
}
public interface GetMyOrgByLoginWxmp extends CustomerClientShowGroup{}
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class})
private String userAccount;
/**
* 验证码
*/
@NotBlank(message="验证码不能为空", groups = {GetMyOrgByLoginWxmp.class})
private String smsCode;
@NotBlank(message = "密码不能为空",groups ={GetMyOrgByPassWordGroup.class})
private String password;
}

48
epmet-auth/src/main/java/com/epmet/dto/form/ThirdStaffOrgByAccountFormDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description appId账号验证码获取组织-接口入参
* @Author zhy
*/
@Data
public class ThirdStaffOrgByAccountFormDTO implements Serializable {
private static final long serialVersionUID = 4193133227120225342L;
/**
* 添加用户操作的用户可见异常分组
* 该分组用于校验需要返回给前端错误信息提示的列需要继承CustomerClientShowGroup
* 返回错误码为8999提示信息为DTO中具体的列的校验注解message的内容
*/
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
public interface GetMyOrgByPassWordGroup extends CustomerClientShowGroup {
}
public interface GetMyOrgByLoginWxmp extends CustomerClientShowGroup{}
/**
* 小程序appId
*/
@NotBlank(message = "appId不能为空", groups = {AddUserShowGroup.class})
private String appId;
/**
* 手机号
*/
@NotBlank(message = "账号不能为空", groups = {AddUserShowGroup.class})
private String userAccount;
/**
* 验证码
*/
@NotBlank(message="验证码不能为空", groups = {GetMyOrgByLoginWxmp.class})
private String smsCode;
@NotBlank(message = "密码不能为空",groups ={GetMyOrgByPassWordGroup.class})
private String password;
}

47
epmet-auth/src/main/java/com/epmet/dto/form/ThirdWxmpEnteOrgByAccountFormDTO.java

@ -0,0 +1,47 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 单客户-选择组织进入首页入参Dto
* @Author sun
*/
@Data
public class ThirdWxmpEnteOrgByAccountFormDTO implements Serializable {
public interface AddUserInternalGroup {}
public interface AddUserShowGroup extends CustomerClientShowGroup {}
/**
* wxCode
*/
@NotBlank(message = "wxCode不能为空",groups = {AddUserInternalGroup.class})
private String wxCode;
/**
* 手机号
*/
@NotBlank(message = "账号不能为空",groups = {AddUserShowGroup.class})
private String userAccount;
/**
* 选择的组织所属的id
*/
@NotBlank(message = "客户id不能为空",groups = {AddUserInternalGroup.class})
private String customerId;
/**
* 选择的要进入的组织(根组织id)
*/
@NotBlank(message = "组织id不能为空",groups = {AddUserInternalGroup.class})
private String rootAgencyId;
/**
* 客户appIdexJson文件中获取
*/
@NotBlank(message = "appId不能为空",groups = {AddUserInternalGroup.class})
private String appId;
}

22
epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -70,6 +70,17 @@ public interface EpmetUserFeignClient {
@GetMapping(value = "epmetuser/customerstaff/getcustsomerstaffbyphone/{mobile}")
Result<List<CustomerStaffDTO>> checkCustomerStaff(@PathVariable("mobile") String mobile);
/**
* @param account
* @return com.epmet.commons.tools.utils.Result
* @Author zhy
* @Description 根据账户查询政府端工作人员基本信息校验用户是否存在
* @Date 2020/4/18 14:03
**/
@GetMapping(value = "epmetuser/customerstaff/getcustsomerstaffbyaccount/{account}")
Result<List<CustomerStaffDTO>> checkCustomerStaffByAccount(@PathVariable("account") String account);
/**
* @param staffWechatFormDTO
* @return com.epmet.commons.tools.utils.Result
@ -100,6 +111,17 @@ public interface EpmetUserFeignClient {
@PostMapping(value = "epmetuser/customerstaff/getcustomerstaffinfo", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<CustomerStaffDTO> getCustomerStaffInfo(@RequestBody CustomerStaffFormDTO customerStaffFormDTO);
/**
* @param customerStaffFormDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerStaffDTO>
* @Author zhy
* @Description 根据手机号+客户id获取工作人员基本信息
* @Date 2020/4/20 14:16
**/
@PostMapping(value = "epmetuser/customerstaff/getcustomerstaffinfobyaccount", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<CustomerStaffDTO> getCustomerStaffInfoByAccount(@RequestBody CustomerStaffByAccountFormDTO customerStaffFormDTO);
/**
* @param staffLoginHistoryFormDTO
* @return com.epmet.commons.tools.utils.Result

9
epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java

@ -44,6 +44,10 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustsomerStaffByPhone", phone);
}
@Override
public Result<List<CustomerStaffDTO>> checkCustomerStaffByAccount(String account) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustsomerStaffByAccount", account);
}
@Override
public Result saveStaffWechat(StaffWechatFormDTO staffWechatFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveStaffWechat", staffWechatFormDTO);
@ -59,6 +63,11 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfo", customerStaffFormDTO);
}
@Override
public Result<CustomerStaffDTO> getCustomerStaffInfoByAccount(CustomerStaffByAccountFormDTO customerStaffFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByAccount", customerStaffFormDTO);
}
@Override
public Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO staffLoginHistoryFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveStaffLoginRecord", staffLoginHistoryFormDTO);

23
epmet-auth/src/main/java/com/epmet/service/GovLoginService.java

@ -1,10 +1,7 @@
package com.epmet.service;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.form.GovWxmpEnteOrgFormDTO;
import com.epmet.dto.form.GovWxmpFormDTO;
import com.epmet.dto.form.SendSmsCodeFormDTO;
import com.epmet.dto.form.StaffOrgsFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.dto.result.UserTokenResultDTO;
@ -52,6 +49,15 @@ public interface GovLoginService {
**/
UserTokenResultDTO enterOrg(GovWxmpEnteOrgFormDTO formDTO);
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.UserTokenResultDTO>
* @Author zhy
* @Description 4选择组织进入首页
* @Date 2020/4/20 13:08
**/
UserTokenResultDTO enterOrgByAccount(GovWxmpEnteOrgByAccountFormDTO formDTO);
/**
* @return com.epmet.commons.tools.utils.Result
* @param tokenDto
@ -76,4 +82,13 @@ public interface GovLoginService {
* @Date 2020/6/30 22:43
**/
List<StaffOrgsResultDTO> getMyOrgByPassword(StaffOrgsFormDTO formDTO);
/**
* @return java.util.List<com.epmet.dto.result.StaffOrgsResultDTO>
* @param formDTO
* @author zhy
* @description 6账户密码获取组织
* @Date 2020/6/30 22:43
**/
List<StaffOrgsResultDTO> getMyOrgByAccount(StaffOrgByAccountFormDTO formDTO);
}

18
epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java

@ -37,6 +37,15 @@ public interface ThirdLoginService {
**/
UserTokenResultDTO enterOrg(ThirdWxmpEnteOrgFormDTO formDTO);
/**
* @param formDTO
* @return
* @Author zhy
* @Description 单客户-选择组织进入首页
**/
UserTokenResultDTO enterOrgByAccount(ThirdWxmpEnteOrgByAccountFormDTO formDTO);
/**
* @param formDTO
* @return
@ -53,6 +62,15 @@ public interface ThirdLoginService {
**/
List<StaffOrgsResultDTO> getMyOrgByPassword(ThirdStaffOrgsFormDTO formDTO);
/**
* @param formDTO
* @return
* @author zhy
* @description 单客户-手机号密码获取组织
**/
List<StaffOrgsResultDTO> getMyOrgByAccount(ThirdStaffOrgByAccountFormDTO formDTO);
/**
* @param formDTO
* @return

87
epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java

@ -289,6 +289,36 @@ public class GovLoginServiceImpl implements GovLoginService, ResultDataResolver
return userTokenResultDTO;
}
@Override
public UserTokenResultDTO enterOrgByAccount(GovWxmpEnteOrgByAccountFormDTO formDTO) {
//1、需要校验要登录的客户,是否被禁用
CustomerStaffByAccountFormDTO customerStaffFormDTO = new CustomerStaffByAccountFormDTO();
customerStaffFormDTO.setCustomerId(formDTO.getCustomerId());
customerStaffFormDTO.setUserAccount(formDTO.getUserAccount());
Result<CustomerStaffDTO> customerStaffDTOResult = epmetUserFeignClient.getCustomerStaffInfoByAccount(customerStaffFormDTO);
if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) {
logger.warn(String.format("获取工作人员信息失败,账户[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getUserAccount(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg()));
throw new RenException(customerStaffDTOResult.getCode());
}
CustomerStaffDTO customerStaff = customerStaffDTOResult.getData();
//2、解析微信用户
WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(LoginConstant.APP_GOV, formDTO.getWxCode(), formDTO.getAppId());
//3、记录staff_wechat,并记录用户激活状态,激活时间
this.savestaffwechat(customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid(), formDTO.getCustomerId());
//4、记录登录日志
GovWxmpEnteOrgFormDTO orgDTO = ConvertUtils.sourceToTarget(formDTO, GovWxmpEnteOrgFormDTO.class);
orgDTO.setMobile(customerStaff.getMobile());
this.saveStaffLoginRecord(orgDTO, customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid());
//5.1、获取用户token
String token = this.generateGovWxmpToken(customerStaff.getUserId());
//5.2、保存到redis
this.saveGovTokenDto(formDTO.getRootAgencyId(), formDTO.getCustomerId(), customerStaff.getUserId(), wxMaJscode2SessionResult, token);
UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO();
userTokenResultDTO.setToken(token);
return userTokenResultDTO;
}
@Override
public void loginOut(TokenDto tokenDto) {
if(null == tokenDto){
@ -381,6 +411,63 @@ public class GovLoginServiceImpl implements GovLoginService, ResultDataResolver
return new ArrayList<>();
}
@Override
public List<StaffOrgsResultDTO> getMyOrgByAccount(StaffOrgByAccountFormDTO formDTO) {
//1、根据手机号查询到用户信息
Result<List<CustomerStaffDTO>> customerStaffResult = epmetUserFeignClient.checkCustomerStaffByAccount(formDTO.getUserAccount());
if (!customerStaffResult.success()) {
logger.warn(String.format("账户密码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getUserAccount(), customerStaffResult.getCode(), customerStaffResult.getMsg()));
throw new RenException(customerStaffResult.getCode());
}
//2、密码是否正确
List<CustomerStaffDTO> customerStaffList=customerStaffResult.getData();
//3、查询用户所有的组织信息
List<String> customerIdList = new ArrayList<>();
//是否设置过密码
boolean havePasswordFlag=false;
//密码是否正确
boolean passwordRightFlag=false;
for (CustomerStaffDTO customerStaffDTO : customerStaffList) {
if(StringUtils.isNotBlank(customerStaffDTO.getPassword())){
havePasswordFlag=true;
}else{
logger.warn(String.format("当前用户:账户%s,客户Id%s下未设置密码.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId()));
continue;
}
if (!PasswordUtils.matches(formDTO.getPassword(), customerStaffDTO.getPassword())) {
logger.warn(String.format("当前用户:账户%s,客户Id%s密码匹配错误.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId()));
}else{
logger.warn(String.format("当前用户:账户%s,客户Id%s密码匹配正确.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId()));
passwordRightFlag=true;
customerIdList.add(customerStaffDTO.getCustomerId());
}
}
//根据手机号查出来所有用户,密码都为空,表明用户未激活账户,未设置密码
if(!havePasswordFlag){
logger.warn(String.format("当前账户(%s)下所有账户都未设置密码,请先使用验证码登录激活账户",formDTO.getUserAccount()));
throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode());
}
//密码错误
if(!passwordRightFlag){
logger.warn(String.format("根据当前账户(%s)密码未找到所属组织,密码错误",formDTO.getUserAccount()));
throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode());
}
StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO();
staffOrgFormDTO.setCustomerIdList(customerIdList);
Result<List<StaffOrgsResultDTO>> result = govOrgFeignClient.getStaffOrgList(staffOrgFormDTO);
if(result.success()&&null!=result.getData()){
return result.getData();
}
logger.warn(String .format("手机验证码获取组织,调用%s服务失败,入参账户%s,密码%s,返回错误码%s,错误提示信息%s",
ServiceConstant.GOV_ORG_SERVER,
formDTO.getUserAccount(),
formDTO.getPassword(),
result.getCode(),
result.getMsg()));
return new ArrayList<>();
}
//保存登录日志
private Result saveStaffLoginRecord(GovWxmpEnteOrgFormDTO formDTO, String staffId, String openId) {
StaffLoginAgencyRecordFormDTO staffLoginAgencyRecordFormDTO = new StaffLoginAgencyRecordFormDTO();

125
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -442,6 +442,68 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
return userTokenResultDTO;
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 单客户-选择组织进入首页
**/
@Override
public UserTokenResultDTO enterOrgByAccount(ThirdWxmpEnteOrgByAccountFormDTO formDTO) {
//1、需要校验要登录的客户,是否被禁用
CustomerStaffByAccountFormDTO customerStaffFormDTO = new CustomerStaffByAccountFormDTO();
customerStaffFormDTO.setCustomerId(formDTO.getCustomerId());
customerStaffFormDTO.setUserAccount(formDTO.getUserAccount());
Result<CustomerStaffDTO> customerStaffDTOResult = epmetUserOpenFeignClient.getCustomerStaffInfoByAccount(customerStaffFormDTO);
if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) {
logger.error(String.format("获取工作人员信息失败,账户[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getUserAccount(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg()));
throw new RenException(customerStaffDTOResult.getCode());
}
CustomerStaffDTO customerStaff = customerStaffDTOResult.getData();
//2020.7.24 获取微信信息接口调整,改调用微信api的方式 sun start
//2.调用epmet_third服务,校验appId是否有效以及是否授权,校验通过的调用微信API获取用户基本信息
WxLoginFormDTO resiLoginFormDTO = new WxLoginFormDTO();
resiLoginFormDTO.setAppId(formDTO.getAppId());
resiLoginFormDTO.setWxCode(formDTO.getWxCode());
UserWechatDTO userWechatDTO = this.getUserWeChat(resiLoginFormDTO);
WxMaJscode2SessionResult wxMaJscode2SessionResult = new WxMaJscode2SessionResult();
wxMaJscode2SessionResult.setOpenid(userWechatDTO.getWxOpenId());
wxMaJscode2SessionResult.setSessionKey(userWechatDTO.getSessionKey());
wxMaJscode2SessionResult.setUnionid("");
// end
//3、记录staff_wechat,并记录用户激活状态,激活时间
this.savestaffwechat(customerStaff.getUserId(), userWechatDTO.getWxOpenId(), formDTO.getCustomerId());
//4、记录登录日志
StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = new StaffLatestAgencyResultDTO();
staffLatestAgencyResultDTO.setCustomerId(formDTO.getCustomerId());
staffLatestAgencyResultDTO.setStaffId(customerStaff.getUserId());
staffLatestAgencyResultDTO.setWxOpenId(userWechatDTO.getWxOpenId());
staffLatestAgencyResultDTO.setMobile(customerStaff.getMobile());
staffLatestAgencyResultDTO.setAgencyId(formDTO.getRootAgencyId());
this.saveStaffLoginRecord(staffLatestAgencyResultDTO);
//5.1、获取用户token
String token = this.generateGovWxmpToken(customerStaff.getUserId());
//5.2、保存到redis
StaffLatestAgencyResultDTO staffLatestAgency = new StaffLatestAgencyResultDTO();
staffLatestAgency.setAgencyId(formDTO.getRootAgencyId());
staffLatestAgency.setCustomerId(formDTO.getCustomerId());
staffLatestAgency.setStaffId(customerStaff.getUserId());
this.saveLatestGovTokenDto(staffLatestAgency, userWechatDTO, token);
UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO();
userTokenResultDTO.setToken(token);
//6.发送登录事件
try {
sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP);
} catch (RenException e) {
log.error(e.getInternalMsg());
} catch (Exception e) {
log.error("【工作端enterOrg登录】发送登录事件失败,程序继续执行。错误信息");
}
return userTokenResultDTO;
}
/**
* @param formDTO
* @return
@ -555,6 +617,69 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
return new ArrayList<>();
}
@Override
public List<StaffOrgsResultDTO> getMyOrgByAccount(ThirdStaffOrgByAccountFormDTO formDTO) {
//0.根据appId查询对应客户Id
PaCustomerDTO customer = this.getCustomerInfo(formDTO.getAppId());
//7.28 上边根据appId只能锁定一条客户id,后边的批量循环操作暂不做调整,还是使用之前的代码 sun
//1、根据手机号查询到用户信息
ThirdCustomerStaffByAccountFormDTO dto = new ThirdCustomerStaffByAccountFormDTO();
dto.setCustomerId(customer.getId());
dto.setUserAccount(formDTO.getUserAccount());
Result<List<CustomerStaffDTO>> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndAccount(dto);
if (!customerStaffResult.success()) {
logger.warn(String.format("账户密码登录异常,账户[%s],code[%s],msg[%s]", formDTO.getUserAccount(), customerStaffResult.getCode(), customerStaffResult.getMsg()));
throw new RenException(customerStaffResult.getCode());
}
//2、密码是否正确
List<CustomerStaffDTO> customerStaffList=customerStaffResult.getData();
//3、查询用户所有的组织信息
List<String> customerIdList = new ArrayList<>();
//是否设置过密码
boolean havePasswordFlag=false;
//密码是否正确
boolean passwordRightFlag=false;
for (CustomerStaffDTO customerStaffDTO : customerStaffList) {
if(StringUtils.isNotBlank(customerStaffDTO.getPassword())){
havePasswordFlag=true;
}else{
logger.warn(String.format("当前用户:账户%s,客户Id%s下未设置密码.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId()));
continue;
}
if (!PasswordUtils.matches(formDTO.getPassword(), customerStaffDTO.getPassword())) {
logger.warn(String.format("当前用户:账户%s,客户Id%s密码匹配错误.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId()));
}else{
logger.warn(String.format("当前用户:账户%s,客户Id%s密码匹配正确.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId()));
passwordRightFlag=true;
customerIdList.add(customerStaffDTO.getCustomerId());
}
}
//根据手机号查出来所有用户,密码都为空,表明用户未激活账户,未设置密码
if(!havePasswordFlag){
logger.warn(String.format("当前账户(%s)下所有账户都未设置密码,请先使用验证码登录激活账户",formDTO.getUserAccount()));
throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode());
}
//密码错误
if(!passwordRightFlag){
logger.warn(String.format("根据当前账户(%s)密码未找到所属组织,密码错误",formDTO.getUserAccount()));
throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode());
}
StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO();
staffOrgFormDTO.setCustomerIdList(customerIdList);
Result<List<StaffOrgsResultDTO>> result = govOrgOpenFeignClient.getStaffOrgList(staffOrgFormDTO);
if(result.success()&&null!=result.getData()){
return result.getData();
}
logger.warn(String .format("手机验证码获取组织,调用%s服务失败,入参账户%s,密码%s,返回错误码%s,错误提示信息%s",
ServiceConstant.GOV_ORG_SERVER,
formDTO.getUserAccount(),
formDTO.getPassword(),
result.getCode(),
result.getMsg()));
return new ArrayList<>();
}
/**
* @Description 获取客户信息
* @param appId

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java

@ -85,6 +85,7 @@ public interface NumConstant {
String POSITIVE_EIGHT_STR = "+8";
String EMPTY_STR = "";
String ONE_NEG_STR = "-1";
String ONE_HUNDRED_STR = "100";
String FIFTY_STR="50";
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -40,6 +40,7 @@ public enum EpmetErrorCode {
PASSWORD_NOT_FIT(8010,"两次填写的密码不一致"),
PASSWORD_OUT_OF_ORDER(8011,"密码必须8-20个字符,而且同时包含大小写字母和数字"),
PASSWORD_UPDATE_FAILED(8012,"密码修改失败"),
GOV_STAFF_ACCOUNT_NOT_EXISTS(8013,"账户未注册,请联系贵单位管理员"),
MOBILE_HAS_BEEN_USED(8101, "该手机号已注册,请更换手机号或使用原绑定的微信账号登录"),
MOBILE_CODE_ERROR(8102, "验证码错误"),
AUTO_CONFIRM_FAILED(8103, "党员注册失败"),
@ -100,6 +101,7 @@ public enum EpmetErrorCode {
EXIT_PEND_PROJECT(8408,"该工作人员有项目尚在处理,处理完毕方可操作"),
EXIT_PUBLISHED_ACTIVITY(8409,"该工作人员有活动尚在进行,等活动完成方可操作"),
CAN_NOT_SELF(8410,"无法对自己进行操作"),
ACCOUNT_USED(8411,"该账号已注册"),
PATROL_IS_NOT_OVER(8520,"巡查尚未结束"),
ALREADY_EVALUATE(8501,"您已评价"),

5
epmet-module/epmet-job/epmet-job-server/pom.xml

@ -43,11 +43,6 @@
<artifactId>epmet-message-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>pli-power-base-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>

17
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/PliPowerService.java

@ -1,17 +0,0 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.plugin.power.dto.visit.form.VisitorLogoutFormDTO;
public interface PliPowerService {
/**
* 访客登出
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhy
* @date 2022/5/30 10:25
*/
Result visitorLogout(VisitorLogoutFormDTO formDTO);
}

31
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/PliPowerServiceImpl.java

@ -1,31 +0,0 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.plugin.power.dto.visit.form.VisitorLogoutFormDTO;
import com.epmet.plugin.power.feign.PliPowerFeignClient;
import com.epmet.service.PliPowerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description
* @ClassName StatsUserServiceImpl
* @Auth wangc
* @Date 2020-06-29 09:41
*/
@Service
public class PliPowerServiceImpl implements PliPowerService {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private PliPowerFeignClient pliPowerFeignClient;
@Override
public Result visitorLogout(VisitorLogoutFormDTO formDTO) {
return pliPowerFeignClient.visitorLogout(formDTO);
}
}

41
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PliVisitorLogoutTask.java

@ -1,41 +0,0 @@
package com.epmet.task;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.utils.Result;
import com.epmet.plugin.power.dto.visit.form.VisitorLogoutFormDTO;
import com.epmet.service.PliPowerService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 访客登出
*
* @author zhy
* @date 2022/5/30 10:23
*/
@Component("pliVisitorLogoutTask")
public class PliVisitorLogoutTask implements ITask {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private PliPowerService pliPowerService;
@Override
public void run(String params) {
logger.info("VisitorLogoutTask定时任务正在执行,参数为:{}", params);
VisitorLogoutFormDTO formDTO = new VisitorLogoutFormDTO();
if (StringUtils.isNotBlank(params)) {
formDTO = JSON.parseObject(params, VisitorLogoutFormDTO.class);
}
Result result = pliPowerService.visitorLogout(formDTO);
if (result.success()) {
logger.info("VisitorLogoutTask定时任务执行成功");
} else {
logger.error("VisitorLogoutTask定时任务执行失败:" + result.getMsg());
}
}
}

87
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffPyFromDTO.java

@ -0,0 +1,87 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;
/**
* @author sun
* @dscription
*/
@NoArgsConstructor
@Data
public class AddStaffPyFromDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 新增人员所属类型Id
*/
private String orgId;
/**
* 客户ID
*/
private String customerId;
/**
* 新增人员所属类型组织:agency;部门:dept;网格:grid
*/
private String orgType;
/**
* 姓名
*/
@NotBlank(message = "姓名不能为空", groups = AddStaffPyFromDTO.AddStaff.class)
@Length(max = 15, message = "姓名仅允许输入15个字符", groups = AddStaffPyFromDTO.AddStaff.class)
private String name;
/**
* 人员ID
*/
private String staffId;
/**
* 手机
*/
@NotBlank(message = "手机号不能为空", groups = AddStaffPyFromDTO.AddStaff.class)
@Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "请输入正确的手机号", groups = AddStaffPyFromDTO.AddStaff.class)
private String mobile;
/**
* 性别
*/
@NotNull(message = "性别不能为空", groups = AddStaffPyFromDTO.AddStaff.class)
private Integer gender;
/**
* 专兼职
*/
@NotBlank(message = "专兼职不能为空", groups = AddStaffPyFromDTO.AddStaff.class)
private String workType;
/**
* 账户
*/
@NotBlank(message = "账号不能为空", groups = AddStaffPyFromDTO.AddStaff.class)
private String userAccount;
/**
* 密码
*/
@NotBlank(message = "密码不能为空", groups = AddStaffPyFromDTO.AddStaff.class)
private String pwd;
/**
* 角色id列表
*/
@NotNull(message = "角色不能为空", groups = AddStaffPyFromDTO.AddStaff.class)
private List<String> roles;
public interface AddStaff extends CustomerClientShowGroup {}
/**
* 来源app(政府端:gov居民端:resi运营端:oper)
*/
private String app;
/**
* 来源client(PC端:web微信小程序:wxmp)
*/
private String client;
}

82
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitAccountFromDTO.java

@ -0,0 +1,82 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;
/**
* @author zhy
* @dscription
* @date 2020/4/24 10:43
*/
@NoArgsConstructor
@Data
public class StaffSubmitAccountFromDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 机关ID
*/
private String agencyId;
/**
* 人员ID
*/
private String staffId;
/**
* 姓名
*/
@NotBlank(message = "姓名不能为空")
@Length(max = 15, message = "姓名仅允许输入15个字符")
private String name;
/**
* 手机
*/
@NotBlank(message = "手机号不能为空")
@Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "请输入正确的手机号")
private String mobile;
/**
* 性别
*/
@NotNull(message = "性别不能为空")
private Integer gender;
/**
* 性别
*/
@NotNull(message = "账号不能为空")
private String userAccount;
/**
* 密码
*/
private String pwd;
/**
* 专兼职
*/
@NotBlank(message = "专兼职不能为空")
private String workType;
/**
* 角色id列表
*/
@NotNull(message = "角色不能为空")
private List<String> roles;
/**
* 来源app(政府端:gov居民端:resi运营端:oper)
*/
private String app;
/**
* 来源client(PC端:web微信小程序:wxmp)
*/
private String client;
/**
* 身份证号
*/
private String idCard;
}

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java

@ -57,6 +57,10 @@ public class IcBulidingDetailDTO implements Serializable {
*/
private String type;
/**
* --楼栋类型1商品房2自建房3别墅
*/
private String typeName;
/**
* 排序

111
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java

@ -0,0 +1,111 @@
package com.epmet.dto.result;
import com.epmet.dto.IcPropertyManagementDTO;
import lombok.Data;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2022/9/21 9:19
*/
@Data
public class IcNeighborHoodDetailDTO {
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 小区名称
*/
private String neighborHoodName;
/**
* 组织id
*/
private String agencyId;
/**
* 组织名称--新版详情页面用于显示
*/
private String agencyName;
/**
* 上级组织id
*/
private String parentAgencyId;
/**
* 组织的所有上级组织id
*/
private String agencyPids;
/**
* 网格id
*/
private String gridId;
/**
* 详细地址
*/
private String address;
/**
* 备注
*/
private String remark;
/**
* 中心点位经度
*/
private String longitude;
/**
* 中心点位纬度
*/
private String latitude;
/**
* 坐标区域
*/
private String coordinates;
/**
* 坐标位置
*/
private String location;
/**
* 网格名称--新版详情页面用于显示
*/
private String gridName;
/**
* 物业名称--新版详情页面用于显示
*/
private List<IcPropertyManagementDTO> propertyList;
/**
* 小区编码
*/
private String coding;
/**
* 小区系统编码
*/
private String sysCoding;
/**
* 实有楼栋数
*/
private Integer realBuilding;
/**
* 二维码地址
*/
private String qrcodeUrl;
}

8
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java

@ -25,6 +25,10 @@ public class StaffInitResultDTO implements Serializable {
* 手机号
*/
private String mobile;
/**
* 手机号
*/
private String userAccount;
/**
* 性别
*/
@ -33,6 +37,10 @@ public class StaffInitResultDTO implements Serializable {
* 专兼职
*/
private String workType;
/**
* 身份证号
*/
private String idCard;
/**
* 职责列表
*/

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java

@ -23,7 +23,6 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.HouseInformationFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -64,7 +63,7 @@ public class HouseInformationController {
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.IcNeighborHoodDTO>
*/
@PostMapping("neighborhoodDetail/{neighborhoodId}")
public Result<IcNeighborHoodEntity> neighborhoodDetail(@PathVariable("neighborhoodId") String neighborhoodId){
public Result<IcNeighborHoodDetailDTO> neighborhoodDetail(@PathVariable("neighborhoodId") String neighborhoodId){
return icNeighborHoodService.neighborhoodDetail(neighborhoodId);
}

27
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java

@ -101,6 +101,19 @@ public class StaffController {
return staffService.editStaff(tokenDto, fromDTO);
}
/**
* 人员编辑
*
* @param fromDTO 参数
* @return Result
*/
@PostMapping("editstaffpy")
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_UPDATE)
public Result editStaffPy(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitAccountFromDTO fromDTO){
ValidatorUtils.validateEntity(fromDTO);
return staffService.editStaffByAccount(tokenDto, fromDTO);
}
/**
* 人员详情
*
@ -195,6 +208,20 @@ public class StaffController {
return staffService.addStaffV2(fromDTO);
}
/**
* 通讯录人员添加-平阴
* @author zhy
*/
@PostMapping("addstaffpy")
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_CREATE)
public Result addStaffPy(@RequestBody StaffSubmitAccountFromDTO fromDTO){
fromDTO.setApp("gov");
fromDTO.setClient("wxmp");
ValidatorUtils.validateEntity(fromDTO);
return staffService.addStaffByAccount(fromDTO);
}
/**
* @Description 用户所属组织
* @Param tokenDto

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -211,4 +211,6 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
IcHouseEntity getHouseInfoByName(CheckHouseInfoFormDTO formDTO);
List<IcHouseListResultDTO> houseStatisListDetail(HouseChartFormDTO formDTO);
List<IcHouseEntity> selectListForRenFangStats(@Param("buildingId") String buildingId);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcPropertyManagementDTO;
import com.epmet.entity.IcPropertyManagementEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -50,4 +51,11 @@ public interface IcPropertyManagementDao extends BaseDao<IcPropertyManagementEnt
* @date 2022/2/13 9:59 上午
*/
List<IcPropertyManagementEntity> selectIdByName(@Param("names")List<String> names);
/**
* 查询小区关联物业id,name
* @param neighborhoodId
* @return
*/
List<IcPropertyManagementDTO> selectPropertyNameList(String neighborhoodId);
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -91,6 +91,16 @@ public interface EpmetUserFeignClient {
@PostMapping("/epmetuser/customerstaff/addstaff")
Result<CustomerStaffDTO> addStaff(@RequestBody StaffSubmitFromDTO fromDTO);
/**
* 人员添加
*
* @param fromDTO 参数
* @return Result
*/
@PostMapping("/epmetuser/customerstaff/addstaffaccount")
Result<CustomerStaffDTO> addStaffByAccount(@RequestBody StaffSubmitAccountFromDTO fromDTO);
/**
* 人员编辑
*
@ -100,6 +110,16 @@ public interface EpmetUserFeignClient {
@PostMapping("/epmetuser/customerstaff/editstaff")
Result editStaff(@RequestBody StaffSubmitFromDTO fromDTO);
/**
* 人员编辑
*
* @param fromDTO 参数
* @return Result
*/
@PostMapping("/epmetuser/customerstaff/editstaffaccount")
Result editStaffByAccount(@RequestBody StaffSubmitAccountFromDTO fromDTO);
/**
* 人员详情
*

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java

@ -62,11 +62,21 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "addStaff", fromDTO);
}
@Override
public Result<CustomerStaffDTO> addStaffByAccount(StaffSubmitAccountFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "addStaffByAccount", fromDTO);
}
@Override
public Result editStaff(StaffSubmitFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editStaff", fromDTO);
}
@Override
public Result editStaffByAccount(StaffSubmitAccountFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editStaffByAccount", fromDTO);
}
@Override
public Result<StaffDetailResultDTO> getStaffDetail(StaffInfoFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffDetail", fromDTO);

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java

@ -28,11 +28,11 @@ import com.epmet.dto.NeighborHoodAndManagementDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.IcNeighborHoodDetailDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.entity.IcNeighborHoodPropertyEntity;
import com.epmet.entity.IcPropertyManagementEntity;
import org.springframework.web.bind.annotation.RequestBody;
import java.io.IOException;
import java.io.InputStream;
@ -194,5 +194,5 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
* @params [neighborhoodId]
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.IcNeighborHoodDTO>
*/
Result<IcNeighborHoodEntity> neighborhoodDetail(String neighborhoodId);
Result<IcNeighborHoodDetailDTO> neighborhoodDetail(String neighborhoodId);
}

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java

@ -64,6 +64,14 @@ public interface StaffService {
*/
Result editStaff(TokenDto tokenDto,StaffSubmitFromDTO fromDTO);
/**
* 人员编辑
*
* @param fromDTO 参数
* @return Result
*/
Result editStaffByAccount(TokenDto tokenDto, StaffSubmitAccountFromDTO fromDTO);
/**
* 人员详情
*
@ -130,6 +138,13 @@ public interface StaffService {
*/
Result addStaffV2(AddStaffV2FromDTO fromDTO);
/**
* 通讯录人员添加-平阴
* @author zhy
*/
Result addStaffByAccount(StaffSubmitAccountFromDTO fromDTO);
/**
* @Description 工作人员所属组织
* @Param tokenDto

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -210,7 +210,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
IcBuildingUnitDTO icBuildingUnit = icBuildingUnitService.get(formDTO.getBuildingUnitId());
String doorName = formDTO.getDoorName();
String buildingName = Optional.ofNullable(icBuilding).map(u -> u.getBuildingName()).orElse("");
String unitName = Optional.ofNullable(icBuildingUnit).map(u -> u.getUnitNum()).orElse("");
String unitName = Optional.ofNullable(icBuildingUnit).map(u -> u.getUnitName()).orElse("");
return new StringBuilder().append(buildingName).append("-").append(unitName).append("-").append(doorName).toString();
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -9,6 +9,8 @@ import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -160,10 +162,13 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
@Override
public List<HouseListResultDTO> getHouseList(TokenDto tokenDto, HouseFormDTO formDTO) {
//查询楼栋下房屋列表
LambdaQueryWrapper<IcHouseEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId());
wrapper.last("ORDER BY CONVERT ( HOUSE_NAME USING gbk ) ASC");
List<IcHouseEntity> list = baseDao.selectList(wrapper);
// LambdaQueryWrapper<IcHouseEntity> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId());
// wrapper.last("ORDER BY CONVERT ( HOUSE_NAME USING gbk ) ASC");
// List<IcHouseEntity> list = baseDao.selectList(wrapper);
List<IcHouseEntity> list = baseDao.selectListForRenFangStats(formDTO.getBuildingId());
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
@ -220,6 +225,13 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
categories.add(NumConstant.ZERO, categories.remove(a));
}
dto.setCategoryList(categories);
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(item.getCustomerId(), item.getId());
if (null != houseInfo){
StringBuffer str = new StringBuffer();
str.append(houseInfo.getBuildingName()).append(houseInfo.getUnitName()).append(houseInfo.getDoorName());
dto.setHouseName(str.toString());
}
return dto;
}).collect(Collectors.toList());
}

26
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -30,6 +30,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -50,10 +51,7 @@ import com.epmet.dto.*;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.InfoByNamesResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.excel.IcNeighborHoodExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -808,12 +806,22 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
}
@Override
public Result<IcNeighborHoodEntity> neighborhoodDetail(String neighborhoodId) {
IcNeighborHoodEntity result = baseDao.selectById(neighborhoodId);
if(null != result && null == result.getRemark()){
result.setRemark("");
public Result<IcNeighborHoodDetailDTO> neighborhoodDetail(String neighborhoodId) {
IcNeighborHoodEntity icNeighborHoodEntity = baseDao.selectById(neighborhoodId);
if (null == icNeighborHoodEntity) {
return new Result<>();
}
return new Result<IcNeighborHoodEntity>().ok(result);
IcNeighborHoodDetailDTO result = ConvertUtils.sourceToTarget(icNeighborHoodEntity, IcNeighborHoodDetailDTO.class);
if(null == result.getRemark()){
result.setRemark(StrConstant.EPMETY_STR);
}
GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(result.getGridId());
if (null != gridInfoCache) {
result.setAgencyName(gridInfoCache.getAgencyName());
result.setGridName(gridInfoCache.getGridName());
}
result.setPropertyList(propertyManagementDao.selectPropertyNameList(neighborhoodId));
return new Result<IcNeighborHoodDetailDTO>().ok(result);
}
}

58
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -204,6 +204,25 @@ public class StaffServiceImpl implements StaffService {
return result;
}
@Override
public Result editStaffByAccount(TokenDto tokenDto, StaffSubmitAccountFromDTO fromDTO) {
CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId());
fromDTO.setCustomerId(customerAgencyEntity.getCustomerId());
fromDTO.setApp(tokenDto.getApp());
fromDTO.setClient(tokenDto.getClient());
Result result = epmetUserFeignClient.editStaffByAccount(fromDTO);
if (!result.success()) {
if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) {
return new Result().error(result.getCode(), result.getMsg());
}
return new Result().error(EpmetErrorCode.STAFF_EDIT_FAILED.getCode(), EpmetErrorCode.STAFF_EDIT_FAILED.getMsg());
}
//2021.8.24 sun 人员信息编辑时删除工作人员的缓存信息
CustomerStaffRedis.delStaffInfoFormCache(fromDTO.getCustomerId(), fromDTO.getStaffId());
return result;
}
@Override
public Result<StaffDetailResultDTO> getStaffDetail(StaffInfoFromDTO fromDTO) {
CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId());
@ -597,6 +616,45 @@ public class StaffServiceImpl implements StaffService {
return new Result();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result addStaffByAccount(StaffSubmitAccountFromDTO fromDTO) {
CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId());
//fromDTO.setApp(tokenDto.getApp());
//fromDTO.setClient(tokenDto.getClient());
fromDTO.setCustomerId(customerAgencyEntity.getCustomerId());
Result<CustomerStaffDTO> result = epmetUserFeignClient.addStaffByAccount(fromDTO);
if (!result.success()) {
if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) {
return new Result().error(result.getCode(), result.getMsg());
}
return new Result().error(EpmetErrorCode.STAFF_ADD_FAILED.getCode(), EpmetErrorCode.STAFF_ADD_FAILED.getMsg());
}
//人员机关关系表
CustomerStaffAgencyEntity customerStaffAgencyEntity = new CustomerStaffAgencyEntity();
customerStaffAgencyEntity.setCustomerId(customerAgencyEntity.getCustomerId());
customerStaffAgencyEntity.setUserId(result.getData().getUserId());
customerStaffAgencyEntity.setAgencyId(customerAgencyEntity.getId());
customerStaffAgencyService.insert(customerStaffAgencyEntity);
//机关总人数加一
customerAgencyEntity.setTotalUser(customerAgencyEntity.getTotalUser() + 1);
customerAgencyService.updateById(customerAgencyEntity);
//2021.8.25 sun 新增一张工作人员注册组织关系表,所以旧接口新增人员时关系表赋值关系数据
//工作人员注册组织关系表新增数据
StaffOrgRelationEntity staffOrgRelationEntity = new StaffOrgRelationEntity();
staffOrgRelationEntity.setCustomerId(fromDTO.getCustomerId());
staffOrgRelationEntity.setPids(("".equals(customerAgencyEntity.getPids()) ? "" : customerAgencyEntity.getPids()));
staffOrgRelationEntity.setStaffId(result.getData().getUserId());
staffOrgRelationEntity.setOrgId(customerAgencyEntity.getId());
staffOrgRelationEntity.setOrgType("agency");
staffOrgRelationService.insert(staffOrgRelationEntity);
return new Result();
}
/**
* @param tokenDto
* @Description 工作人员所属组织

13
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

@ -235,6 +235,12 @@
LEFT JOIN ic_neighbor_hood nh ON (nh.ID = b.NEIGHBOR_HOOD_ID AND nh.DEL_FLAG = '0')
WHERE b.DEL_FLAG = '0'
AND b.NEIGHBOR_HOOD_ID = #{neighborHoodId}
ORDER BY
b.SORT ASC,
CAST( nh.NEIGHBOR_HOOD_NAME AS SIGNED ),
CONVERT ( nh.NEIGHBOR_HOOD_NAME USING gbk ),
CAST( b.BUILDING_NAME AS SIGNED ),
CONVERT ( b.BUILDING_NAME USING gbk)
</select>
<select id="checkBuildName" parameterType="map" resultType="java.lang.Integer">
@ -452,6 +458,13 @@
b.LONGITUDE,
b.COORDINATE_POSITION,
b.TYPE,
(
case when b.TYPE='1' then '商品房'
when b.TYPE='2' then '自建房'
when b.TYPE='3' then '别墅'
else ''
end
) as typeName,
h.GRID_ID,
h.AGENCY_ID,
b.BUILDING_LEADER_NAME,

45
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -638,5 +638,48 @@
CONVERT(a.DOOR_NAME using gbk)
</select>
<select id="selectListForRenFangStats" resultMap="icHouseMap">
select a.id,
a.customer_id,
a.org_id_path,
a.neighbor_hood_id,
a.part_id,
a.building_id,
a.building_unit_id,
a.house_name,
a.door_name,
a.full_name,
a.house_type,
a.purpose,
a.rent_flag,
a.owner_name,
a.owner_phone,
a.owner_id_card,
a.resi_number,
a.avg_ysr,
a.sort,
a.del_flag,
a.revision,
a.created_by,
a.created_time,
a.updated_by,
a.updated_time,
a.remark,
a.house_code,
a.house_qrcode_url,
a.coding
FROM ic_house a
LEFT JOIN ic_building b on a.building_id = b.id and b.del_flag = '0'
LEFT JOIN ic_neighbor_hood c on a.neighbor_hood_id = c.id and c.del_flag = '0'
LEFT JOIN ic_building_unit d on a.building_unit_id = d.id and d.del_flag = '0'
where a.BUILDING_ID = #{buildingId}
and a.DEL_FLAG = '0'
order by
a.sort,
CONVERT(c.NEIGHBOR_HOOD_NAME using gbk),
CONVERT(b.BUILDING_NAME USING gbk),
CONVERT(d.UNIT_NAME USING gbk),
CAST(a.DOOR_NAME AS SIGNED),
CONVERT(a.DOOR_NAME using gbk)
</select>
</mapper>

17
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml

@ -48,4 +48,21 @@
)
</select>
<select id="selectPropertyNameList" parameterType="java.lang.String" resultType="com.epmet.dto.IcPropertyManagementDTO">
SELECT
p.id,
p.NAME
FROM
ic_property_management p
WHERE
p.id IN (
SELECT DISTINCT
p.PROPERTY_ID
FROM
ic_neighbor_hood_property p
WHERE
p.NEIGHBOR_HOOD_ID = #{neighborhoodId}
AND p.DEL_FLAG = '0'
)
</select>
</mapper>

1
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java

@ -16,4 +16,5 @@ public class IcEventResultDTO {
private String reportUserName;
private String mobile;
private String address;
private String happenTime;
}

9
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

@ -43,7 +43,8 @@
e.REPORT_USER_ID reportUserId,
e.NAME reportUserName,
e.MOBILE mobile,
e.STATUS processStatus
e.STATUS processStatus,
e.happen_time happenTime
from ic_event e
<choose>
<!-- 如果是事件分类分析,那么用inner join;如果是处理分析,那么leftjoin查询所有事件 -->
@ -71,7 +72,7 @@
and c.CATEGORY_CODE like CONCAT(#{categoryCode},'%')
</if>
</where>
order by e.CREATED_TIME desc
order by e.happen_time desc
</select>
<select id="listMonthlyEventCount" resultType="com.epmet.dto.result.IcEventMonthlyCountResultDTO">
select t.monthName, count(1) eventCount
@ -210,10 +211,10 @@
AND ie.mobile = #{mobile}
</if>
<if test="startTime != null and startTime != '' ">
AND DATE_FORMAT(ie.created_time,"%Y-%m-%d %H:%i") <![CDATA[>=]]> #{startTime}
AND DATE_FORMAT(ie.happen_time,"%Y-%m-%d %H:%i") <![CDATA[>=]]> #{startTime}
</if>
<if test="endTime != null and endTime != '' ">
AND DATE_FORMAT(ie.created_time,"%Y-%m-%d %H:%i") <![CDATA[<=]]> #{endTime}
AND DATE_FORMAT(ie.happen_time,"%Y-%m-%d %H:%i") <![CDATA[<=]]> #{endTime}
</if>
<if test="status != null and status != '' ">
AND ie.`status` = #{status}

2
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemGroupDTO.java

@ -74,7 +74,7 @@ public class IcFormItemGroupDTO implements Serializable {
private Integer sort;
/**
* 1展示0不展示默认1
* 1展示0不展示默认1像党员点击是追加党员信息这种分组默认0不展示
*/
private Boolean display;

2
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java

@ -71,7 +71,7 @@ public class IcFormItemGroupEntity extends BaseEpmetEntity {
private Integer sort;
/**
* 1展示0不展示默认1
* 1展示0不展示默认1像党员点击是追加党员信息这种分组默认0不展示
*/
private Boolean display;

2
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java

@ -105,7 +105,9 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
if (null == resultDTO) {
throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(), EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg());
}
//基础信息这个分组对应的id:客户id_0
String itemGroupId=formDto.getCustomerId().concat(StrConstant.UNDER_LINE).concat(NumConstant.ZERO_STR);
//查询的是基础信息这个分组下的组件
List<FormItemResult> itemList = baseDao.selectItemList(itemGroupId,resultDTO.getFormId(), formDto.getDynamic());
List<FormGroupDTO> groupList = baseDao.selectListGroup(resultDTO.getFormId());
resultDTO.setItemList(itemList);

9
epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.39__itemgroup_child.sql

@ -0,0 +1,9 @@
ALTER TABLE ic_form_item_group MODIFY COLUMN `DISPLAY` TINYINT ( 1 ) NOT NULL DEFAULT '1' COMMENT '1展示,0不展示,默认1;像党员点击是,追加党员信息这种分组,默认0不展示';
ALTER TABLE ic_form_item_group ADD COLUMN `CHILD_SHOW_FLAG`
TINYINT ( 1 ) NOT NULL DEFAULT '0' COMMENT '1展示,0不展示,默认0' AFTER POLICY_FLAG;
UPDATE ic_form_item_group g
set g.CHILD_SHOW_FLAG='1'
where g.DISPLAY='0' and g.LABEL !='基础信息';

3
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml

@ -71,6 +71,7 @@
ic_form_item_group g
WHERE
g.DEL_FLAG = '0'
and g.CHILD_SHOW_FLAG='1'
AND g.id =(
SELECT DISTINCT
i.ITEM_GROUP_ID
@ -237,7 +238,7 @@
FROM ic_form_item fi
left join ic_form_item_group g on (fi.ITEM_GROUP_ID = g.ID and fi.DEL_FLAG = 0 and g.DEL_FLAG = 0)
left join ic_form_item pitem on (pitem.DEL_FLAG = 0 and fi.PARENT_ITEM_ID = pitem.ID)
WHERE fi.FORM_ID = #{formId}
WHERE fi.FORM_ID = #{formId} and fi.DEL_FLAG = '0'
ORDER BY fi.SORT ASC
</select>
</mapper>

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java

@ -44,6 +44,11 @@ public class CustomerStaffDTO implements Serializable {
*/
private String userId;
/**
* 账户
*/
private String userAccount;
/**
* 真实姓名
*/

15
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcBirthRecordDTO.java

@ -71,7 +71,11 @@ public class IcBirthRecordDTO implements Serializable {
@NotBlank(message = "所属家庭不能为空", groups = {AddGroup.class})
private String homeId;
private String home;
/**
* 所属房屋全路径名称
* 详情回显
*/
private String homeAllName;
/**
* 姓名
*/
@ -84,10 +88,9 @@ public class IcBirthRecordDTO implements Serializable {
private String mobile;
/**
* 性别
* 性别 1男2女
*/
private String gender;
/**
* 身份证号
*/
@ -139,6 +142,12 @@ public class IcBirthRecordDTO implements Serializable {
*/
private String householderRelation;
/**
* 与户主关系字典表
* 详情回显
*/
private String householderRelationName;
/**
* 是否勾选补充居民信息0否 1是
*/

14
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java

@ -28,7 +28,8 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable {
/**
* ID
*/
private String id;
@NotBlank(message = "id不能为空",groups = {IcEpidemicSpecialAttentionUpdate.class})
private String id;
/**
* 客户ID
@ -55,6 +56,17 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable {
*/
private Integer isAttention;
/**
* 是否历史关注1是0否
*/
private String isHistory;
/**
* 隔离类型,来自字典表
*/
// @NotBlank(message = "isolatedState不能为空",groups = {IcEpidemicSpecialAttentionAdd.class,IcEpidemicSpecialAttentionUpdate.class})
private String isolatedState;
/**
* 关注类型核酸检测2疫苗接种1行程上报0
*/

36
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffByAccountFormDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description 根据手机号+客户id获取工作人员基本信息
* @Author yinzuomei
* @Date 2020/4/20 14:02
*/
@Data
public class CustomerStaffByAccountFormDTO implements Serializable {
private static final long serialVersionUID = 7619815083427853431L;
// 根据手机号+客户id获取工作人员基本信息
public interface GetCustomerStaffInfo {}
@NotBlank(message = "账号不能为空", groups = { GetCustomerStaffInfo.class })
private String userAccount;
@NotBlank(message = "客户id不能为空", groups = { GetCustomerStaffInfo.class })
private String customerId;
/**
* 姓名
*/
private String realName;
/**
* 用户id集合
*/
private List<String> userIds;
}

24
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ThirdCustomerStaffByAccountFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 根据客户ID手机号查询政府端工作人员基本信息
* @Author zhy
*/
@Data
public class ThirdCustomerStaffByAccountFormDTO implements Serializable{
private static final long serialVersionUID = -7994579456530273809L;
/**
* 客户Id
* */
private String customerId;
/**
* 账号
* */
private String userAccount;
}

3
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java

@ -24,6 +24,9 @@ public class VaccinationListFormDTO extends PageFormDTO implements Serializable
@NotNull(message = "attentionType不能为空",groups = VaccinationListForm.class)
private Integer attentionType;
private String isolatedState;
private String isHistory;
/**
* 手机号
*/

30
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatPieResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/9/19 15:47
* @DESC
*/
@Data
public class NatPieResultDTO implements Serializable {
private static final long serialVersionUID = -1617454069928624020L;
private List<IsolatedList> isolatedList = new ArrayList<>();
private List<IsolatedList> historyList = new ArrayList<>();
@Data
public static class IsolatedList{
private Integer total = NumConstant.ZERO;
private String categoryCode;
private String categoryName;
private String color;
}
}

3
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java

@ -95,4 +95,7 @@ public class PersonDataResultDTO implements Serializable {
@JsonIgnore
private String gridId;
@JsonIgnore
private String homeId;
}

9
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java

@ -1,6 +1,7 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
@ -57,6 +58,7 @@ public class VaccinationListResultDTO implements Serializable {
* 最后一次通知时间
*/
private String lastInformTime;
private String lastNatTime;
/**
* 所属小区ID
@ -72,6 +74,8 @@ public class VaccinationListResultDTO implements Serializable {
* 所属楼宇Id
*/
private String buildId;
private String gridId;
private String gridName;
/**
* 所属楼宇名称
@ -102,7 +106,12 @@ public class VaccinationListResultDTO implements Serializable {
* 小区名+楼栋名+单元名+房屋名
*/
private String allName;
private String isolatedState;
private String id;
private String userId;
@JsonIgnore
private String customerId;
public VaccinationListResultDTO() {
this.vaccinationCount = NumConstant.ZERO;

47
epmet-user/epmet-user-client/src/main/java/com/epmet/enums/NatPieColorEnum.java

@ -0,0 +1,47 @@
package com.epmet.enums;
import com.epmet.commons.tools.constant.NumConstant;
import org.apache.commons.lang3.StringUtils;
/**
* @Author zxc
* @DateTime 2022/3/29 16:17
* @DESC
*/
public enum NatPieColorEnum {
REd("0","#ee6666"),
YELLOW("2","#fac858"),
ORANGE("1","#fc8452"),
THREE("3","#73c0de"),
GREEN("100","#91cc75"),
;
private String key;
private String value;
NatPieColorEnum(String key, String value) {
this.key = key;
this.value = value;
}
public static String getValueByKey(String key){
if (StringUtils.isBlank(key)){
return NumConstant.ZERO_STR;
}
for (NatPieColorEnum a : NatPieColorEnum.values()) {
if (a.getKey().equals(key)){
return a.getValue();
}
}
return NumConstant.ZERO_STR;
}
public String getKey() {
return key;
}
public String getValue() {
return value;
}
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -153,6 +153,16 @@ public interface EpmetUserOpenFeignClient {
@PostMapping(value = "epmetuser/customerstaff/getcustomerstaffinfo", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<CustomerStaffDTO> getCustomerStaffInfo(@RequestBody CustomerStaffFormDTO customerStaffFormDTO);
/**
* @param customerStaffFormDTO
* @return
* @Author sun
* @Description 根据账户+客户id获取工作人员基本信息
**/
@PostMapping(value = "epmetuser/customerstaff/getcustomerstaffinfobyaccount", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<CustomerStaffDTO> getCustomerStaffInfoByAccount(@RequestBody CustomerStaffByAccountFormDTO customerStaffFormDTO);
/**
* @param userIdList
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.UserBaseInfoResultDTO>>
@ -234,6 +244,16 @@ public interface EpmetUserOpenFeignClient {
@GetMapping(value = "epmetuser/customerstaff/getCustsomerStaffByIdAndPhone")
Result<List<CustomerStaffDTO>> getCustsomerStaffByIdAndPhone(@RequestBody ThirdCustomerStaffFormDTO formDTO);
/**
* @param formDTO
* @return
* @Author zhy
* @Description 根据客户ID手机号查询政府端工作人员基本信息校验用户是否存在
**/
@GetMapping(value = "epmetuser/customerstaff/getCustsomerStaffByIdAndAccount")
Result<List<CustomerStaffDTO>> getCustsomerStaffByIdAndAccount(@RequestBody ThirdCustomerStaffByAccountFormDTO formDTO);
/**
* 获取用户基础信息
*

9
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -99,6 +99,11 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfo", customerStaffFormDTO);
}
@Override
public Result<CustomerStaffDTO> getCustomerStaffInfoByAccount(CustomerStaffByAccountFormDTO customerStaffFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByAccount", customerStaffFormDTO);
}
/**
* @param userIdList
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.UserBaseInfoResultDTO>>
@ -174,6 +179,10 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustsomerStaffByIdAndPhone", formDTO);
}
@Override
public Result<List<CustomerStaffDTO>> getCustsomerStaffByIdAndAccount(ThirdCustomerStaffByAccountFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustsomerStaffByIdAndAccount", formDTO);
}
@Override
public Result<ResiUserBaseInfoResultDTO> selectUserBaseInfo(TokenDto tokenDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectUserBaseInfo", tokenDTO);

85
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -119,6 +119,18 @@ public class CustomerStaffController {
return customerStaffService.getCustsomerStaffByPhone(mobile);
}
/**
* @param account 账户
* @return com.epmet.commons.tools.utils.Result
* @Author zhy
* @Description 根据账户查询政府端工作人员基本信息校验用户是否存在
* @Date 2020/4/18 14:07
**/
@GetMapping(value = "getcustsomerstaffbyaccount/{account}")
public Result<List<CustomerStaffDTO>> getCustsomerStaffByAccount(@PathVariable("account") String account) {
return customerStaffService.getCustsomerStaffByAccount(account);
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerStaffDTO>
@ -132,6 +144,19 @@ public class CustomerStaffController {
return customerStaffService.getCustomerStaffInfo(formDTO);
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerStaffDTO>
* @Author zhy
* @Description 根据账户+客户id获取工作人员基本信息
* @Date 2020/4/20 14:04
**/
@PostMapping(value = "getcustomerstaffinfobyaccount")
public Result<CustomerStaffDTO> getCustomerStaffInfoByAccount(@RequestBody CustomerStaffByAccountFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CustomerStaffFormDTO.GetCustomerStaffInfo.class);
return customerStaffService.getCustomerStaffInfoByAccount(formDTO);
}
/**
* 根据userId查询网格下用户信息
* @param customerStaffGridDTOS
@ -234,6 +259,31 @@ public class CustomerStaffController {
return result;
}
/**
* 人员添加
*
* @param fromDTO 参数
* @return Result
*/
@PostMapping("addstaffaccount")
public Result<CustomerStaffDTO> addStaffByAccount(@RequestBody StaffSubmitAccountFromDTO fromDTO){
Result<CustomerStaffDTO> result = customerStaffService.addStaffByAccount(fromDTO);
//2021-10-18 推送mq,数据同步到中介库 start
if (result.success()) {
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(fromDTO.getCustomerId());
mq.setOrgId(result.getData().getUserId());
mq.setOrgType("staff");
mq.setType("staff_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
}
//2021-10-18 end
return result;
}
/**
* 人员编辑
*
@ -260,6 +310,30 @@ public class CustomerStaffController {
return result;
}
/**
* 人员编辑
*
* @param fromDTO 参数
* @return Result
*/
@PostMapping("editstaffaccount")
public Result editStaffByAccount(@RequestBody StaffSubmitAccountFromDTO fromDTO){
Result result = customerStaffService.editStaffByAccount(fromDTO);
//2021-10-18 推送mq,数据同步到中介库 start
if (result.success()) {
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(fromDTO.getCustomerId());
mq.setOrgId(fromDTO.getStaffId());
mq.setOrgType("staff");
mq.setType("staff_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
}
//2021-10-18 end
return result;
}
/**
* 人员详情
*
@ -366,6 +440,17 @@ public class CustomerStaffController {
return new Result<List<CustomerStaffDTO>>().ok(customerStaffService.getCustsomerStaffByIdAndPhone(formDTO));
}
/**
* @param formDTO
* @return
* @Author zhy
* @Description 根据客户ID账户查询政府端工作人员基本信息校验用户是否存在
**/
@GetMapping(value = "getCustsomerStaffByIdAndAccount")
public Result<List<CustomerStaffDTO>> getCustsomerStaffByIdAndAccount(@RequestBody ThirdCustomerStaffByAccountFormDTO formDTO) {
return new Result<List<CustomerStaffDTO>>().ok(customerStaffService.getCustsomerStaffByIdAndAccount(formDTO));
}
/**
* @Description 查询工作人员的信息
* @param formDTO

44
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java

@ -15,13 +15,13 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.NatPieResultDTO;
import com.epmet.dto.result.VaccinationListResultDTO;
import com.epmet.excel.NatExportExcel;
import com.epmet.excel.NatImportExcel;
import com.epmet.excel.VaccinationExportExcel;
import com.epmet.excel.VaccinationImportExcel;
import com.epmet.excel.*;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcEpidemicSpecialAttentionService;
import lombok.extern.slf4j.Slf4j;
@ -34,7 +34,9 @@ import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -52,6 +54,8 @@ public class IcEpidemicSpecialAttentionController {
private IcEpidemicSpecialAttentionService icEpidemicSpecialAttentionService;
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
/**
* Desc: 疫苗接种关注名单疫苗接种关注名单列表
@ -68,6 +72,15 @@ public class IcEpidemicSpecialAttentionController {
return new Result<PageData>().ok(icEpidemicSpecialAttentionService.vaccinationList(formDTO));
}
@PostMapping("historyList")
@MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD })
public Result<PageData> historyList(@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class, VaccinationListFormDTO.VaccinationListForm.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<PageData>().ok(icEpidemicSpecialAttentionService.historyList(formDTO));
}
/**
* Desc: 疫苗接种关注名单疫苗接种关注名单详情
* @param formDTO
@ -185,12 +198,24 @@ public class IcEpidemicSpecialAttentionController {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setIsPage(false);
PageData pageData = icEpidemicSpecialAttentionService.vaccinationList(formDTO);
// 关注类型,核酸检测:2,疫苗接种:1,行程上报:0
PageData<VaccinationListResultDTO> pageData = icEpidemicSpecialAttentionService.vaccinationList(formDTO);
// 关注类型,核酸检测:2,疫苗接种:1,行程上报:0,历史核酸检测关注:99
if (formDTO.getAttentionType().equals(NumConstant.ONE)){
ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), VaccinationExportExcel.class);
}else {
ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), NatExportExcel.class);
Result<List<SysDictDataDTO>> isolatedState = epmetAdminOpenFeignClient.dictDataList("isolatedState");
if (!isolatedState.success()){
throw new EpmetException("查询字典表数据失败..."+"isolatedState");
}
Map<String, String> dictMap = isolatedState.getData().stream().collect(Collectors.toMap(SysDictDataDTO::getDictValue, SysDictDataDTO::getDictLabel));
pageData.getList().forEach(l -> {
l.setIsolatedState(dictMap.get(l.getIsolatedState()));
});
if (formDTO.getIsHistory().equals(NumConstant.ONE_STR)){
ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), NatHistoryExportExcel.class);
}else {
ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), NatExportExcel.class);
}
}
}
@ -213,4 +238,9 @@ public class IcEpidemicSpecialAttentionController {
ExcelPoiUtils.exportExcel(templatePath ,map,fileName,response);
}
@PostMapping("pie")
public Result<NatPieResultDTO> pie(@LoginUser TokenDto tokenDto){
return new Result<NatPieResultDTO>().ok(icEpidemicSpecialAttentionService.pie(tokenDto));
}
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -584,9 +584,9 @@ public class IcResiUserController implements ResultDataResolver {
@RequestMapping(value = "/exportExcelCustomData")
public Map<String, Object> exportExcelCustomData(@LoginUser TokenDto tokenDto, @RequestParam("templateId") String templateId,
@RequestBody ExportResiUserFormDTO pageFormDTO) throws Exception {
log.warn("templateId=【"+templateId+"】");
log.warn("pageFormDTO入参【"+JSON.toJSONString(pageFormDTO)+"】");
pageFormDTO.setTemplateId(templateId);
// pageFormDTO.setTemplateId(templateId);
pageFormDTO.setTemplateId(tokenDto.getCustomerId().concat("_").concat(templateId));
if (null == pageFormDTO.getSearchForm()) {
IcResiUserPageFormDTO searchForm = new IcResiUserPageFormDTO();
searchForm.setFormCode("resi_base_info");
@ -613,7 +613,8 @@ public class IcResiUserController implements ResultDataResolver {
pageFormDTO.setExportConfig(exportTemplateSaveFormDTO);
}
//固定通用客户Id
pageFormDTO.setCustomerId("jmreport_resi_default");
// pageFormDTO.setCustomerId("jmreport_resi_default");
pageFormDTO.setCustomerId(tokenDto.getCustomerId());
Page<Map<String, Object>> maps = icResiUserExportService.exportIcResiUser(tokenDto, pageFormDTO, null, true);
Map<String,Object> result = new HashMap<>();
result.put("total",maps.getPages());

19
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java

@ -45,6 +45,8 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
**/
List<CustomerStaffDTO> selectListCustomerStaffDTO(String mobile);
List<CustomerStaffDTO> listCustomerStaffByAccount(@Param("userAccount") String userAccount);
/**
* @param formDTO
* @return com.epmet.dto.CustomerStaffDTO
@ -54,6 +56,15 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
**/
CustomerStaffDTO selectListCustomerStaffInfo(CustomerStaffFormDTO formDTO);
/**
* @param formDTO
* @return com.epmet.dto.CustomerStaffDTO
* @Author zhy
* @Description 根据账户+客户id获取工作人员基本信息
* @Date 2020/4/20 14:08
**/
CustomerStaffDTO selectListCustomerStaffInfoByAccount(CustomerStaffByAccountFormDTO formDTO);
CustomerStaffDTO selectStaffInfoByUserId(CustomerStaffDTO formDTO);
/**
@ -147,6 +158,14 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
**/
List<CustomerStaffDTO> selectStaff(ThirdCustomerStaffFormDTO formDTO);
/**
* @param formDTO
* @return
* @Author zhy
* @Description 根据客户ID账户查询政府端工作人员基本信息
**/
List<CustomerStaffDTO> selectStaffByAccount(ThirdCustomerStaffByAccountFormDTO formDTO);
/**
* @Description 查询工作人员的信息
* @param userIds

7
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java

@ -3,6 +3,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.AttentionDetailFormDTO;
import com.epmet.dto.form.VaccinationListFormDTO;
import com.epmet.dto.result.NatPieResultDTO;
import com.epmet.dto.result.VaccinationListResultDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
import org.apache.ibatis.annotations.Mapper;
@ -51,6 +52,8 @@ public interface IcEpidemicSpecialAttentionDao extends BaseDao<IcEpidemicSpecial
* @date 2022/3/28 16:59
*/
void cancelAttention(@Param("list")List<String> list,@Param("attentionType")Integer attentionType);
void addAttention(@Param("list")List<String> list,@Param("attentionType")Integer attentionType);
void addExistAttention(@Param("list") List<IcEpidemicSpecialAttentionEntity> list,@Param("attentionType")Integer attentionType);
/**
* Desc: 查询已经存在的关注
@ -69,4 +72,8 @@ public interface IcEpidemicSpecialAttentionDao extends BaseDao<IcEpidemicSpecial
* @return
*/
List<String> getIdCardList(@Param("customerId") String customerId,@Param("idCardSet") List<String> idCardSet, @Param("attentionType") Integer attentionType);
List<NatPieResultDTO.IsolatedList> isolatedList(@Param("agencyId")String agencyId);
Integer getHistoryCount(@Param("agencyId")String agencyId);
}

5
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java

@ -42,6 +42,11 @@ public class CustomerStaffEntity extends BaseEpmetEntity {
*/
private String userId;
/**
* 账户
*/
private String userAccount;
/**
* 真实姓名
*/

10
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java

@ -43,6 +43,16 @@ public class IcEpidemicSpecialAttentionEntity extends BaseEpmetEntity {
*/
private Integer isAttention;
/**
* 是否历史关注1是0否
*/
private String isHistory;
/**
* 隔离类型,来自字典表
*/
private String isolatedState;
/**
* 关注类型核酸检测2疫苗接种1行程上报0
*/

3
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java

@ -45,6 +45,9 @@ public class ImportEpidemicSpecialAttention extends ExcelVerifyInfo {
@Excel(name = "备注")
private String remark;
@Excel(name = "隔离状态")
private String isolatedState;
@ExcelIgnore
private Integer attentionType;

7
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java

@ -29,7 +29,10 @@ public class NatExportExcel {
@Excel(name = "关注原因",width = 40)
private String reason;
@Excel(name = "最近一次通知时间",width = 20)
private String lastInformTime;
@Excel(name = "最后一次核酸时间",width = 20)
private String lastNatTime;
@Excel(name = "隔离状态",width = 20)
private String isolatedState;
}

40
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatHistoryExportExcel.java

@ -0,0 +1,40 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/3/29 10:24
* @DESC
*/
@Data
public class NatHistoryExportExcel {
@Excel(name = "排序",width = 10)
private Integer sort;
@Excel(name = "姓名",width = 20)
private String name;
@Excel(name = "电话",width = 20)
private String mobile;
@Excel(name = "所属房屋",width = 20)
private String allName;
@Excel(name = "身份证",width = 30)
private String idCard;
@Excel(name = "备注",width = 40)
private String remark;
@Excel(name = "关注原因",width = 40)
private String reason;
@Excel(name = "最后一次核酸时间",width = 20)
private String lastNatTime;
@Excel(name = "隔离状态",width = 20)
private String isolatedState;
}

43
epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java

@ -105,6 +105,15 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
**/
Result<List<CustomerStaffDTO>> getCustsomerStaffByPhone(String mobile);
/**
* @param account 账户
* @return com.epmet.commons.tools.utils.Result
* @Author zhy
* @Description 根据账户查询政府端工作人员基本信息校验用户是否存在
* @Date 2020/4/18 14:07
**/
Result<List<CustomerStaffDTO>> getCustsomerStaffByAccount(String account);
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerStaffDTO>
@ -114,6 +123,15 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
**/
Result<CustomerStaffDTO> getCustomerStaffInfo(CustomerStaffFormDTO formDTO);
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerStaffDTO>
* @Author zhy
* @Description 根据账户+客户id获取工作人员基本信息
* @Date 2020/4/20 14:05
**/
Result<CustomerStaffDTO> getCustomerStaffInfoByAccount(CustomerStaffByAccountFormDTO formDTO);
/**
* 根据用户ID获取工作人员基本信息
*
@ -169,6 +187,15 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
*/
Result<CustomerStaffDTO> addStaff(StaffSubmitFromDTO fromDTO);
/**
* 人员添加
*
* @param fromDTO 参数
* @return Result
*/
Result<CustomerStaffDTO> addStaffByAccount(StaffSubmitAccountFromDTO fromDTO);
/**
* 人员编辑
*
@ -177,6 +204,14 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
*/
Result editStaff(StaffSubmitFromDTO fromDTO);
/**
* 人员编辑
*
* @param fromDTO 参数
* @return Result
*/
Result editStaffByAccount(StaffSubmitAccountFromDTO fromDTO);
/**
* 人员详情
*
@ -259,6 +294,14 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
**/
List<CustomerStaffDTO> getCustsomerStaffByIdAndPhone(ThirdCustomerStaffFormDTO formDTO);
/**
* @param formDTO
* @return
* @Author zhy
* @Description 根据客户ID手机号查询政府端工作人员基本信息校验用户是否存在
**/
List<CustomerStaffDTO> getCustsomerStaffByIdAndAccount(ThirdCustomerStaffByAccountFormDTO formDTO);
/**
* @Description 查询工作人员的信息
* @param formDTO

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java

@ -8,6 +8,7 @@ import com.epmet.dto.form.AttentionDetailFormDTO;
import com.epmet.dto.form.CancelAttentionPackageFormDTO;
import com.epmet.dto.form.VaccinationAddFormDTO;
import com.epmet.dto.form.VaccinationListFormDTO;
import com.epmet.dto.result.NatPieResultDTO;
import com.epmet.dto.result.VaccinationListResultDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
@ -90,6 +91,7 @@ public interface IcEpidemicSpecialAttentionService extends BaseService<IcEpidemi
* @date 2022/3/28 10:29
*/
PageData vaccinationList(VaccinationListFormDTO formDTO);
PageData historyList(VaccinationListFormDTO formDTO);
/**
@ -140,4 +142,6 @@ public interface IcEpidemicSpecialAttentionService extends BaseService<IcEpidemi
* @date 2022/4/27 15:33
*/
VaccinationListResultDTO detail(AttentionDetailFormDTO formDTO);
NatPieResultDTO pie(TokenDto tokenDto);
}

196
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -170,6 +170,16 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
return new Result<List<CustomerStaffDTO>>().ok(customerStaffDTOList);
}
@Override
public Result<List<CustomerStaffDTO>> getCustsomerStaffByAccount(String userAccount) {
//判断用户是否存在
List<CustomerStaffDTO> customerStaffDTOList = baseDao.listCustomerStaffByAccount(userAccount);
if (null == customerStaffDTOList || customerStaffDTOList.size() == 0) {
logger.warn(String.format("根据账户查询用户异常,账户:[%s],code[%s],msg[%s]", userAccount, EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getMsg()));
return new Result().error(EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode());
}
return new Result<List<CustomerStaffDTO>>().ok(customerStaffDTOList);
}
@Override
public Result<CustomerStaffDTO> getCustomerStaffInfo(CustomerStaffFormDTO formDTO) {
@ -186,6 +196,21 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
return new Result<CustomerStaffDTO>().ok(customerStaffDTO);
}
@Override
public Result<CustomerStaffDTO> getCustomerStaffInfoByAccount(CustomerStaffByAccountFormDTO formDTO) {
CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfoByAccount(formDTO);
if (null == customerStaffDTO) {
logger.warn(String.format("根据账户查询用户异常,账户:[%s],code[%s],msg[%s]", formDTO.getUserAccount(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getMsg()));
return new Result().error(EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode());
}
//判断用户是否已被禁用
if (null != customerStaffDTO && UserConstant.DISABLED.equals(customerStaffDTO.getEnableFlag())) {
logger.warn(String.format("根据账户查询用户异常,账户:[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getUserAccount(), formDTO.getCustomerId(), EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()));
return new Result().error(EpmetErrorCode.GOV_STAFF_DISABLED.getCode());
}
return new Result<CustomerStaffDTO>().ok(customerStaffDTO);
}
@Override
public Result<CustomerStaffDTO> getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) {
CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfoByUserId(formDTO);
@ -265,11 +290,16 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
if (null == customerStaffDTO) {
log.warn("工作人员不存在");
}
if (StringUtils.isBlank(customerStaffDTO.getHeadPhoto())) {
customerStaffDTO.setHeadPhoto("");
}
resultDTO.setStaffId(customerStaffDTO.getUserId());
resultDTO.setUserAccount(customerStaffDTO.getUserAccount());
resultDTO.setName(customerStaffDTO.getRealName());
resultDTO.setGender(customerStaffDTO.getGender());
resultDTO.setMobile(customerStaffDTO.getMobile());
resultDTO.setWorkType(customerStaffDTO.getWorkType());
resultDTO.setIdCard(customerStaffDTO.getIdCard());
//获取角色列表
GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO();
govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId());
@ -363,6 +393,71 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class));
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result<CustomerStaffDTO> addStaffByAccount(StaffSubmitAccountFromDTO fromDTO) {
CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO();
customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId());
customerStaffFormDTO.setMobile(fromDTO.getMobile());
CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO);
if (null != customerStaffDTO) {
return new Result<CustomerStaffDTO>().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg());
}
CustomerStaffByAccountFormDTO customerStaffAccountFormDTO = new CustomerStaffByAccountFormDTO();
customerStaffAccountFormDTO.setCustomerId(fromDTO.getCustomerId());
customerStaffAccountFormDTO.setUserAccount(fromDTO.getUserAccount());
customerStaffDTO = baseDao.selectListCustomerStaffInfoByAccount(customerStaffAccountFormDTO);
if (null != customerStaffDTO) {
return new Result<CustomerStaffDTO>().error(EpmetErrorCode.ACCOUNT_USED.getCode(), EpmetErrorCode.ACCOUNT_USED.getMsg());
}
//USER表插入数据
UserEntity userEntity = new UserEntity();
userEntity.setFromApp(fromDTO.getApp());
userEntity.setFromClient(fromDTO.getClient());
userEntity.setCustomerId(fromDTO.getCustomerId());
userService.insert(userEntity);
//Customer_Staff表插入数据
CustomerStaffEntity staffEntity = new CustomerStaffEntity();
staffEntity.setCustomerId(fromDTO.getCustomerId());
staffEntity.setUserId(userEntity.getId());
staffEntity.setUserAccount(fromDTO.getUserAccount());
staffEntity.setRealName(fromDTO.getName());
staffEntity.setMobile(fromDTO.getMobile());
staffEntity.setActiveFlag(CustomerStaffConstant.INACTIVE);
staffEntity.setGender(fromDTO.getGender());
staffEntity.setWorkType(fromDTO.getWorkType());
staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE);
staffEntity.setPassword(PasswordUtils.encode(fromDTO.getPwd()));
staffEntity.setIdCard(fromDTO.getIdCard());
baseDao.insert(staffEntity);
//工作人员角色关联表
fromDTO.getRoles().forEach(role -> {
StaffRoleEntity staffRoleEntity = new StaffRoleEntity();
staffRoleEntity.setStaffId(userEntity.getId());
staffRoleEntity.setRoleId(role);
staffRoleEntity.setOrgId(fromDTO.getAgencyId());
staffRoleEntity.setCustomerId(fromDTO.getCustomerId());
staffRoleService.insert(staffRoleEntity);
});
// 角色放缓存
CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO();
List<RoleKeyValueResultDTO> roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles());
dto.setCustomerId(fromDTO.getCustomerId());
dto.setStaffId(userEntity.getId());
dto.setAgencyId(fromDTO.getAgencyId());
Map m = new HashMap(16);
roleKeyValue.forEach(r -> {
m.put(r.getRoleKey(), r.getRoleName());
});
dto.setRoles(m);
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class));
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result editStaff(StaffSubmitFromDTO fromDTO) {
@ -437,11 +532,99 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
return new Result();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result editStaffByAccount(StaffSubmitAccountFromDTO fromDTO) {
CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO();
customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId());
customerStaffFormDTO.setMobile(fromDTO.getMobile());
CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO);
if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())) {
return new Result<CustomerStaffDTO>().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg());
}
CustomerStaffByAccountFormDTO customerStaffAccountFormDTO = new CustomerStaffByAccountFormDTO();
customerStaffAccountFormDTO.setCustomerId(fromDTO.getCustomerId());
customerStaffAccountFormDTO.setUserAccount(fromDTO.getUserAccount());
customerStaffDTO = baseDao.selectListCustomerStaffInfoByAccount(customerStaffAccountFormDTO);
if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())) {
return new Result<CustomerStaffDTO>().error(EpmetErrorCode.ACCOUNT_USED.getCode(), EpmetErrorCode.ACCOUNT_USED.getMsg());
}
CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId());
//Customer_Staff表插入数据
CustomerStaffEntity staffEntity = new CustomerStaffEntity();
staffEntity.setId(customerStaffEntity.getId());
staffEntity.setRealName(fromDTO.getName());
staffEntity.setMobile(fromDTO.getMobile());
staffEntity.setGender(fromDTO.getGender());
staffEntity.setUserAccount(fromDTO.getUserAccount());
staffEntity.setWorkType(fromDTO.getWorkType());
if (StringUtils.isNotBlank(fromDTO.getPwd())){
staffEntity.setPassword(PasswordUtils.encode(fromDTO.getPwd()));
}
staffEntity.setIdCard(fromDTO.getIdCard());
baseDao.updateById(staffEntity);
//清空权限关联
StaffRoleDTO staffRoleDTO = new StaffRoleDTO();
staffRoleDTO.setStaffId(fromDTO.getStaffId());
staffRoleDTO.setOrgId(fromDTO.getAgencyId());
staffRoleService.clearStaffRoles(staffRoleDTO);
//重新添加角色关联
fromDTO.getRoles().forEach(role -> {
StaffRoleEntity staffRoleEntity = new StaffRoleEntity();
staffRoleEntity.setStaffId(fromDTO.getStaffId());
staffRoleEntity.setRoleId(role);
staffRoleEntity.setOrgId(fromDTO.getAgencyId());
staffRoleService.insert(staffRoleEntity);
});
// 重新查询用户的角色列表(可以取到前端没有传过来的角色,例如根管理员)
List<StaffRoleEntity> staffRoleEntytiesByStaffIdAndOrgId = staffRoleService.getStaffRoleEntytiesByStaffIdAndOrgId(fromDTO.getAgencyId(), fromDTO.getStaffId());
List<String> roleIds = new ArrayList<>();
if (!CollectionUtils.isEmpty(staffRoleEntytiesByStaffIdAndOrgId)) {
roleIds = staffRoleEntytiesByStaffIdAndOrgId.stream().map(sr -> sr.getRoleId()).collect(Collectors.toList());
}
// redis缓存角色修改
UpdateCachedRolesFormDTO updateRolesForm = new UpdateCachedRolesFormDTO();
updateRolesForm.setOrgId(fromDTO.getAgencyId());
updateRolesForm.setStaffId(fromDTO.getStaffId());
updateRolesForm.setRoleIds(roleIds);
try {
Result result = authFeignClient.updateCachedRoles(updateRolesForm);
if (!result.success()) {
logger.error("修改用户信息:修改用户已缓存的角色列表失败:{}", result.getInternalMsg());
}
logger.info("修改用户信息:修改用户已缓存的角色列表成功");
} catch (Exception e) {
log.error("method exception", e);
logger.error("修改用户信息:修改用户已缓存的角色列表异常:{}", ExceptionUtils.getErrorStackTrace(e));
}
// 角色放缓存
CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO();
List<RoleKeyValueResultDTO> roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles());
dto.setCustomerId(fromDTO.getCustomerId());
dto.setStaffId(fromDTO.getStaffId());
dto.setAgencyId(fromDTO.getAgencyId());
Map m = new HashMap(16);
roleKeyValue.forEach(r -> {
m.put(r.getRoleKey(), r.getRoleName());
});
dto.setRoles(m);
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
return new Result();
}
@Override
public Result<StaffDetailResultDTO> getStaffDetail(StaffInfoFromDTO fromDTO) {
StaffDetailResultDTO resultDTO = new StaffDetailResultDTO();
//获取工作人员信息
CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfo(fromDTO);
if (StringUtils.isBlank(customerStaffDTO.getHeadPhoto())) {
customerStaffDTO.setHeadPhoto("");
}
resultDTO.setStaffId(customerStaffDTO.getUserId());
resultDTO.setName(customerStaffDTO.getRealName());
resultDTO.setMobile(customerStaffDTO.getMobile());
@ -604,6 +787,19 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
return customerStaffDTOList;
}
@Override
public List<CustomerStaffDTO> getCustsomerStaffByIdAndAccount(ThirdCustomerStaffByAccountFormDTO formDTO) {
//根据客户Id和手机号查询工作人员信息
List<CustomerStaffDTO> customerStaffDTOList = baseDao.selectStaffByAccount(formDTO);
if (null == customerStaffDTOList || customerStaffDTOList.size() < NumConstant.ONE) {
logger.warn(String.format("根据客户Id和账户查询用户异常,客户Id:[%s],账户:[%s],code[%s],msg[%s]",
formDTO.getCustomerId(), formDTO.getUserAccount(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode(),
EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getMsg()));
throw new RenException(EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode());
}
return customerStaffDTOList;
}
/**
* @param formDTO
* @Description 查询工作人员的信息

32
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcBirthRecordServiceImpl.java

@ -5,14 +5,15 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.GenderEnum;
import com.epmet.commons.tools.enums.IcResiUserSubStatusEnum;
import com.epmet.commons.tools.enums.IdCardTypeEnum;
import com.epmet.commons.tools.enums.RelationshipEnum;
import com.epmet.commons.tools.enums.*;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.IdCardRegexUtils;
@ -29,6 +30,7 @@ import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.SyncResiResDTO;
import com.epmet.entity.IcBirthRecordEntity;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.ChangeWelfareService;
import com.epmet.service.IcBirthRecordService;
@ -37,6 +39,7 @@ import com.epmet.service.IcUserTransferRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
@ -65,6 +68,8 @@ public class IcBirthRecordServiceImpl extends BaseServiceImpl<IcBirthRecordDao,
private IcResiUserDao icResiUserDao;
@Resource
private ChangeWelfareService changeWelfareService;
@Resource
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Override
public PageData<IcBirthRecordDTO> page(BirthRecordFormDTO formDTO) {
@ -118,7 +123,24 @@ public class IcBirthRecordServiceImpl extends BaseServiceImpl<IcBirthRecordDao,
@Override
public IcBirthRecordDTO get(String id) {
IcBirthRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcBirthRecordDTO.class);
if (null == entity) {
return null;
}
IcBirthRecordDTO recordDTO=ConvertUtils.sourceToTarget(entity, IcBirthRecordDTO.class);
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(recordDTO.getGridId());
if (null != gridInfoCache) {
recordDTO.setGridName(gridInfoCache.getGridNamePath());
}
HouseInfoCache houseInfoCache = CustomerIcHouseRedis.getHouseInfo(entity.getCustomerId(), recordDTO.getHomeId());
if (null != houseInfoCache) {
recordDTO.setHomeAllName(houseInfoCache.getAllName());
}
Result<Map<String, String>> relationshipRes = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode());
if (relationshipRes.success() && MapUtils.isNotEmpty(relationshipRes.getData())) {
String householderRelationName = relationshipRes.getData().containsKey(recordDTO.getHouseholderRelation()) ? relationshipRes.getData().get(recordDTO.getHouseholderRelation()) : StrConstant.EPMETY_STR;
recordDTO.setHouseholderRelationName(householderRelationName);
}
return recordDTO;
}
@Override

144
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java

@ -15,6 +15,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
@ -22,14 +23,18 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcEpidemicSpecialAttentionDao;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.NatPieResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.result.VaccinationListResultDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
import com.epmet.enums.ChannelEnum;
import com.epmet.enums.NatPieColorEnum;
import com.epmet.excel.ImportEpidemicSpecialAttention;
import com.epmet.excel.error.EpidemicSpecialAttentionErrorModel;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OssFeignClient;
@ -76,6 +81,8 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
private IcNoticeService noticeService;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Override
public PageData<IcEpidemicSpecialAttentionDTO> page(Map<String, Object> params) {
@ -155,6 +162,9 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
result.setTotal(list.size());
}
}else if (formDTO.getAttentionType().equals(NumConstant.TWO)){
if (StringUtils.isBlank(formDTO.getIsHistory())){
formDTO.setIsHistory(NumConstant.ZERO_STR);
}
if (formDTO.getIsPage()){
PageInfo<VaccinationListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.natList(formDTO));
result.setList(pageInfo.getList());
@ -164,6 +174,65 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
result.setList(list);
result.setTotal(list.size());
}
if (CollectionUtils.isNotEmpty(result.getList())){
result.getList().forEach(r -> {
if (StringUtils.isNotBlank(r.getGridId())){
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(r.getGridId());
if (null == gridInfo){
throw new EpmetException("查询网格失败:"+r.getGridId());
}
r.setGridName(gridInfo.getGridNamePath());
}
});
}
}
if (CollectionUtils.isNotEmpty(result.getList())){
result.getList().forEach(v -> {
v.setSex();
});
}
//需求调整 列表和导出增加所属房屋(小区+楼栋+单元+房间)一列值 sun
Map<String, HouseInfoDTO> houseInfoMap = new HashMap<>();
//查询房屋信息
if (result.getList().size() > NumConstant.ZERO) {
Set<String> houseIds = result.getList().stream().filter(l -> StringUtils.isNotBlank(l.getHomeId())).map(m -> m.getHomeId()).collect(Collectors.toSet());
Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId());
List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>();
houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity()));
}
int i = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
for (VaccinationListResultDTO v : result.getList()) {
i += 1;
v.setSort(i);
if (null != houseInfoMap && houseInfoMap.containsKey(v.getHomeId())) {
v.setVillageName(houseInfoMap.get(v.getHomeId()).getNeighborHoodName());
v.setBuildName(houseInfoMap.get(v.getHomeId()).getBuildingName());
v.setUnitName(houseInfoMap.get(v.getHomeId()).getUnitName());
v.setHomeName(houseInfoMap.get(v.getHomeId()).getDoorName());
v.setAllName(houseInfoMap.get(v.getHomeId()).getAllName());
}
}
return result;
}
@Override
public PageData historyList(VaccinationListFormDTO formDTO) {
PageData<VaccinationListResultDTO> result = new PageData(new ArrayList(), NumConstant.ZERO_L);
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询到工作人员信息"+formDTO.getUserId());
}
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setIsHistory(NumConstant.ONE_STR);
if (formDTO.getIsPage()){
PageInfo<VaccinationListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.natList(formDTO));
result.setList(pageInfo.getList());
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal())));
}else {
List<VaccinationListResultDTO> list = baseDao.natList(formDTO);
result.setList(list);
result.setTotal(list.size());
}
if (CollectionUtils.isNotEmpty(result.getList())){
result.getList().forEach(v -> {
@ -212,19 +281,26 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
if (null == agencyInfo){
throw new EpmetException("未查询到组织信息"+staffInfo.getAgencyId());
}
/**
* 一条改多条取消关注就成为历史再次关注即新增不操作历史数据
* 新增关注列表已存在时覆盖旧数据
*/
List<IcEpidemicSpecialAttentionEntity> entities = ConvertUtils.sourceToTarget(formDTO.getList(), IcEpidemicSpecialAttentionEntity.class);
List<String> idCards = entities.stream().map(m -> m.getIdCard()).collect(Collectors.toList());
Integer attentionType = entities.get(NumConstant.ZERO).getAttentionType();
List<String> existList = baseDao.getExistList(attentionType, idCards);
List<IcEpidemicSpecialAttentionEntity> existsEntities = new ArrayList<>();
if (CollectionUtils.isNotEmpty(existList)){
for (String s : existList) {
for (int i = NumConstant.ZERO; i < entities.size(); i++) {
if (s.equals(entities.get(i).getIdCard())){
existsEntities.add(entities.get(i));
entities.remove(i);
continue;
}
}
}
baseDao.addExistAttention(existsEntities,attentionType);
}
entities.forEach(e -> {
e.setIsAttention(NumConstant.ONE);
@ -232,9 +308,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
e.setPid(agencyInfo.getPid());
e.setPids(agencyInfo.getPids());
e.setCustomerId(formDTO.getCustomerId());
if (e.getAttentionType().equals(NumConstant.TWO)){
e.setReason("有重点区域行程");
}
e.setIsHistory(NumConstant.ZERO_STR);
});
insertBatch(entities);
//新增通知表信息
@ -265,11 +339,12 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
public void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO,TokenDto tokenDto) {
LambdaQueryWrapper<IcEpidemicSpecialAttentionEntity> w = new LambdaQueryWrapper<>();
IcEpidemicSpecialAttentionEntity e = new IcEpidemicSpecialAttentionEntity();
w.eq(IcEpidemicSpecialAttentionEntity::getIdCard,formDTO.getIdCard())
w.eq(IcEpidemicSpecialAttentionEntity::getId,formDTO.getId())
.eq(IcEpidemicSpecialAttentionEntity::getAttentionType,formDTO.getAttentionType());
e.setMobile(formDTO.getMobile());
e.setReason(formDTO.getReason());
e.setRemark(formDTO.getRemark());
e.setIsolatedState(formDTO.getIsolatedState());
update(e,w);
if (CollectionUtils.isNotEmpty(formDTO.getChannel())){
SendNoticeFormDTO dto = new SendNoticeFormDTO();
@ -311,7 +386,6 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
@Async
public void importFile(TokenDto tokenDto, InputStream inputStream, Integer attentionType, String taskId) {
List<EpidemicSpecialAttentionErrorModel> errorInfo = new ArrayList<>();
try {
List<ImportEpidemicSpecialAttention> list = ExcelPoiUtils.importExcel(inputStream, 0,1,ImportEpidemicSpecialAttention.class);
if (CollectionUtils.isEmpty(list)){
@ -336,7 +410,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
continue;
}
if (StringUtils.isBlank(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "身份证号不能为空",i+1));
errorInfo.add(getErrorInfo(list.get(i), "证号不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
@ -345,9 +419,19 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
list.get(i).setAddStatus(true);
continue;
}
if (attentionType.compareTo(NumConstant.TWO) == NumConstant.ZERO && StringUtils.isBlank(list.get(i).getIsolatedState()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "隔离状态不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
}
Result<List<SysDictDataDTO>> isolatedState = epmetAdminOpenFeignClient.dictDataList("isolatedState");
if (!isolatedState.success()){
throw new EpmetException("查询字典表数据失败..."+"isolatedState");
}
Map<String, String> dictMap = isolatedState.getData().stream().collect(Collectors.toMap(SysDictDataDTO::getDictLabel, SysDictDataDTO::getDictValue));
if (list.size() > errorInfo.size()){
Map<String, Long> groupByIdCard = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getIdCard, Collectors.counting()));
Map<String, Long> groupByIdCard = list.stream().filter(l -> StringUtils.isNotBlank(l.getIdCard())).collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getIdCard, Collectors.counting()));
groupByIdCard.forEach((idCard,count) -> {
if (Integer.valueOf(count.toString()).compareTo(1) != 0){
for (ImportEpidemicSpecialAttention i : list) {
@ -359,6 +443,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
}
});
List<String> idCards = list.stream().map(m -> m.getIdCard()).collect(Collectors.toList());
List<IcEpidemicSpecialAttentionEntity> existsEntities = new ArrayList<>();
List<String> existList = baseDao.getExistList(attentionType, idCards);
if (CollectionUtils.isNotEmpty(existList)){
for (String s : existList) {
@ -367,10 +452,17 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
// 按照产品指示,去除提示错误信息,并不做操作
// errorInfo.add(getErrorInfo(list.get(i),"数据已存在",list.get(i).getNum()));
list.get(i).setAddStatus(true);
if (attentionType.compareTo(NumConstant.TWO) == NumConstant.ZERO){
list.get(i).setIsolatedState(dictMap.get(list.get(i).getIsolatedState()));
existsEntities.add(ConvertUtils.sourceToTarget(list.get(i),IcEpidemicSpecialAttentionEntity.class));
}
continue;
}
}
}
if (attentionType.compareTo(NumConstant.TWO) == NumConstant.ZERO && CollectionUtils.isNotEmpty(existsEntities)) {
baseDao.addExistAttention(existsEntities, attentionType);
}
}
}
Map<Boolean, List<ImportEpidemicSpecialAttention>> groupByStatus = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getAddStatus));
@ -378,6 +470,9 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
if (CollectionUtils.isNotEmpty(needInsert)){
List<IcEpidemicSpecialAttentionEntity> entities = ConvertUtils.sourceToTarget(needInsert, IcEpidemicSpecialAttentionEntity.class);
entities.forEach(e -> {
if (attentionType.compareTo(NumConstant.TWO) == NumConstant.ZERO){
e.setIsolatedState(dictMap.get(e.getIsolatedState()));
}
e.setIsAttention(NumConstant.ONE);
e.setOrgId(agencyInfo.getId());
e.setPid(agencyInfo.getPid());
@ -482,6 +577,41 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
return baseDao.nat(formDTO);
}
@Override
public NatPieResultDTO pie(TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询到工作人员信息"+tokenDto.getUserId());
}
NatPieResultDTO result = new NatPieResultDTO();
Result<List<SysDictDataDTO>> isolatedState = epmetAdminOpenFeignClient.dictDataList("isolatedState");
if (!isolatedState.success()){
throw new EpmetException("查询字典表数据失败..."+"isolatedState");
}
List<SysDictDataDTO> data = isolatedState.getData();
if (CollectionUtils.isEmpty(data)){
return result;
}
List<NatPieResultDTO.IsolatedList> conResult = new ArrayList<>();
data.forEach(d -> {
NatPieResultDTO.IsolatedList dto = new NatPieResultDTO.IsolatedList();
dto.setCategoryCode(d.getDictValue());
dto.setCategoryName(d.getDictLabel());
dto.setColor(NatPieColorEnum.getValueByKey(d.getDictValue()));
conResult.add(dto);
});
List<NatPieResultDTO.IsolatedList> isolatedLists = baseDao.isolatedList(staffInfo.getAgencyId());
conResult.forEach(c -> isolatedLists.stream().filter(i -> i.getCategoryCode().equals(c.getCategoryCode())).forEach(i -> c.setTotal(i.getTotal())));
NatPieResultDTO.IsolatedList dto = new NatPieResultDTO.IsolatedList();
dto.setCategoryCode("");
dto.setCategoryName("历史关注人数");
dto.setColor(NatPieColorEnum.getValueByKey(NumConstant.ONE_HUNDRED_STR));
dto.setTotal(baseDao.getHistoryCount(staffInfo.getAgencyId()));
result.setIsolatedList(conResult);
result.setHistoryList(Arrays.asList(dto));
return result;
}
/**
* Desc: 文件上传并返回url
* @param errorRows

25
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java

@ -189,16 +189,21 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
// 如果是顺德居小区的人还要下放门禁
if (formDTO.getVillageName().contains("顺德居")) {
formDTO.getMemberList().forEach(item -> {
if (StringUtils.isNotBlank(item.getFaceImg())) {
VisitVisitorFormDTO visitor = new VisitVisitorFormDTO();
visitor.setIdCard(item.getIdNum());
visitor.setMobile(item.getMobile());
visitor.setName(item.getName());
visitor.setFaceImg(item.getFaceImg());
dhDeviceUtil.sendAuth(visitor);
}
});
try {
formDTO.getMemberList().forEach(item -> {
if (StringUtils.isNotBlank(item.getFaceImg())) {
VisitVisitorFormDTO visitor = new VisitVisitorFormDTO();
visitor.setIdCard(item.getIdNum());
visitor.setMobile(item.getMobile());
visitor.setName(item.getName());
visitor.setFaceImg(item.getFaceImg());
dhDeviceUtil.sendAuth(visitor);
}
});
return new Result().ok("今日您可通过人脸设备便捷出入小区,明天及后续进入请再次登记,谢谢!");
} catch (Exception e) {
return new Result().ok("访客信息登记成功");
}
}
return new Result().ok("提交成功");

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectVisitorServiceImpl.java

@ -165,7 +165,12 @@ public class IcResiCollectVisitorServiceImpl extends BaseServiceImpl<IcResiColle
visitor.setName(dto.getName());
visitor.setIdCard(dto.getIdCard());
visitor.setFaceImg(dto.getFaceImg());
dhDeviceUtil.sendAuth(visitor);
try {
dhDeviceUtil.sendAuth(visitor);
return new Result().ok("今日您可通过人脸设备便捷出入小区,明天及后续进入请再次登记,谢谢!");
} catch (Exception e) {
return new Result().ok("访客信息登记成功");
}
}
return new Result().ok("提交成功");
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -1143,11 +1143,25 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
personData.setIcResiUserId(formDTO.getUserId());
// 房屋信息查询
Result<List<String>> listResult = govOrgOpenFeignClient.selectHouseInfoByIdCard(personData.getIdCard(), formDTO.getCustomerId());
//2022.9.14 应产品要求之前返的是这个人是房东的房屋信息,现在改成返回这个人当前居住的房屋信息 syc
/*Result<List<String>> listResult = govOrgOpenFeignClient.selectHouseInfoByIdCard(personData.getIdCard(), formDTO.getCustomerId());
if (!listResult.success()) {
throw new RenException("查询房屋信息失败");
}
personData.setHouseInfo(listResult.getData());
*/
Set<String> houseIds = new HashSet<>();
houseIds.add(personData.getHomeId());
Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId());
if (!houseInfoRes.success()) {
throw new RenException("查询房屋信息失败");
}
List<String> houseInfo = new ArrayList<>();
if(null!=houseInfoRes.getData()&& !CollectionUtils.isEmpty(houseInfoRes.getData())){
houseInfo.add(houseInfoRes.getData().get(0).getAllName());
}
//2022.9.14 end
personData.setHouseInfo(houseInfo);
// 志愿者处理
if (personData.getIsVolunteer().equals(NumConstant.ONE_STR)) {

2
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.62__alter_customer_staff.sql

@ -0,0 +1,2 @@
ALTER TABLE epmet_user.customer_staff ADD USER_ACCOUNT varchar(32) NULL COMMENT '登录账户';
ALTER TABLE epmet_user.customer_staff CHANGE USER_ACCOUNT USER_ACCOUNT varchar(32) NULL COMMENT '登录账户' AFTER USER_ID;

3
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.69__alter_ic_epidemic_special_attention.sql

@ -0,0 +1,3 @@
ALTER TABLE ic_epidemic_special_attention ADD COLUMN IS_HISTORY tinyint not null DEFAULT '0' COMMENT '是否历史关注,1是0否' AFTER ATTENTION_TYPE;
ALTER TABLE ic_epidemic_special_attention ADD COLUMN ISOLATED_STATE VARCHAR(20) COMMENT '隔离类型,来自字典表' AFTER IS_HISTORY;

5
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.70__default_ic_epidemic_special_attention.sql

@ -0,0 +1,5 @@
UPDATE ic_epidemic_special_attention
SET UPDATED_TIME = NOW(),
ISOLATED_STATE = '1'
WHERE ISOLATED_STATE IS NULL
AND ATTENTION_TYPE = 2;

BIN
epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls

Binary file not shown.

38
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -11,6 +11,14 @@
order by cs.ACTIVE_TIME desc,cs.CREATED_TIME asc
</select>
<!-- 根据账户查询工作人员信息 -->
<select id="listCustomerStaffByAccount" parameterType="java.lang.String" resultType="com.epmet.dto.CustomerStaffDTO">
select * from customer_staff cs
where cs.USER_ACCOUNT=#{userAccount}
and cs.DEL_FLAG='0'
order by cs.ACTIVE_TIME desc,cs.CREATED_TIME asc
</select>
<!-- 根据手机号+客户id获取工作人员基本信息 -->
<select id="selectListCustomerStaffInfo" parameterType="com.epmet.dto.form.CustomerStaffFormDTO" resultType="com.epmet.dto.CustomerStaffDTO">
select * from customer_staff cs
@ -18,6 +26,14 @@
and cs.CUSTOMER_ID=#{customerId}
and cs.DEL_FLAG='0'
</select>
<!-- 根据账户+客户id获取工作人员基本信息 -->
<select id="selectListCustomerStaffInfoByAccount" parameterType="com.epmet.dto.form.CustomerStaffByAccountFormDTO" resultType="com.epmet.dto.CustomerStaffDTO">
select * from customer_staff cs
where cs.USER_ACCOUNT=#{userAccount}
and cs.CUSTOMER_ID=#{customerId}
and cs.DEL_FLAG='0'
</select>
<select id="selectStaffInfoByUserId" parameterType="com.epmet.dto.CustomerStaffDTO" resultType="com.epmet.dto.CustomerStaffDTO">
select * from customer_staff cs
where cs.USER_ID=#{userId}
@ -125,15 +141,7 @@
</select>
<select id="selectStaffInfo" resultType="com.epmet.dto.CustomerStaffDTO" parameterType="com.epmet.dto.form.StaffInfoFromDTO">
SELECT
USER_ID,
REAL_NAME,
MOBILE,
GENDER,
IFNULL(HEAD_PHOTO, "") AS "headPhoto",
ENABLE_FLAG,
ACTIVE_FLAG,
ACTIVE_TIME,
WORK_TYPE
*
FROM
customer_staff
WHERE
@ -221,6 +229,18 @@
ORDER BY active_time DESC, created_time ASC
</select>
<select id="selectStaffByAccount" resultType="com.epmet.dto.CustomerStaffDTO">
SELECT
*
FROM
customer_staff
WHERE
del_flag='0'
AND customer_id = #{customerId}
AND user_account = #{userAccount}
ORDER BY active_time DESC, created_time ASC
</select>
<!-- 查询工作人员的信息 -->
<select id="getStaffInfoList" resultType="com.epmet.dto.result.StaffSinGridResultDTO">
SELECT

95
epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

@ -8,7 +8,7 @@
UPDATE ic_epidemic_special_attention
SET UPDATED_TIME = NOW(),
IS_ATTENTION = 0,
del_flag = 1
IS_HISTORY = '1'
WHERE del_flag = 0
AND attention_type = #{attentionType}
AND id IN (
@ -18,6 +18,54 @@
)
</update>
<update id="addAttention">
UPDATE ic_epidemic_special_attention
SET UPDATED_TIME = NOW(),
IS_ATTENTION = 1
WHERE del_flag = 0
AND attention_type = #{attentionType}
AND id_card IN (
<foreach collection="list" item="l" separator=",">
#{l}
</foreach>
)
</update>
<update id="addExistAttention">
UPDATE ic_epidemic_special_attention
<trim prefix="set" suffixOverrides=",">
<trim prefix="IS_ATTENTION =(case" suffix="end),">
<foreach collection="list" item="item">
when id_card = #{item.idCard} then 1
</foreach>
</trim>
<trim prefix="reason =(case" suffix="end),">
<foreach collection="list" item="item">
when id_card = #{item.idCard} then #{item.reason}
</foreach>
</trim>
<trim prefix="remark =(case" suffix="end),">
<foreach collection="list" item="item">
when id_card = #{item.idCard} then #{item.remark}
</foreach>
</trim>
<trim prefix="isolated_state =(case" suffix="end),">
<foreach collection="list" item="item">
when id_card = #{item.idCard} then #{item.isolatedState}
</foreach>
</trim>
updated_time = now()
</trim>
WHERE del_flag = 0
AND attention_type = #{attentionType}
AND is_history = 0
AND id_card IN (
<foreach collection="list" item="l" separator=",">
#{l.idCard}
</foreach>
)
</update>
<!-- 疫苗接种关注名单 -->
<select id="vaccinationList" resultType="com.epmet.dto.result.VaccinationListResultDTO">
SELECT a.id,
@ -75,6 +123,7 @@
<select id="natList" resultType="com.epmet.dto.result.VaccinationListResultDTO">
SELECT a.id,
a.`NAME`,
a.customer_id as customerId,
a.MOBILE,
a.ID_CARD,
a.REMARK,
@ -83,19 +132,34 @@
b.BUILD_ID,
b.UNIT_ID,
b.HOME_ID,
IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime
b.id as userId,
b.grid_id as gridId,
a.ISOLATED_STATE,
IFNULL((SELECT DATE_FORMAT(NAT_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_nat WHERE DEL_FLAG = '0' AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastNatTime
FROM ic_epidemic_special_attention a
LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and a.CUSTOMER_ID = b.CUSTOMER_ID
WHERE a.DEL_FLAG = 0
AND concat(a.pids,':',ORG_ID) like concat('%',#{orgId},'%')
AND a.ATTENTION_TYPE = #{attentionType}
<if test='null != isolatedState and "" != isolatedState'>
AND a.isolated_state = #{isolatedState}
</if>
<if test='null == isolatedState or "" == isolatedState'>
AND a.isolated_state is not null
</if>
<if test='null != isHistory and "" != isHistory and isHistory == "0"'>
AND a.IS_ATTENTION = 1
</if>
<if test='null != isHistory and "" != isHistory and isHistory == "1"'>
AND a.is_history = 1
</if>
<if test='null != name and "" != name'>
AND a.`NAME` LIKE CONCAT('%',#{name},'%')
</if>
<if test='null != mobile and "" != mobile'>
AND a.MOBILE LIKE CONCAT('%',#{mobile},'%')
</if>
<if test='null != mobile and "" != mobile'>
<if test='null != idCard and "" != idCard'>
AND a.ID_CARD LIKE CONCAT('%',#{idCard},'%')
</if>
<if test='null != reason and "" != reason'>
@ -125,6 +189,7 @@
ID_CARD
FROM ic_epidemic_special_attention
WHERE DEL_FLAG = 0
AND IS_HISTORY = 0
AND ATTENTION_TYPE = #{attentionType}
AND ID_CARD IN (
<foreach collection="list" item="l" separator=",">
@ -158,8 +223,30 @@
a.MOBILE,
a.ID_CARD,
a.REMARK,
a.REASON
a.REASON,
a.ISOLATED_STATE
FROM ic_epidemic_special_attention a
WHERE a.ID = #{id}
</select>
<select id="isolatedList" resultType="com.epmet.dto.result.NatPieResultDTO$IsolatedList">
SELECT
count(id) AS total,
ISOLATED_STATE AS categoryCode
FROM ic_epidemic_special_attention
WHERE DEL_FLAG = 0
AND concat( pids, ':', ORG_ID ) LIKE concat( '%', #{agencyId}, '%' )
AND ATTENTION_TYPE = 2
AND IS_ATTENTION = 1
AND ISOLATED_STATE is not null
GROUP BY categoryCode
</select>
<select id="getHistoryCount" resultType="java.lang.Integer">
SELECT
count(distinct id_card)
FROM ic_epidemic_special_attention
WHERE DEL_FLAG = 0
AND concat( pids, ':', ORG_ID ) LIKE concat( '%', #{agencyId}, '%' )
AND ATTENTION_TYPE = 2
AND IS_HISTORY = 1
</select>
</mapper>

7
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -300,6 +300,7 @@
<result column="isTenant" property="isTenant"/>
<result column="CUSTOMER_ID" property="customerId"/>
<result column="GRID_ID" property="gridId"/>
<result column="HOME_ID" property="homeId"/>
<collection property="financialSituation" ofType="com.epmet.dto.FinancialSituationDTO">
<result column="YSR" property="monthlyIncome"/>
<result column="TXJE" property="retirementAmount"/>
@ -316,7 +317,8 @@
IS_TENANT as isTenant,
IFNULL(IS_VOLUNTEER,'0') AS isVolunteer,
CUSTOMER_ID,
GRID_ID
GRID_ID,
HOME_ID
FROM ic_resi_user
WHERE DEL_FLAG = '0'
AND ID = #{userId}
@ -372,7 +374,7 @@
and ${columnName}='1'
</if>
AND `STATUS`='0'
ORDER BY `NAME`
ORDER BY `CREATED_TIME` DESC, `NAME`
</select>
<select id="selectUserDemandCode" parameterType="java.lang.String" resultType="java.lang.String">
@ -916,6 +918,7 @@
<if test="natCount != null">
AND natCount = #{natCount}
</if>
order by t.vaccineCount desc, t.natCount desc
</select>
<select id="natList" resultType="com.epmet.dto.result.EpidemicPreventionResultDTO">

Loading…
Cancel
Save