Browse Source

Merge branch 'develop' of http://git.elinkit.com.cn:7070/r/epmet-cloud into release_temp

master
jianjun 4 years ago
parent
commit
dedaf3a3b3
  1. 22
      epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java
  2. 24
      epmet-auth/src/main/java/com/epmet/dto/form/BcStaffAuthenticationFormDTO.java
  3. 8
      epmet-auth/src/main/java/com/epmet/service/GovLoginService.java
  4. 29
      epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java
  5. 72
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java
  6. 1
      epmet-gateway/src/main/resources/bootstrap.yml
  7. 47
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffInfoResultDTO.java
  8. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java
  9. 115
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java
  10. 18
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java
  11. 39
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java
  12. 44
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java
  13. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java
  14. 50
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java
  15. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  16. 16
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java
  17. 17
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  18. 71
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java
  19. 46
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java
  20. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  21. 86
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java
  22. 40
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  23. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql
  24. 27
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml
  25. 46
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
  26. 6
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java
  27. 27
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/PackageAddOftenUseFunctionFormDTO.java
  28. 3
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java
  29. 44
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcResiUserOrgMsgFormDTO.java
  30. 60
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcResiUserOrgMsgResultDTO.java
  31. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  32. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  33. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  34. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  35. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  36. 6
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java
  37. 27
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/PackageEditIndividualCategoryFormDTO.java
  38. 54
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerCategoryShowAndWarnListResultDTO.java
  39. 16
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  40. 12
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  41. 3
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java
  42. 9
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java
  43. 11
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java
  44. 9
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java
  45. 10
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java
  46. 6
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java
  47. 22
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java
  48. 14
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java
  49. 21
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml
  50. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java
  51. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java
  52. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java
  53. 26
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PersonWarnLeftPieDTO.java
  54. 32
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserChangeRecordFormDTO.java
  55. 71
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java
  56. 25
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java
  57. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserChangeRecordResultDTO.java
  58. 48
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnLeftPieResultDTO.java
  59. 68
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java
  60. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  61. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java
  62. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java
  63. 23
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java
  64. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  65. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java
  66. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java
  67. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java
  68. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java
  69. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java
  70. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  71. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java
  72. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java
  73. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java
  74. 184
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  75. 54
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java
  76. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java
  77. 234
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java
  78. 42
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml
  79. 16
      epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml
  80. 22
      epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml

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

@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
/**
@ -121,5 +122,26 @@ public class GovLoginController {
List<StaffOrgsResultDTO> staffOrgs = govLoginService.getMyOrgByPassword(formDTO);
return new Result<List<StaffOrgsResultDTO>>().ok(staffOrgs);
}
/**
* 区块链web 系统身份认证
* @param input
* @return
*/
@PostMapping("/blockchain/authentication")
public Result blockChainGetStaffInfoByPwd(@RequestBody BcStaffAuthenticationFormDTO input) {
ValidatorUtils.validateEntity(input);
String customerId = input.getCustomerId();
String mobile = input.getMobile();
String password = input.getPassword();
String userId = govLoginService.blockChainStaffAuthenticationByPwd(customerId, mobile, password);
HashMap<String, String> m = new HashMap<>();
m.put("userId", userId);
return new Result().ok(m);
}
}

24
epmet-auth/src/main/java/com/epmet/dto/form/BcStaffAuthenticationFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @ClassName BcAdminLoginFormDTO
* @Description 区块链管理系统staff身份认证
* @Author wangxianzhang
* @Date 2022/1/17 10:11 下午
*/
@Data
public class BcStaffAuthenticationFormDTO {
@NotBlank(message = "客户ID必填")
private String customerId;
@NotBlank(message = "手机号必填")
private String mobile;
@NotBlank(message = "密码必填")
private String password;
}

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

@ -76,4 +76,12 @@ public interface GovLoginService {
* @Date 2020/6/30 22:43
**/
List<StaffOrgsResultDTO> getMyOrgByPassword(StaffOrgsFormDTO formDTO);
/**
* 区块链系统通过用户密码认证身份
* @param mobile
* @param password
* @return
*/
String blockChainStaffAuthenticationByPwd(String customerId, String mobile, String password);
}

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

@ -5,8 +5,10 @@ import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.password.PasswordUtils;
@ -46,7 +48,7 @@ import java.util.stream.Collectors;
* @Date 2020/4/20 10:56
*/
@Service
public class GovLoginServiceImpl implements GovLoginService {
public class GovLoginServiceImpl implements GovLoginService, ResultDataResolver {
private static final Logger logger = LoggerFactory.getLogger(GovLoginServiceImpl.class);
private static final String SEND_SMS_CODE_ERROR = "发送短信验证码异常,手机号[%s],code[%s],msg[%s]";
@Autowired
@ -490,5 +492,30 @@ public class GovLoginServiceImpl implements GovLoginService {
}
return result.getData();
}
@Override
public String blockChainStaffAuthenticationByPwd(String customerId, String mobile, String password) {
GovWebOperLoginFormDTO form = new GovWebOperLoginFormDTO();
form.setCustomerId(customerId);
form.setMobile(mobile);
GovWebOperLoginResultDTO staff = getResultDataOrThrowsException(epmetUserFeignClient.getStaffIdAndPwd(form), ServiceConstant.EPMET_USER_SERVER,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
String.format("【区块链获取用户信息】根据手机号%s和指定客户ID:%s查找用户信息失败", mobile, customerId),
"查询用户失败");
if (staff == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
String.format("【区块链获取用户信息】根据手机号%s和指定客户ID:%s查找用户信息失败", mobile, customerId));
}
if (!PasswordUtils.matches(password, staff.getPassWord())) {
// 密码不匹配
throw new EpmetException(EpmetErrorCode.ERR10004.getCode(), String.format("【区块链获取用户信息】密码不匹配,手机号:%s", mobile));
}
return staff.getUserId();
}
}

72
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java

@ -0,0 +1,72 @@
package com.epmet.commons.tools.enums;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import java.util.Objects;
/**
* @author Administrator
*/
public enum DateEnum {
/**
* 月份相关枚举
*/
JAN("01", "1月"),
FEB("02", "2月"),
MAR("03", "3月"),
APR("04", "4月"),
MAY("05", "5月"),
JUN("06", "6月"),
JUL("07", "7月"),
AUG("08", "8月"),
SEP("09", "9月"),
OCT("10", "10月"),
NOV("11", "11月"),
DEC("12", "12月"),
/**
* 季度相关枚举
*/
Q1("Q1", "第一季度"),
Q2("Q2", "第二季度"),
Q3("Q3", "第三季度"),
Q4("Q4", "第四季度"),
UN_KNOWN("0", "未知");
private String code;
private String name;
DateEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static String getName(String code) {
DateEnum[] dateEnums = values();
for (DateEnum dateEnum : dateEnums) {
if (Objects.equals(dateEnum.getCode(), code)) {
return dateEnum.getName();
}
}
return EpmetErrorCode.SERVER_ERROR.getMsg();
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

1
epmet-gateway/src/main/resources/bootstrap.yml

@ -523,6 +523,7 @@ epmet:
- /third/private-epmet/push-component-access-token
- /data/stats/plugins/ofs/**
- /data/stats/plugins/workrecord/**
- /epmetuser/staffrole/getGridStaffList #py获取网格员 网格长
# 对外开放接口认证白名单

47
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffInfoResultDTO.java

@ -1,47 +0,0 @@
package com.epmet.dataaggre.dto.epmetuser.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 工作人员信息结果
* @Auth sun
*/
@Data
public class StaffInfoResultDTO implements Serializable {
private static final long serialVersionUID = -746814280620822111L;
/**
* 用户Id
*/
private String userId;
/**
* 用户名
*/
private String userName;
/**
* 手机号
*/
private String mobile;
/**
* 性别0.未知1男2.
*/
private Integer gender;
/**
* 组织Id
*/
private String orgId;
/**
* 组织名
*/
private String orgName;
}

5
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java

@ -440,6 +440,11 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String jtxxRemakes;
/**
* 用户状态0:正常 1:转出
*/
private String status;
/**
* 预留字段1
*/

115
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java

@ -0,0 +1,115 @@
package com.epmet.dto;
import com.epmet.commons.tools.validator.group.AddGroup;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Data
public class IcPartyUnitCompletionDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
*
*/
private String pids;
/**
* 单位ID
*/
@NotNull(message = "单位ID不能为空",groups = AddGroup.class)
private String unitId;
/**
* 类型 monthly月度quarter季度
*/
@NotNull(message = "类型不能为空",groups = AddGroup.class)
private String type;
/**
* 评分 百分制
*/
@NotNull(message = "评分不能为空",groups = AddGroup.class)
private String score;
/**
* 完成情况1已完成0未完成
*/
@NotNull(message = "完成情况不能为空",groups = AddGroup.class)
private String status;
/**
* 年份
*/
@NotNull(message = "年份不能为空",groups = AddGroup.class)
private String year;
/**
* 月或季度
*/
@NotNull(message = "月或季度",groups = AddGroup.class)
private String monthQuarter;
private String monthQuarterName;
/**
* 时间
*/
private String recordDate;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

18
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/17 15:46
*/
@Data
public class CompletionFormDTO implements Serializable {
private static final long serialVersionUID = 4925867264241549310L;
private String unitId;
private Integer pageNo = 1;
private Integer pageSize = 10;
}

39
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java

@ -0,0 +1,39 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/18 9:34
*/
@NoArgsConstructor
@Data
public class PointRecordFormDTO implements Serializable {
private static final long serialVersionUID = -5200348821951188343L;
/**
* 服务方类型社会组织social_org社区自组织community_org区域党建单位party_unit
*/
private String serviceType;
/**
* 服务方ID
*/
private String serviceId;
/**
* 开始时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private String startTime;
/**
* 结束时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private String endTime;
private Integer pageNo = 1;
private Integer pageSize = 10;
private String customerId;
}

44
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java

@ -0,0 +1,44 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/18 9:30
*/
@NoArgsConstructor
@Data
public class PointRecordDTO implements Serializable {
private static final long serialVersionUID = 8562346042241117055L;
/**
* 需求类型
*/
@JsonIgnore
private String categoryCode;
private String categoryName;
/**
* 需求人
*/
private String demandUserName;
/**
* 需求内容
*/
private String content;
/**
* 发放积分时间
*/
private String pointTime;
/**
* 评价
*/
private String score;
/**
* 积分
*/
private String point;
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.page.PageData;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/18 9:28
*/
@NoArgsConstructor
@Data
public class PointRecordResultDTO implements Serializable {
private static final long serialVersionUID = -2359756064125925616L;
private Integer totalPoint;
private PageData<PointRecordDTO> page;
}

50
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java

@ -0,0 +1,50 @@
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcPartyUnitCompletionDTO;
import com.epmet.dto.form.CompletionFormDTO;
import com.epmet.service.IcPartyUnitCompletionService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@RestController
@RequestMapping("icpartyunitcompletion")
public class IcPartyUnitCompletionController {
@Autowired
private IcPartyUnitCompletionService icPartyUnitCompletionService;
@PostMapping("list")
public Result<PageData<IcPartyUnitCompletionDTO>> page(@RequestParam CompletionFormDTO formDTO){
PageData<IcPartyUnitCompletionDTO> page = icPartyUnitCompletionService.page(formDTO);
return new Result<PageData<IcPartyUnitCompletionDTO>>().ok(page);
}
@PostMapping("save")
public Result save(@RequestBody IcPartyUnitCompletionDTO dto){
//效验数据
if (StringUtils.isBlank(dto.getUnitId())) {
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
}
icPartyUnitCompletionService.save(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody IcPartyUnitCompletionDTO dto){
icPartyUnitCompletionService.delete(dto.getId());
return new Result();
}
}

18
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

@ -25,7 +25,6 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -35,9 +34,11 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.PointRecordFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.result.PointRecordResultDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
@ -364,5 +365,20 @@ public class IcUserDemandRecController implements ResultDataResolver {
return new Result().ok(page);
}
/**
* 组织单位积分记录
*
* @Param formDTO
* @Return {@link Result< PointRecordResultDTO>}
* @Author zhaoqifeng
* @Date 2022/1/18 9:45
*/
@PostMapping("recordList")
public Result<PointRecordResultDTO> pointRecordList(@LoginUser TokenDto tokenDto, @RequestBody PointRecordFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
PointRecordResultDTO result = icUserDemandRecService.pointRecordList(formDTO);
return new Result<PointRecordResultDTO>().ok(result);
}
}

16
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcPartyUnitCompletionEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Mapper
public interface IcPartyUnitCompletionDao extends BaseDao<IcPartyUnitCompletionEntity> {
}

17
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java

@ -19,13 +19,12 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.PointRecordFormDTO;
import com.epmet.dto.form.demand.IcResiUserDemandFromDTO;
import com.epmet.dto.form.demand.PageListAnalysisFormDTO;
import com.epmet.dto.form.demand.UserDemandPageFormDTO;
import com.epmet.dto.result.PointRecordDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
import com.epmet.dto.result.demand.ServiceStatDTO;
import com.epmet.entity.IcUserDemandRecEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -118,4 +117,16 @@ public interface IcUserDemandRecDao extends BaseDao<IcUserDemandRecEntity> {
@Param("type")String type);
int evaluate(@Param("demandRecId")String demandRecId, @Param("finishResult")String finishResult);
/**
* 组织单位积分记录
*
* @Param formDTO
* @Return {@link List< PointRecordDTO>}
* @Author zhaoqifeng
* @Date 2022/1/18 10:33
*/
List<PointRecordDTO> getPointRecordList(PointRecordFormDTO formDTO);
int getTotalPoint(PointRecordFormDTO formDTO);
}

71
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java

@ -0,0 +1,71 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_party_unit_completion")
public class IcPartyUnitCompletionEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
*
*/
private String pids;
/**
* 单位ID
*/
private String unitId;
/**
* 类型 monthly月度quarter季度
*/
private String type;
/**
* 评分 百分制
*/
private String score;
/**
* 完成情况1已完成0未完成
*/
private String status;
/**
* 年份
*/
private String year;
/**
* 月或季度
*/
private String monthQuarter;
/**
* 时间
*/
private String recordDate;
}

46
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java

@ -0,0 +1,46 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcPartyUnitCompletionDTO;
import com.epmet.dto.form.CompletionFormDTO;
import com.epmet.entity.IcPartyUnitCompletionEntity;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
public interface IcPartyUnitCompletionService extends BaseService<IcPartyUnitCompletionEntity> {
/**
* 默认分页
*
* @param formDTO
* @return PageData<IcPartyUnitCompletionDTO>
* @author generator
* @date 2022-01-17
*/
PageData<IcPartyUnitCompletionDTO> page(CompletionFormDTO formDTO);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-01-17
*/
void save(IcPartyUnitCompletionDTO dto);
/**
* 删除
*
* @param id
* @return void
* @author generator
* @date 2022-01-17
*/
void delete(String id);
}

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java

@ -20,7 +20,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.PointRecordFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.PointRecordResultDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.entity.IcUserDemandRecEntity;
@ -224,4 +226,13 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @return
*/
PageData<DemandRecResultDTO> search(String customerId, String agencyId, String keyword, Integer pageNo, Integer pageSize);
/**
* 组织单位积分记录
* @Param formDTO
* @Return {@link PointRecordResultDTO}
* @Author zhaoqifeng
* @Date 2022/1/18 9:45
*/
PointRecordResultDTO pointRecordList(PointRecordFormDTO formDTO);
}

86
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java

@ -0,0 +1,86 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.DateEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcPartyUnitCompletionDao;
import com.epmet.dto.IcPartyUnitCompletionDTO;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.CompletionFormDTO;
import com.epmet.entity.IcPartyUnitCompletionEntity;
import com.epmet.service.IcPartyUnitCompletionService;
import com.epmet.service.IcPartyUnitService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Service
public class IcPartyUnitCompletionServiceImpl extends BaseServiceImpl<IcPartyUnitCompletionDao, IcPartyUnitCompletionEntity> implements IcPartyUnitCompletionService {
@Resource
private IcPartyUnitService icPartyUnitService;
@Override
public PageData<IcPartyUnitCompletionDTO> page(CompletionFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getUnitId())) {
return new PageData<>(Collections.emptyList(), NumConstant.ZERO);
}
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
LambdaQueryWrapper<IcPartyUnitCompletionEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyUnitCompletionEntity::getUnitId, formDTO.getUnitId());
wrapper.orderByDesc(IcPartyUnitCompletionEntity::getCreatedTime);
List<IcPartyUnitCompletionEntity> list = baseDao.selectList(wrapper);
PageInfo<IcPartyUnitCompletionEntity> pageInfo = new PageInfo<>(list);
List<IcPartyUnitCompletionDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitCompletionDTO.class);
if(CollectionUtils.isNotEmpty(dtoList)) {
dtoList.forEach(item -> {
item.setMonthQuarterName(DateEnum.getName(item.getMonthQuarter()));
});
}
return new PageData<>(dtoList, pageInfo.getTotal());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcPartyUnitCompletionDTO dto) {
IcPartyUnitCompletionEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitCompletionEntity.class);
if (StringUtils.isNotBlank(dto.getYear()) && StringUtils.isNotBlank(dto.getMonthQuarter())) {
entity.setRecordDate(dto.getYear().concat(dto.getMonthQuarter()));
}
if(StringUtils.isBlank(dto.getId())) {
IcPartyUnitDTO unity = icPartyUnitService.get(dto.getUnitId());
entity.setCustomerId(unity.getCustomerId());
entity.setAgencyId(unity.getAgencyId());
entity.setPids(unity.getPids());
insert(entity);
} else {
updateById(entity);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String id) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteById(id);
}
}

40
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -1644,5 +1644,45 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return new PageData<>(list, new PageInfo<>(list).getTotal());
}
/**
* 组织单位积分记录
*
* @param formDTO
* @Param formDTO
* @Return {@link PointRecordResultDTO}
* @Author zhaoqifeng
* @Date 2022/1/18 9:45
*/
@Override
public PointRecordResultDTO pointRecordList(PointRecordFormDTO formDTO) {
PointRecordResultDTO result = new PointRecordResultDTO();
if (StringUtils.isBlank(formDTO.getServiceId())) {
result.setTotalPoint(NumConstant.ZERO);
result.setPage(new PageData<>(Collections.emptyList(), NumConstant.ZERO));
}
//总积分
result.setTotalPoint(baseDao.getTotalPoint(formDTO));
//分页查询
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<PointRecordDTO> list = baseDao.getPointRecordList(formDTO);
PageInfo<PointRecordDTO> pageInfo = new PageInfo<>(list);
if (CollectionUtils.isNotEmpty(list)) {
//查询分类名称
List<String> categoryCodes = list.stream().map(PointRecordDTO::getCategoryCode).collect(Collectors.toList());
List<IcResiDemandDictEntity> dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes);
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName));
list.forEach(item -> {
if (dictMap.containsKey(item.getCategoryCode())) {
item.setCategoryName(dictMap.get(item.getCategoryCode()));
}
});
}
result.setPage(new PageData<>(list, pageInfo.getTotal()));
return result;
}
}

22
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql

@ -0,0 +1,22 @@
CREATE TABLE `ic_party_unit_completion`
(
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID',
`PIDS` varchar(255) NOT NULL,
`UNIT_ID` varchar(64) NOT NULL COMMENT '单位ID',
`TYPE` varchar(10) NOT NULL COMMENT '类型 monthly月度,quarter季度',
`SCORE` varchar(5) NOT NULL COMMENT '评分 百分制',
`STATUS` varchar(1) NOT NULL COMMENT '完成情况1已完成,0未完成',
`YEAR` varchar(4) NOT NULL COMMENT '年份',
`MONTH_QUARTER` varchar(4) NOT NULL COMMENT '月或季度',
`RECORD_DATE` varchar(12) NOT NULL COMMENT '时间',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='联建单位完成情况';

27
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcPartyUnitCompletionDao">
<resultMap type="com.epmet.entity.IcPartyUnitCompletionEntity" id="icPartyUnitCompletionMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pids" column="PIDS"/>
<result property="unitId" column="UNIT_ID"/>
<result property="type" column="TYPE"/>
<result property="score" column="SCORE"/>
<result property="status" column="STATUS"/>
<result property="year" column="YEAR"/>
<result property="monthQuarter" column="MONTH_QUARTER"/>
<result property="recordDate" column="RECORD_DATE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

46
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -572,4 +572,50 @@
UPDATED_TIME=NOW()
where id=#{demandRecId}
</update>
<select id="getPointRecordList" resultType="com.epmet.dto.result.PointRecordDTO">
SELECT
a.CATEGORY_CODE,
a.DEMAND_USER_NAME,
a.CONTENT,
a.AWARD_POINT AS point,
a.`STATUS`,
c.SCORE,
DATE_FORMAT(c.EVALUATE_TIME, '%Y-%m-%d %H:%i') AS pointTime
FROM
ic_user_demand_rec a
INNER JOIN ic_user_demand_service b ON a.ID = b.DEMAND_REC_ID AND b.SERVICE_TYPE = #{serviceType}
AND b.SERVER_ID = #{serviceId} AND b.DEL_FLAG = '0'
INNER JOIN ic_user_demand_satisfaction c ON a.ID = c.DEMAND_REC_ID AND c.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
AND a.`STATUS` = 'finished'
AND a.EVALUATE_FLAG = 1
<if test="null != startTime">
AND c.EVALUATE_TIME &gt;= #{startTime}
</if>
<if test="null != endTime">
AND c.EVALUATE_TIME &lt;= #{endTime}
</if>
ORDER BY c.EVALUATE_TIME DESC
</select>
<select id="getTotalPoint" resultType="java.lang.Integer">
SELECT
SUM(a.AWARD_POINT)
FROM
ic_user_demand_rec a
INNER JOIN ic_user_demand_service b ON a.ID = b.DEMAND_REC_ID AND b.SERVICE_TYPE = #{serviceType}
AND b.SERVER_ID = #{serviceId} AND b.DEL_FLAG = '0'
INNER JOIN ic_user_demand_satisfaction c ON a.ID = c.DEMAND_REC_ID AND c.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
AND a.`STATUS` = 'finished'
AND a.EVALUATE_FLAG = 1
<if test="null != startTime">
AND c.EVALUATE_TIME &gt;= #{startTime}
</if>
<if test="null != endTime">
AND c.EVALUATE_TIME &lt;= #{endTime}
</if>
</select>
</mapper>

6
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java

@ -16,11 +16,9 @@ public class AddOftenUseFunctionFormDTO implements Serializable {
private static final long serialVersionUID = -8044386389656626183L;
public interface AddOftenUseFunctionForm{}
@NotBlank(message = "menuId不能为空", groups = AddOftenUseFunctionForm.class)
@NotBlank(message = "menuId不能为空",groups = PackageAddOftenUseFunctionFormDTO.PackageAddOftenUseFunctionForm.class)
private String menuId;
@NotNull(message = "sort不能为空", groups = AddOftenUseFunctionForm.class)
@NotNull(message = "sort不能为空",groups = PackageAddOftenUseFunctionFormDTO.PackageAddOftenUseFunctionForm.class)
private Integer sort;
}

27
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/PackageAddOftenUseFunctionFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/1/17 5:20 下午
* @DESC
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PackageAddOftenUseFunctionFormDTO implements Serializable {
public interface PackageAddOftenUseFunctionForm{}
@Valid
public List<AddOftenUseFunctionFormDTO> list;
}

3
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcOftenUseFunctionDTO;
import com.epmet.dto.form.AddOftenUseFunctionFormDTO;
import com.epmet.dto.form.PackageAddOftenUseFunctionFormDTO;
import com.epmet.dto.result.OftenUseFunctionListResultDTO;
import com.epmet.service.IcOftenUseFunctionService;
import org.springframework.beans.factory.annotation.Autowired;
@ -49,6 +50,8 @@ public class IcOftenUseFunctionController {
*/
@PostMapping("addoftenusefunction")
public Result addOftenUseFunction(@RequestBody List<AddOftenUseFunctionFormDTO> formDTOS, @LoginUser TokenDto tokenDto){
PackageAddOftenUseFunctionFormDTO fo = new PackageAddOftenUseFunctionFormDTO(formDTOS);
ValidatorUtils.validateEntity(fo, PackageAddOftenUseFunctionFormDTO.PackageAddOftenUseFunctionForm.class);
icOftenUseFunctionService.addOftenUseFunction(formDTOS, tokenDto);
return new Result();
}

44
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcResiUserOrgMsgFormDTO.java

@ -0,0 +1,44 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 查询组织网格小区楼栋单元房屋信息
*/
@Data
public class IcResiUserOrgMsgFormDTO implements Serializable {
/**
* 客户ID
*/
private String customerId;
/**
* 组织Id
*/
private String agencyId;
/**
* 网格Id
*/
private String gridId;
/**
* 小区Id
*/
private String neighborHoodId;
/**
* 楼宇Id
*/
private String buildingId;
/**
* 单元Id
*/
private String buildingUnitId;
/**
* 房屋Id
*/
private String houseId;
}

60
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcResiUserOrgMsgResultDTO.java

@ -0,0 +1,60 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import com.epmet.dto.*;
import lombok.Data;
import java.io.Serializable;
/**
* 查询组织网格小区楼栋单元房屋信息
*
* @author sun
*/
@Data
public class IcResiUserOrgMsgResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组织信息
*/
private CustomerAgencyDTO agencyDTO;
/**
* 组织信息
*/
private CustomerGridDTO gridDTO;
/**
* 组织信息
*/
private IcNeighborHoodDTO neighborHoodDTO;
/**
* 组织信息
*/
private IcBuildingDTO buildingDTO;
/**
* 组织信息
*/
private IcBuildingUnitDTO buildingUnitDTO;
/**
* 组织信息
*/
private IcHouseDTO houseDTO;
}

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -577,6 +577,13 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/customeragency/configcustomerareacode")
Result configCustomerAreaCode(@RequestBody CustomerAreaCodeFormDTO formDTO);
/**
* @Author sun
* @Description 查询组织网格小区楼栋单元房屋信息
**/
@PostMapping(value = "/gov/org/customeragency/icresiuserorgmsg")
Result<IcResiUserOrgMsgResultDTO> icResiUserOrgMsg(@RequestBody IcResiUserOrgMsgFormDTO formDTO);
@PostMapping("/gov/org/customergrid/getstaffgridlist")
Result<List<CustomerStaffGridResultDTO>> getStaffGridList(@RequestParam("orgId")String orgId, @RequestParam("orgType")String orgType);
}

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -362,7 +362,7 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
/**
* 运营端-客户管理修改客户信息调用gov-org服务修改组织区划开关修改根组织areaCode入参
*
* @param areaCodeFormDTO
* @param formDTO
* @return
*/
@Override
@ -370,6 +370,16 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "configCustomerAreaCode", formDTO);
}
/**
* @Author sun
* @Description 查询组织网格小区楼栋单元房屋信息
**/
@Override
public Result<IcResiUserOrgMsgResultDTO> icResiUserOrgMsg(IcResiUserOrgMsgFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "icResiUserOrgMsg", formDTO);
}
@Override
public Result<List<CustomerStaffGridResultDTO>> getStaffGridList(String orgId, String orgType) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridList", orgId, orgType);

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -395,4 +395,14 @@ public class CustomerAgencyController {
customerAgencyService.configCustomerAreaCode(formDTO);
return new Result();
}
/**
* @Author sun
* @Description 查询组织网格小区楼栋单元房屋信息
**/
@PostMapping(value = "icresiuserorgmsg")
Result<IcResiUserOrgMsgResultDTO> icResiUserOrgMsg(@RequestBody IcResiUserOrgMsgFormDTO formDTO) {
return new Result<IcResiUserOrgMsgResultDTO>().ok(customerAgencyService.icResiUserOrgMsg(formDTO));
}
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -276,4 +276,11 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @return
*/
void configCustomerAreaCode(CustomerAreaCodeFormDTO formDTO);
/**
* @Author sun
* @Description 查询组织网格小区楼栋单元房屋信息
**/
IcResiUserOrgMsgResultDTO icResiUserOrgMsg(IcResiUserOrgMsgFormDTO formDTO);
}

32
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -98,6 +98,14 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
private CustomerOrgParameterDao customerOrgParameterDao;
@Autowired
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private IcNeighborHoodDao icNeighborHoodDao;
@Autowired
private IcBuildingDao icBuildingDao;
@Autowired
private IcBuildingUnitDao icBuildingUnitDao;
@Autowired
private IcHouseDao icHouseDao;
@Override
@ -1369,4 +1377,28 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
}
return newAreaCode;
}
/**
* @Author sun
* @Description 查询组织网格小区楼栋单元房屋信息
**/
@Override
public IcResiUserOrgMsgResultDTO icResiUserOrgMsg(IcResiUserOrgMsgFormDTO formDTO) {
IcResiUserOrgMsgResultDTO resultDTO = new IcResiUserOrgMsgResultDTO();
CustomerAgencyDTO agencyDTO = ConvertUtils.sourceToTarget(baseDao.selectById(formDTO.getAgencyId()), CustomerAgencyDTO.class);
CustomerGridDTO gridDTO = ConvertUtils.sourceToTarget(customerGridDao.selectById(formDTO.getGridId()), CustomerGridDTO.class);
IcNeighborHoodDTO neighborHoodDTO = ConvertUtils.sourceToTarget(icNeighborHoodDao.selectById(formDTO.getGridId()), IcNeighborHoodDTO.class);
IcBuildingDTO buildingDTO = ConvertUtils.sourceToTarget(icBuildingDao.selectById(formDTO.getGridId()), IcBuildingDTO.class);
IcBuildingUnitDTO buildingUnitDTO = ConvertUtils.sourceToTarget(icBuildingUnitDao.selectById(formDTO.getGridId()), IcBuildingUnitDTO.class);
IcHouseDTO houseDTO = ConvertUtils.sourceToTarget(icHouseDao.selectById(formDTO.getGridId()), IcHouseDTO.class);
resultDTO.setAgencyDTO(agencyDTO);
resultDTO.setGridDTO(gridDTO);
resultDTO.setNeighborHoodDTO(neighborHoodDTO);
resultDTO.setBuildingDTO(buildingDTO);
resultDTO.setBuildingUnitDTO(buildingUnitDTO);
resultDTO.setHouseDTO(houseDTO);
return resultDTO;
}
}

6
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java

@ -16,11 +16,9 @@ public class EditIndividualCategoryFormDTO implements Serializable {
private static final long serialVersionUID = -3492393795553841513L;
public interface EditIndividualCategoryForm{}
@NotBlank(message = "columnId不能为空",groups = EditIndividualCategoryForm.class)
@NotBlank(message = "columnId不能为空",groups = PackageEditIndividualCategoryFormDTO.PackageEditIndividualCategoryForm.class)
private String columnId;
@NotNull(message = "sort不能为空",groups = EditIndividualCategoryForm.class)
@NotNull(message = "sort不能为空",groups = PackageEditIndividualCategoryFormDTO.PackageEditIndividualCategoryForm.class)
private Integer sort;
}

27
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/PackageEditIndividualCategoryFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/1/17 5:49 下午
* @DESC
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PackageEditIndividualCategoryFormDTO implements Serializable {
private static final long serialVersionUID = -6112833952805305270L;
public interface PackageEditIndividualCategoryForm{}
@Valid
private List<EditIndividualCategoryFormDTO> list;
}

54
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerCategoryShowAndWarnListResultDTO.java

@ -0,0 +1,54 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/1/18 10:04 上午
* @DESC
*/
@Data
public class CustomerCategoryShowAndWarnListResultDTO implements Serializable {
/**
* 居民类别配置表ID
*/
private String statsConfigId;
/**
* 居民类别预警配置表ID
*/
private String warnConfigId;
/**
* 字段名
*/
private String columnName;
/**
* 标签
*/
private String label;
/**
* 管理平台分类图标
*/
private String managementIcon;
/**
* 数据平台分类图标
*/
private String dataIcon;
/**
* 房屋显示分类图标
*/
private String houseShowIcon;
private Integer level1;
private Integer level2;
private Integer level3;
}

16
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -109,6 +109,15 @@ public interface OperCustomizeOpenFeignClient {
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist")
Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(@RequestParam String customerId);
/**
* @Description 获取客户下人员分类配置显示的预警配置的
* @param customerId
* @author zxc
* @date 2022/1/18 10:07 上午
*/
@PostMapping("/oper/customize/resicategorystatsconfig/getcustomercategoryshowandwarnlist")
Result<List<CustomerCategoryShowAndWarnListResultDTO>> getCustomerCategoryShowAndWarnList(@RequestParam("customerId")String customerId);
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarninfobyid")
Result<IcResiCategoryWarnConfigDTO> resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto);
@ -129,4 +138,11 @@ public interface OperCustomizeOpenFeignClient {
@PostMapping("/oper/customize/icformitemoptions/list-by-item-conditions")
Result<List<IcFormItemOptionsDTO>> listOptionsByItemConditions(@RequestBody IcFormOptionsQueryFormDTO input);
/**
* @author sun
* @Description 获取客户居民类别预警配置表数据
*/
@PostMapping("/oper/customize/icresicategorywarnconfig/categorywarnconfiglist/{customerId}")
Result<List<IcResiCategoryWarnConfigDTO>> categoryWarnConfigList(@PathVariable String customerId);
}

12
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java

@ -95,7 +95,12 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList",customerId);
}
@Override
@Override
public Result<List<CustomerCategoryShowAndWarnListResultDTO>> getCustomerCategoryShowAndWarnList(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerCategoryShowAndWarnList",customerId);
}
@Override
public Result<IcResiCategoryWarnConfigDTO> resiCategoryWarnInfoById(IcResiCategoryWarnConfigDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnInfoById",dto);
}
@ -109,4 +114,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
public Result<List<IcFormItemOptionsDTO>> listOptionsByItemConditions(IcFormOptionsQueryFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listOptionsByItemConditions", input);
}
@Override
public Result<List<IcResiCategoryWarnConfigDTO>> categoryWarnConfigList(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "categoryWarnConfigList", customerId);
}
}

3
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcIndividualCategoryManageDTO;
import com.epmet.dto.form.EditIndividualCategoryFormDTO;
import com.epmet.dto.form.PackageEditIndividualCategoryFormDTO;
import com.epmet.dto.result.IndividualCategoryListResultDTO;
import com.epmet.service.IcIndividualCategoryManageService;
import org.springframework.beans.factory.annotation.Autowired;
@ -49,6 +50,8 @@ public class IcIndividualCategoryManageController {
*/
@PostMapping("editindividualcategory")
public Result editIndividualCategory(@RequestBody List<EditIndividualCategoryFormDTO> formDTOS,@LoginUser TokenDto tokenDto){
PackageEditIndividualCategoryFormDTO formDTO = new PackageEditIndividualCategoryFormDTO(formDTOS);
ValidatorUtils.validateEntity(formDTO,PackageEditIndividualCategoryFormDTO.PackageEditIndividualCategoryForm.class);
icIndividualCategoryManageService.editIndividualCategory(formDTOS,tokenDto);
return new Result();
}

9
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java

@ -91,4 +91,13 @@ public class IcResiCategoryWarnConfigController {
ExcelUtils.exportExcelToTarget(response, null, list, IcResiCategoryWarnConfigExcel.class);
}
/**
* @author sun
* @Description 获取客户居民类别预警配置表数据
*/
@PostMapping("categorywarnconfiglist/{customerId}")
Result<List<IcResiCategoryWarnConfigDTO>> categoryWarnConfigList(@PathVariable String customerId) {
return new Result<List<IcResiCategoryWarnConfigDTO>>().ok(icResiCategoryWarnConfigService.categoryWarnConfigList(customerId));
}
}

11
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java

@ -34,6 +34,7 @@ import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO;
import com.epmet.dto.form.ResiCategoryStatsConfigListFormDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import com.epmet.entity.IcResiCategoryWarnConfigEntity;
@ -164,5 +165,15 @@ public class ResiCategoryStatsConfigController {
return new Result<IcResiCategoryWarnConfigDTO>().ok(ConvertUtils.sourceToTarget(icResiCategoryWarnConfigDao.selectById(dto.getId()),IcResiCategoryWarnConfigDTO.class));
}
/**
* @Description 获取客户下人员分类配置显示的预警配置的
* @param customerId
* @author zxc
* @date 2022/1/18 10:07 上午
*/
@PostMapping("getcustomercategoryshowandwarnlist")
public Result<List<CustomerCategoryShowAndWarnListResultDTO>> getCustomerCategoryShowAndWarnList(@RequestParam("customerId")String customerId){
return new Result<List<CustomerCategoryShowAndWarnListResultDTO>>().ok(icResiCategoryStatsConfigService.getCustomerCategoryShowAndWarnList(customerId));
}
}

9
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import org.apache.ibatis.annotations.Mapper;
@ -43,4 +44,12 @@ public interface IcResiCategoryStatsConfigDao extends BaseDao<IcResiCategoryStat
List<IcResiCategoryStatsConfigResultDTO> listInfo(@Param("customerId") String customerId, @Param("isWarn") Integer isWarn, @Param("level") Integer level);
IcResiCategoryStatsConfigResultDTO info(@Param("id") String id,@Param("customerId") String customerId);
/**
* @Description 获取客户下人员分类配置显示的预警配置的
* @param customerId
* @author zxc
* @date 2022/1/18 10:09 上午
*/
List<CustomerCategoryShowAndWarnListResultDTO> getCustomerCategoryShowAndWarnList(@Param("customerId")String customerId);
}

10
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java

@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import java.util.List;
@ -101,4 +102,13 @@ public interface IcResiCategoryStatsConfigService extends BaseService<IcResiCate
* @Date 2021/11/5 15:43
*/
List<IcResiCategoryStatsConfigDTO> getCategoryList(IcResiCategoryStatsConfigDTO dto);
/**
* @Description 获取客户下人员分类配置显示的预警配置的
* @param customerId
* @author zxc
* @date 2022/1/18 10:07 上午
*/
List<CustomerCategoryShowAndWarnListResultDTO> getCustomerCategoryShowAndWarnList(String customerId);
}

6
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java

@ -92,4 +92,10 @@ public interface IcResiCategoryWarnConfigService extends BaseService<IcResiCateg
* @date 2021-11-04
*/
void delete(String[] ids);
/**
* @author sun
* @Description 获取客户居民类别预警配置表数据
*/
List<IcResiCategoryWarnConfigDTO> categoryWarnConfigList(String customerId);
}

22
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java

@ -26,18 +26,17 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcResiCategoryStatsConfigDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import com.epmet.redis.IcResiCategoryStatsConfigRedis;
import com.epmet.service.IcResiCategoryStatsConfigService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 居民类别配置表
@ -123,4 +122,19 @@ public class IcResiCategoryStatsConfigServiceImpl extends BaseServiceImpl<IcResi
return ConvertUtils.sourceToTarget(list, IcResiCategoryStatsConfigDTO.class);
}
/**
* @Description 获取客户下人员分类配置显示的预警配置的
* @param customerId
* @author zxc
* @date 2022/1/18 10:07 上午
*/
@Override
public List<CustomerCategoryShowAndWarnListResultDTO> getCustomerCategoryShowAndWarnList(String customerId) {
List<CustomerCategoryShowAndWarnListResultDTO> result = baseDao.getCustomerCategoryShowAndWarnList(customerId);
if (CollectionUtils.isNotEmpty(result)){
return result;
}
return new ArrayList<>();
}
}

14
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -101,4 +102,17 @@ public class IcResiCategoryWarnConfigServiceImpl extends BaseServiceImpl<IcResiC
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @author sun
* @Description 获取客户居民类别预警配置表数据
*/
@Override
public List<IcResiCategoryWarnConfigDTO> categoryWarnConfigList(String customerId) {
LambdaQueryWrapper<IcResiCategoryWarnConfigEntity> wrapperWarn = new LambdaQueryWrapper<>();
wrapperWarn.eq(IcResiCategoryWarnConfigEntity::getCustomerId, customerId);
wrapperWarn.orderByAsc(IcResiCategoryWarnConfigEntity::getSort);
List<IcResiCategoryWarnConfigEntity> entityList = baseDao.selectList(wrapperWarn);
return ConvertUtils.sourceToTarget(entityList, IcResiCategoryWarnConfigDTO.class);
}
}

21
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml

@ -71,5 +71,26 @@
and a.id = #{id}
</select>
<!-- 获取客户下人员分类配置显示的,预警配置的 -->
<select id="getCustomerCategoryShowAndWarnList" resultType="com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO">
SELECT
sc.ID AS statsConfigId,
sc.COLUMN_NAME,
sc.LABEL,
sc.MANAGEMENT_ICON,
sc.DATA_ICON,
sc.HOUSE_SHOW_ICON,
wc.ID AS warnConfigId,
wc.LEVEL_1 AS level1,
wc.LEVEL_2 AS level2,
wc.LEVEL_3 AS level3
FROM ic_resi_category_stats_config sc
INNER JOIN ic_resi_category_warn_config wc ON (wc.CUSTOMER_ID = sc.CUSTOMER_ID AND wc.COLUMN_NAME = sc.COLUMN_NAME AND wc.WARN = 1)
WHERE sc.DEL_FLAG = '0'
AND sc.`STATUS` = 'show'
AND sc.CUSTOMER_ID = #{customerId}
ORDER BY sc.SORT
</select>
</mapper>

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

@ -448,6 +448,11 @@ public class IcResiUserDTO implements Serializable {
*/
private String jtxxRemakes;
/**
* 用户状态0:正常 1:转出
*/
private String status;
/**
* 删除标识 0.未删除 1.已删除
*/

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java

@ -45,7 +45,7 @@ public class IcUserChangeDetailedDTO implements Serializable {
private String customerId;
/**
* 字段名18类对应的ic_resi_user表字段名
* 变更记录表主键ic_user_change_record.id
*/
private String icUserChangeRecordId;

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java

@ -69,12 +69,12 @@ public class IcUserChangeRecordDTO implements Serializable {
private String icUserName;
/**
* 操作类型add:新增 category:类别变动 transfer
* 操作类型add:新增 category:类别 transfer:调动
*/
private String type;
/**
* 操作类型名称add:新增 category:类别变动 transfer:迁出
* 操作类型名称add:新增 category:类别 transfer:调动
*/
private String typeName;

26
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PersonWarnLeftPieDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/1/17 3:27 下午
* @DESC
*/
@Data
public class PersonWarnLeftPieDTO implements Serializable {
private static final long serialVersionUID = 337571869959815613L;
private Integer count;
private String configId;
public PersonWarnLeftPieDTO() {
this.count = NumConstant.ZERO;
this.configId = "";
}
}

32
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserChangeRecordFormDTO.java

@ -0,0 +1,32 @@
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 sun
*/
@Data
public class IcResiUserChangeRecordFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
public interface ChangeRecord extends CustomerClientShowGroup {}
/**
* 字段对应表名
*/
@NotBlank(message = "人员Id不能为空" , groups = ChangeRecord.class)
private String icUserId;
/**
* 页码
*/
private Integer pageNo = 1;
/**
* 每页显示数量
*/
private Integer pageSize = 20;
}

71
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java

@ -0,0 +1,71 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 基础信息人员调动
* @Author sun
*/
@Data
public class IcResiUserTransferFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
public interface TransferAdd extends CustomerClientShowGroup {}
/**
* 被调动人ID
*/
@NotBlank(message = "被调动人Id不能为空" , groups = TransferAdd.class)
private String icUserId;
/**
* 操作类型客户外out,客户内in
*/
@NotBlank(message = "操作类型不能为空" , groups = TransferAdd.class)
private String type;
/**
* 调动到的组织Id
*/
private String newAgencyId;
/**
* 调动到的网格Id
*/
private String newGridId;
/**
* 调动到的小区ID
*/
private String newNeighborHoodId;
/**
* 调动到的楼宇Id
*/
private String newBuildingId;
/**
* 调动到的单元Id
*/
private String newBuildingUnitId;
/**
* 调动到的房屋Id
*/
private String newHouseId;
/**
* 调动时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@NotNull(message = "调动时间不能为空" , groups = TransferAdd.class)
private Date transferTime;
/**
* 备注
*/
private String remark;
//标识,默认为true,为false表示是居民信息修改调用了人员调动的接口,只需要生成调动记录,不涉及修改基础信息
private Boolean idEdit = true;
//token中信息
private String customerId;
private String staffId;
}

25
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/1/17 4:13 下午
* @DESC
*/
@Data
public class PersonWarnRightListFormDTO implements Serializable {
private static final long serialVersionUID = -3561699479212127370L;
public interface PersonWarnRightListForm{}
@NotNull(message = "pageNo不能为空",groups = PersonWarnRightListForm.class)
private Integer pageNo;
@NotNull(message = "pageSize不能为空",groups = PersonWarnRightListForm.class)
private Integer pageSize;
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserChangeRecordResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import com.epmet.dto.IcUserChangeRecordDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 基础信息变更记录
* @Author sun
*/
@Data
public class IcUserChangeRecordResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
//集合总条数
private Integer total = 0;
//变更记录
private List<IcUserChangeRecordDTO> list;
}

48
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnLeftPieResultDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/1/17 2:33 下午
* @DESC
*/
@Data
public class PersonWarnLeftPieResultDTO implements Serializable {
private static final long serialVersionUID = -111604873581992490L;
private Integer total;
private List<PersonWarnLeftPie> list;
public PersonWarnLeftPieResultDTO() {
this.total = NumConstant.ZERO;
this.list = new ArrayList<>();
}
@Data
public static class PersonWarnLeftPie{
@JsonIgnore
private String configId;
private String typeName;
private String typeCode;
private Integer typeCount;
public PersonWarnLeftPie() {
this.typeName = "";
this.typeCode = "";
this.typeCount = NumConstant.ZERO;
}
}
}

68
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java

@ -0,0 +1,68 @@
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/1/17 4:16 下午
* @DESC
*/
@Data
public class PersonWarnRightListResultDTO implements Serializable {
private static final long serialVersionUID = -9181230625228226662L;
private Integer total;
private List<PersonWarnRightList> list;
public PersonWarnRightListResultDTO() {
this.total = NumConstant.ZERO;
this.list = new ArrayList<>();
}
@Data
public static class PersonWarnRightList{
/**
* 类型
*/
private List<String> type;
/**
* 所属网格
*/
private String gridName;
/**
* 姓名
*/
private String name;
/**
* 所属家庭
*/
private String family;
/**
* 电话
*/
private String mobile;
private String userId;
public PersonWarnRightList() {
this.type = new ArrayList<>();
this.gridName = "";
this.name = "";
this.family = "";
this.mobile = "";
this.userId = "";
}
}
}

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

@ -668,4 +668,17 @@ public class IcResiUserController {
PageData<Map<String, Object>> r = icResiUserService.pageResiMap(input);
return new Result<PageData<Map<String, Object>>>().ok(r);
}
/**
* @Description 社区查询人员预警右侧列表
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/1/17 4:25 下午
*/
@PostMapping("personwarn/rightlist")
public Result<PersonWarnRightListResultDTO> personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO,@LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, PersonWarnRightListFormDTO.PersonWarnRightListForm.class);
return new Result<PersonWarnRightListResultDTO>().ok(icResiUserService.personWarnRightList(formDTO,tokenDto));
}
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java

@ -17,7 +17,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -26,6 +28,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcStatsResiWarnDTO;
import com.epmet.dto.result.PersonWarnLeftPieResultDTO;
import com.epmet.excel.IcStatsResiWarnExcel;
import com.epmet.service.IcStatsResiWarnService;
import org.springframework.beans.factory.annotation.Autowired;
@ -91,4 +94,15 @@ public class IcStatsResiWarnController {
ExcelUtils.exportExcelToTarget(response, null, list, IcStatsResiWarnExcel.class);
}
/**
* @Description 社区查询人员预警饼图
* @param tokenDto
* @author zxc
* @date 2022/1/17 2:39 下午
*/
@PostMapping("personwarn/leftpie")
public Result<PersonWarnLeftPieResultDTO> personWarnLeftPie(@LoginUser TokenDto tokenDto){
return new Result<PersonWarnLeftPieResultDTO>().ok(icStatsResiWarnService.personWarnLeftPie(tokenDto));
}
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java

@ -17,8 +17,15 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.IcResiUserChangeRecordFormDTO;
import com.epmet.dto.form.IcResiUserTransferFormDTO;
import com.epmet.dto.result.IcUserChangeRecordResultDTO;
import com.epmet.service.IcUserChangeRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -36,5 +43,14 @@ public class IcUserChangeRecordController {
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
/**
* @Author sun
* @Description 基础信息变更记录
**/
@PostMapping("list")
public Result<IcUserChangeRecordResultDTO> list(@RequestBody IcResiUserChangeRecordFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IcResiUserTransferFormDTO.TransferAdd.class);
return new Result<IcUserChangeRecordResultDTO>().ok(icUserChangeRecordService.list(formDTO));
}
}

23
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java

@ -17,8 +17,16 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.IcResiUserTransferFormDTO;
import com.epmet.service.IcUserTransferRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -37,4 +45,19 @@ public class IcUserTransferRecordController {
private IcUserTransferRecordService icUserTransferRecordService;
/**
* @Author sun
* @Description 基础信息人员调动
**/
@NoRepeatSubmit
@PostMapping("add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserTransferFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IcResiUserTransferFormDTO.TransferAdd.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
icUserTransferRecordService.add(formDTO);
return new Result();
}
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -229,4 +229,6 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
@Param("code") String code);
List<VolunteerDistributionResultDTO.Distribution> listIcResiInfosByUserIds(@Param("userIds") List<String> userIds);
Map<String, String> getCategoryListMap(@Param("icUserId") String icUserId);
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.PersonWarnLeftPieDTO;
import com.epmet.entity.IcStatsResiWarnEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -58,4 +59,13 @@ public interface IcStatsResiWarnDao extends BaseDao<IcStatsResiWarnEntity> {
@Param("columnName") String columnName,
@Param("icStatsResiWarn") IcStatsResiWarnEntity icStatsResiWarn);
/**
* @Description 查询分类下的人数
* @param configIds
* @param agencyId
* @author zxc
* @date 2022/1/17 3:30 下午
*/
List<PersonWarnLeftPieDTO> selectCategoryCount(@Param("configIds") List<String> configIds,@Param("agencyId")String agencyId);
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java

@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcUserChangeRecordDTO;
import com.epmet.entity.IcUserChangeRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 居民变更记录表
@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcUserChangeRecordDao extends BaseDao<IcUserChangeRecordEntity> {
/**
* @Author sun
* @Description 查询居民变更记录
**/
List<IcUserChangeRecordDTO> getList(@Param("icUserId") String icUserId);
}

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

@ -440,6 +440,11 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String jtxxRemakes;
/**
* 用户状态0:正常 1:转出
*/
private String status;
/**
* 预留字段1
*/

2
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java

@ -42,7 +42,7 @@ public class IcUserChangeDetailedEntity extends BaseEpmetEntity {
private String customerId;
/**
* 字段名18类对应的ic_resi_user表字段名
* 变更记录表主键ic_user_change_record.id
*/
private String icUserChangeRecordId;

4
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java

@ -68,12 +68,12 @@ public class IcUserChangeRecordEntity extends BaseEpmetEntity {
private String icUserName;
/**
* 操作类型add:新增 category:类别变动 transfer
* 操作类型add:新增 category:类别 transfer:调动
*/
private String type;
/**
* 操作类型名称add:新增 category:类别变动 transfer:迁出
* 操作类型名称add:新增 category:类别 transfer:调动
*/
private String typeName;

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -199,4 +199,14 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @return
*/
IcResiUserDTO get(String icResiUserId);
/**
* @Description 社区查询人员预警右侧列表
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/1/17 4:25 下午
*/
PersonWarnRightListResultDTO personWarnRightList(PersonWarnRightListFormDTO formDTO, TokenDto tokenDto);
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java

@ -19,7 +19,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcStatsResiWarnDTO;
import com.epmet.dto.result.PersonWarnLeftPieResultDTO;
import com.epmet.entity.IcStatsResiWarnEntity;
import java.util.List;
@ -92,4 +94,12 @@ public interface IcStatsResiWarnService extends BaseService<IcStatsResiWarnEntit
* @date 2021-11-04
*/
void delete(String[] ids);
/**
* @Description 社区查询人员预警饼图
* @param tokenDto
* @author zxc
* @date 2022/1/17 2:39 下午
*/
PersonWarnLeftPieResultDTO personWarnLeftPie(TokenDto tokenDto);
}

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

@ -18,6 +18,8 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.IcResiUserChangeRecordFormDTO;
import com.epmet.dto.result.IcUserChangeRecordResultDTO;
import com.epmet.entity.IcUserChangeRecordEntity;
/**
@ -28,4 +30,9 @@ import com.epmet.entity.IcUserChangeRecordEntity;
*/
public interface IcUserChangeRecordService extends BaseService<IcUserChangeRecordEntity> {
/**
* @Author sun
* @Description 基础信息变更记录
**/
IcUserChangeRecordResultDTO list(IcResiUserChangeRecordFormDTO formDTO);
}

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

@ -18,6 +18,7 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.IcResiUserTransferFormDTO;
import com.epmet.entity.IcUserTransferRecordEntity;
/**
@ -28,4 +29,10 @@ import com.epmet.entity.IcUserTransferRecordEntity;
*/
public interface IcUserTransferRecordService extends BaseService<IcUserTransferRecordEntity> {
/**
* @Author sun
* @Description 基础信息人员调动
**/
void add(IcResiUserTransferFormDTO formDTO);
}

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

@ -54,10 +54,11 @@ import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.entity.IcUserChangeDetailedEntity;
import com.epmet.entity.IcUserChangeRecordEntity;
import com.epmet.excel.support.ExportResiUserItemDTO;
import com.epmet.feign.*;
import com.epmet.service.IcResiUserService;
import com.epmet.service.UserService;
import com.epmet.service.*;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -106,6 +107,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Autowired
private IcResiUserDao icResiUserDao;
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
@Autowired
private IcUserChangeDetailedService icUserChangeDetailedService;
@Autowired
private IcUserTransferRecordService icUserTransferRecordService;
private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
@ -162,9 +169,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//1.先往主表新增数据
//主表Id
String resiUserId = UUID.randomUUID().toString().replaceAll("-", "");
formDTO.forEach(d -> {
String name = "";
LinkedHashMap<String, String> map = new LinkedHashMap<>();
for (IcResiUserFormDTO d : formDTO) {
if ("ic_resi_user".equals(d.getTableName())) {
LinkedHashMap<String, String> map = d.getList().get(0);
map = d.getList().get(0);
name = map.get("NAME");
map.put("id", resiUserId);
map.put("customer_id", tokenDto.getCustomerId());
map.put("created_by", tokenDto.getUserId());
@ -195,26 +205,79 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//新增主表数据
baseDao.add(d.getTableName(), map);
}
});
}
//2.循环字表新增数据
formDTO.forEach(d -> {
if (!"ic_resi_user".equals(d.getTableName())) {
for (LinkedHashMap<String, String> map : d.getList()) {
map.put("id", UUID.randomUUID().toString().replaceAll("-", ""));
map.put("ic_resi_user", resiUserId);
map.put("customer_id", tokenDto.getCustomerId());
map.put("created_by", tokenDto.getUserId());
map.put("updated_by", tokenDto.getUserId());
for (LinkedHashMap<String, String> hash : d.getList()) {
hash.put("id", UUID.randomUUID().toString().replaceAll("-", ""));
hash.put("ic_resi_user", resiUserId);
hash.put("customer_id", tokenDto.getCustomerId());
hash.put("created_by", tokenDto.getUserId());
hash.put("updated_by", tokenDto.getUserId());
//字表新增数据
baseDao.add(d.getTableName(), map);
baseDao.add(d.getTableName(), hash);
}
}
});
//3.变更记录表和变更记录明细表新增数据
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
//3-1.变更记录表
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
changeRecordEntity.setCustomerId(tokenDto.getCustomerId());
changeRecordEntity.setOperatorId(tokenDto.getUserId());
changeRecordEntity.setIcUserId(resiUserId);
changeRecordEntity.setOperatorName(staffInfoCache.getRealName());
changeRecordEntity.setIcUserName(name);
changeRecordEntity.setType("add");
changeRecordEntity.setTypeName("新增");
changeRecordEntity.setBeforeChangeName("-");
changeRecordEntity.setAfterChangeName("-");
changeRecordEntity.setChangeTime(new java.util.Date());
icUserChangeRecordService.insert(changeRecordEntity);
//3-2.变更明细表
List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeRecord(tokenDto, map, resiUserId, changeRecordEntity.getId());
icUserChangeDetailedService.insertBatch(changeDetailedEntityList);
return resiUserId;
}
/**
* @Author sun
* @Description 变更明细表
**/
private List<IcUserChangeDetailedEntity> saveChangeRecord(TokenDto tokenDto, LinkedHashMap<String, String> map, String icUserId, String icUserChangeRecordId) {
List<IcUserChangeDetailedEntity> list = new ArrayList<>();
Result<List<IcResiCategoryWarnConfigDTO>> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(tokenDto.getCustomerId());
if (!resultList.success()) {
throw new RuntimeException("人员新增,获取客户居民类别预警配置表数据失败");
}
IcUserChangeDetailedEntity outEntity = null;
for (IcResiCategoryWarnConfigDTO cf : resultList.getData()) {
if (map.containsKey(cf.getColumnName()) && "1".equals(map.get(cf.getColumnName()))) {
//新增
outEntity = new IcUserChangeDetailedEntity();
outEntity.setCustomerId(tokenDto.getCustomerId());
outEntity.setIcUserChangeRecordId(icUserChangeRecordId);
outEntity.setAgencyId(map.get("AGENCY_ID"));
outEntity.setGridId(map.get("GRID_ID"));
outEntity.setNeighborHoodId(map.get("VILLAGE_ID"));
outEntity.setBuildingId(map.get("BUILD_ID"));
outEntity.setBuildingUnitId(map.get("UNIT_ID"));
outEntity.setHouseId(map.get("HOME_ID"));
outEntity.setIcUserId(icUserId);
outEntity.setType("add");
outEntity.setTypeName("新增");
outEntity.setFieldName(cf.getColumnName());
outEntity.setValue(1);
list.add(outEntity);
}
}
return list;
}
/**
* @Author sun
* @Description 党建互联平台--修改居民信息
@ -253,6 +316,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (null == entity) {
throw new RenException(String.format("居民信息修改,获取基础信息失败,基础信息Id->", resiUserId));
}
//2022-1-18 信息修改判断基础信息表人员网格、小区、楼栋、单元、房屋维度数据以及十八类的类别数据是否变化,相应生成变更记录和变更明细数据 sun start
icUserChangeRecord(tokenDto, entity, map);
//2022-1-18 sun end
//2.更新主表数据
if (map.size() > NumConstant.ONE) {
map.put("updated_by", tokenDto.getUserId());
@ -283,6 +349,88 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return resiUserId;
}
/**
* @Author sun
* @Description 居民信息修改--生成变更记录和变更明细
**/
private void icUserChangeRecord(TokenDto tokenDto, IcResiUserEntity entity, LinkedHashMap<String, String> map) {
Date date = (Date) new java.util.Date();
//1.判断维度数据是否修改【网格、小区、楼栋、单元、房间有变化则先走人员调动逻辑】
if ((map.containsKey("GRID_ID") && !entity.getGridId().equals(map.get("GRID_ID"))) || (map.containsKey("VILLAGE_ID") && !entity.getVillageId().equals(map.get("VILLAGE_ID")))
|| (map.containsKey("BUILD_ID") && !entity.getBuildId().equals(map.get("BUILD_ID"))) || (map.containsKey("UNIT_ID") && !entity.getUnitId().equals(map.get("UNIT_ID")))
|| (map.containsKey("HOME_ID") && !entity.getHomeId().equals(map.get("HOME_ID")))) {
IcResiUserTransferFormDTO formDTO = new IcResiUserTransferFormDTO();
formDTO.setIcUserId(entity.getId());
formDTO.setType("in");
formDTO.setNewAgencyId(entity.getAgencyId());
formDTO.setNewGridId(map.containsKey("GRID_ID") ? map.get("GRID_ID") : entity.getGridId());
formDTO.setNewNeighborHoodId(map.containsKey("VILLAGE_ID") ? map.get("VILLAGE_ID") : entity.getVillageId());
formDTO.setNewBuildingId(map.containsKey("BUILD_ID") ? map.get("BUILD_ID") : entity.getBuildId());
formDTO.setNewBuildingUnitId(map.containsKey("UNIT_ID") ? map.get("UNIT_ID") : entity.getUnitId());
formDTO.setNewHouseId(map.containsKey("HOME_ID") ? map.get("HOME_ID") : entity.getHomeId());
formDTO.setTransferTime(date);
formDTO.setIdEdit(false);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
icUserTransferRecordService.add(formDTO);
}
//2.判断类别数据是否修改[类别修改的变更明细里边存修改后的新值,是就存1否就存-1]
Result<List<IcResiCategoryWarnConfigDTO>> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(tokenDto.getCustomerId());
if (!resultList.success()) {
throw new RuntimeException("居民信息修改,获取客户居民类别预警配置表数据失败");
}
//修改前数据库居民十八类信息值
Map<String, String> hash = icResiUserDao.getCategoryListMap(entity.getId());
//封装变更记录和变更明细数据
//变更记录
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
StringBuffer beforeChangeName = new StringBuffer("");
StringBuffer afterChangeName = new StringBuffer("");
//变更明细
List<IcUserChangeDetailedEntity> list = new ArrayList<>();
IcUserChangeDetailedEntity categoryEntity = null;
for (IcResiCategoryWarnConfigDTO dto : resultList.getData()) {
String oldValue = hash.get(dto.getColumnName());
if (map.containsKey(dto.getColumnName()) && !oldValue.equals(map.get(dto.getColumnName()))) {
//类别修改后的值
String newVlaue = map.get(dto.getColumnName());
beforeChangeName.append(dto.getLabel()).append(":").append("1".equals(oldValue) ? "是" : "否").append(";");
afterChangeName.append(dto.getLabel()).append(":").append("1".equals(newVlaue) ? "是" : "否").append(";");
//变更明细里边存修改后的新值,是就存1否就存-1
categoryEntity = new IcUserChangeDetailedEntity();
categoryEntity.setCustomerId(tokenDto.getCustomerId());
categoryEntity.setAgencyId(entity.getAgencyId());
categoryEntity.setGridId(map.containsKey("GRID_ID") ? map.get("GRID_ID") : entity.getGridId());
categoryEntity.setNeighborHoodId(map.containsKey("VILLAGE_ID") ? map.get("VILLAGE_ID") : entity.getVillageId());
categoryEntity.setBuildingId(map.containsKey("BUILD_ID") ? map.get("BUILD_ID") : entity.getBuildId());
categoryEntity.setBuildingUnitId(map.containsKey("UNIT_ID") ? map.get("UNIT_ID") : entity.getUnitId());
categoryEntity.setHouseId(map.containsKey("HOME_ID") ? map.get("HOME_ID") : entity.getHomeId());
categoryEntity.setIcUserId(entity.getId());
categoryEntity.setType("category");
categoryEntity.setTypeName("类别");
categoryEntity.setFieldName(dto.getColumnName());
categoryEntity.setValue("1".equals(newVlaue) ? 1 : -1);
list.add(categoryEntity);
}
}
//变更记录
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
changeRecordEntity.setCustomerId(tokenDto.getCustomerId());
changeRecordEntity.setOperatorId(tokenDto.getUserId());
changeRecordEntity.setIcUserId(entity.getId());
changeRecordEntity.setOperatorName(staffInfoCache.getRealName());
changeRecordEntity.setIcUserName(map.containsKey("NAME") ? map.get("NAME") : entity.getName());
changeRecordEntity.setType("category");
changeRecordEntity.setTypeName("类别");
changeRecordEntity.setBeforeChangeName(beforeChangeName.toString());
changeRecordEntity.setAfterChangeName(afterChangeName.toString());
changeRecordEntity.setChangeTime(date);
icUserChangeRecordService.insert(changeRecordEntity);
list.forEach(l -> l.setIcUserChangeRecordId(changeRecordEntity.getId()));
icUserChangeDetailedService.insertBatch(list);
}
/**
* @param homeId
* @Description 获取房间内人员
@ -942,6 +1090,18 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return ConvertUtils.sourceToTarget(icResiUserEntity,IcResiUserDTO.class);
}
/**
* @Description 社区查询人员预警右侧列表
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/1/17 4:25 下午
*/
@Override
public PersonWarnRightListResultDTO personWarnRightList(PersonWarnRightListFormDTO formDTO, TokenDto tokenDto) {
return null;
}
/**
* 查询志愿者类别options
* @param customerId

54
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java

@ -20,22 +20,35 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcStatsResiWarnDao;
import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.IcStatsResiWarnDTO;
import com.epmet.dto.PersonWarnLeftPieDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.dto.result.PersonWarnLeftPieResultDTO;
import com.epmet.entity.IcStatsResiWarnEntity;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.redis.IcStatsResiWarnRedis;
import com.epmet.service.IcStatsResiWarnService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 预警统计表
@ -47,7 +60,7 @@ import java.util.Map;
public class IcStatsResiWarnServiceImpl extends BaseServiceImpl<IcStatsResiWarnDao, IcStatsResiWarnEntity> implements IcStatsResiWarnService {
@Autowired
private IcStatsResiWarnRedis icStatsResiWarnRedis;
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
@Override
public PageData<IcStatsResiWarnDTO> page(Map<String, Object> params) {
@ -101,4 +114,43 @@ public class IcStatsResiWarnServiceImpl extends BaseServiceImpl<IcStatsResiWarnD
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 社区查询人员预警饼图
* @param tokenDto
* @author zxc
* @date 2022/1/17 2:39 下午
*/
@Override
public PersonWarnLeftPieResultDTO personWarnLeftPie(TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException(String.format("未查询到此工作人员%s",tokenDto.getUserId()));
}
// 查询设置预警的分类
Result<List<CustomerCategoryShowAndWarnListResultDTO>> listResult = operCustomizeOpenFeignClient.getCustomerCategoryShowAndWarnList(tokenDto.getCustomerId());
if (!listResult.success()){
throw new EpmetException("查询设置预警的分类失败...");
}
PersonWarnLeftPieResultDTO result = new PersonWarnLeftPieResultDTO();
if (CollectionUtils.isEmpty(listResult.getData())){
return result;
}
List<CustomerCategoryShowAndWarnListResultDTO> configList = listResult.getData();
List<PersonWarnLeftPieResultDTO.PersonWarnLeftPie> list = new ArrayList<>();
configList.forEach(c -> {
PersonWarnLeftPieResultDTO.PersonWarnLeftPie p = new PersonWarnLeftPieResultDTO.PersonWarnLeftPie();
p.setTypeName(c.getLabel());
p.setTypeCode(c.getColumnName());
p.setConfigId(c.getWarnConfigId());
list.add(p);
});
List<PersonWarnLeftPieDTO> dtos = baseDao.selectCategoryCount(configList.stream().map(m -> m.getWarnConfigId()).collect(Collectors.toList()), staffInfo.getAgencyId());
if (CollectionUtils.isNotEmpty(dtos)){
list.forEach(l -> dtos.stream().filter(d -> d.getConfigId().equals(l.getConfigId())).forEach(d -> l.setTypeCount(d.getCount())));
}
result.setTotal(list.stream().collect(Collectors.summingInt(PersonWarnLeftPieResultDTO.PersonWarnLeftPie::getTypeCount)));
result.setList(list);
return result;
}
}

22
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java

@ -19,9 +19,15 @@ package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.IcUserChangeRecordDao;
import com.epmet.dto.IcUserChangeRecordDTO;
import com.epmet.dto.form.IcResiUserChangeRecordFormDTO;
import com.epmet.dto.result.IcUserChangeRecordResultDTO;
import com.epmet.entity.IcUserChangeRecordEntity;
import com.epmet.service.IcUserChangeRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
/**
* 居民变更记录表
@ -32,5 +38,21 @@ import org.springframework.stereotype.Service;
@Service
public class IcUserChangeRecordServiceImpl extends BaseServiceImpl<IcUserChangeRecordDao, IcUserChangeRecordEntity> implements IcUserChangeRecordService {
/**
* @Author sun
* @Description 基础信息变更记录
**/
@Override
public IcUserChangeRecordResultDTO list(IcResiUserChangeRecordFormDTO formDTO) {
IcUserChangeRecordResultDTO resultDTO = new IcUserChangeRecordResultDTO();
PageInfo<IcUserChangeRecordDTO> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO.getIcUserId()));
if (CollectionUtils.isEmpty(result.getList())) {
return resultDTO;
}
resultDTO.setTotal((int) result.getTotal());
resultDTO.setList(result.getList());
return resultDTO;
}
}

234
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java

@ -18,10 +18,35 @@
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dao.IcUserTransferRecordDao;
import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.IcResiUserOrgMsgFormDTO;
import com.epmet.dto.form.IcResiUserTransferFormDTO;
import com.epmet.dto.result.IcResiUserOrgMsgResultDTO;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.entity.IcUserChangeDetailedEntity;
import com.epmet.entity.IcUserChangeRecordEntity;
import com.epmet.entity.IcUserTransferRecordEntity;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.IcUserChangeDetailedService;
import com.epmet.service.IcUserChangeRecordService;
import com.epmet.service.IcUserTransferRecordService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 居民调动记录表
@ -31,6 +56,215 @@ import org.springframework.stereotype.Service;
*/
@Service
public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTransferRecordDao, IcUserTransferRecordEntity> implements IcUserTransferRecordService {
private Logger log = LoggerFactory.getLogger(IcUserTransferRecordServiceImpl.class);
@Autowired
private IcResiUserDao icResiUserDao;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
@Autowired
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
@Autowired
private IcUserChangeDetailedService icUserChangeDetailedService;
/**
* @Author sun
* @Description 基础信息人员调动
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void add(IcResiUserTransferFormDTO formDTO) {
//1.判断被调动人员是否有效
IcResiUserDTO resiUserDTO = icResiUserDao.selectIdByIdCard(formDTO.getCustomerId(), null, formDTO.getIcUserId());
if (null == resiUserDTO) {
throw new RenException("9000", "人员调动失败,被调动人不存在!");
}
//2.查询人员调动前的组织、网格、小区、楼栋、单元、房屋信息
IcResiUserOrgMsgFormDTO orgMsgFormDTO1 = new IcResiUserOrgMsgFormDTO();
orgMsgFormDTO1.setCustomerId(resiUserDTO.getCustomerId());
orgMsgFormDTO1.setAgencyId(resiUserDTO.getAgencyId());
orgMsgFormDTO1.setGridId(resiUserDTO.getGridId());
orgMsgFormDTO1.setNeighborHoodId(resiUserDTO.getVillageId());
orgMsgFormDTO1.setBuildingId(resiUserDTO.getBuildId());
orgMsgFormDTO1.setBuildingUnitId(resiUserDTO.getUnitId());
orgMsgFormDTO1.setHouseId(resiUserDTO.getHomeId());
Result<IcResiUserOrgMsgResultDTO> result1 = govOrgOpenFeignClient.icResiUserOrgMsg(orgMsgFormDTO1);
if (!result1.success() || null == result1.getData().getAgencyDTO() || null == result1.getData().getGridDTO() || null == result1.getData().getNeighborHoodDTO()
|| null == result1.getData().getBuildingDTO() || null == result1.getData().getBuildingUnitDTO() || null == result1.getData().getHouseDTO()) {
log.warn("查找被调动人调动前的组织、网格、小区、楼栋、单元、房屋信息失败");
throw new RenException("9000", "获取被调动人基础信息失败");
}
//3.查询人员调动后的组织、网格、小区、楼栋、单元、房屋信息
IcResiUserOrgMsgFormDTO orgMsgFormDTO2 = new IcResiUserOrgMsgFormDTO();
orgMsgFormDTO2.setCustomerId(formDTO.getCustomerId());
orgMsgFormDTO2.setAgencyId(formDTO.getNewAgencyId());
orgMsgFormDTO2.setGridId(formDTO.getNewGridId());
orgMsgFormDTO2.setNeighborHoodId(formDTO.getNewNeighborHoodId());
orgMsgFormDTO2.setBuildingId(formDTO.getNewBuildingId());
orgMsgFormDTO2.setBuildingUnitId(formDTO.getNewBuildingUnitId());
orgMsgFormDTO2.setHouseId(formDTO.getNewHouseId());
Result<IcResiUserOrgMsgResultDTO> result2 = govOrgOpenFeignClient.icResiUserOrgMsg(orgMsgFormDTO2);
if (!result2.success() || null == result2.getData().getAgencyDTO() || null == result2.getData().getGridDTO() || null == result2.getData().getNeighborHoodDTO()
|| null == result2.getData().getBuildingDTO() || null == result2.getData().getBuildingUnitDTO() || null == result2.getData().getHouseDTO()) {
log.warn("查找被调动人调动后的组织、网格、小区、楼栋、单元、房屋信息失败");
throw new RenException("9000", "获取被调动人基础信息失败");
}
//4.修改被调动人所属各维度信息或人员状态信息
if (formDTO.getIdEdit()) {
IcResiUserEntity userEntity = new IcResiUserEntity();
userEntity.setId(formDTO.getIcUserId());
if ("out".equals(formDTO.getType())) {
//4-1.转到客户外修改基础信息表人员信息状态
userEntity.setStatus("1");
} else {
//4-2.客户内部流转修改所属各维度信息
userEntity.setAgencyId(formDTO.getNewAgencyId());
userEntity.setGridId(formDTO.getNewGridId());
userEntity.setVillageId(formDTO.getNewNeighborHoodId());
userEntity.setBuildId(formDTO.getNewBuildingId());
userEntity.setUnitId(formDTO.getNewBuildingUnitId());
userEntity.setHomeId(formDTO.getNewHouseId());
}
icResiUserDao.updateById(userEntity);
}
//5.生成调动记录
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
IcUserTransferRecordEntity recordEntity = saveTransferRecord(staffInfoCache, formDTO, resiUserDTO, result1.getData(), result2.getData());
insert(recordEntity);
//6.生成调动前后的变更记录、变更明细
//6-1.变更记录
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
changeRecordEntity.setIcUserTransferRecordId(recordEntity.getId());
if ("in".equals(formDTO.getType())) {
changeRecordEntity.setCustomerId(resiUserDTO.getCustomerId());
}
changeRecordEntity.setOperatorId(formDTO.getStaffId());
changeRecordEntity.setIcUserId(formDTO.getIcUserId());
changeRecordEntity.setOperatorName(staffInfoCache.getRealName());
changeRecordEntity.setIcUserName(resiUserDTO.getName());
changeRecordEntity.setType("transfer");
changeRecordEntity.setTypeName("调动");
StringBuffer beforeName = new StringBuffer();
beforeName.append(result1.getData().getAgencyDTO().getOrganizationName()).append("-").append(result1.getData().getGridDTO().getGridName()).append("-")
.append(result1.getData().getNeighborHoodDTO().getNeighborHoodName()).append("-").append(result1.getData().getBuildingDTO().getBuildingName()).append("-")
.append(result1.getData().getBuildingUnitDTO().getUnitName()).append("-").append(result1.getData().getHouseDTO().getHouseName());
changeRecordEntity.setBeforeChangeName(beforeName.toString());
StringBuffer afterName = new StringBuffer();
afterName.append(result2.getData().getAgencyDTO().getOrganizationName()).append("-").append(result2.getData().getGridDTO().getGridName()).append("-")
.append(result2.getData().getNeighborHoodDTO().getNeighborHoodName()).append("-").append(result2.getData().getBuildingDTO().getBuildingName()).append("-")
.append(result2.getData().getBuildingUnitDTO().getUnitName()).append("-").append(result2.getData().getHouseDTO().getHouseName());
changeRecordEntity.setAfterChangeName(afterName.toString());
changeRecordEntity.setChangeTime(formDTO.getTransferTime());
changeRecordEntity.setRemark(formDTO.getRemark());
icUserChangeRecordService.insert(changeRecordEntity);
//6-2.变更明细【类别明细迁出组织的-1,迁入组织的1】
Result<List<IcResiCategoryWarnConfigDTO>> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(formDTO.getCustomerId());
if (!resultList.success()) {
throw new RuntimeException("人员调动,获取客户居民类别预警配置表数据失败");
}
Map<String, String> map = icResiUserDao.getCategoryListMap(formDTO.getIcUserId());
List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeDetailed(resultList.getData(), map, changeRecordEntity.getId(), formDTO, resiUserDTO);
icUserChangeDetailedService.insertBatch(changeDetailedEntityList);
}
/**
* @Author sun
* @Description 调动记录
**/
private IcUserTransferRecordEntity saveTransferRecord(CustomerStaffInfoCacheResult staffInfoCache, IcResiUserTransferFormDTO formDTO, IcResiUserDTO resiUserDTO, IcResiUserOrgMsgResultDTO result1, IcResiUserOrgMsgResultDTO result2) {
IcUserTransferRecordEntity recordEntity = new IcUserTransferRecordEntity();
recordEntity.setIcUserId(formDTO.getIcUserId());
recordEntity.setOperatorId(formDTO.getStaffId());
recordEntity.setIcUserName(resiUserDTO.getName());
recordEntity.setOperatorName(null == staffInfoCache ? "" : staffInfoCache.getRealName());
recordEntity.setOldCustomerId(formDTO.getCustomerId());
if ("in".equals(formDTO.getType())) {
recordEntity.setNewCustomerId(resiUserDTO.getCustomerId());
}
recordEntity.setOldAgencyId(resiUserDTO.getAgencyId());
recordEntity.setNewAgencyId(formDTO.getNewAgencyId());
recordEntity.setOldAgencyName(result1.getAgencyDTO().getOrganizationName());
recordEntity.setNewAgencyName(result2.getAgencyDTO().getOrganizationName());
recordEntity.setOldGridId(resiUserDTO.getGridId());
recordEntity.setNewGridId(formDTO.getNewGridId());
recordEntity.setOldGridName(result1.getGridDTO().getGridName());
recordEntity.setNewGridName(result2.getGridDTO().getGridName());
recordEntity.setOldNeighborHoodId(resiUserDTO.getVillageId());
recordEntity.setNewNeighborHoodId(formDTO.getNewNeighborHoodId());
recordEntity.setOldNeighborHoodName(result1.getNeighborHoodDTO().getNeighborHoodName());
recordEntity.setNewNeighborHoodName(result2.getNeighborHoodDTO().getNeighborHoodName());
recordEntity.setOldBuildingId(resiUserDTO.getBuildId());
recordEntity.setNewBuildingId(formDTO.getNewBuildingId());
recordEntity.setOldBuildingName(result1.getBuildingDTO().getBuildingName());
recordEntity.setNewBuildingName(result2.getBuildingDTO().getBuildingName());
recordEntity.setOldBuildingUnitId(resiUserDTO.getUnitId());
recordEntity.setNewBuildingUnitId(formDTO.getNewBuildingUnitId());
recordEntity.setOldBuildingUnitName(result1.getBuildingUnitDTO().getUnitName());
recordEntity.setNewBuildingUnitName(result2.getBuildingUnitDTO().getUnitName());
recordEntity.setOldHouseId(resiUserDTO.getHomeId());
recordEntity.setNewHouseId(formDTO.getNewHouseId());
recordEntity.setOldHouseName(result1.getHouseDTO().getHouseName());
recordEntity.setNewHouseName(result2.getHouseDTO().getHouseName());
recordEntity.setTransferTime(formDTO.getTransferTime());
recordEntity.setRemark(formDTO.getRemark());
return recordEntity;
}
/**
* @Author sun
* @Description 变更明细
**/
private List<IcUserChangeDetailedEntity> saveChangeDetailed(List<IcResiCategoryWarnConfigDTO> configList, Map<String, String> map, String icUserChangeRecordId, IcResiUserTransferFormDTO formDTO, IcResiUserDTO resiUserDTO) {
List<IcUserChangeDetailedEntity> list = new ArrayList<>();
IcUserChangeDetailedEntity outEntity = null;
IcUserChangeDetailedEntity inEntity = null;
for (IcResiCategoryWarnConfigDTO cf : configList) {
if ("1".equals(map.get(cf.getColumnName()))) {
//迁出
outEntity = new IcUserChangeDetailedEntity();
outEntity.setCustomerId(formDTO.getCustomerId());
outEntity.setIcUserChangeRecordId(icUserChangeRecordId);
outEntity.setAgencyId(resiUserDTO.getAgencyId());
outEntity.setGridId(resiUserDTO.getGridId());
outEntity.setNeighborHoodId(resiUserDTO.getVillageId());
outEntity.setBuildingId(resiUserDTO.getBuildId());
outEntity.setBuildingUnitId(resiUserDTO.getUnitId());
outEntity.setHouseId(resiUserDTO.getHomeId());
outEntity.setIcUserId(formDTO.getIcUserId());
outEntity.setType("out");
outEntity.setTypeName("迁出");
outEntity.setFieldName(cf.getColumnName());
outEntity.setValue(-1);
list.add(outEntity);
//迁入
if ("in".equals(formDTO.getType())) {
inEntity = new IcUserChangeDetailedEntity();
inEntity.setCustomerId(formDTO.getCustomerId());
inEntity.setIcUserChangeRecordId(icUserChangeRecordId);
inEntity.setAgencyId(formDTO.getNewAgencyId());
inEntity.setGridId(formDTO.getNewGridId());
inEntity.setNeighborHoodId(formDTO.getNewNeighborHoodId());
inEntity.setBuildingId(formDTO.getNewBuildingId());
inEntity.setBuildingUnitId(formDTO.getNewBuildingUnitId());
inEntity.setHouseId(formDTO.getNewHouseId());
inEntity.setIcUserId(formDTO.getIcUserId());
inEntity.setType("in");
inEntity.setTypeName("迁入");
inEntity.setFieldName(cf.getColumnName());
inEntity.setValue(1);
list.add(inEntity);
}
}
}
return list;
}
}

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

@ -51,13 +51,6 @@
<if test="resultTableName != null and resultTableName != ''">
AND ${resultTableName}.ID IS NOT NULL
</if>
<if test="keyword != null and keyword != ''">
AND (
NAME = #{keyword}
or MOBILE = #{keyword}
or ID_CARD = #{keyword}
)
</if>
and ic_resi_user.customer_id=#{customerId}
and (ic_resi_user.AGENCY_ID =#{currentStaffAgencyId} or ic_resi_user.pids like concat(#{staffOrgPath},'%'))
<if test="null != conditions and conditions.size() > 0">
@ -129,6 +122,13 @@
</if>
<where>
<include refid="listWhereForPage"></include>
<if test="keyword != null and keyword != ''">
AND (
NAME = #{keyword}
or MOBILE = #{keyword}
or ID_CARD = #{keyword}
)
</if>
</where>
group by IC_RESI_USER.id
order by ic_resi_user.CREATED_TIME desc
@ -513,4 +513,32 @@
#{userId}
</foreach>
</select>
<select id="getCategoryListMap" resultType="java.util.Map">
SELECT
IFNULL(is_kc,'0') IS_KC,
IFNULL(is_cj,'0') IS_CJ,
IFNULL(is_ylfn,'0') IS_YLFN,
IFNULL(is_sn,'0') IS_SN,
IFNULL(is_special,'0') IS_SPECIAL,
IFNULL(is_volunteer,'0') IS_VOLUNTEER,
IFNULL(is_unemployed,'0') IS_UNEMPLOYED,
IFNULL(is_mb,'0') IS_MB,
IFNULL(is_sz,'0') IS_SZ,
IFNULL(is_sd,'0') IS_SD,
IFNULL(is_veterans,'0') IS_VETERANS,
IFNULL(is_ensure_house,'0') IS_ENSURE_HOUSE,
IFNULL(is_party,'0') IS_PARTY,
IFNULL(is_old_people,'0') IS_OLD_PEOPLE,
IFNULL(is_xfry,'0')IS_XFRY,
IFNULL(is_united_front,'0') IS_UNITED_FRONT,
IFNULL(is_db,'0') IS_DB,
IFNULL(is_dbh,'0') IS_DBH
FROM
ic_resi_user
WHERE
del_flag = '0'
AND id = #{icUserId}
</select>
</mapper>

16
epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml

@ -131,4 +131,20 @@
and AGENCY_ID = #{icStatsResiWarn.agencyId} and GRID_ID =#{icStatsResiWarn.gridId} and VILLAGE_ID=#{icStatsResiWarn.neighborHoodId} and BUILD_ID=#{icStatsResiWarn.buildingId}
group by AGENCY_ID,GRID_ID,VILLAGE_ID,BUILD_ID
</select>
<!-- 查询分类下的人数 -->
<select id="selectCategoryCount" resultType="com.epmet.dto.PersonWarnLeftPieDTO">
SELECT
CONFIG_ID,
COUNT(COUNT) AS count
FROM ic_stats_resi_warn
WHERE DEL_FLAG = '0'
AND CONCAT(AGENCY_PIDS,':',AGENCY_ID) LIKE CONCAT('%',#{agencyId},'%')
AND CONFIG_ID IN (
<foreach collection="configIds" item="c" separator=",">
#{c}
</foreach>
)
GROUP BY CONFIG_ID
</select>
</mapper>

22
epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml

@ -3,5 +3,27 @@
<mapper namespace="com.epmet.dao.IcUserChangeRecordDao">
<select id="getList" resultType="com.epmet.dto.IcUserChangeRecordDTO">
SELECT
id,
ic_user_transfer_record_id,
customer_id,
operator_id,
ic_user_id,
operator_name,
ic_user_name,
type,
type_name,
before_change_name,
after_change_name,
change_time,
remark
FROM
ic_user_change_record
WHERE
del_flag = '0'
AND ic_user_id = #{icUserId}
ORDER BY change_time DESC, type ASC
</select>
</mapper>
Loading…
Cancel
Save