diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java index 386e162c02..deaa719859 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java +++ b/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 staffOrgs = govLoginService.getMyOrgByPassword(formDTO); return new Result>().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 m = new HashMap<>(); + m.put("userId", userId); + return new Result().ok(m); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/BcStaffAuthenticationFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/BcStaffAuthenticationFormDTO.java new file mode 100644 index 0000000000..202f8073c9 --- /dev/null +++ b/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; +} diff --git a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java index ea6329ceda..2a493fd54c 100644 --- a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java @@ -76,4 +76,12 @@ public interface GovLoginService { * @Date 2020/6/30 22:43 **/ List getMyOrgByPassword(StaffOrgsFormDTO formDTO); + + /** + * 区块链系统通过用户密码认证身份 + * @param mobile + * @param password + * @return + */ + String blockChainStaffAuthenticationByPwd(String customerId, String mobile, String password); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index 86569434c2..8a36124e4d 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/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(); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java new file mode 100644 index 0000000000..7ffdda964f --- /dev/null +++ b/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; + } +} diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 35b4f1802b..bf6d9f270e 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/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获取网格员 网格长 # 对外开放接口认证白名单 diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffInfoResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffInfoResultDTO.java deleted file mode 100644 index c59ac45da9..0000000000 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffInfoResultDTO.java +++ /dev/null @@ -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; - - - -} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java index e40441101d..657b37bb14 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java +++ b/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 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java new file mode 100644 index 0000000000..1c7080f4a7 --- /dev/null +++ b/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; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java new file mode 100644 index 0000000000..181074d3b9 --- /dev/null +++ b/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; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java new file mode 100644 index 0000000000..bacdc786f6 --- /dev/null +++ b/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; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java new file mode 100644 index 0000000000..b9c2c1e787 --- /dev/null +++ b/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; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java new file mode 100644 index 0000000000..52efbfa253 --- /dev/null +++ b/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 page; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java new file mode 100644 index 0000000000..42dc75a6c1 --- /dev/null +++ b/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> page(@RequestParam CompletionFormDTO formDTO){ + PageData page = icPartyUnitCompletionService.page(formDTO); + return new Result>().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(); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index e3e9cde3b8..1d14501080 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/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 pointRecordList(@LoginUser TokenDto tokenDto, @RequestBody PointRecordFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + PointRecordResultDTO result = icUserDemandRecService.pointRecordList(formDTO); + return new Result().ok(result); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java new file mode 100644 index 0000000000..d99bd42168 --- /dev/null +++ b/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 { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index 27eaa8c689..60b437ceb5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/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 { @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 getPointRecordList(PointRecordFormDTO formDTO); + + int getTotalPoint(PointRecordFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java new file mode 100644 index 0000000000..ea4a22feb4 --- /dev/null +++ b/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; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java new file mode 100644 index 0000000000..730da2c6ea --- /dev/null +++ b/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 { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2022-01-17 + */ + PageData 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); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index 336cd21999..6497e96139 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/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 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); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java new file mode 100644 index 0000000000..ebfd7fd8c5 --- /dev/null +++ b/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 implements IcPartyUnitCompletionService { + + @Resource + private IcPartyUnitService icPartyUnitService; + + @Override + public PageData page(CompletionFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getUnitId())) { + return new PageData<>(Collections.emptyList(), NumConstant.ZERO); + } + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitCompletionEntity::getUnitId, formDTO.getUnitId()); + wrapper.orderByDesc(IcPartyUnitCompletionEntity::getCreatedTime); + List list = baseDao.selectList(wrapper); + PageInfo pageInfo = new PageInfo<>(list); + List 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); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index f7034a63ee..4bf7846cd0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/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(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 list = baseDao.getPointRecordList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + //查询分类名称 + List categoryCodes = list.stream().map(PointRecordDTO::getCategoryCode).collect(Collectors.toList()); + List dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes); + Map 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; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql new file mode 100644 index 0000000000..7493e63f53 --- /dev/null +++ b/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 ='联建单位完成情况'; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml new file mode 100644 index 0000000000..2dd26ab7a2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index b59fa44be5..eb1260f58b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -572,4 +572,50 @@ UPDATED_TIME=NOW() where id=#{demandRecId} + + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java index f03b2a2cf0..d4e5f13356 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java +++ b/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; } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/PackageAddOftenUseFunctionFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/PackageAddOftenUseFunctionFormDTO.java new file mode 100644 index 0000000000..f34c326b3d --- /dev/null +++ b/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 list; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java index 07f036e90a..6d89deab21 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java +++ b/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 formDTOS, @LoginUser TokenDto tokenDto){ + PackageAddOftenUseFunctionFormDTO fo = new PackageAddOftenUseFunctionFormDTO(formDTOS); + ValidatorUtils.validateEntity(fo, PackageAddOftenUseFunctionFormDTO.PackageAddOftenUseFunctionForm.class); icOftenUseFunctionService.addOftenUseFunction(formDTOS, tokenDto); return new Result(); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcResiUserOrgMsgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcResiUserOrgMsgFormDTO.java new file mode 100644 index 0000000000..28338a15a4 --- /dev/null +++ b/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; + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcResiUserOrgMsgResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcResiUserOrgMsgResultDTO.java new file mode 100644 index 0000000000..cefb9eed05 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 8bd74a2c52..ec5ea812f8 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/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 icResiUserOrgMsg(@RequestBody IcResiUserOrgMsgFormDTO formDTO); + @PostMapping("/gov/org/customergrid/getstaffgridlist") Result> getStaffGridList(@RequestParam("orgId")String orgId, @RequestParam("orgType")String orgType); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 9aeea0c92b..797f257bac 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/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 icResiUserOrgMsg(IcResiUserOrgMsgFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "icResiUserOrgMsg", formDTO); + } + + @Override public Result> getStaffGridList(String orgId, String orgType) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridList", orgId, orgType); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index d826060c2d..db2a0eec32 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/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 icResiUserOrgMsg(@RequestBody IcResiUserOrgMsgFormDTO formDTO) { + return new Result().ok(customerAgencyService.icResiUserOrgMsg(formDTO)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 3e7406594e..3e4f44cd36 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -276,4 +276,11 @@ public interface CustomerAgencyService extends BaseService * @return */ void configCustomerAreaCode(CustomerAreaCodeFormDTO formDTO); + + /** + * @Author sun + * @Description 查询组织、网格、小区、楼栋、单元、房屋信息 + **/ + IcResiUserOrgMsgResultDTO icResiUserOrgMsg(IcResiUserOrgMsgFormDTO formDTO); + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 0cb99364a8..372aafa390 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/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 list; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerCategoryShowAndWarnListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerCategoryShowAndWarnListResultDTO.java new file mode 100644 index 0000000000..237966afc3 --- /dev/null +++ b/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; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index 9cda858533..8cdf6e39de 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/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> resiCategoryWarnList(@RequestParam String customerId); + /** + * @Description 获取客户下人员分类配置显示的,预警配置的 + * @param customerId + * @author zxc + * @date 2022/1/18 10:07 上午 + */ + @PostMapping("/oper/customize/resicategorystatsconfig/getcustomercategoryshowandwarnlist") + Result> getCustomerCategoryShowAndWarnList(@RequestParam("customerId")String customerId); + @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarninfobyid") Result resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto); @@ -129,4 +138,11 @@ public interface OperCustomizeOpenFeignClient { @PostMapping("/oper/customize/icformitemoptions/list-by-item-conditions") Result> listOptionsByItemConditions(@RequestBody IcFormOptionsQueryFormDTO input); + /** + * @author sun + * @Description 获取客户居民类别预警配置表数据 + */ + @PostMapping("/oper/customize/icresicategorywarnconfig/categorywarnconfiglist/{customerId}") + Result> categoryWarnConfigList(@PathVariable String customerId); + } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index da282124bb..fde2def25e 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/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> getCustomerCategoryShowAndWarnList(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerCategoryShowAndWarnList",customerId); + } + + @Override public Result resiCategoryWarnInfoById(IcResiCategoryWarnConfigDTO dto) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnInfoById",dto); } @@ -109,4 +114,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe public Result> listOptionsByItemConditions(IcFormOptionsQueryFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listOptionsByItemConditions", input); } + + @Override + public Result> categoryWarnConfigList(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "categoryWarnConfigList", customerId); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java index cd3122cd47..5a902c2c99 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java +++ b/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 formDTOS,@LoginUser TokenDto tokenDto){ + PackageEditIndividualCategoryFormDTO formDTO = new PackageEditIndividualCategoryFormDTO(formDTOS); + ValidatorUtils.validateEntity(formDTO,PackageEditIndividualCategoryFormDTO.PackageEditIndividualCategoryForm.class); icIndividualCategoryManageService.editIndividualCategory(formDTOS,tokenDto); return new Result(); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java index 5e1ac6667b..004912ec40 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java +++ b/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> categoryWarnConfigList(@PathVariable String customerId) { + return new Result>().ok(icResiCategoryWarnConfigService.categoryWarnConfigList(customerId)); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java index 99b6299afa..f43e75bf97 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java +++ b/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().ok(ConvertUtils.sourceToTarget(icResiCategoryWarnConfigDao.selectById(dto.getId()),IcResiCategoryWarnConfigDTO.class)); } + /** + * @Description 获取客户下人员分类配置显示的,预警配置的 + * @param customerId + * @author zxc + * @date 2022/1/18 10:07 上午 + */ + @PostMapping("getcustomercategoryshowandwarnlist") + public Result> getCustomerCategoryShowAndWarnList(@RequestParam("customerId")String customerId){ + return new Result>().ok(icResiCategoryStatsConfigService.getCustomerCategoryShowAndWarnList(customerId)); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java index 95fd7c9222..3ba17512ec 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java +++ b/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 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 getCustomerCategoryShowAndWarnList(@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java index aa99453387..f9092491aa 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java +++ b/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 getCategoryList(IcResiCategoryStatsConfigDTO dto); + + /** + * @Description 获取客户下人员分类配置显示的,预警配置的 + * @param customerId + * @author zxc + * @date 2022/1/18 10:07 上午 + */ + List getCustomerCategoryShowAndWarnList(String customerId); + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java index bef9c7360f..adc78df071 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java @@ -92,4 +92,10 @@ public interface IcResiCategoryWarnConfigService extends BaseService categoryWarnConfigList(String customerId); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java index d0183a03f9..d5bfdbd521 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java +++ b/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 getCustomerCategoryShowAndWarnList(String customerId) { + List result = baseDao.getCustomerCategoryShowAndWarnList(customerId); + if (CollectionUtils.isNotEmpty(result)){ + return result; + } + return new ArrayList<>(); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java index 3235b04f0d..9559cf07f0 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java +++ b/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 categoryWarnConfigList(String customerId) { + LambdaQueryWrapper wrapperWarn = new LambdaQueryWrapper<>(); + wrapperWarn.eq(IcResiCategoryWarnConfigEntity::getCustomerId, customerId); + wrapperWarn.orderByAsc(IcResiCategoryWarnConfigEntity::getSort); + List entityList = baseDao.selectList(wrapperWarn); + return ConvertUtils.sourceToTarget(entityList, IcResiCategoryWarnConfigDTO.class); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml index f3afd11c49..2493d1a14c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml @@ -71,5 +71,26 @@ and a.id = #{id} + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java index 62fa0e45cf..72769ea31e 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java +++ b/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.已删除 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java index 2c5203eddd..2220f907f5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java +++ b/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; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java index e9f4e3ff91..5e4818d8f8 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java +++ b/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; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PersonWarnLeftPieDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PersonWarnLeftPieDTO.java new file mode 100644 index 0000000000..d6feeb3c18 --- /dev/null +++ b/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 = ""; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserChangeRecordFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserChangeRecordFormDTO.java new file mode 100644 index 0000000000..9d8167fd86 --- /dev/null +++ b/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; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java new file mode 100644 index 0000000000..7b840a83aa --- /dev/null +++ b/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; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java new file mode 100644 index 0000000000..977390e31a --- /dev/null +++ b/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; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserChangeRecordResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserChangeRecordResultDTO.java new file mode 100644 index 0000000000..872c619cea --- /dev/null +++ b/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 list; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnLeftPieResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnLeftPieResultDTO.java new file mode 100644 index 0000000000..44d714a318 --- /dev/null +++ b/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 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; + } + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java new file mode 100644 index 0000000000..031f0e6c3d --- /dev/null +++ b/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 list; + + public PersonWarnRightListResultDTO() { + this.total = NumConstant.ZERO; + this.list = new ArrayList<>(); + } + + @Data + public static class PersonWarnRightList{ + + /** + * 类型 + */ + private List 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 = ""; + } + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index dd6cf7ef7e..0c573c1049 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -668,4 +668,17 @@ public class IcResiUserController { PageData> r = icResiUserService.pageResiMap(input); return new Result>>().ok(r); } + + /** + * @Description 【社区查询】人员预警右侧列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/1/17 4:25 下午 + */ + @PostMapping("personwarn/rightlist") + public Result personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PersonWarnRightListFormDTO.PersonWarnRightListForm.class); + return new Result().ok(icResiUserService.personWarnRightList(formDTO,tokenDto)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java index f0b9860e45..5b681b639b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java +++ b/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 personWarnLeftPie(@LoginUser TokenDto tokenDto){ + return new Result().ok(icStatsResiWarnService.personWarnLeftPie(tokenDto)); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java index 6da9c5b6cf..fc11027e8f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java +++ b/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 list(@RequestBody IcResiUserChangeRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcResiUserTransferFormDTO.TransferAdd.class); + return new Result().ok(icUserChangeRecordService.list(formDTO)); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java index ead153c8cf..bb45818970 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java +++ b/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(); + } + + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 3a9cffbf7e..db5f3aa613 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -229,4 +229,6 @@ public interface IcResiUserDao extends BaseDao { @Param("code") String code); List listIcResiInfosByUserIds(@Param("userIds") List userIds); + + Map getCategoryListMap(@Param("icUserId") String icUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java index ef9fac802c..aeb0c2ca82 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java +++ b/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 { @Param("columnName") String columnName, @Param("icStatsResiWarn") IcStatsResiWarnEntity icStatsResiWarn); + /** + * @Description 查询分类下的人数 + * @param configIds + * @param agencyId + * @author zxc + * @date 2022/1/17 3:30 下午 + */ + List selectCategoryCount(@Param("configIds") List configIds,@Param("agencyId")String agencyId); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java index f552d6798a..d0079ab6eb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java +++ b/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 { - + + /** + * @Author sun + * @Description 查询居民变更记录 + **/ + List getList(@Param("icUserId") String icUserId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java index f647871525..4a25a479af 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java +++ b/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 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java index e230fbfd2a..35608feae9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java +++ b/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; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java index eaf7226588..82b964d104 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java +++ b/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; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 16d2aaf0d9..dc2c2a76d5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -199,4 +199,14 @@ public interface IcResiUserService extends BaseService { * @return */ IcResiUserDTO get(String icResiUserId); + + /** + * @Description 【社区查询】人员预警右侧列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/1/17 4:25 下午 + */ + PersonWarnRightListResultDTO personWarnRightList(PersonWarnRightListFormDTO formDTO, TokenDto tokenDto); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java index 6a0592adbe..b63f35a59e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java +++ b/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 { + /** + * @Author sun + * @Description 【基础信息】变更记录 + **/ + IcUserChangeRecordResultDTO list(IcResiUserChangeRecordFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java index 5ce1565dcf..4d1d25f952 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java +++ b/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 { + /** + * @Author sun + * @Description 【基础信息】人员调动 + **/ + void add(IcResiUserTransferFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index cfa57f050e..91192dcf42 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/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 getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); @@ -162,9 +169,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl { + String name = ""; + LinkedHashMap map = new LinkedHashMap<>(); + for (IcResiUserFormDTO d : formDTO) { if ("ic_resi_user".equals(d.getTableName())) { - LinkedHashMap 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 { if (!"ic_resi_user".equals(d.getTableName())) { - for (LinkedHashMap 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 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 changeDetailedEntityList = saveChangeRecord(tokenDto, map, resiUserId, changeRecordEntity.getId()); + icUserChangeDetailedService.insertBatch(changeDetailedEntityList); + return resiUserId; } + /** + * @Author sun + * @Description 变更明细表 + **/ + private List saveChangeRecord(TokenDto tokenDto, LinkedHashMap map, String icUserId, String icUserChangeRecordId) { + List list = new ArrayList<>(); + Result> 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", 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 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> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(tokenDto.getCustomerId()); + if (!resultList.success()) { + throw new RuntimeException("居民信息修改,获取客户居民类别预警配置表数据失败"); + } + //修改前数据库居民十八类信息值 + Map hash = icResiUserDao.getCategoryListMap(entity.getId()); + //封装变更记录和变更明细数据 + //变更记录 + IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); + StringBuffer beforeChangeName = new StringBuffer(""); + StringBuffer afterChangeName = new StringBuffer(""); + //变更明细 + List 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 implements IcStatsResiWarnService { @Autowired - private IcStatsResiWarnRedis icStatsResiWarnRedis; + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; @Override public PageData page(Map params) { @@ -101,4 +114,43 @@ public class IcStatsResiWarnServiceImpl extends BaseServiceImpl> listResult = operCustomizeOpenFeignClient.getCustomerCategoryShowAndWarnList(tokenDto.getCustomerId()); + if (!listResult.success()){ + throw new EpmetException("查询设置预警的分类失败..."); + } + PersonWarnLeftPieResultDTO result = new PersonWarnLeftPieResultDTO(); + if (CollectionUtils.isEmpty(listResult.getData())){ + return result; + } + List configList = listResult.getData(); + List 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 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; + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index 92589c9bfc..4b61577545 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/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 implements IcUserChangeRecordService { + /** + * @Author sun + * @Description 【基础信息】变更记录 + **/ + @Override + public IcUserChangeRecordResultDTO list(IcResiUserChangeRecordFormDTO formDTO) { + IcUserChangeRecordResultDTO resultDTO = new IcUserChangeRecordResultDTO(); + PageInfo 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; + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java index 4e06314238..e2616d2842 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java +++ b/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 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 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 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> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(formDTO.getCustomerId()); + if (!resultList.success()) { + throw new RuntimeException("人员调动,获取客户居民类别预警配置表数据失败"); + } + Map map = icResiUserDao.getCategoryListMap(formDTO.getIcUserId()); + List 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 saveChangeDetailed(List configList, Map map, String icUserChangeRecordId, IcResiUserTransferFormDTO formDTO, IcResiUserDTO resiUserDTO) { + List 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; + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 9d07548103..d2cf1d73aa 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -51,13 +51,6 @@ AND ${resultTableName}.ID IS NOT NULL - - AND ( - NAME = #{keyword} - or MOBILE = #{keyword} - or ID_CARD = #{keyword} - ) - and ic_resi_user.customer_id=#{customerId} and (ic_resi_user.AGENCY_ID =#{currentStaffAgencyId} or ic_resi_user.pids like concat(#{staffOrgPath},'%')) @@ -129,6 +122,13 @@ + + AND ( + NAME = #{keyword} + or MOBILE = #{keyword} + or ID_CARD = #{keyword} + ) + group by IC_RESI_USER.id order by ic_resi_user.CREATED_TIME desc @@ -513,4 +513,32 @@ #{userId} + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml index 4a4a2a6cc3..683938f80e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml +++ b/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 + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml index 6632dd653c..7c606296e0 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml @@ -3,5 +3,27 @@ + \ No newline at end of file