diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.12__up_sys_dict_data.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.12__up_sys_dict_data.sql new file mode 100644 index 0000000000..7d93d8bc97 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.12__up_sys_dict_data.sql @@ -0,0 +1,17 @@ + + +UPDATE `epmet_admin`.`sys_dict_data` SET `id` = '1000000000000000220', `dict_label` = '区域化党建单位--楼宇党建' +WHERE (`id` = '1000000000000000200'); +UPDATE `epmet_admin`.`sys_dict_data` SET `id` = '1000000000000000221', `dict_label` = '区域化党建单位--两新组织' +WHERE (`id` = '1000000000000000201'); +UPDATE `epmet_admin`.`sys_dict_data` SET `id` = '1000000000000000222', `dict_label` = '区域化党建单位--区域单位党建' +WHERE (`id` = '1000000000000000202'); +UPDATE `epmet_admin`.`sys_dict_data` SET `id` = '1000000000000000223', `dict_label` = '区域化党建单位--机关直属部门' +WHERE (`id` = '1000000000000000203'); +UPDATE `epmet_admin`.`sys_dict_data` SET `id` = '1000000000000000224', `dict_label` = '区域化党建单位--其他' +WHERE (`id` = '1000000000000000204'); + +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000225', '1000000000000000007', '社会组织--社会团体', '5', '0', '', '5', '0', '0', '', '2022-04-12 14:39:18', '', '2022-04-12 14:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000226', '1000000000000000007', '社会组织--民办非企业单位', '6', '0', '', '6', '0', '0', '', '2022-04-12 14:39:18', '', '2022-04-12 14:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000227', '1000000000000000007', '社会组织--基金会', '7', '0', '', '7', '0', '0', '', '2022-04-12 14:39:18', '', '2022-04-12 14:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000228', '1000000000000000007', '社会组织--其他', '8', '0', '', '8', '0', '0', '', '2022-04-12 14:39:18', '', '2022-04-12 14:39:18'); diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.13__up_sys_dict_data.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.13__up_sys_dict_data.sql new file mode 100644 index 0000000000..8cf8a7e21a --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.13__up_sys_dict_data.sql @@ -0,0 +1,6 @@ +update sys_dict_data set dict_label='联建单位' +where dict_value='party_unit' +and DEL_FLAG='0' +and dict_type_id=( + select st.id from sys_dict_type st where st.dict_type='user_demand_service_type' and st.DEL_FLAG='0' +); \ No newline at end of file diff --git a/epmet-auth-client/pom.xml b/epmet-auth-client/pom.xml index 1aee53c24e..d84ead3ff5 100644 --- a/epmet-auth-client/pom.xml +++ b/epmet-auth-client/pom.xml @@ -11,4 +11,11 @@ epmet-auth-client + + + com.epmet + epmet-commons-tools + 2.0.0 + + \ No newline at end of file diff --git a/epmet-auth-client/src/main/java/com/epmet/auth/dto/result/BlockChainStaffAuthResultDTO.java b/epmet-auth-client/src/main/java/com/epmet/auth/dto/result/BlockChainStaffAuthResultDTO.java new file mode 100644 index 0000000000..2a1ca0dfcc --- /dev/null +++ b/epmet-auth-client/src/main/java/com/epmet/auth/dto/result/BlockChainStaffAuthResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.auth.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ClassName BlockChainStaffAuthResultDTO + * @Description 区块链用户认证结果 + * @Author wangxianzhang + * @Date 2022/1/20 10:41 上午 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class BlockChainStaffAuthResultDTO { + + private String userId; + private String realName; + private String phone; + private String headUrl; + private String agencyId; + private String agencyName; + +} 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..8745418f90 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; /** diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java index 7edc08c1ca..89fb9b183c 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java @@ -1,8 +1,10 @@ package com.epmet.controller; +import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO; import com.epmet.commons.tools.utils.RSASignature; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.BcStaffAuthenticationFormDTO; import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.GovWebService; @@ -14,6 +16,8 @@ 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; + /** * @author sun @@ -65,5 +69,21 @@ public class GovWebController { return new Result().ok(publicKey); } + /** + * 区块链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(); + + BlockChainStaffAuthResultDTO r = govWebService.blockChainStaffAuthenticationByPwd(customerId, mobile, password); + + return new Result().ok(r); + } } 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/GovWebService.java b/epmet-auth/src/main/java/com/epmet/service/GovWebService.java index 30f8d8ae4c..10d86c20b4 100644 --- a/epmet-auth/src/main/java/com/epmet/service/GovWebService.java +++ b/epmet-auth/src/main/java/com/epmet/service/GovWebService.java @@ -1,5 +1,6 @@ package com.epmet.service; +import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO; import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.result.UserTokenResultDTO; @@ -16,4 +17,12 @@ public interface GovWebService { * @Description PC工作端-工作人员登录 **/ UserTokenResultDTO login(GovWebLoginFormDTO formDTO); + + /** + * 区块链系统通过用户密码认证身份 + * @param mobile + * @param password + * @return + */ + BlockChainStaffAuthResultDTO 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..8d78665550 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 diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 9d455af694..d6edfb8657 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -1,13 +1,21 @@ package com.epmet.service.impl; +import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO; import com.epmet.common.token.constant.LoginConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.form.GovWebOperLoginFormDTO; import com.epmet.dto.result.GovWebOperLoginResultDTO; @@ -32,7 +40,7 @@ import java.util.Map; */ @Slf4j @Service -public class GovWebServiceImpl implements GovWebService { +public class GovWebServiceImpl implements GovWebService, ResultDataResolver { private static final Logger logger = LoggerFactory.getLogger(GovWebServiceImpl.class); @Autowired @@ -131,5 +139,36 @@ public class GovWebServiceImpl implements GovWebService { return token; } + @Override + public BlockChainStaffAuthResultDTO 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)); + } + + // 用户基础信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staff.getUserId()); + + BlockChainStaffAuthResultDTO r = new BlockChainStaffAuthResultDTO(staff.getUserId(), staffInfo.getRealName(), + staffInfo.getMobile(), staffInfo.getHeadPhoto(), staffInfo.getAgencyId(), staffInfo.getAgencyName()); + + return r; + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java index 6d7aee6009..27807a6d9a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java @@ -7,11 +7,16 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; */ public enum PartyUnitTypeEnum { //房屋类型,1楼房,2平房,3别墅 - LOUYU("0", "楼宇党建"), - ZUZHI("1", "两新组织"), - DANWEI("2", "区域单位党建"), - JIGUAN("3", "机关直属部门"), - QITA("4", "其他"); + LOUYU("0", "区域化党建单位--楼宇党建"), + ZUZHI("1", "区域化党建单位--两新组织"), + DANWEI("2", "区域化党建单位--区域单位党建"), + JIGUAN("3", "区域化党建单位--机关直属部门"), + QITA("4", "区域化党建单位--其他"), + SHZZ_SHTT("5", "社会组织--社会团体"), + SHZZ_MBFQYDW("6", "社会组织--民办非企业单位"), + SHZZ_JJH("7", "社会组织--基金会"), + SHZZ_QT("8", "社会组织--其他"); + private String code; private String name; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java index cb7146138d..abcc6fc90b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java @@ -5,7 +5,6 @@ import com.epmet.commons.tools.feign.fallback.CommonAggFeignClientFallBackFactor import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; -import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.Result; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; @@ -39,15 +38,6 @@ public interface CommonAggFeignClient { @PostMapping("/data/aggregator/org/agency") Result getAgencyInfo(@RequestParam("agencyId")String agencyId); - /** - * @Description 查询网格信息 - * @param gridId - * @author zxc - * @date 2021/11/5 2:54 下午 - */ - @PostMapping("/data/aggregator/org/grid") - Result getGridInfo(@RequestParam("gridId")String gridId); - /** * 查询楼栋信息 * @param buildingId diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java index 8d6f5f1260..4aff62f235 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java @@ -5,7 +5,6 @@ import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; -import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import org.springframework.stereotype.Component; @@ -29,11 +28,6 @@ public class CommonAggFeignClientFallback implements CommonAggFeignClient { return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getAgencyInfo", agencyId); } - @Override - public Result getGridInfo(String gridId) { - return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getGridInfo", gridId); - } - /** * 查询楼栋信息 * diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java index 684440db65..c9e908d7da 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java @@ -4,6 +4,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** * @Author zxc @@ -59,6 +60,11 @@ public class AgencyInfoCache implements Serializable { */ private String areaCode; + /** + * 地区编码全路径:例如:37,3702,370203,370203005,370203005015 + */ + private List areaCodePath; + /** * 删除标识 */ @@ -139,4 +145,26 @@ public class AgencyInfoCache implements Serializable { * 中心位置纬度 */ private String latitude; + + /** + * 组织编码 + */ + private String code; + + /** + * 负责人姓名 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; + + + //内部接口使用 + /** + * open:当前客户新增组织需要选择areaCode;closed: 无需选择区域编码 + */ + private String areaCodeSwitch; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java index 70c25c839c..1880541692 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java @@ -21,6 +21,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -172,4 +173,9 @@ public class CustomerAgencyDTO implements Serializable { * 联系电话 */ private String mobile; + + /** + * 地区编码全路径:例如:37,3702,370203,370203005,370203005015 + */ + private List areaCodePath; } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java index 717e2370b9..1e560103fa 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java @@ -21,10 +21,10 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.beans.GridMemberDataAnalysisExcelExportBean; +import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.form.*; import com.epmet.dataaggre.dto.govorg.result.*; -import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums; import com.epmet.dataaggre.service.AggreGridService; import com.epmet.dataaggre.service.govorg.GovOrgService; @@ -242,8 +242,8 @@ public class GovOrgController { * @date 2021/11/5 2:54 下午 */ @PostMapping("agency") - public Result getAgencyInfo(@RequestParam("agencyId")String agencyId){ - return new Result().ok(govOrgService.getAgencyInfo(agencyId)); + public Result getAgencyInfo(@RequestParam("agencyId")String agencyId){ + return new Result().ok(govOrgService.getAgencyInfo(agencyId)); } /** @@ -305,7 +305,7 @@ public class GovOrgController { CustomerGridDTO gridInfo = govOrgService.getGridInfo(orgId); Optional.ofNullable(gridInfo).ifPresent((g) -> orgName.set(g.getGridName())); } else if ("agency".equals(orgType)) { - CustomerAgencyEntity agencyInfo = govOrgService.getAgencyInfo(orgId); + CustomerAgencyDTO agencyInfo = govOrgService.getAgencyInfo(orgId); Optional.ofNullable(agencyInfo).ifPresent((a) -> orgName.set(a.getOrganizationName())); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java index c9ebd4bf8d..076b7af7bd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java @@ -105,4 +105,5 @@ public interface CustomerAgencyDao extends BaseDao { * @author sun */ LinkedList subAgencyListAndGridSumNum(@Param("agencyId") String agencyId); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 53c1f3200c..6b5d2d0ed4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -8,7 +8,6 @@ import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.form.*; import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; -import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import javax.servlet.http.HttpServletResponse; import java.util.List; @@ -162,7 +161,7 @@ public interface GovOrgService { * @author zxc * @date 2021/11/5 2:54 下午 */ - CustomerAgencyEntity getAgencyInfo(String agencyId); + CustomerAgencyDTO getAgencyInfo(String agencyId); /** * @Description 查询网格信息 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index 4d1b356fd3..5dc796e562 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import com.alibaba.fastjson.JSON; import com.dingtalk.api.request.OapiRobotSendRequest; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.DingDingRobotConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -23,6 +24,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.constant.DataSourceConstant; @@ -96,10 +98,10 @@ public class GovOrgServiceImpl implements GovOrgService { @Autowired private OssFeignClient ossFeignClient; @Autowired - private EvaluationIndexService evaluationIndexService; - @Autowired private IcBuildingDao icBuildingDao; @Autowired + private EvaluationIndexService evaluationIndexService; + @Autowired private RedisUtils redisUtils; @Autowired private ExecutorService executorService; @@ -250,41 +252,6 @@ public class GovOrgServiceImpl implements GovOrgService { return result; } - public static void main(String[] args) { - List allList = new ArrayList<>(); - NextAreaCodeResultDTO m1 = new NextAreaCodeResultDTO(); - m1.setAreaCode("1"); - m1.setAreaName("a"); - allList.add(m1); - - NextAreaCodeResultDTO m2 = new NextAreaCodeResultDTO(); - m2.setAreaCode("2"); - m2.setAreaName("b"); - allList.add(m2); - - - NextAreaCodeResultDTO m3 = new NextAreaCodeResultDTO(); - m3.setAreaCode("3"); - m3.setAreaName("c"); - allList.add(m3); - - List stringList = new ArrayList<>(); - stringList.add("1"); - stringList.add("2"); - - Iterator iterator = allList.iterator(); - while (iterator.hasNext()) { - NextAreaCodeResultDTO next = iterator.next(); - for (String usedAreaCode : stringList) { - if (next.getAreaCode().equals(usedAreaCode)) { - iterator.remove(); - } - } - - } - System.out.println(JSON.toJSONString(allList, true)); - } - /** * @param staffId * @Author sun @@ -642,8 +609,46 @@ public class GovOrgServiceImpl implements GovOrgService { * @date 2021/11/5 2:54 下午 */ @Override - public CustomerAgencyEntity getAgencyInfo(String agencyId) { - return customerAgencyDao.selectById(agencyId); + public CustomerAgencyDTO getAgencyInfo(String agencyId) { + CustomerAgencyEntity customerAgencyEntity=customerAgencyDao.selectById(agencyId); + CustomerAgencyDTO res= ConvertUtils.sourceToTarget(customerAgencyEntity,CustomerAgencyDTO.class); + //设置行政地区编码全路径 + if (StringUtils.isNotBlank(res.getAreaCode()) && StringUtils.isNotBlank(res.getParentAreaCode())) { + res.setAreaCodePath(queryAreaCodePath(res)); + } + return res; + } + + private List queryAreaCodePath(CustomerAgencyDTO customerAgencyEntity) { + List areaCodePath = new ArrayList<>(); + switch (customerAgencyEntity.getLevel()) { + case Constant.COMMUNITY: + areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO)); + areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.FOUR)); + areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.SIX)); + areaCodePath.add(customerAgencyEntity.getParentAreaCode()); + areaCodePath.add(customerAgencyEntity.getAreaCode()); + break; + case Constant.STREET: + areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO)); + areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.FOUR)); + areaCodePath.add(customerAgencyEntity.getParentAreaCode()); + areaCodePath.add(customerAgencyEntity.getAreaCode()); + break; + case Constant.DISTRICT: + areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO)); + areaCodePath.add(customerAgencyEntity.getParentAreaCode()); + areaCodePath.add(customerAgencyEntity.getAreaCode()); + break; + case Constant.CITY: + areaCodePath.add(customerAgencyEntity.getParentAreaCode()); + areaCodePath.add(customerAgencyEntity.getAreaCode()); + break; + case Constant.PROVINCE: + areaCodePath.add(customerAgencyEntity.getAreaCode()); + break; + } + return areaCodePath; } /** diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java index 3c4ea9f65c..ed8b7928dc 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java index 972d686151..d9804c5b1c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java @@ -8,10 +8,10 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.dto.epmetuser.result.StaffPatrolRecordDailyResultDTO; +import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity; -import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.service.AggreGridService; import com.epmet.dataaggre.service.datastats.DataStatsService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; @@ -22,7 +22,6 @@ import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import sun.rmi.runtime.Log; import java.util.*; @@ -173,7 +172,7 @@ public class AggreGridServiceImpl implements AggreGridService { * @return */ private String getPidsByAgencyId(String agencyId) { - CustomerAgencyEntity agencyInfo = govOrgService.getAgencyInfo(agencyId); + CustomerAgencyDTO agencyInfo = govOrgService.getAgencyInfo(agencyId); if (agencyInfo == null) { String errorMsg = "【网格员数据统计查询pcwork】查询组织信息返回为null"; diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 2851c5a835..add7341a75 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -163,6 +163,7 @@ WHERE u.del_flag = '0' AND PARTY_FLAG = 0 + AND u.point_total > 0 AND u.all_parent_ids LIKE CONCAT('%',#{orgId},'%') @@ -207,6 +208,7 @@ WHERE u.del_flag = '0' AND party_flag = '1' + and u.point_total > 0 AND u.all_parent_ids LIKE CONCAT('%',#{orgId},'%') diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml index eca90f2415..324edf5f0f 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml @@ -84,7 +84,6 @@ area_code_child ac WHERE ac.DEL_FLAG = '0' - AND ac.USER_DEFINED = '0' AND ac.p_code=#{pCode} @@ -101,7 +100,6 @@ area_code_child ac WHERE ac.DEL_FLAG = '0' - AND ac.USER_DEFINED = '0' AND ac.p_code=#{pCode} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java index 6be34cb9b8..52338da6e9 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java @@ -133,4 +133,9 @@ public class IcCommunitySelfOrganizationDTO implements Serializable { */ private Date updatedTime; + /** + * 备注 + */ + private String remark; + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java index bcb04fb6ef..23451a79d7 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java @@ -57,7 +57,8 @@ public class IcPartyActivityDTO implements Serializable { */ @JsonIgnore private String agencyId; - + private String gridId; + private String gridName; /** * 组织的所有上级 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java index e73c466837..d4cc64d386 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java @@ -43,7 +43,7 @@ public class LatestActInfoDTO implements Serializable { * 客户id */ private String customerId; - + private String gridId; /** * 活动标题 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java index 302f3d08a4..2a693143d3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java @@ -56,6 +56,11 @@ public class AddCommunitySelfOrganizationFormDTO implements Serializable { */ private String organizationCreatedTime; + /** + * 备注 + */ + private String remark; + /** * 经度 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java index c70e2a7055..5d634afaa3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java @@ -46,4 +46,6 @@ public class CommunitySelfOrganizationListFormDTO implements Serializable { private String customerId; private String agencyId; private Integer ranking; + + private String remark; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java index cade96113f..68d0176e35 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java @@ -68,6 +68,11 @@ public class EditCommunitySelfOrganizationFormDTO implements Serializable { */ private String latitude; + /** + * 备注 + */ + private String remark; + /** * 社区自组织ID */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java index 1f108568e1..0481b07fc4 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java @@ -19,6 +19,7 @@ public class PartyActivityFormDTO implements Serializable { private static final long serialVersionUID = -2510068555703677L; @NotBlank(message = "组织Id不能为空" ) private String agencyId; + private String gridId; private String unitId; private String title; @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java index a88d1d393f..08c6c8def7 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java @@ -28,7 +28,7 @@ public class DraftActInfoFormDTO implements Serializable { * 活动草稿id,如果是编辑之前的活动草稿,此列是有值的 */ private String actDraftId; - + private String gridId; /** * 如果是重新发布活动,此列是有值的 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java index 099fa38e60..57e0358505 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java @@ -36,7 +36,7 @@ public class PublishActInfoFormDTO implements Serializable { * 活动草稿id,如果是编辑之前的活动草稿,此列是有值的 */ private String actDraftId; - + private String gridId; /** * 客户id */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java index 587a60a0ff..7dfc46329f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java @@ -36,6 +36,8 @@ public class RePublishFormDTO implements Serializable { */ private String actDraftId; + private String gridId; + /** * 活动id */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java index 522da610d1..b7a7627030 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java @@ -53,6 +53,11 @@ public class CommunitySelfOrganizationListDTO implements Serializable { */ private String organizationCreatedTime; + /** + * 备注 + */ + private String remark; + /** * 经度 */ @@ -87,6 +92,7 @@ public class CommunitySelfOrganizationListDTO implements Serializable { this.longitude = ""; this.latitude = ""; this.orgId = ""; + this.remark = ""; this.score = NumConstant.ZERO; this.organizationPersonnel = new ArrayList<>(); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java index caeed480d5..b1856da3b3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java @@ -101,6 +101,9 @@ public class ActPreviewResultDTO implements Serializable { */ private String actType; + private String gridId; + private String gridName; + /** * 联建单位 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java index 764d3ffabf..61f6eae029 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java @@ -153,6 +153,8 @@ public class CanceledActDetailResultDTO implements Serializable { */ private String actType; + private String gridId; + private String gridName; /** * 联建单位 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java index 5bf9c4bfb1..26aa13d4a1 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java @@ -142,6 +142,9 @@ public class FinishedActDetailResultDTO implements Serializable { */ private String actType; + private String gridId; + private String gridName; + /** * 联建单位 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java index 03fdbf576b..f220f19a96 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java @@ -137,6 +137,9 @@ public class InProgressActDetailResultDTO implements Serializable { */ private String actType; + private String gridId; + private String gridName; + /** * 联建单位 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java index 70b4c5754f..e5699f1140 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java @@ -21,6 +21,7 @@ public class LatestDraftActInfoResultDTO implements Serializable { * 活动草稿id */ private String actDraftId; + private String gridId; /** * 客户id */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java index 367ab0ec1d..e4db367ee0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java @@ -154,6 +154,9 @@ public class ReEditActInfoResultDTO implements Serializable { */ private String actType; + private String gridId; + private String gridName; + /** * 联建单位 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index 25cf270549..5c71e7bcf1 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -12,6 +12,7 @@ import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -92,4 +93,14 @@ public interface EpmetHeartOpenFeignClient { */ @PostMapping("/heart/resi/volunteer/modifyVolunteerGrid") Result modifyVolunteerGrid(@RequestBody VolunteerInfoDTO volunteerInfoDTO); + + /** + * 客户初始化数据 + * @Param customerId + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/4/14 14:50 + */ + @GetMapping("/heart/serviceitem/initCustomer/{customerId}") + Result customerInit(@PathVariable(value = "customerId") String customerId); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java index 06bdc642c9..28e1fc50b8 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java @@ -88,4 +88,18 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli public Result modifyVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "modifyVolunteerGrid", volunteerInfoDTO); } + + /** + * 客户初始化数据 + * + * @param customerId + * @Param customerId + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/4/14 14:50 + */ + @Override + public Result customerInit(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "customerInit", customerId); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java index 12b617b6bc..7608069b76 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java @@ -12,13 +12,12 @@ import com.epmet.dto.form.demand.ServiceItemSelectFormDTO; import com.epmet.dto.form.demand.StatusFormDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceItemResultDTO; +import com.epmet.service.IcResiDemandDictService; import com.epmet.service.IcServiceItemDictService; 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; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.List; /** @@ -33,6 +32,8 @@ public class IcServiceItemDictController { @Autowired private IcServiceItemDictService icServiceItemDictService; + @Resource + private IcResiDemandDictService icResiDemandDictService; /** @@ -85,4 +86,18 @@ public class IcServiceItemDictController { ValidatorUtils.validateEntity(formDTO,ServiceItemSelectFormDTO.AddUserInternalGroup.class); return new Result>().ok(icServiceItemDictService.queryDictListForSelect(formDTO)); } + + /** + * 客户初始化数据 + * @Param customerId + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/4/14 14:50 + */ + @GetMapping("initCustomer/{customerId}") + public Result customerInit(@PathVariable(value = "customerId") String customerId) { + icServiceItemDictService.customerInit(customerId); + icResiDemandDictService.customerInit(customerId); + return new Result(); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java index b66e6a0773..fa00ec37e8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java @@ -106,4 +106,9 @@ public class IcCommunitySelfOrganizationEntity extends BaseEpmetEntity { */ private String latitude; + /** + * 备注 + */ + private String remark; + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java index 4919fdd133..da03e372e7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java @@ -47,7 +47,7 @@ public class IcPartyActivityEntity extends BaseEpmetEntity { * 组织ID */ private String agencyId; - + private String gridId; /** * 组织的所有上级 */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java index 491ed210f8..011a57519f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java @@ -43,7 +43,7 @@ public class LatestActInfoEntity extends BaseEpmetEntity { * 客户id */ private String customerId; - + private String gridId; /** * 活动标题 */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java index 1822610552..fdf33d7b48 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java @@ -31,6 +31,9 @@ public class ExportCommunitySelfOrganizationExcel { @Excel(name = "创建时间", width = 20, needMerge = true) private String organizationCreatedTime; + @Excel(name = "备注", width = 60, needMerge = true) + private String remark; + @ExcelCollection(name = "组织成员") private List organizationPersonnel; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java index a6c6102431..25a8f27af9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java @@ -40,6 +40,9 @@ public class ImportCommunitySelfOrganization extends ExcelVerifyInfo { @Excel(name = "创建时间", needMerge = true) private String organizationCreatedTime; + @Excel(name = "备注", needMerge = true) + private String remark; + @ExcelCollection(name = "组织成员") private List persons; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java index ce861497cf..4510a34341 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java @@ -20,7 +20,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.demand.DemandCategoryResDTO; import com.epmet.dto.result.demand.DemandPageResDTO; @@ -147,4 +146,13 @@ public interface IcResiDemandDictService extends BaseService queryLatestOrder(String userId, String customerId); + + /** + * 客户初始化 + * @Param customerId + * @Return + * @Author zhaoqifeng + * @Date 2022/4/14 14:31 + */ + void customerInit(String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java index 4e704aff54..af01c8a4c3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java @@ -70,4 +70,13 @@ public interface IcServiceItemDictService extends BaseService queryDictListForSelect(ServiceItemSelectFormDTO formDTO); + + /** + * 客户初始化 + * @Param customerId + * @Return + * @Author zhaoqifeng + * @Date 2022/4/14 14:31 + */ + void customerInit(String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index b72739dbbc..ce0b172893 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -28,7 +28,9 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; @@ -123,6 +125,12 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA)); List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA)); + if (StringUtils.isNotEmpty(dto.getGridId())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null != gridInfo) { + dto.setGridName(gridInfo.getGridName()); + } + } }); } @@ -150,6 +158,12 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA)); List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA)); + if (StringUtils.isNotEmpty(dto.getGridId())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null != gridInfo) { + dto.setGridName(gridInfo.getGridName()); + } + } }); } @@ -171,6 +185,12 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); dto.setServiceMatterList(services); dto.setServiceMatterNameList(serviceNames); + if (StringUtils.isNotEmpty(dto.getGridId())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null != gridInfo) { + dto.setGridName(gridInfo.getGridName()); + } + } //获取单位 //获取组织下联建单位 @@ -547,6 +567,14 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl services = Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)); List serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); dto.setServiceMatterName(StringUtils.join(serviceNames, StrConstant.SEMICOLON)); + + if (StringUtils.isNotEmpty(dto.getGridId())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null != gridInfo) { + dto.setGridName(gridInfo.getGridName()); + } + } + }); } PageInfo pageInfo = new PageInfo<>(dtoList); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java index c6d0e0946f..5081bfd574 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java @@ -333,5 +333,34 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl(); } + /** + * 客户初始化 + * + * @param customerId + * @Param customerId + * @Return + * @Author zhaoqifeng + * @Date 2022/4/14 14:31 + */ + @Override + public void customerInit(String customerId) { + String defaultCustomerId = "default"; + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiDemandDictEntity::getCustomerId, defaultCustomerId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + String uuid = UUID.randomUUID().toString().replaceAll("-",""); + item.setId(uuid); + item.setCustomerId(customerId); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + baseDao.insert(item); + }); + } + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java index 76e431aa44..3fbda7cd37 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java @@ -42,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.UUID; /** * 服务事项分类字典表 @@ -171,5 +172,34 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcServiceItemDictEntity::getCustomerId, defaultCustomerId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + String uuid = UUID.randomUUID().toString().replaceAll("-",""); + item.setId(uuid); + item.setCustomerId(customerId); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + baseDao.insert(item); + }); + } + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index 846e342657..0b5ee36509 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -67,6 +67,12 @@ 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; +import java.util.Optional; +import java.util.Set; +import java.util.Optional; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java index 1273ffa577..99fda3fbcf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java @@ -2,6 +2,8 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ActConstant; @@ -16,6 +18,7 @@ import com.epmet.dto.result.work.*; import com.epmet.entity.LatestActServiceRelationEntity; import com.epmet.entity.LatestActUnitRelationEntity; import com.epmet.service.*; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -131,29 +134,32 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { //保存活动与服务关系 latestActServiceRelationService.deleteByAct(actDraftId); - AtomicInteger i = new AtomicInteger(NumConstant.ONE); - List serviceList = formDTO.getServiceMatterList().stream().map(service -> { - LatestActServiceRelationEntity entity = new LatestActServiceRelationEntity(); - entity.setCustomerId(formDTO.getCustomerId()); - entity.setActId(actDraftId); - entity.setServiceMatter(service); - entity.setSort(i.getAndIncrement()); - return entity; - }).collect(Collectors.toList()); - latestActServiceRelationService.insertBatch(serviceList); - + if (CollectionUtils.isNotEmpty(formDTO.getServiceMatterList())) { + AtomicInteger i = new AtomicInteger(NumConstant.ONE); + List serviceList = formDTO.getServiceMatterList().stream().map(service -> { + LatestActServiceRelationEntity entity = new LatestActServiceRelationEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setActId(actDraftId); + entity.setServiceMatter(service); + entity.setSort(i.getAndIncrement()); + return entity; + }).collect(Collectors.toList()); + latestActServiceRelationService.insertBatch(serviceList); + } //保存活动与单位关系 latestActUnitRelationService.deleteByAct(actDraftId); - AtomicInteger j = new AtomicInteger(NumConstant.ONE); - List unitList = formDTO.getUnitIdList().stream().map(unitId -> { - LatestActUnitRelationEntity entity = new LatestActUnitRelationEntity(); - entity.setCustomerId(formDTO.getCustomerId()); - entity.setActId(actDraftId); - entity.setUnitId(unitId); - entity.setSort(j.getAndIncrement()); - return entity; - }).collect(Collectors.toList()); - latestActUnitRelationService.insertBatch(unitList); + if (CollectionUtils.isNotEmpty(formDTO.getServiceMatterList())) { + AtomicInteger j = new AtomicInteger(NumConstant.ONE); + List unitList = formDTO.getUnitIdList().stream().map(unitId -> { + LatestActUnitRelationEntity entity = new LatestActUnitRelationEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setActId(actDraftId); + entity.setUnitId(unitId); + entity.setSort(j.getAndIncrement()); + return entity; + }).collect(Collectors.toList()); + latestActUnitRelationService.insertBatch(unitList); + } return resultDTO; } @@ -201,6 +207,13 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); actPreviewResultDTO.setUnitIdList(unitIds); actPreviewResultDTO.setUnitNameList(unitNames); + + if (StringUtils.isNotEmpty(actPreviewResultDTO.getGridId())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(actPreviewResultDTO.getGridId()); + if (null != gridInfo) { + actPreviewResultDTO.setGridName(gridInfo.getGridName()); + } + } } } return actPreviewResultDTO; @@ -337,7 +350,7 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { latestActInfoDTO.setActType(formDTO.getActType()); latestActInfoDTO.setTarget(formDTO.getTarget()); - + latestActInfoDTO.setGridId(formDTO.getGridId()); return latestActInfoDTO; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index 7ab8dc2e52..ee3924bdb5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -9,6 +9,8 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.scan.param.ImgScanParamDTO; import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -832,6 +834,14 @@ public class WorkActServiceImpl implements WorkActService { List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); canceledActDetailResultDTO.setUnitIdList(unitIds); canceledActDetailResultDTO.setUnitNameList(unitNames); + + if (StringUtils.isNotEmpty(dto.getGridId())) { + canceledActDetailResultDTO.setGridId(dto.getGridId()); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null != gridInfo) { + canceledActDetailResultDTO.setGridName(gridInfo.getGridName()); + } + } } } } @@ -897,6 +907,14 @@ public class WorkActServiceImpl implements WorkActService { List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); resultDTO.setUnitIdList(unitIds); resultDTO.setUnitNameList(unitNames); + + if (StringUtils.isNotEmpty(dto.getGridId())) { + resultDTO.setGridId(dto.getGridId()); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null != gridInfo) { + resultDTO.setGridName(gridInfo.getGridName()); + } + } } } } @@ -986,6 +1004,14 @@ public class WorkActServiceImpl implements WorkActService { List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); resultDTO.setUnitIdList(unitIds); resultDTO.setUnitNameList(unitNames); + + if (StringUtils.isNotEmpty(dto.getGridId())) { + resultDTO.setGridId(dto.getGridId()); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null != gridInfo) { + resultDTO.setGridName(gridInfo.getGridName()); + } + } } } } @@ -1390,6 +1416,14 @@ public class WorkActServiceImpl implements WorkActService { List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); resultDTO.setUnitIdList(unitIds); resultDTO.setUnitNameList(unitNames); + + if (StringUtils.isNotEmpty(dto.getGridId())) { + resultDTO.setGridId(dto.getGridId()); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null != gridInfo) { + resultDTO.setGridName(gridInfo.getGridName()); + } + } } } @@ -1563,6 +1597,7 @@ public class WorkActServiceImpl implements WorkActService { }else{ logger.warn("根据agencyId查询组织信息失败,agencyId={}",formDTO.getSponsorId()); } + entity.setGridId(formDTO.getGridId()); entity.setActId(actInfoEntity.getId()); entity.setTitle(actInfoEntity.getTitle()); entity.setTarget(actInfoEntity.getTarget()); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.13__add_column_remark.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.13__add_column_remark.sql new file mode 100644 index 0000000000..9a747fa8a4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.13__add_column_remark.sql @@ -0,0 +1 @@ +alter table ic_community_self_organization add COLUMN REMARK VARCHAR(500) comment '备注' AFTER ORGANIZATION_CREATED_TIME; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.14__activity_add_grid.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.14__activity_add_grid.sql new file mode 100644 index 0000000000..c542430b98 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.14__activity_add_grid.sql @@ -0,0 +1,4 @@ +ALTER TABLE `epmet_heart`.`ic_party_activity` + ADD COLUMN `GRID_ID` varchar(64) NULL COMMENT '网格ID' AFTER `AGENCY_ID`; +ALTER TABLE `epmet_heart`.`latest_act_info` + ADD COLUMN `GRID_ID` varchar(64) NULL COMMENT '网格ID' AFTER `CUSTOMER_ID`; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml index d2575e0af0..0903571a1a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml @@ -14,6 +14,7 @@ LONGITUDE = #{longitude}, LATITUDE = #{latitude}, ORGANIZATION_CREATED_TIME = #{organizationCreatedTime}, + REMARK = #{remark}, UPDATED_TIME = NOW(), UPDATED_BY = #{updatedBy} WHERE DEL_FLAG = 0 @@ -52,7 +53,8 @@ so.SERVICE_ITEM AS serviceItem, so.LONGITUDE AS longitude, so.LATITUDE AS latitude, - so.ID as orgId + so.ID as orgId, + so.remark FROM ic_community_self_organization so WHERE so.DEL_FLAG = 0 AND so.ORG_ID = #{agencyId} @@ -60,6 +62,9 @@ AND so.ORGANIZATION_NAME LIKE CONCAT('%',#{organizationName},'%') + + AND so.REMARK LIKE CONCAT('%',#{remark},'%') + AND so.ORGANIZATION_CREATED_TIME = ]]> #{startTime} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml index 429461fbfb..9bd0824165 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml @@ -49,6 +49,7 @@ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml index 1bcd53d153..7146af82b8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml @@ -102,6 +102,7 @@ - + --> - select a.BUILDING_NAME as buildingName, b.NEIGHBOR_HOOD_NAME as neighborHoodName, @@ -86,30 +86,25 @@ LEFT JOIN ic_neighbor_hood b on a.NEIGHBOR_HOOD_ID = b.ID and b.DEL_FLAG='0' left join customer_agency c on b.AGENCY_ID = c.ID and c.DEL_FLAG='0' - left join customer_grid d on b.GRID_ID = d.ID and d.DEL_FLAG='0' - - AND a.NEIGHBOR_HOOD_ID = #{building.neighborHoodId} + + AND a.NEIGHBOR_HOOD_ID = #{neighborHoodId} - - + AND a.ID in (select distinct BUILDING_ID from ic_house e - - AND e.OWNER_NAME = #{house.ownerName} + + AND e.OWNER_NAME = #{ownerName} - - AND e.OWNER_PHONE = #{house.ownerPhone} + + AND e.OWNER_PHONE = #{ownerPhone} and e.DEL_FLAG='0' ) - - - AND a.DEL_FLAG = #{building.delFlag} - + AND a.DEL_FLAG = '0' order by a.CREATED_TIME, a.BUILDING_NAME diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 0db3dfa93e..ab43322f81 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -70,91 +70,17 @@ ) - - - select a.HOUSE_NAME as houseName, c.NEIGHBOR_HOOD_NAME as neighborHoodName, b.BUILDING_NAME as buildingName, d.UNIT_NUM as unitNum, a.DOOR_NAME as doorName, - if(a.RENT_FLAG=1,'是','否') as rentFlag, + (case when a.RENT_FLAG = '0' then '自住' + when a.RENT_FLAG = '1' then '出租' + when a.RENT_FLAG = '2' then '闲置' + else '' end) as rentFlag, a.OWNER_NAME as ownerName, /*a.RENT_FLAG as rentFlag, a.PURPOSE as purpose,*/ @@ -167,7 +93,7 @@ a.BUILDING_UNIT_ID as unitNumKey, a.HOUSE_TYPE as houseTypeKey, a.PURPOSE as purposeKey, - a.RENT_FLAG as rentFlagKey, + CAST(a.RENT_FLAG AS CHAR) as rentFlagKey, c.AGENCY_ID as agencyId, c.GRID_ID as gridId from ic_house a @@ -175,16 +101,26 @@ LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0' LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID and d.DEL_FLAG = '0' - a.del_flag = '0' + 1 = 1 - and case c.AGENCY_PIDS - when '' then CONCAT(c.AGENCY_ID) like CONCAT(#{pids}, '%') - else CONCAT(c.AGENCY_PIDS, ':', c.AGENCY_ID) like CONCAT(#{pids}, '%') - end + and case c.AGENCY_PIDS when '' then CONCAT(c.AGENCY_ID) like CONCAT(#{pids}, '%') + else CONCAT(c.AGENCY_PIDS, ':', c.AGENCY_ID) like CONCAT(#{pids}, '%') end AND a.BUILDING_ID = #{buildingId} + + AND c.GRID_ID = #{id} + + + AND c.id = #{id} + + + AND b.id = #{id} + + + AND a.RENT_FLAG = #{rentFlag} + AND a.OWNER_NAME like concat('%',#{ownerName},'%') @@ -197,22 +133,17 @@ AND b.BUILDING_NAME like CONCAT('%',#{buildingName},'%') + + AND a.rent_flag = #{rentFlag} + + and a.del_flag = '0' - /*排序规则:如果是社区查询则根据小区、楼栋、单元、房屋名字分别升序排序*/ - - - ORDER BY CONVERT(c.NEIGHBOR_HOOD_NAME using gbk) ASC, - CONVERT(b.BUILDING_NAME USING gbk) ASC, - CONVERT(d.UNIT_NAME USING gbk) ASC, - CONVERT(a.HOUSE_NAME using gbk) ASC - - - ORDER BY CAST(d.UNIT_NUM AS SIGNED), a.DOOR_NAME - - - ORDER BY CAST(d.UNIT_NUM AS SIGNED), a.DOOR_NAME - - + #排序规则:根据小区、楼栋、单元、门牌号(分别按照数字和中文)分别升序排序 + ORDER BY CONVERT(c.NEIGHBOR_HOOD_NAME using gbk), + CONVERT(b.BUILDING_NAME USING gbk), + CONVERT(d.UNIT_NAME USING gbk), + CAST(a.DOOR_NAME AS SIGNED), + CONVERT(a.DOOR_NAME using gbk) - + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index acc02135cf..911fae23fd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -57,54 +57,48 @@ --> - select - a.id as neighborHoodId, - a.NEIGHBOR_HOOD_NAME as neighborHoodName, - b.ORGANIZATION_NAME as agencyName, - c.GRID_NAME as gridName, - a.ADDRESS as address, - a.REMARK as remark, - b.ID as agencyId, - c.ID as gridId, - d.PROPERTY_ID as propertyId , - a.LOCATION as location, - a.LONGITUDE as longitude, - a.LATITUDE as latitude + a.id as neighborHoodId, + a.NEIGHBOR_HOOD_NAME as neighborHoodName, + b.ORGANIZATION_NAME as agencyName, + c.GRID_NAME as gridName, + a.ADDRESS as address, + a.REMARK as remark, + b.ID as agencyId, + c.ID as gridId, + d.PROPERTY_ID as propertyId , + a.LOCATION as location, + a.LONGITUDE as longitude, + a.LATITUDE as latitude from ic_neighbor_hood a - left join customer_agency b on a.AGENCY_ID = b.ID and b.DEL_FLAG='0' - left join customer_grid c on a.GRID_ID = c.ID and c.DEL_FLAG='0' - left join ic_neighbor_hood_property d on a.ID = d.NEIGHBOR_HOOD_ID and d.DEL_FLAG='0' - - AND a.GRID_ID = #{neighbor.gridId} + + AND a.GRID_ID = #{gridId} - - AND (a.AGENCY_ID = #{neighbor.agencyId} or CONCAT(':',a.AGENCY_PIDS, ':') like CONCAT('%:',#{neighbor.agencyId},':%')) + + AND (a.AGENCY_ID = #{agencyId} or CONCAT(':',a.AGENCY_PIDS, ':') like CONCAT('%:',#{agencyId},':%')) - + AND a.ID in (select NEIGHBOR_HOOD_ID from ic_house e - - AND e.OWNER_NAME like concat('%',#{house.ownerName},'%') + + AND e.OWNER_NAME like concat('%',#{ownerName},'%') - - AND e.OWNER_PHONE like concat('%',#{house.ownerPhone},'%') + + AND e.OWNER_PHONE like concat('%',#{ownerPhone},'%') and e.DEL_FLAG='0' ) + AND a.DEL_FLAG = '0' - - - AND a.DEL_FLAG = #{neighbor.delFlag} - ORDER BY a.CREATED_TIME diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java index 18f4d39d4a..d28f2c11a1 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java @@ -134,9 +134,10 @@ public class BlockChainUploadServiceImpl implements BlockChainUploadService { } Result result; - if (project == null) { - // 处理 + if (!"created".equals(processEntity.getOperation())) { + // 处理。如果是结案,则会有project对象,因为要传递结案状态给区块链,其他状态则project==null BlockChainProcessProjectFormDTO processForm = new BlockChainProcessProjectFormDTO(); + processForm.setProject(project); processForm.setProcess(process); processForm.setAssignedStaffs(assignedStaffs); processForm.setHandledStaff(handledStaff); diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 43d965f8a8..a74ee75a3e 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -613,7 +613,7 @@ public class ProjectServiceImpl extends BaseServiceImpl2.0.0 compile + + com.epmet + epmet-heart-client + 2.0.0 + compile + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormListItemDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormListItemDao.java new file mode 100644 index 0000000000..673ff3b2f3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormListItemDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcFormListItemEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 列表展示项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-14 + */ +@Mapper +public interface IcFormListItemDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java index c5c509ea25..9727a6276d 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java @@ -41,7 +41,7 @@ public class IcFormItemEntity extends BaseEpmetEntity { private String customerId; /** - * + * */ private String areaCode; @@ -135,4 +135,14 @@ public class IcFormItemEntity extends BaseEpmetEntity { */ private Integer columnNum; + /** + * 是否为固定列 1动态,0固定 + */ + private Integer dynamic; + + /** + * 是否为多选 1可以多选,0单选 + */ + private Integer multiSelect; + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormListItemEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormListItemEntity.java new file mode 100644 index 0000000000..b5426d37de --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormListItemEntity.java @@ -0,0 +1,46 @@ +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-04-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form_list_item") +public class IcFormListItemEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * ic_form_item.id + */ + private String formItemId; + + /** + * ic_form.form_code,举例:resi_base_info + */ + private String formCode; + + /** + * 表头宽度 + */ + private Integer width; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java index 3d453ea38c..3e88b05f7b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java @@ -24,16 +24,19 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.*; import com.epmet.dto.form.CustomerFormQueryDTO; import com.epmet.dto.result.CustomerFormResultDTO; import com.epmet.dto.result.FormGroupDTO; import com.epmet.dto.result.FormItemResult; import com.epmet.entity.*; +import com.epmet.feign.EpmetHeartOpenFeignClient; import com.epmet.redis.CustomerFootBarRedis; import com.epmet.service.IcFormService; import lombok.extern.slf4j.Slf4j; @@ -43,6 +46,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import javax.annotation.Resource; import java.util.Date; import java.util.List; @@ -72,6 +76,10 @@ public class IcFormServiceImpl extends BaseServiceImpl private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao; @Autowired private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao; + @Resource + private IcFormListItemDao icFormListItemDao; + @Resource + private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; /** * 获取居民信息表单 @@ -131,7 +139,9 @@ public class IcFormServiceImpl extends BaseServiceImpl @Override public String initCustomerFormByCode(String customerId, String areaCode, String formCode) { CustomerFormResultDTO formResultDTO = baseDao.selectByCode(customerId, formCode); + //客户已经存在了表单的数据 if (formResultDTO != null) { + return "该客户已经存在了表单的数据"; } String defaultCustomerId = "default"; @@ -164,7 +174,7 @@ public class IcFormServiceImpl extends BaseServiceImpl if (CollectionUtils.isEmpty(itemList)) { return "默认配置错误"; } - //设置item + //设置ic_form_item itemList.forEach(item -> { item.setId(newPrefixed + item.getId()); item.setCustomerId(customerId); @@ -192,6 +202,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormItemDao.insert(item); }); + //设置ic_form_item_options LambdaQueryWrapper wrapperOptions = new LambdaQueryWrapper<>(); wrapperOptions.eq(IcFormItemOptionsEntity::getCustomerId, defaultCustomerId); wrapperOptions.eq(IcFormItemOptionsEntity::getFormCode, formCode); @@ -209,6 +220,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormItemOptionsDao.insert(item); }); + //设置ic_form_item_group LambdaQueryWrapper wrapperGroup = new LambdaQueryWrapper<>(); wrapperGroup.eq(IcFormItemGroupEntity::getCustomerId, defaultCustomerId); wrapperGroup.eq(IcFormItemGroupEntity::getFormCode, formCode); @@ -225,6 +237,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormItemGroupDao.insert(item); }); + //设置ic_form_query_builder LambdaQueryWrapper wrapperQuery = new LambdaQueryWrapper<>(); wrapperQuery.eq(IcFormQueryBuilderEntity::getCustomerId, defaultCustomerId); wrapperQuery.eq(IcFormQueryBuilderEntity::getFormCode, formCode); @@ -241,6 +254,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormQueryBuilderDao.insert(item); }); + //设置ic_resi_category_stats_config LambdaQueryWrapper wrapperStats = new LambdaQueryWrapper<>(); wrapperStats.eq(IcResiCategoryStatsConfigEntity::getCustomerId, defaultCustomerId); List statsConfigList = icResiCategoryStatsConfigDao.selectList(wrapperStats); @@ -255,6 +269,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icResiCategoryStatsConfigDao.insert(item); }); + //设置ic_resi_category_warn_config LambdaQueryWrapper wrapperWarn = new LambdaQueryWrapper<>(); wrapperWarn.eq(IcResiCategoryWarnConfigEntity::getCustomerId, defaultCustomerId); List warnConfigList = icResiCategoryWarnConfigDao.selectList(wrapperWarn); @@ -269,6 +284,31 @@ public class IcFormServiceImpl extends BaseServiceImpl icResiCategoryWarnConfigDao.insert(item); }); + //设置ic_form_list_item + LambdaQueryWrapper listItemWapper = new LambdaQueryWrapper<>(); + listItemWapper.eq(IcFormListItemEntity::getCustomerId, defaultCustomerId); + listItemWapper.eq(IcFormListItemEntity::getFormCode, formCode); + List listItemList = icFormListItemDao.selectList(listItemWapper); + if (CollectionUtils.isEmpty(listItemList)) { + return "默认配置错误"; + } + listItemList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setFormItemId(newPrefixed + item.getFormItemId()); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("stats:"+ JSON.toJSONString(item)); + icFormListItemDao.insert(item); + }); + + //设置ic_service_item_dict和ic_resi_demand_dict + Result result = epmetHeartOpenFeignClient.customerInit(customerId); + if (!result.success()) { + throw new EpmetException(result.getCode(), result.getMsg()); + } return "初始化成功!客户ID:" + customerId + " formCode:" + formCode; } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormListItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormListItemDao.xml new file mode 100644 index 0000000000..d31304f648 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormListItemDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java index 95ae25cd79..12aff48466 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java @@ -44,6 +44,16 @@ public class IcResiCollectMemFormDTO implements Serializable { // @NotNull(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private Integer ymjz; + /** + * 户籍所在地 + */ + private String domicilePlace; + + /** + * 学校或公司 + */ + private String workPlace; + /** * 社区居民信息登记-查询返参用 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberListFormDTO.java index a6ffad6477..39ce7f3a9d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberListFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -11,7 +12,7 @@ import java.io.Serializable; * @Date 2021/12/10 15:49 */ @Data -public class PartyMemberListFormDTO implements Serializable { +public class PartyMemberListFormDTO extends PageFormDTO implements Serializable { private static final long serialVersionUID = -6085134769034337175L; @NotBlank(message = "组织类型不能为空") @@ -19,6 +20,4 @@ public class PartyMemberListFormDTO implements Serializable { @NotBlank(message = "组织ID不能为空") private String orgId; private String code; - private Integer pageNo = 1; - private Integer pageSize = 20; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SearchByNameFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SearchByNameFormDTO.java index 8f4abca17f..56f7c244c4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SearchByNameFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SearchByNameFormDTO.java @@ -17,7 +17,7 @@ public class SearchByNameFormDTO implements Serializable { private static final long serialVersionUID = -5017695783909884799L; public interface SearchByNameForm{} - + public interface SearchByCategoryForm{} @NotBlank(message = "name不能为空",groups = SearchByNameForm.class) private String name; @@ -27,4 +27,9 @@ public class SearchByNameFormDTO implements Serializable { @NotNull(message = "pageNo不能为空",groups = SearchByNameForm.class) private Integer pageNo; + @NotBlank(message = "columnName不能为空",groups = SearchByCategoryForm.class) + private String columnName; + + private String customerId; + private String userId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java index fc69f5da84..23da9d859b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java @@ -54,6 +54,26 @@ public class VaccinationListFormDTO extends PageFormDTO implements Serializable * 备注,核酸检测关注名单,此字段可填可不填 */ private String remark; + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 单元id + */ + private String unitId; + + /** + * 所属家庭Id + */ + private String homeId; + private String userId; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java index 854d1b3c93..34efe5d146 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java @@ -45,4 +45,15 @@ public class CollectListMemberExcelResultDTO implements Serializable { @Excel(name = "疫苗接种情况",replace = { "全程接种_1", "未全程接种_2", "未接种_0" }, width = 30) private String ymjz; + /** + * 户籍所在地 + */ + @Excel(name = "户籍所在地", width = 60) + private String domicilePlace; + + /** + * 学校或公司 + */ + @Excel(name = "单位或学校", width = 60) + private String workPlace; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java index 1d61469165..2b95eb5e04 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java @@ -69,6 +69,15 @@ public class CollectListResultDTO implements Serializable { */ private Integer ymjz; + /** + * 户籍所在地 + */ + private String domicilePlace; + + /** + * 学校或公司 + */ + private String workPlace; } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.java index 4f670770f3..beacf24482 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.java @@ -40,5 +40,8 @@ public class IcStatsResiResultDTO implements Serializable { private String managementIcon; private String dataIcon; private String houseShowIcon; - + /** + * 列名 + */ + private String columnName; } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SearchByNameResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SearchByNameResultDTO.java index 0451dafaf0..005e645b16 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SearchByNameResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SearchByNameResultDTO.java @@ -55,6 +55,31 @@ public class SearchByNameResultDTO implements Serializable { */ private String userId; + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 备注 + */ + private String remarks; + public SearchByNameResultDTO() { this.sort = NumConstant.ZERO; this.name = ""; @@ -62,5 +87,10 @@ public class SearchByNameResultDTO implements Serializable { this.neighborHoodName = ""; this.buildNum = ""; this.userId = ""; + this.mobile=""; + this.gender=""; + this.idCard=""; + this.birthday=""; + this.remarks=""; } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java index 52c432f810..33416972ae 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java @@ -92,5 +92,8 @@ public class StaffBasicInfoResultDTO implements Serializable { */ private String latitude; - + /** + * 地区编码全路径:例如:37,3702,370203,370203005,370203005015 + */ + private List areaCodePath; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java index a0b10a13d3..a2012686fe 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java @@ -55,6 +55,51 @@ public class VaccinationListResultDTO implements Serializable { */ private String lastInformTime; + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属小区名称 + */ + private String villageName; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 所属楼宇名称 + */ + private String buildName; + + /** + * 单元id + */ + private String unitId; + + /** + * 单元名称 + */ + private String unitName; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 所属家庭名称 + */ + private String homeName; + + /** + * 小区名+楼栋名+单元名+房屋名 + */ + private String allName; + public VaccinationListResultDTO() { this.vaccinationCount = NumConstant.ZERO; this.name = ""; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 415f818abe..d49756dba9 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -1,7 +1,6 @@ package com.epmet.feign; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.security.dto.TokenDto; @@ -25,7 +24,7 @@ import java.util.Set; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:09 */ -// @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087") + // @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087") @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class) public interface EpmetUserOpenFeignClient { diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 154960f1db..7d9ac90396 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -10,7 +10,7 @@ services: - "/opt/epmet-cloud-logs/dev:/logs" - "/opt/epmet_files/:/opt/epmet_files" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx512m -jar ./epmet-user.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-user.jar" restart: "unless-stopped" deploy: resources: 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 f054e77608..5a44547fc8 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 @@ -43,6 +43,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.utils.poi.excel.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.SystemMessageType; import com.epmet.constants.ImportTaskConstants; @@ -50,6 +51,8 @@ import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.enums.IcResiUserTableEnum; +import com.epmet.excel.PartyMemberAgeExportExcel; +import com.epmet.excel.PartyMemberEducationExportExcel; import com.epmet.excel.support.ExportResiUserItemDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; @@ -59,6 +62,7 @@ import com.epmet.service.IcResiUserService; import feign.RequestInterceptor; import jodd.io.FileUtil; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; @@ -85,6 +89,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.*; import java.util.concurrent.ExecutorService; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @@ -394,7 +399,7 @@ public class IcResiUserController implements ResultDataResolver { } /** - * desc:根据客户id 下载模版文件 如果不存在则返回null + * desc:根据客户id 先从oss下载模版,如果有没有则使用系统默认模板 如果不存在则返回null * * @param customerId * @return @@ -532,8 +537,24 @@ public class IcResiUserController implements ResultDataResolver { */ @PostMapping("searchbyname") public Result> searchByName(@RequestBody SearchByNameFormDTO formDTO, @LoginUser TokenDto tokenDto) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, SearchByNameFormDTO.SearchByNameForm.class); - return new Result>().ok(icResiUserService.searchByName(formDTO, tokenDto)); + return new Result>().ok(icResiUserService.searchByName(formDTO)); + } + + /** + * 需求: http://zentao.elinkservice.cn/task-view-4193.html 第11条 + * @param formDTO + * @param tokenDto + * @return 根据分类搜索 + */ + @PostMapping("searchbycategory") + public Result> search(@RequestBody SearchByNameFormDTO formDTO, @LoginUser TokenDto tokenDto) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, SearchByNameFormDTO.SearchByCategoryForm.class); + return new Result>().ok(icResiUserService.searchByName(formDTO)); } @NotNull @@ -640,6 +661,56 @@ public class IcResiUserController implements ResultDataResolver { return new Result>().ok(icResiUserService.getPartyMemberAgeList(formDTO)); } + @NoRepeatSubmit + @PostMapping("partymemberagelist/export") + public void partyMemberAgeListExport(@LoginUser TokenDto tokenDto, @RequestBody PartyMemberListFormDTO formDTO, HttpServletResponse response) { + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + formDTO.setIsPage(false); + List exportList = new ArrayList<>(); + try { + String fileName = ""; + switch (formDTO.getCode()) { + case NumConstant.ZERO_STR: + fileName = "50岁以下党员信息.xlsx"; + break; + case NumConstant.ONE_STR: + fileName = "50-59岁党员信息.xlsx"; + break; + case NumConstant.TWO_STR: + fileName = "60-69岁党员信息.xlsx"; + break; + case NumConstant.THREE_STR: + fileName = "70-79岁党员信息.xlsx"; + break; + case NumConstant.FOUR_STR: + fileName = "80岁以上党员信息.xlsx"; + break; + default: + fileName = "党员年龄信息.xlsx"; + break; + } + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), PartyMemberAgeExportExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("党员列表").registerWriteHandler(new FreezeAndFilter()).build(); + List list = icResiUserService.getPartyMemberAgeList(formDTO).getList(); + AtomicInteger i = new AtomicInteger(1); + if (CollectionUtils.isNotEmpty(list)) { + exportList = list.stream().map(item -> { + PartyMemberAgeExportExcel excel = ConvertUtils.sourceToTarget(item, PartyMemberAgeExportExcel.class); + excel.setIndex(i.getAndIncrement()); + return excel; + }).collect(Collectors.toList()); + } + excelWriter.write(exportList, writeSheet); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + /** * 党员学历统计 * @Param formDTO @@ -666,6 +737,62 @@ public class IcResiUserController implements ResultDataResolver { return new Result>().ok(icResiUserService.getPartyMemberEducationList(formDTO)); } + @NoRepeatSubmit + @PostMapping("partymembereducationlist/export") + public void partyMemberEducationListExport(@LoginUser TokenDto tokenDto, @RequestBody PartyMemberListFormDTO formDTO, HttpServletResponse response) { + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + formDTO.setIsPage(false); + List exportList = new ArrayList<>(); + try { + String fileName = ""; + switch (formDTO.getCode()) { + case NumConstant.ZERO_STR: + fileName = "小学及文盲党员信息.xlsx"; + break; + case NumConstant.ONE_STR: + fileName = "初中学历党员信息.xlsx"; + break; + case NumConstant.TWO_STR: + fileName = "高中学历党员信息.xlsx"; + break; + case NumConstant.THREE_STR: + fileName = "大专学历党员信息.xlsx"; + break; + case NumConstant.FOUR_STR: + fileName = "本科学历党员信息.xlsx"; + break; + case NumConstant.FIVE_STR: + fileName = "硕士学历党员信息.xlsx"; + break; + case NumConstant.SIX_STR: + fileName = "博士学历党员信息.xlsx"; + break; + default: + fileName = "党员学历信息.xlsx"; + break; + } + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), PartyMemberEducationExportExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("党员列表").registerWriteHandler(new FreezeAndFilter()).build(); + List list = icResiUserService.getPartyMemberEducationList(formDTO).getList(); + AtomicInteger i = new AtomicInteger(1); + if (CollectionUtils.isNotEmpty(list)) { + exportList = list.stream().map(item -> { + PartyMemberEducationExportExcel excel = ConvertUtils.sourceToTarget(item, PartyMemberEducationExportExcel.class); + excel.setIndex(i.getAndIncrement()); + return excel; + }).collect(Collectors.toList()); + } + excelWriter.write(exportList, writeSheet); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + /** * 根据居民id查询居民信息简介 * @param resiUserId 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 f5ebf8ac51..0119efa44f 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 @@ -124,7 +124,7 @@ public interface IcResiUserDao extends BaseDao { * @author zxc * @date 2021/11/3 2:05 下午 */ - List searchByName(@Param("name") String name, @Param("agencyId") String agencyId, @Param("pageNo") Integer pageNo); + List searchByName(@Param("name") String name, @Param("columnName") String columnName, @Param("agencyId") String agencyId, @Param("pageNo") Integer pageNo); Set selectUserDemandCode(String icResiUserId); @@ -247,7 +247,7 @@ public interface IcResiUserDao extends BaseDao { List icUserCustomerIds(); - List> getIcUserList(@Param("customerId") String customerId, @Param("columns") List columns); + List> getIcUserList(@Param("customerId") String customerId); /** * desc: 获取数据分析列中的 各类居民数据 @@ -263,6 +263,7 @@ public interface IcResiUserDao extends BaseDao { */ Map getDataAnalyseCount(@Param("customerId") String customerId, @Param("tableName") String tableName, @Param("columnList") List columnList, @Param("id") String id, @Param("level") String level); + List> getIcUserList(@Param("customerId") String customerId, @Param("columns")List columns); /** * Desc: 根据房屋IDs查询房屋下是否有存在居民的 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java index 399ce07822..b93190e5c5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java @@ -53,4 +53,13 @@ public class IcResiMemberEntity extends BaseEpmetEntity { */ private Integer ymjz; + /** + * 户籍所在地 + */ + private String domicilePlace; + + /** + * 学校或公司 + */ + private String workPlace; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java index 0490c50c5c..65bafdd551 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java @@ -36,7 +36,9 @@ public enum IcResiUserTableEnum { IC_SZ("ic_resi_user","失智人员信息录入表", null, 2, "IS_SZ", false), IC_CJ("ic_resi_user","残疾人员信息录入表", null, 2, "IS_CJ", false), IC_DB("ic_resi_user","大病人员信息录入表", null, 2, "IS_DB", false), - IC_MB("ic_resi_user","慢病人员信息录入表", null, 2, "IS_MB", false); + IC_MB("ic_resi_user","慢病人员信息录入表", null, 2, "IS_MB", false), + IC_TENANT("ic_resi_user","租户信息录入表", null, 2, "IS_TENANT", false), + IC_FLOATING("ic_resi_user","流动人口信息录入表", null, 2, "IS_FLOATING", false); private String tableName; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/PartyMemberAgeExportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/PartyMemberAgeExportExcel.java new file mode 100644 index 0000000000..6e0a65afc3 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/PartyMemberAgeExportExcel.java @@ -0,0 +1,31 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.HeadStyle; +import com.alibaba.excel.enums.poi.FillPatternTypeEnum; +import lombok.Data; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/4/13 10:46 + */ +@Data +@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) +public class PartyMemberAgeExportExcel { + @ColumnWidth(8) + @ExcelProperty(value = "序号",order = 1) + private Integer index; + @ColumnWidth(15) + @ExcelProperty(value = "姓名",order = 2) + private String name; + @ColumnWidth(8) + @ExcelProperty(value = "年龄",order = 3) + private String age; + @ColumnWidth(20) + @ExcelProperty(value = "手机号码",order = 4) + @Excel(name = "手机号码", width = 30) + private String mobile; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/PartyMemberEducationExportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/PartyMemberEducationExportExcel.java new file mode 100644 index 0000000000..1a6955ede2 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/PartyMemberEducationExportExcel.java @@ -0,0 +1,31 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.HeadStyle; +import com.alibaba.excel.enums.poi.FillPatternTypeEnum; +import lombok.Data; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/4/13 10:46 + */ +@Data +@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) +public class PartyMemberEducationExportExcel { + @ColumnWidth(8) + @ExcelProperty(value = "序号",order = 1) + private Integer index; + @ColumnWidth(15) + @ExcelProperty(value = "姓名",order = 2) + private String name; + @ColumnWidth(11) + @ExcelProperty(value = "学历",order = 3) + private String education; + @ColumnWidth(20) + @ExcelProperty(value = "手机号码",order = 4) + @Excel(name = "手机号码", width = 30) + private String mobile; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java index 65534756cd..8fe217466f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java @@ -32,4 +32,7 @@ public class VaccinationExportExcel { @Excel(name = "最近一次通知时间",width = 20) private String lastInformTime; + @Excel(name = "所属房屋",width = 40) + private String allName; + } 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 fd3e49415d..8bcebefd92 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 @@ -98,11 +98,10 @@ public interface IcResiUserService extends BaseService { /** * @Description 根据名字搜索 * @param formDTO - * @param tokenDto * @author zxc * @date 2021/11/3 1:42 下午 */ - PageData searchByName(SearchByNameFormDTO formDTO, TokenDto tokenDto); + PageData searchByName(SearchByNameFormDTO formDTO); /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 30203ef9bc..72b43b0506 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -30,7 +30,9 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; @@ -741,6 +743,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl()); } //获取工作人员所属客户名 CustomerDTO dto = new CustomerDTO(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index f27bc46842..94ed60ce9f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcEpidemicSpecialAttentionDao; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.dto.result.VaccinationListResultDTO; import com.epmet.entity.IcEpidemicSpecialAttentionEntity; @@ -30,6 +31,7 @@ import com.epmet.enums.ChannelEnum; import com.epmet.excel.ImportEpidemicSpecialAttention; import com.epmet.excel.error.EpidemicSpecialAttentionErrorModel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OssFeignClient; import com.epmet.service.IcEpidemicSpecialAttentionService; import com.epmet.service.IcNoticeService; @@ -53,6 +55,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -71,6 +74,8 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl page(Map params) { @@ -160,10 +165,28 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl houseInfoMap = new HashMap<>(); + //查询房屋信息 + if (result.getList().size() > NumConstant.ZERO) { + Set houseIds = result.getList().stream().filter(l -> StringUtils.isNotBlank(l.getHomeId())).map(m -> m.getHomeId()).collect(Collectors.toSet()); + Result> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId()); + List houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>(); + houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); + } + int i = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); for (VaccinationListResultDTO v : result.getList()) { i += 1; v.setSort(i); + if (null != houseInfoMap && houseInfoMap.containsKey(v.getHomeId())) { + v.setVillageName(houseInfoMap.get(v.getHomeId()).getNeighborHoodName()); + v.setBuildName(houseInfoMap.get(v.getHomeId()).getBuildingName()); + v.setUnitName(houseInfoMap.get(v.getHomeId()).getUnitName()); + v.setHomeName(houseInfoMap.get(v.getHomeId()).getDoorName()); + v.setAllName(houseInfoMap.get(v.getHomeId()).getAllName()); + } } return result; } 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 7e376b57ec..50f46409a4 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 @@ -835,19 +835,18 @@ public class IcResiUserServiceImpl extends BaseServiceImpl searchByName(SearchByNameFormDTO formDTO, TokenDto tokenDto) { + public PageData searchByName(SearchByNameFormDTO formDTO) { // 查询工作人员所属组织 - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); if (null == staffInfo){ throw new RenException("未查询到当前工作人员所属组织"); } Integer no = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); - PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.searchByName(formDTO.getName(), staffInfo.getAgencyId(), no)); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.searchByName(formDTO.getName(), formDTO.getColumnName(),staffInfo.getAgencyId(), no)); List result = pageInfo.getList(); if (CollectionUtils.isEmpty(result)){ return new PageData<>(new ArrayList<>(), pageInfo.getTotal()); @@ -1298,6 +1297,16 @@ public class IcResiUserServiceImpl extends BaseServiceImpl idCards = list.stream().map(m -> m.getIdCard()).distinct().collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(idCards)){ + Result> housesNameByIdCards = govOrgOpenFeignClient.getHousesNameByIdCards(idCards); + if (!housesNameByIdCards.success()){ + throw new EpmetException("查询居民所属房屋失败..."); + } + if (CollectionUtils.isNotEmpty(housesNameByIdCards.getData())){ + list.forEach(l -> housesNameByIdCards.getData().stream().filter( h -> h.getIdCard().equals(l.getIdCard())).forEach(h -> l.setHouseName(h.getHouseName()))); + } + } PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); } @@ -1474,10 +1483,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getPartyMemberAgeList(PartyMemberListFormDTO formDTO) { - PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + if (formDTO.getIsPage()) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getPartyMemberAgeList(formDTO.getOrgType(), formDTO.getOrgId(), formDTO.getCode()); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } List list = baseDao.getPartyMemberAgeList(formDTO.getOrgType(), formDTO.getOrgId(), formDTO.getCode()); - PageInfo pageInfo = new PageInfo<>(list); - return new PageData<>(list, pageInfo.getTotal()); + return new PageData<>(list, null == list?NumConstant.ZERO:list.size()); } /** @@ -1533,15 +1546,26 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getPartyMemberEducationList(PartyMemberListFormDTO formDTO) { - PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + if (formDTO.getIsPage()) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getPartyMemberEducationList(formDTO.getOrgType(), formDTO.getOrgId(), formDTO.getCode()); + Result> mapResult = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation())); + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } List list = baseDao.getPartyMemberEducationList(formDTO.getOrgType(), formDTO.getOrgId(), formDTO.getCode()); Result> mapResult = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); - PageInfo pageInfo = new PageInfo<>(list); if (CollectionUtils.isNotEmpty(list)) { list.forEach(item -> { item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation())); }); } - return new PageData<>(list, pageInfo.getTotal()); + return new PageData<>(list, null == list?NumConstant.ZERO:list.size()); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java index 3766ee7baa..af4c3c0357 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java @@ -220,6 +220,7 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl orDefault = tableColumnCountMap.getOrDefault(item.getTableName(), new HashMap<>()); diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.40__member_huji.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.40__member_huji.sql new file mode 100644 index 0000000000..be15b0a523 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.40__member_huji.sql @@ -0,0 +1,10 @@ +alter table ic_resi_member add COLUMN DOMICILE_PLACE VARCHAR(128) comment '户籍所在地' AFTER YMJZ; +alter table ic_resi_member add COLUMN WORK_PLACE VARCHAR(128) comment '单位或学校' AFTER DOMICILE_PLACE; + +-- 居民信息表添加租户列 +alter table ic_resi_user add column IS_TENANT char(1) comment '是否租户【是:1 否:0】' after IS_SPECIAL; +update ic_resi_user set ic_resi_user.IS_TENANT='0' where ic_resi_user.IS_TENANT is null or ic_resi_user.IS_TENANT=''; + +-- 居民信息表添加流动人口列 +alter table ic_resi_user add column IS_FLOATING char(1) comment '是否是流动人口【是:1 否:0】' after IS_TENANT; +update ic_resi_user set ic_resi_user.IS_FLOATING='0' where ic_resi_user.IS_FLOATING is null or ic_resi_user.IS_FLOATING=''; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx index 9209a1be45..8999a52839 100644 Binary files a/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx and b/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls index 23c9c692af..f8169a18bb 100644 Binary files a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls and b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xlsx index 5d92c7beb5..708221ffea 100644 Binary files a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xlsx and b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml index dc8ae898b1..2b063d7094 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -24,14 +24,20 @@ a.`NAME`, a.MOBILE, a.ID_CARD, + a.reason, a.REMARK, + b.VILLAGE_ID, + b.BUILD_ID, + b.UNIT_ID, + b.HOME_ID, IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime, IFNULL(v.vaccinationCount,0) AS vaccinationCount FROM ic_epidemic_special_attention a + LEFT JOIN ic_resi_user b ON a.id_card = b.id_card LEFT JOIN (SELECT id_card ,count(1) AS vaccinationCount FROM ic_vaccine WHERE DEL_FLAG = 0 GROUP BY ID_CARD) v ON (v.ID_CARD = a.ID_CARD) WHERE a.DEL_FLAG = 0 AND a.ORG_ID = #{orgId} - AND ATTENTION_TYPE = #{attentionType} + AND a.ATTENTION_TYPE = #{attentionType} AND a.`NAME` LIKE CONCAT('%',#{name},'%') @@ -41,6 +47,18 @@ AND a.ID_CARD LIKE CONCAT('%',#{idCard},'%') + + AND b.village_id = #{villageId} + + + AND b.build_id = #{buildId} + + + AND b.unit_id = #{unitId} + + + AND b.home_id = #{homeId} + HAVING vaccinationCount = #{vaccinationCount} @@ -55,11 +73,16 @@ a.ID_CARD, a.REMARK, a.REASON, + b.VILLAGE_ID, + b.BUILD_ID, + b.UNIT_ID, + b.HOME_ID, IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime FROM ic_epidemic_special_attention a + LEFT JOIN ic_resi_user b ON a.id_card = b.id_card WHERE a.DEL_FLAG = 0 AND a.ORG_ID = #{orgId} - AND ATTENTION_TYPE = #{attentionType} + AND a.ATTENTION_TYPE = #{attentionType} AND a.`NAME` LIKE CONCAT('%',#{name},'%') @@ -75,6 +98,18 @@ AND a.REMARK LIKE CONCAT('%',#{remark},'%') + + AND b.village_id = #{villageId} + + + AND b.build_id = #{buildId} + + + AND b.unit_id = #{unitId} + + + AND b.home_id = #{homeId} + ORDER BY a.CREATED_TIME DESC diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml index 777622c9f5..28e1e8370a 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml @@ -47,7 +47,9 @@ m.ID_NUM AS memberIdNum, m.MOBILE AS memberMobile, m.HE_SUAN_COUNT AS heSuanCount, - m.YMJZ AS ymjz + m.YMJZ AS ymjz, + m.DOMICILE_PLACE as domicilePlace, + m.WORK_PLACE as workPlace from ic_resi_member m where m.DEL_FLAG = 0 and m.IC_RESI_COLLECT_ID = #{id} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml index b76345774c..b9bc9300dd 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml @@ -12,7 +12,9 @@ m.ID_NUM, m.MOBILE, m.HE_SUAN_COUNT, - m.YMJZ + m.YMJZ, + m.DOMICILE_PLACE, + m.WORK_PLACE FROM ic_resi_member m WHERE 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 d5fb91de45..a70ffddac0 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 @@ -196,11 +196,25 @@ `NAME`, VILLAGE_ID AS neighborHoodId, BUILD_ID, - GRID_ID + GRID_ID, + MOBILE, + ( case when GENDER='1'then '男' + when GENDER='2' then '女' + else '未知' + end + ) as GENDER, + ID_CARD, + IFNULL(BIRTHDAY,'') AS BIRTHDAY, + IFNULL(REMARKS,'') AS REMARKS FROM ic_resi_user WHERE DEL_FLAG = '0' AND (AGENCY_ID = #{agencyId} OR PIDS LIKE CONCAT('%',#{agencyId},'%')) - AND `NAME` LIKE CONCAT('%',#{name},'%') + + AND `NAME` LIKE CONCAT('%',#{name},'%') + + + and ${columnName}='1' + ORDER BY `NAME` @@ -454,6 +468,7 @@ WHERE ageGroup = #{code} + ORDER BY CONVERT(NAME USING GBK) ASC