diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/AdminApplication.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/AdminApplication.java index ea570175ef..4678542a56 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/AdminApplication.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/AdminApplication.java @@ -23,7 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients -@ServletComponentScan +@ServletComponentScan(basePackages = "com.epmet") public class AdminApplication { public static void main(String[] args) { diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java index 2c5aee3369..da054b5052 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } 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-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.14__up_del_sys_dict_data.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.14__up_del_sys_dict_data.sql new file mode 100644 index 0000000000..4e9f45a64f --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.14__up_del_sys_dict_data.sql @@ -0,0 +1,10 @@ +UPDATE `epmet_admin`.`sys_dict_data` SET `dict_label`='楼宇党建' WHERE (`id`='1000000000000000220'); +UPDATE `epmet_admin`.`sys_dict_data` SET `dict_label`='两新组织' WHERE (`id`='1000000000000000221'); +UPDATE `epmet_admin`.`sys_dict_data` SET `dict_label`='区域单位党建' WHERE (`id`='1000000000000000222'); +UPDATE `epmet_admin`.`sys_dict_data` SET `dict_label`='机关直属部门' WHERE (`id`='1000000000000000223'); +UPDATE `epmet_admin`.`sys_dict_data` SET `dict_label`='社会团体' WHERE (`id`='1000000000000000224'); +UPDATE `epmet_admin`.`sys_dict_data` SET `dict_label`='民办非企业单位' WHERE (`id`='1000000000000000225'); +UPDATE `epmet_admin`.`sys_dict_data` SET `dict_label`='基金会' WHERE (`id`='1000000000000000226'); +UPDATE `epmet_admin`.`sys_dict_data` SET `dict_label`='其他' WHERE (`id`='1000000000000000227'); + +DELETE FROM `epmet_admin`.`sys_dict_data` WHERE id = '1000000000000000228'; \ No newline at end of file diff --git a/epmet-auth/src/main/java/com/epmet/AuthApplication.java b/epmet-auth/src/main/java/com/epmet/AuthApplication.java index 2c14a7792b..0bf685bd5b 100644 --- a/epmet-auth/src/main/java/com/epmet/AuthApplication.java +++ b/epmet-auth/src/main/java/com/epmet/AuthApplication.java @@ -23,7 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients -@ServletComponentScan // 开启Servlet容器扫描,扫描@WebFilter等注解 +@ServletComponentScan(basePackages = "com.epmet") // 开启Servlet容器扫描,扫描@WebFilter等注解 public class AuthApplication { public static void main(String[] args) { diff --git a/epmet-auth/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java b/epmet-auth/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java index 2c5aee3369..da054b5052 100644 --- a/epmet-auth/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java +++ b/epmet-auth/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java index 8c42570bc3..4226c2acac 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java @@ -14,9 +14,11 @@ import java.util.List; public class OptionResultDTO implements Serializable { private static final long serialVersionUID = 8618231166600518980L; private String label; + private String code; private String value; private String pValue; private String sysDictDataId; private List children; private Boolean usableFlag; + private String type; } 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/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index eac79156d5..2526eb8486 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -10,6 +10,8 @@ package com.epmet.commons.tools.redis; 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.utils.DateUtils; import org.apache.commons.lang3.StringUtils; @@ -774,4 +776,16 @@ public class RedisKeys { public static String getNextAreaCodeKey(String areaCode) { return rootPrefix.concat("areaCode:parentCode:").concat(areaCode); } + + /** + * desc:获取分布式锁key + * @param methodName + * @return + */ + public static String getLockByMethodName(String methodName) { + if (StringUtils.isBlank(methodName)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误"); + } + return rootPrefix.concat("lock:").concat(methodName); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java index ec0a79f1db..6f2e4959e0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java @@ -62,4 +62,8 @@ public class CustomerIcHouseRedis { return buildInfoResult.getData(); } + public static void delBuildingInfo(String buildingId){ + String key = RedisKeys.getBuildingInfoKey(buildingId); + customerIcHouseRedis.redisUtils.delete(key); + } } 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-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java index 63114e5794..c55e61513e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java @@ -118,4 +118,20 @@ public class GridInfoCache implements Serializable { * 弃用标记 */ private Integer abandonFlag; + + /** + * 网格编码 + */ + private String code; + + /** + * 负责人姓名 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; + } diff --git a/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java b/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java index 064b59610e..cf7493a300 100644 --- a/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java +++ b/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java @@ -27,7 +27,7 @@ import org.springframework.context.annotation.FilterType; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients -//@ServletComponentScan +//@ServletComponentScan(basePackages = "com.epmet") @ComponentScan(basePackages = {"com.epmet.*"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {RedissonConfig.class, ThreadDispatcherConfig.class, ServletExceptionHandler.class})) public class GatewayApplication { diff --git a/epmet-gateway/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java b/epmet-gateway/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java index 2c5aee3369..da054b5052 100644 --- a/epmet-gateway/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java +++ b/epmet-gateway/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } 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/DataAggregatorApplication.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/DataAggregatorApplication.java index 5e8d7c4788..a3eac596ae 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/DataAggregatorApplication.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/DataAggregatorApplication.java @@ -10,7 +10,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication(scanBasePackages = {"com.epmet"}, exclude = {DataSourceAutoConfiguration.class}) @EnableDiscoveryClient @EnableFeignClients -@ServletComponentScan +@ServletComponentScan(basePackages = "com.epmet") public class DataAggregatorApplication { public static void main(String[] args) { SpringApplication.run(DataAggregatorApplication.class, args); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/config/NacosServiceListListenerRegisterer.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/config/NacosServiceListListenerRegisterer.java index 800f23a357..036f1e0189 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/config/NacosServiceListListenerRegisterer.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } 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..992ac08201 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; @@ -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/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/java/com/epmet/DataReportApplication.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java index 3fccfa8b6e..f6c1856a1a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java @@ -11,7 +11,7 @@ import org.springframework.scheduling.annotation.EnableAsync; @EnableDiscoveryClient @EnableFeignClients @EnableAsync -@ServletComponentScan +@ServletComponentScan(basePackages = "com.epmet") public class DataReportApplication { public static void main(String[] args) { SpringApplication.run(DataReportApplication.class, args); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/config/NacosServiceListListenerRegisterer.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/config/NacosServiceListListenerRegisterer.java index 915724e664..d89aeb1f67 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/config/NacosServiceListListenerRegisterer.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } 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/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java index 4a572b4889..15bb6ee2a6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java @@ -12,7 +12,7 @@ import org.springframework.scheduling.annotation.EnableAsync; @EnableFeignClients @SpringBootApplication (exclude = {DataSourceAutoConfiguration.class}) @EnableAsync -@ServletComponentScan +@ServletComponentScan(basePackages = "com.epmet") public class DataStatsApplication { public static void main(String[] args) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java index 2c5aee3369..da054b5052 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml index 51f9a0fcb6..f132877210 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml @@ -394,61 +394,61 @@ diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/ActivitiApplication.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/ActivitiApplication.java index 46ee097f8d..a70a296b59 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/ActivitiApplication.java +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/ActivitiApplication.java @@ -26,7 +26,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; }) @EnableDiscoveryClient @EnableFeignClients -@ServletComponentScan +@ServletComponentScan(basePackages = "com.epmet") public class ActivitiApplication { public static void main(String[] args) { diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/utils/ImportTaskUtils.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/utils/ImportTaskUtils.java new file mode 100644 index 0000000000..80bf086374 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/utils/ImportTaskUtils.java @@ -0,0 +1,51 @@ +package com.epmet.utils; + +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; + +/** + * 导入任务工具类,用于创建/完成导入工具 + */ +public class ImportTaskUtils implements ResultDataResolver { + + /** + * 创建导入任务,可能抛出8000异常,请考虑捕获异常 + * @param originFileName 上传的文件的名称 + * @param bizType 业务类型,见ImportTaskConstants常量 + * @return Result + */ + public static Result createImportTask(String originFileName, String bizType) { + ImportTaskCommonFormDTO form = new ImportTaskCommonFormDTO(); + form.setOriginFileName(originFileName); + form.setOperatorId(EpmetRequestHolder.getHeader(AppClientConstant.USER_ID)); + form.setBizType(bizType); + + return SpringContextUtils.getBean(EpmetCommonServiceOpenFeignClient.class).createImportTask(form); + } + + /** + * 结束导入任务 + * @param taskId 任务ID + * @param processStatus 处理状态 见ImportTaskConstants + * @param resultDescFilePath 结果描述文件的路径 + * @param resultDesc 结果简要描述文字 + * @return Result + */ + public static Result finishImportTask(String taskId, String processStatus, String resultDescFilePath, String resultDesc) { + ImportTaskCommonFormDTO form = new ImportTaskCommonFormDTO(); + form.setTaskId(taskId); + form.setOperatorId(EpmetRequestHolder.getHeader(AppClientConstant.USER_ID)); + form.setProcessStatus(processStatus); + form.setResultDescFilePath(resultDescFilePath); + form.setResultDesc(resultDesc); + + return SpringContextUtils.getBean(EpmetCommonServiceOpenFeignClient.class).finishImportTask(form); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/EpmetCommonServiceApplication.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/EpmetCommonServiceApplication.java index 486ac4bf21..76b6eb744b 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/EpmetCommonServiceApplication.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/EpmetCommonServiceApplication.java @@ -23,7 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients -@ServletComponentScan +@ServletComponentScan(basePackages = "com.epmet") public class EpmetCommonServiceApplication { public static void main(String[] args) { diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java index c14a7efa4d..98da5bf4d4 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } 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-demo/epmet-demo-server/src/main/java/com/epmet/DemoApplication.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/DemoApplication.java index 5e83208c30..ba87427ca1 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/DemoApplication.java +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/DemoApplication.java @@ -23,7 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients -@ServletComponentScan +@ServletComponentScan(basePackages = "com.epmet") public class DemoApplication { public static void main(String[] args) { diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java index 2c5aee3369..da054b5052 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java index 04b9410c8b..a14d433a84 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java @@ -9,7 +9,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients -@ServletComponentScan +@ServletComponentScan(basePackages = "com.epmet") public class EpmetExtApplication { public static void main(String[] args) { diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java index 2c5aee3369..da054b5052 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } 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..b0367639ed 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; /** * 组织的所有上级 */ @@ -67,7 +68,6 @@ public class IcPartyActivityDTO implements Serializable { /** * act_info表ID */ - @JsonIgnore private String actId; private String unitId; 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/resi/ResiActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java index aa33f41e69..266ccf8e9f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java @@ -181,6 +181,9 @@ public class ResiActDetailResultDTO 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/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/EpmetHeartApplication.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java index 38a41f919e..236d81d8d9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java @@ -24,7 +24,7 @@ import org.springframework.scheduling.annotation.EnableAsync; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients -@ServletComponentScan +@ServletComponentScan(basePackages = "com.epmet") @EnableAsync public class EpmetHeartApplication { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java index 2c5aee3369..da054b5052 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } 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/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index 407cb74dac..388594a48b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -25,6 +25,8 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; 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.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -279,6 +281,14 @@ public class ActInfoServiceImpl extends BaseServiceImpl unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); detailResultDTO.setUnitIdList(unitIds); detailResultDTO.setUnitNameList(unitNames); + + if (StringUtils.isNotEmpty(dto.getGridId())) { + detailResultDTO.setGridId(dto.getGridId()); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null != gridInfo) { + detailResultDTO.setGridName(gridInfo.getGridName()); + } + } } } return new Result().ok(detailResultDTO); 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/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..1117174bcc 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,8 @@ 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 ID, PID, diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java index 5dad0a50c8..a6c36c40e8 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java @@ -9,7 +9,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients -@ServletComponentScan +@ServletComponentScan(basePackages = "com.epmet") public class GovMineApplication { public static void main(String[] args) { diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java index 2c5aee3369..da054b5052 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java index 510fe28f3b..c18766b89e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java @@ -87,7 +87,7 @@ public class ImportGeneralDTO implements Serializable { private String purpose; /** - * 是否出租 + * 房屋状态 1:出租 0:自住 2:闲置 */ private String rentFlagString; private Integer rentFlag; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBuildingListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBuildingListFormDTO.java new file mode 100644 index 0000000000..249a7d4c42 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBuildingListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +/** + * desc: 楼宇列表查询条件 + * + * @return + * @author LiuJanJun + * @date 2022/4/13 2:45 下午 + */ +@Data +public class IcBuildingListFormDTO extends PageFormDTO { + + private static final long serialVersionUID = -7536532648656861790L; + /** + * 小区ID + */ + private String neighborHoodId; + /** + * 房主姓名 + */ + private String ownerName; + /** + * 房主电话 + */ + private String ownerPhone; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java similarity index 98% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java index 879fd011c9..e476297ec6 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java @@ -27,7 +27,7 @@ import java.io.Serializable; @Data -public class IcBulidingFormDTO implements Serializable { +public class IcBulidingAddFormDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -126,4 +126,4 @@ public class IcBulidingFormDTO implements Serializable { -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java similarity index 94% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java index fb679755d7..b05d70d8aa 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java @@ -26,7 +26,7 @@ import java.io.Serializable; @Data -public class IcHouseFormDTO implements Serializable { +public class IcHouseAddFormDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -79,9 +79,9 @@ public class IcHouseFormDTO implements Serializable { private String purpose; /** - * 1出租;0未出租 + * 1:出租 0:自住 2:闲置 */ - @NotNull(message = "是否出租不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + @NotNull(message = "房屋状态不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private Integer rentFlag; /** diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java new file mode 100644 index 0000000000..7fdbf31cc5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto.form;/** + * Created by 11 on 2020/3/19. + */ + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +/** + * @Description 小区房屋列表查询条件 + * @ClassName ListCustomerGridFormDTO + * @Author wangc + * @date 2020.03.19 15:00 + */ +@Data +public class IcHouseListFormDTO extends PageFormDTO { + + private static final long serialVersionUID = -1L; + + /** + * 组织类别 + */ + private String level; + + private String id; + + + /** + * 组织ID + */ + private String agencyId; + private String pids; + private String gridId; + + /** + * 小区名字 + */ + private String neighborHoodName; + /** + * 楼栋名字 + */ + private String buildingName; + /** + * 房主姓名 + */ + private String ownerName; + /** + * 房主电话 + */ + private String ownerPhone; + /** + * 房屋状态 【1:出租 0:自住 2:闲置】 + */ + private String rentFlag; + /** + * 楼栋ID + */ + private String buildingId; + /** + * 小区ID + */ + private String neighborHoodId; + + /** + * 搜索关键词,社区查询,搜索输入的关键词 + */ + private String keyword; + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java similarity index 97% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java index 32eabb2ea6..65708da4d3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java @@ -27,7 +27,7 @@ import javax.validation.constraints.NotBlank; @Data -public class IcNeighborHoodFormDTO extends PageFormDTO { +public class IcNeighborHoodAddFormDTO extends PageFormDTO { private static final long serialVersionUID = 1L; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodListFormDTO.java new file mode 100644 index 0000000000..632cb1ea60 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodListFormDTO.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + + +@Data +public class IcNeighborHoodListFormDTO extends PageFormDTO { + + private static final long serialVersionUID = 1L; + + /** + * 组织类别 + */ + @NotBlank(message = "组织类别不能为空") + private String level; + + /** + * orgId 跟level配套使用 + */ + @NotBlank(message = "组织Id不能为空") + private String id; + + + /** + * 组织ID + */ + private String agencyId; + private String pids; + private String gridId; + + + /** + * 房主姓名 + */ + private String ownerName; + /** + * 房主电话 + */ + private String ownerPhone; + + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java deleted file mode 100644 index 402c86c868..0000000000 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.epmet.dto.form;/** - * Created by 11 on 2020/3/19. - */ - -import lombok.Data; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Pattern; -import java.io.Serializable; - -/** - * @Description 陌生人导览查询附近网格传参定义 - * @ClassName ListCustomerGridFormDTO - * @Author wangc - * @date 2020.03.19 15:00 - */ -@Data -public class ListIcNeighborHoodFormDTO implements Serializable{ - - private static final long serialVersionUID = -1L; - - - /** - * 当前页 - * */ - private Integer pageNo = 1; - - /** - * 每页显示数量 - * */ - private Integer pageSize = 20; - - /** - * 组织类别 - */ - private String level ; - - private String id; - - /** - * 组织ID - */ -// private String agencyId; - /** - * 网格ID - */ -// private String gridId; - /** - * 小区名字 - */ -// private String neighborHoodName; - /** - * 楼栋名字 - */ -// private String buildingName; - /** - * 房主姓名 - */ - private String ownerName; - /** - * 房主电话 - */ - private String ownerPhone; - /** - * 数据类型【小区:neighbourHood,楼栋:building,房屋:house】 - */ -// @Pattern(regexp = "^(neighbourHood|building|house)?$",message = "数据类型选择错误") -// private String dataType; - /** - * 楼栋ID - */ - private String buildingId; - /** - * 小区ID - */ - private String neighborHoodId; - - /** - * 搜索关键词,社区查询,搜索输入的关键词 - */ - private String keyword; - - -} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RentHouseFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RentHouseFormDTO.java new file mode 100644 index 0000000000..88c584ccc8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RentHouseFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhy + * @date 2022/4/26 11:18 + */ +@Data +public class RentHouseFormDTO implements Serializable { + private static final long serialVersionUID = 2636608477324780974L; + + private String id; + + /** + * 1出租;0未出租 + */ + private Integer rentFlag; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java deleted file mode 100644 index 58a07c8bbc..0000000000 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.epmet.dto.result; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @Description - * @Author zhaoqifeng - * @Date 2021/10/25 16:58 - */ -@Data -public class HouseResultDTO implements Serializable { - private static final long serialVersionUID = 8054109017922254586L; - private String houseId; - private String houseName; -} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HousesNameResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HousesNameResultDTO.java new file mode 100644 index 0000000000..954031f4c2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HousesNameResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/4/12 16:40 + * @DESC + */ +@Data +public class HousesNameResultDTO implements Serializable { + + private static final long serialVersionUID = -8643628706377635279L; + + private String idCard; + + private String houseName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBuildingListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBuildingListResultDTO.java new file mode 100644 index 0000000000..ebaf6ca58e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBuildingListResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * desc:楼宇列表结果类 + * + * @author: LiuJanJun + * @date: 2022/4/13 2:28 下午 + * @version: 1.0 + */ +@NoArgsConstructor +@Data +public class IcBuildingListResultDTO extends PageFormDTO { + + private static final long serialVersionUID = -8277921228438123299L; + private String gridName; + private Integer totalHouseNum; + private String latitude; + private String agencyId; + private Integer sort; + private String agencyName; + private String buildingId; + private String buildingName; + private String buildingTypeKey; + private String neighborHoodId; + private String neighborHoodName; + private Integer totalFloorNum; + private String gridId; + private Integer totalUnitNum; + private String longitude; + private String buildingType; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java new file mode 100644 index 0000000000..3d12115f05 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java @@ -0,0 +1,85 @@ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:房屋列表结果类 + * + * @author liujianjun + */ +@Data +public class IcHouseListResultDTO implements Serializable { + + + private static final long serialVersionUID = 4963952996288796744L; + + private String houseId; + + private String doorName; + + + private String buildingId; + private String houseName; + + private String rentFlag; + + private String neighborHoodId; + private String purposeKey; + + private String unitNumKey; + /** + * 所属组织 + */ + private String agencyName; + private String agencyId; + /** + * 所属网格 + */ + private String gridName; + private String gridId; + /** + * 所属小区 + */ + private String neighborHoodName; + /** + * 所属楼栋 + */ + private String buildingName; + /** + * 单元号 + */ + private String unitNum; + /** + * 房屋类型 + */ + private String houseType; + private String houseTypeKey; + /** + * 房屋用途 + */ + private String purpose; + /** + * 是否出租 + */ + private Integer rentFlagKey; + + /** + * 房主姓名 + */ + private String ownerName; + /** + * 房主电话 + */ + private String ownerPhone; + /** + * 房主身份证 + */ + private String ownerIdCard; + + + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java index 51b410eaa5..d775552bbf 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java @@ -1,10 +1,8 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.Data; - -import java.io.Serializable; -import java.util.List; -import java.util.Map; +import lombok.NoArgsConstructor; /** * @Description 网格列表信息 @@ -12,25 +10,22 @@ import java.util.Map; * @Author wangc * @date 2020.04.23 14:21 */ +@NoArgsConstructor @Data -public class IcNeighborHoodResultDTO implements Serializable { +public class IcNeighborHoodResultDTO extends PageFormDTO { private static final long serialVersionUID = 1L; - /** - * 总条数 - * */ - - private Integer total; - -// /** -// * 数据类型【小区:neighbourHood,楼栋:building,房屋:house】 -// * */ -// private String dataType; - - /** - * 结果集 - */ - private List> list; - + private String gridName; + private String address; + private String neighborHoodId; + private String neighborHoodName; + private String latitude; + private String remark; + private String agencyId; + private String location; + private String gridId; + private String propertyId; + private String agencyName; + private String longitude; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java index 618be0ea9a..27cd699bf3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java @@ -3,8 +3,12 @@ package com.epmet.enums; import org.springframework.util.StringUtils; public enum HouseRentFlagEnums { - YES(1,"是"), - NO(0,"否"); + //原有的房屋出租状态是否改为房屋状态【1:出租 0:自住 2:闲置】 + /*YES(1,"是"), + NO(0,"否");*/ + HOUSE_ZZ(0,"自住"), + HOUSE_CZ(1,"出租"), + HOUSE_XZ(2,"闲置"); diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index e3ffa35663..87db3dd3e6 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -605,4 +605,13 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/customerstaffgrid/getallstaffbygridid") Result> getAllStaffByGridId(@RequestParam("gridId")String gridId); + + /** + * Desc: 根据身份证查询房屋名 + * @param idCards + * @author zxc + * @date 2022/4/12 16:42 + */ + @PostMapping("/gov/org/ichouse/houses-name") + Result> getHousesNameByIdCards(@RequestBody List idCards); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index dd29ab6129..4e48ff1657 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -393,4 +393,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> getAllStaffByGridId(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAllStaffByGridId", gridId); } + + @Override + public Result> getHousesNameByIdCards(List idCards) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getHousesNameByIdCards", idCards); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java index 348a7b67b0..3dda2f6217 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java @@ -24,7 +24,7 @@ import org.springframework.scheduling.annotation.EnableAsync; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients -@ServletComponentScan +@ServletComponentScan(basePackages = "com.epmet") @EnableAsync public class GovOrgApplication { diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java index 2c5aee3369..da054b5052 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java @@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer { public void onEvent(Event event) { if (event instanceof NamingEvent) { NamingEvent namingEvent = (NamingEvent) event; - log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); doRefreshServerList(service); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java index be68d37843..2c764b63db 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java @@ -9,14 +9,19 @@ public interface ImportErrorMsgConstants { String EXIST_ERROR = "数据已存在"; - String HOUSE_ERROR = "所属组织、所属网格、所属小区、所属楼栋、单元号、房屋类型、房屋用途、出租的值未填写,或者所填写信息在系统中未找到"; + String DOCUMENT_EXIST_ERROR = "文件中存在重复数据"; - String BUILDING_ERROR = "所属组织、所属网格、所属小区、楼栋类型、单元数的值未填写,或者所填写信息在系统中未找到"; + String BELONG_GRID_ERROR = "所属网格的值未填写或者所填写信息在系统中未找到"; - String NEIGHBOR_HOOD_ERROR = "所属组织、所属网格、详细地址的值未填写,或者所填写信息在系统中未找到"; + String BELONG_AGENCY_ERROR = "所属组织的值未填写或者所填写信息在系统中未找到"; + String HOUSE_TYPE_ERROR = "房屋类型的值未填写或者所填写信息在系统中未找到"; + + String BUILDING_TYPE_ERROR = "楼栋类型的值未填写或者所填写信息在系统中未找到"; + + String NEIGHBORHOOD_TYPE_ERROR = "小区名称的值未填写或者所填写信息在系统中未找到"; String HOUSE_ERROR_NAME = "导入失败的列表-房屋"; - String BUILDING_ERROR_NAME = "导入失败的列表-楼宇"; + String BUILDING_ERROR_NAME = "导入失败的列表-楼栋"; String NEIGHBORHOOD_ERROR_NAME = "导入失败的列表-小区"; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java index fca09fe069..9185571640 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java @@ -18,14 +18,13 @@ package com.epmet.controller; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; -import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; -import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -35,10 +34,9 @@ import com.epmet.dto.BuildingTreeLevelDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultPagedDTO; -import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.dto.result.IcBuildingListResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.entity.IcBuildingUnitEntity; -import com.epmet.excel.IcBuildingExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.BuildingService; import com.epmet.util.ExcelPoiUtils; @@ -51,8 +49,9 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; -import java.util.*; -import java.util.stream.Collectors; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; /** @@ -75,19 +74,17 @@ public class BuildingController { @PostMapping("buildinglist") - public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ - //效验数据 - ValidatorUtils.validateEntity(formDTO); - IcNeighborHoodResultDTO icNeighborHoodResultDTO = buildingService.listBuilding(formDTO); + public Result> houseList(@RequestBody IcBuildingListFormDTO formDTO){ + PageData icNeighborHoodResultDTO = buildingService.listBuilding(formDTO); return new Result().ok(icNeighborHoodResultDTO); } @NoRepeatSubmit @PostMapping("buildingadd") - public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ + public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingAddFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.AddShowGroup.class); + ValidatorUtils.validateEntity(formDTO, IcBulidingAddFormDTO.AddShowGroup.class); String customerId = tokenDTO.getCustomerId(); buildingService.addBuilding(customerId,formDTO); return new Result().ok("保存成功"); @@ -95,19 +92,18 @@ public class BuildingController { @NoRepeatSubmit @PostMapping("buildingupdate") - public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ + public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingAddFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.UpdateShowGroup.class); + ValidatorUtils.validateEntity(formDTO, IcBulidingAddFormDTO.UpdateShowGroup.class); String customerId = tokenDTO.getCustomerId(); -// String customerId = "123123"; buildingService.updateBuilding(customerId,formDTO); return new Result().ok("修改成功"); } @PostMapping("buildingdel") - public Result buildingDel(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ + public Result buildingDel(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingAddFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.DeleteGroup.class); + ValidatorUtils.validateEntity(formDTO, IcBulidingAddFormDTO.DeleteGroup.class); String buildingId = formDTO.getBuildingId(); buildingService.delBuilding(buildingId); return new Result(); @@ -118,6 +114,18 @@ public class BuildingController { List buildingTreeLevelDTOS =buildingService.treeList(tokenDTO.getCustomerId(), tokenDTO.getUserId()); return new Result().ok(buildingTreeLevelDTOS); } + + /** + * Desc: 根据前端方便,新开接口,只返回树的ID + * @param tokenDTO + * @author zxc + * @date 2022/4/12 15:20 + */ + @PostMapping("tree-ids") + public Result treeIds(@LoginUser TokenDto tokenDTO){ + List ids =buildingService.treeIds(tokenDTO.getCustomerId(), tokenDTO.getUserId()); + return new Result().ok(ids); + } /** * 导出模板 * @param response @@ -125,12 +133,8 @@ public class BuildingController { */ @PostMapping("exporttemplate") public void exportTemplate( HttpServletResponse response) throws Exception { - TemplateExportParams templatePath = new TemplateExportParams("excel/building_template.xlsx"); - Map map = new HashMap<>(); - map.put("maplist",new ArrayList()); - ExcelPoiUtils.exportExcel(templatePath ,map,"楼宇信息录入表",response); - + ExcelPoiUtils.exportExcel(templatePath ,new HashMap<>(),"楼栋信息录入表",response); } /** * 导出 @@ -139,10 +143,9 @@ public class BuildingController { * @throws Exception */ @RequestMapping("exportbuildinginfo") - public void exportbuildinginfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + public void exportbuildinginfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception { ValidatorUtils.validateEntity(formDTO); buildingService.exportBuildinginfo(formDTO,response); - } /** @@ -153,49 +156,12 @@ public class BuildingController { */ @GetMapping("export") public void export(HttpServletResponse response) throws Exception { - ListIcNeighborHoodFormDTO formDTO = new ListIcNeighborHoodFormDTO(); + IcHouseListFormDTO formDTO = new IcHouseListFormDTO(); ValidatorUtils.validateEntity(formDTO); buildingService.exportBuildinginfo(formDTO,response); } - - /** - * 导入数据 - * @param file - * @return - * @throws IOException - */ - @PostMapping("import") - public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException { - String customerId = tokenDTO.getCustomerId(); -// String customerId = "123123"; - - ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcBuildingExcel.class); - - List failList = importResult.getFailList(); - - //存放错误数据行号 - List numList = new ArrayList<>(); - if(!CollectionUtils.isEmpty(failList)){ - for ( IcBuildingExcel entity : failList) { - log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 - numList.add(entity.getRowNum()); - } - //return new Result().error(8001,failList.get(0).getErrorMsg()); - } - List result =importResult.getList(); - List resultList = buildingService.importExcel(customerId,result,tokenDTO.getUserId(),numList); - String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size()); - if(resultList.size()> NumConstant.ZERO){ - Collections.sort(resultList); - String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、")); - log.warn(str + "第" + subList + "行未成功!"); - return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str+"第"+subList+"行未成功!"); - } - return new Result().ok(str); - } - /** * @Description 楼宇导入 * @param tokenDTO diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 09f29f5330..7be2f59dac 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -18,7 +18,6 @@ package com.epmet.controller; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; -import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; @@ -26,36 +25,29 @@ 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.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constants.ImportTaskConstants; -import com.epmet.dao.IcBuildingDao; import com.epmet.dto.form.*; import com.epmet.dto.result.HouseInfoDTO; -import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.dto.result.IcHouseListResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; -import com.epmet.excel.IcHouseExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.redis.IcHouseRedis; import com.epmet.service.HouseService; -import com.epmet.service.IcHouseService; import com.epmet.util.ExcelPoiUtils; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; import java.io.InputStream; import java.util.*; -import java.util.stream.Collectors; /** @@ -75,45 +67,42 @@ public class HouseController implements ResultDataResolver { @Autowired private EpmetUserOpenFeignClient userOpenFeignClient; @Autowired - private IcBuildingDao icBuildingDao; - @Autowired - private IcHouseRedis icHouseRedis; - @Autowired - private IcHouseService icHouseService; - @Autowired private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; @PostMapping("houselist") - public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ + public Result> houseList(@LoginUser TokenDto loginUser, @RequestBody IcHouseListFormDTO formDTO) { //效验数据 + LoginUserDetailsResultDTO loginUserDetail = getLoginUserDetailsResultDTO(loginUser, "【查询房屋】查询当前staff所在组织信息失败"); + formDTO.setAgencyId(loginUserDetail.getAgencyId()); ValidatorUtils.validateEntity(formDTO); + return new Result().ok(houseService.getHouseList(formDTO)); - String queryScene = "house_manage"; - - IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(null, formDTO.getBuildingId(), formDTO.getOwnerName(), - formDTO.getOwnerPhone(), null, - null, queryScene, - formDTO.getPageNo(), formDTO.getPageSize()); - return new Result().ok(icNeighborHoodResultDTO); + } + public LoginUserDetailsResultDTO getLoginUserDetailsResultDTO(@LoginUser TokenDto loginUser, String errorMsg) { + LoginUserDetailsFormDTO form = new LoginUserDetailsFormDTO(); + form.setUserId(loginUser.getUserId()); + form.setClient(loginUser.getClient()); + form.setApp(loginUser.getApp()); + return getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(form), ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + errorMsg, + null); } /** - *@Description 社区查询-搜索房屋 - *@Author wangxianzhang - *@Date 2022/1/14 11:00 上午 - *@Param - *@return - */ + * @return + * @Description 社区查询-搜索房屋 + * @Author wangxianzhang + * @Date 2022/1/14 11:00 上午 + * @Param + */ @PostMapping("search") - public Result searchHouse(@RequestBody ListIcNeighborHoodFormDTO formDTO, @LoginUser TokenDto loginUser) { + public Result> searchHouse(@RequestBody IcHouseListFormDTO formDTO, @LoginUser TokenDto loginUser) { String keyword = formDTO.getKeyword(); if (StringUtils.isBlank(keyword)) { - IcNeighborHoodResultDTO r = new IcNeighborHoodResultDTO(); - r.setTotal(0); - r.setList(new ArrayList<>()); - return new Result().ok(r); + return new Result>().ok(new PageData<>(new ArrayList<>(), NumConstant.ZERO)); } keyword = keyword.trim(); @@ -129,132 +118,102 @@ public class HouseController implements ResultDataResolver { buildingName = null; } - // 使用场景:社区查询 - String scene = "community_search"; - - LoginUserDetailsFormDTO form = new LoginUserDetailsFormDTO(); - form.setUserId(loginUser.getUserId()); - form.setClient(loginUser.getClient()); - form.setApp(loginUser.getApp()); - LoginUserDetailsResultDTO loginUserDetail = getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(form), ServiceConstant.EPMET_USER_SERVER, - EpmetErrorCode.SERVER_ERROR.getCode(), - "【社区查询-查询房屋】查询当前staff所在组织信息失败", - null); - - IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(loginUserDetail.getAgencyId(),null, null, null, - neighborhoodName, buildingName, scene, formDTO.getPageNo(), formDTO.getPageSize()); - - return new Result().ok(icNeighborHoodResultDTO); + LoginUserDetailsResultDTO loginUserDetail = getLoginUserDetailsResultDTO(loginUser, "【社区查询-查询房屋】查询当前staff所在组织信息失败"); + formDTO.setAgencyId(loginUserDetail.getAgencyId()); + formDTO.setBuildingName(buildingName); + formDTO.setNeighborHoodName(neighborhoodName); + return new Result>().ok(houseService.getHouseList(formDTO)); } @NoRepeatSubmit @PostMapping("houseadd") - public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseAddFormDTO formDTO) { //效验数据 - ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.AddShowGroup.class); + ValidatorUtils.validateEntity(formDTO, IcHouseAddFormDTO.AddShowGroup.class); String customerId = tokenDTO.getCustomerId(); // String customerId = "123123"; - houseService.addHouse(customerId,formDTO); + houseService.addHouse(customerId, formDTO); return new Result(); } @NoRepeatSubmit @PostMapping("houseupdate") - public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseAddFormDTO formDTO) { //效验数据 - ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.UpdateShowGroup.class); + ValidatorUtils.validateEntity(formDTO, IcHouseAddFormDTO.UpdateShowGroup.class); String customerId = tokenDTO.getCustomerId(); // String customerId = "123123"; - houseService.updateHouse(customerId,formDTO); + houseService.updateHouse(customerId, formDTO); + return new Result(); + } + + /** + * 小寨子社区-合同签订后变更成出租状态 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/4/26 11:16 + */ + @NoRepeatSubmit + @PostMapping("update2rent") + public Result update2Rent(@RequestBody RentHouseFormDTO formDTO) { + houseService.update2Rent(formDTO); return new Result(); } /** * lzh + * * @param formDTO * @return 单独删除房屋内部调用/gov/org/house/delete */ @PostMapping("housedel") - public Result houseDel(@RequestBody IcHouseFormDTO formDTO){ + public Result houseDel(@RequestBody IcHouseAddFormDTO formDTO) { //效验数据 - ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class); + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.DeleteGroup.class); houseService.delHouse(formDTO.getHouseId()); return new Result(); } + /** * 导出模板 + * * @param response * @throws Exception */ @PostMapping("exporttemplate") public void exportTemplate(HttpServletResponse response) throws Exception { -// ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); TemplateExportParams templatePath = new TemplateExportParams("excel/house_template.xlsx"); - Map map = new HashMap<>(); - map.put("maplist",new ArrayList()); - ExcelPoiUtils.exportExcel(templatePath ,map,"房屋信息录入表",response); + ExcelPoiUtils.exportExcel(templatePath, new HashMap<>(), "房屋信息录入表", response); } + /** * 导出 + * * @param formDTO * @param response * @throws Exception */ @RequestMapping("exporthouseinfo") - public void exporthouseinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + public void exporthouseinfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception { ValidatorUtils.validateEntity(formDTO); - houseService.exportBuildinginfo(formDTO,response); - - } - - /** - * 导入数据 - * @param file - * @return - * @throws IOException - */ - @PostMapping("import") - public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException { - - String customerId = tokenDTO.getCustomerId(); -// String customerId = "123123"; + formDTO.setIsPage(false); + houseService.exportBuildinginfo(formDTO, response); - ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcHouseExcel.class); - - List failList = importResult.getFailList(); - - //存放错误数据行号 - List numList = new ArrayList<>(); - if(!CollectionUtils.isEmpty(failList)){ - for ( IcHouseExcel entity : failList) { - log.warn("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 - numList.add(entity.getRowNum()); - } - } - List result =importResult.getList(); - - List resultList = houseService.importExcel(customerId,result,tokenDTO.getUserId(),numList); - String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size()); - if(resultList.size()> NumConstant.ZERO){ - Collections.sort(resultList); - String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、")); - log.warn(str + "第" + subList + "行未成功!"); - return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str+"第"+subList+"行未成功!"); - } - return new Result().ok(str); } - @PostMapping( "queryListHouseInfo") - Result> queryListHouseInfo(@RequestBody Set houseIds, @RequestParam("customerId") String customerId){ - return new Result>().ok(houseService.queryListHouseInfo(houseIds,customerId)); + @PostMapping("queryListHouseInfo") + Result> queryListHouseInfo(@RequestBody Set houseIds, @RequestParam("customerId") String customerId) { + return new Result>().ok(houseService.queryListHouseInfo(houseIds, customerId)); } @PostMapping("houseimport") public Result houseImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file, - @RequestParam("orgId")String orgId, - @RequestParam("orgType")String orgType,HttpServletRequest multipartRequest){ + @RequestParam("orgId") String orgId, + @RequestParam("orgType") String orgType) { ImportInfoFormDTO formDTO = new ImportInfoFormDTO(); formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setOrgType(orgType); @@ -265,32 +224,33 @@ public class HouseController implements ResultDataResolver { importFormDTO.setOperatorId(formDTO.getUserId()); importFormDTO.setOriginFileName(file.getOriginalFilename()); Result importTask = epmetCommonServiceOpenFeignClient.createImportTask(importFormDTO); - if (!importTask.success()){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"","存在进行中的导入"); + if (!importTask.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "", "存在进行中的导入"); } InputStream inputStream = null; try { inputStream = file.getInputStream(); - }catch (Exception e){ + } catch (Exception e) { ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); input.setOperatorId(formDTO.getUserId()); input.setTaskId(importTask.getData().getTaskId()); input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); epmetCommonServiceOpenFeignClient.finishImportTask(input); - log.error("读取文件失败",e); + log.error("读取文件失败", e); } - houseService.dispose(inputStream,formDTO,importTask); + houseService.dispose(inputStream, formDTO, importTask); return new Result<>(); } /** * Desc 小区管理中批量删除 + * * @param formDTO * @author zxc * @date 2022/3/1 4:57 下午 */ @PostMapping("delete") - public Result allDelete(@RequestBody NeighborHoodManageDelFormDTO formDTO){ + public Result allDelete(@RequestBody NeighborHoodManageDelFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, NeighborHoodManageDelFormDTO.NeighborHoodManageDelForm.class); houseService.allDelete(formDTO); return new Result(); @@ -298,14 +258,15 @@ public class HouseController implements ResultDataResolver { /** * 获取房屋信息 + * * @param houseId * @return */ @PostMapping("gethouseinfo/{houseId}") - public Result getHouseInfo(@LoginUser TokenDto tokenDto,@PathVariable("houseId") String houseId){ - if(StringUtils.isBlank(houseId)){ + public Result getHouseInfo(@LoginUser TokenDto tokenDto, @PathVariable("houseId") String houseId) { + if (StringUtils.isBlank(houseId)) { return new Result<>(); } - return new Result().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(),houseId)); + return new Result().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(), houseId)); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java index 15ba83ef46..848e1cc053 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java @@ -18,20 +18,13 @@ package com.epmet.controller; 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.commons.tools.validator.AssertUtils; -import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcBuildingDTO; import com.epmet.service.IcBuildingService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; -import java.util.Map; /** @@ -43,46 +36,10 @@ import java.util.Map; @RestController @RequestMapping("icbuilding") public class IcBuildingController { - + @Autowired private IcBuildingService icBuildingService; - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icBuildingService.page(params); - return new Result>().ok(page); - } - - @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - IcBuildingDTO data = icBuildingService.get(id); - return new Result().ok(data); - } - - @PostMapping - public Result save(@RequestBody IcBuildingDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icBuildingService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody IcBuildingDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icBuildingService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icBuildingService.delete(ids); - return new Result(); - } - /** * @Description 获取小区内的楼栋 * @Param dto @@ -94,4 +51,10 @@ public class IcBuildingController { public Result> getBuildingOptions(@RequestBody IcBuildingDTO dto) { return new Result>().ok(icBuildingService.getBuildingOptions(dto.getNeighborHoodId())); } -} \ No newline at end of file + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcBuildingDTO data = icBuildingService.get(id); + return new Result().ok(data); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java index 8473a7ac72..edbdde8625 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java @@ -19,23 +19,17 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.dto.result.OptionResultDTO; -import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.AssertUtils; -import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcHouseDTO; import com.epmet.dto.form.HouseFormDTO; import com.epmet.dto.result.HouseListResultDTO; +import com.epmet.dto.result.HousesNameResultDTO; import com.epmet.service.IcHouseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; -import java.util.Map; /** @@ -47,45 +41,16 @@ import java.util.Map; @RestController @RequestMapping("ichouse") public class IcHouseController { - + @Autowired private IcHouseService icHouseService; - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icHouseService.page(params); - return new Result>().ok(page); - } - @GetMapping("{id}") public Result get(@PathVariable("id") String id){ IcHouseDTO data = icHouseService.get(id); return new Result().ok(data); } - @PostMapping - public Result save(@RequestBody IcHouseDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icHouseService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody IcHouseDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icHouseService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icHouseService.delete(ids); - return new Result(); - } @PostMapping("houseoption") public Result> getHouseOption(@RequestBody HouseFormDTO formDTO){ return new Result>().ok(icHouseService.getHouseOption(formDTO)); @@ -114,4 +79,15 @@ public class IcHouseController { return new Result>().ok(icHouseService.getHouseList(tokenDto, formDTO)); } -} \ No newline at end of file + /** + * Desc: 根据身份证查询房屋名 + * @param idCards + * @author zxc + * @date 2022/4/12 16:42 + */ + @PostMapping("houses-name") + public Result> getHousesNameByIdCards(@RequestBody List idCards){ + return new Result>().ok(icHouseService.getHousesNameByIdCards(idCards)); + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java index ab44cc24f6..627b5a5d8b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java @@ -19,6 +19,7 @@ package com.epmet.controller; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.enums.EnvEnum; @@ -35,13 +36,14 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcNeighborHoodDTO; -import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.IcNeighborHoodService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -52,6 +54,7 @@ import javax.servlet.http.HttpServletResponse; import java.awt.image.BufferedImage; import java.io.*; import java.net.URLEncoder; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -78,8 +81,17 @@ public class IcNeighborHoodController { return new Result>().ok(page); } + /** + * 可根据agencyId或者gridId查询 + * @param params + * @return + */ @PostMapping("open/list") - public Result> openList(@RequestBody IcNeighborHoodFormDTO params){ + public Result> openList(@RequestBody IcNeighborHoodAddFormDTO params){ + if (StringUtils.isBlank(params.getAgencyId()) && StringUtils.isBlank(params.getGridId())) { + PageData result = new PageData<>(new ArrayList<>(), NumConstant.ZERO); + return new Result>().ok(result); + } PageData page = icNeighborHoodService.openPage(params); return new Result>().ok(page); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java index da7f783c1e..743254c2d4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java @@ -18,37 +18,32 @@ package com.epmet.controller; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; -import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; -import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dao.IcBuildingDao; -import com.epmet.dto.form.IcNeighborHoodFormDTO; -import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.form.IcHouseListFormDTO; +import com.epmet.dto.form.IcNeighborHoodAddFormDTO; +import com.epmet.dto.form.IcNeighborHoodListFormDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.entity.IcBuildingEntity; -import com.epmet.excel.IcNeighborHoodExcel; -import com.epmet.service.BuildingService; -import com.epmet.service.HouseService; -import com.epmet.service.IcNeighborHoodService; import com.epmet.service.NeighborHoodService; import com.epmet.util.ExcelPoiUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; +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 javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; -import java.util.stream.Collectors; +import java.util.HashMap; +import java.util.List; /** @@ -62,63 +57,52 @@ import java.util.stream.Collectors; @RequestMapping("neighborhood") public class NeighborHoodController { - @Autowired - private IcNeighborHoodService icNeighborHoodService; @Autowired private NeighborHoodService neighborHoodService; - @Autowired - private BuildingService buildingService; - @Autowired - private HouseService houseService; @Resource private IcBuildingDao icBuildingDao; - - @PostMapping("neighborhoodlist") - public Result neighborhoodlist(@RequestBody ListIcNeighborHoodFormDTO formDTO){ + public Result neighborhoodlist(@RequestBody IcNeighborHoodListFormDTO formDTO){ //效验数据 ValidatorUtils.validateEntity(formDTO); - IcNeighborHoodResultDTO icNeighborHoodResultDTO = neighborHoodService.listNeighborhood(formDTO); - return new Result().ok(icNeighborHoodResultDTO); + return new Result().ok(neighborHoodService.listNeighborhood(formDTO)); } @NoRepeatSubmit @PostMapping("neighborhoodadd") - public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ + public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodAddFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.AddShowGroup.class); + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.AddShowGroup.class); String customerId = tokenDTO.getCustomerId(); -// String customerId = "123123"; - - neighborHoodService.AddNeighborhood(customerId,formDTO); + neighborHoodService.addNeighborhood(customerId,formDTO); return new Result(); } @NoRepeatSubmit @PostMapping("neighborhoodupdate") - public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ + public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodAddFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.UpdateShowGroup.class); + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.UpdateShowGroup.class); String customerId = tokenDTO.getCustomerId(); // String customerId = "123123"; - neighborHoodService.UpdateNeighborhood(customerId,formDTO); + neighborHoodService.updateNeighborhood(customerId,formDTO); return new Result(); } @PostMapping("neighborhooddel") - public Result neighborhooddel(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ + public Result neighborhooddel(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodAddFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class); + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.DeleteGroup.class); String neighborHoodId = formDTO.getNeighborHoodId(); //判断是否存在楼宇,如果存在不能删除 List icBuildingEntities = icBuildingDao.selectList(new QueryWrapper().lambda().eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId)); if(!CollectionUtils.isEmpty(icBuildingEntities)){ - return new Result().error(8001,"小区下已存在楼宇,无法删除"); + return new Result().error(8001,"小区下已存在楼栋,无法删除"); } - neighborHoodService.DelNeighborhood(neighborHoodId); + neighborHoodService.delNeighborhood(neighborHoodId); return new Result().ok("删除成功"); } @@ -130,7 +114,7 @@ public class NeighborHoodController { * @throws Exception */ @PostMapping("exportneighborhoodinfo") - public void exportneighborhoodinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + public void exportneighborhoodinfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception { ValidatorUtils.validateEntity(formDTO); neighborHoodService.exportNeighborhoodinfo(formDTO,response); @@ -142,94 +126,7 @@ public class NeighborHoodController { */ @PostMapping("exporttemplate") public void exportTemplate( HttpServletResponse response) throws Exception { -// ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); - TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_template.xlsx"); - Map map = new HashMap<>(); - map.put("maplist",new ArrayList()); - ExcelPoiUtils.exportExcel(templatePath ,map,"小区信息录入表",response); - - } - - /** - * 导出模板 - - * @param response - * @throws Exception - */ - /*@GetMapping("export") - public void export( HttpServletResponse response) throws Exception { - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_template.xlsx"); - Map map = new HashMap<>(); - map.put("maplist",new ArrayList()); - ExcelPoiUtils.exportExcel(templatePath ,map,"小区信息录入表",response); - - }*/ - /** - * 导出 - * @param response - * @throws Exception - */ - /* @RequestMapping("exportinfo") - public void exportinfo(HttpServletResponse response) throws Exception { - ListIcNeighborHoodFormDTO formDTO = new ListIcNeighborHoodFormDTO(); - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); - neighborHoodService.exportNeighborhoodinfo(formDTO,response); - - }*/ - - -// /** -// * 导入 -// * @param params -// * @param response -// * @throws Exception -// */ -// @PostMapping("importneighborhoodinfo") -// public void importneighborhoodinfo(@RequestParam Map params, HttpServletResponse response) throws Exception { -// List list = icNeighborHoodService.list(params); -// ExcelUtils.exportExcelToTarget(response, "小区信息录入表", list, IcNeighborHoodExcel.class); -//// ExcelUtils.expor -// } - - /** - * 导入数据 - * @param file - * @return - * @throws IOException - */ - @PostMapping("import") - public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException { - - String customerId = tokenDTO.getCustomerId(); -// String customerId = "123123"; - ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcNeighborHoodExcel.class); -// List result = ExcelPoiUtils.importExcel(file, 0, 1, IcNeighborHoodExcel.class); - List failList = importResult.getFailList(); - - //存放错误数据行号 - List numList = new ArrayList<>(); - if(!CollectionUtils.isEmpty(failList)){ - for ( IcNeighborHoodExcel entity : failList) { - log.warn("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 - numList.add(entity.getRowNum()); - } - //return new Result().error(8001,failList.get(0).getErrorMsg()); - } - List result =importResult.getList(); -// log.info(JSON.toJSONString(result)); - List resultList = neighborHoodService.importExcel(customerId,result,tokenDTO.getUserId(),numList); - String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size()); - if (resultList.size() > NumConstant.ZERO) { - Collections.sort(resultList); - String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、")); - log.warn(str + "第" + subList + "行未成功!"); - return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str + "第" + subList + "行未成功!"); - } - return new Result().ok(str); + ExcelPoiUtils.exportExcel(templatePath ,new HashMap<>(),"小区信息录入表",response); } - - - - } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java index 780e489e21..5c87d4ec46 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java @@ -20,10 +20,8 @@ package com.epmet.dao; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ImportGeneralDTO; -import com.epmet.dto.result.BaseInfoFamilyBuildingResultDTO; -import com.epmet.dto.result.BuildingResultDTO; -import com.epmet.dto.result.ExistHouseInfoResultDTO; -import com.epmet.dto.result.UpdateBuildingHouseNumResultDTO; +import com.epmet.dto.form.IcBuildingListFormDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.IcBuildingEntity; import com.epmet.entity.IcHouseEntity; @@ -45,16 +43,9 @@ import java.util.Set; @Mapper public interface IcBuildingDao extends BaseDao { -// IPage> searchBuildingByPage(IPage page, -// @Param("neighbor") IcNeighborHoodEntity neighbor, -// @Param("building")IcBuildingEntity building); - IPage> searchBuildingByPage(IPage page, - @Param("building")IcBuildingEntity building, @Param("house") IcHouseEntity house); -// List searchAllBuilding(@Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper, -// @Param("ew1") QueryWrapper buildingEntityQueryWrapper); -// List searchAllBuilding(@Param("neighbor") IcNeighborHoodEntity neighbor, -// @Param("building")IcBuildingEntity building); + List searchBuildingByPage(IcBuildingListFormDTO formDTO); + List searchAllBuilding( @Param("building")IcBuildingEntity building, @Param("house")IcHouseEntity house); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java index c5a392e6ca..8c17130cd9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -1,17 +1,17 @@ package com.epmet.dao; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ImportGeneralDTO; +import com.epmet.dto.form.IcHouseListFormDTO; import com.epmet.dto.result.HouseInfoDTO; +import com.epmet.dto.result.HousesNameResultDTO; +import com.epmet.dto.result.IcHouseListResultDTO; import com.epmet.dto.result.NeighborHoodManageDelResultDTO; import com.epmet.entity.IcHouseEntity; -import com.epmet.excel.IcHouseExcel; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; -import java.util.Map; import java.util.Set; /** @@ -23,24 +23,7 @@ import java.util.Set; @Mapper public interface IcHouseDao extends BaseDao { -// IPage> searchHouseByPage(IPage page, -// @Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper, -// @Param("ew1") QueryWrapper buildingEntityQueryWrapper, -// @Param("ew2") QueryWrapper houseEntityQueryWrapper); -// IPage> searchHouseByPage(IPage page, -// @Param("neighbor") IcNeighborHoodEntity neighbor, -// @Param("building") IcBuildingEntity building, -// @Param("house") IcHouseEntity house); - IPage> searchHouseByPage(IPage page, - @Param("pids") String pids, - @Param("buildingId") String buildingId, - @Param("ownerName") String ownerName, - @Param("ownerPhone") String ownerPhone, - @Param("neighborHoodName") String neighborHoodName, - @Param("buildingName") String buildingName, - @Param("queryScene") String queryScene); - - List searchAllHouse(@Param("house") IcHouseEntity house); + List searchHouseByPage(IcHouseListFormDTO formDTO); List queryHouseInfo(@Param("houseIdList") Set houseIdList); @@ -92,4 +75,20 @@ public interface IcHouseDao extends BaseDao { */ void houseUpdate(@Param("houses") List houses); -} \ No newline at end of file + /** + * Desc: 根据身份证查询房屋名 + * @param idCards + * @author zxc + * @date 2022/4/12 16:42 + */ + List getHousesNameByIdCards(@Param("idCards") List idCards); + + /** + * Desc: 根据楼栋ID修改房屋名 + * @param buildingId + * @author zxc + * @date 2022/4/26 13:49 + */ + void houseUpdateHouseName(@Param("buildingId")String buildingId); + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java index 43b6aedaf5..d2adb6c87f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java @@ -17,8 +17,9 @@ package com.epmet.dao; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcNeighborHoodListFormDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.entity.IcHouseEntity; import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.excel.IcNeighborHoodExcel; @@ -26,7 +27,6 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; -import java.util.Map; /** * 小区表 @@ -37,10 +37,8 @@ import java.util.Map; @Mapper public interface IcNeighborHoodDao extends BaseDao { -// IPage> searchNeighborhoodByPage(IPage page,@Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper); - IPage> searchNeighborhoodByPage(IPage page, @Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house); + List searchNeighborhoodByPage(IcNeighborHoodListFormDTO formDTO); -// List searchAllNeighborhood(@Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper); List searchAllNeighborhood(@Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house); List selectListByName(@Param("customerId") String customerId, @@ -61,4 +59,4 @@ public interface IcNeighborHoodDao extends BaseDao { */ List selectNeighborhoodNameByNames(@Param("names")List names,@Param("customerId") String customerId); -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java deleted file mode 100644 index be6ba11d2f..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.excel; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import com.epmet.util.ExcelVerifyInfo; -import lombok.Data; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 房屋信息 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2021-10-27 - */ -@Data -public class IcHouseExcel extends ExcelVerifyInfo implements Serializable { - - /*@Excel(name = "房屋主键") - private String id; - - @Excel(name = "客户id") - private String customerId; - - @Excel(name = "小区id") - private String neighborHoodId; - - @Excel(name = "片区id,neighbor_hood_part.id,可为空。") - private String partId; - - @Excel(name = "所属楼栋id") - private String buildingId; - - @Excel(name = "所属单元id") - private String buildingUnitId; - - @Excel(name = "房屋名字后台插入时生成") - private String houseName; - - @Excel(name = "门牌号") - private String doorName; - - @Excel(name = "房屋类型,这里存储字典value就可以") - private String houseType; - - @Excel(name = "存储字典value") - private String purpose; - - @Excel(name = "1出租;0未出租") - private Integer rentFlag; - - @Excel(name = "房主姓名") - private String ownerName; - - @Excel(name = "房主电话") - private String ownerPhone; - - @Excel(name = "房主身份证号") - private String ownerIdCard; - - @Excel(name = "删除标识 0未删除、1已删除") - private String delFlag; - - @Excel(name = "乐观锁") - private Integer revision; - - @Excel(name = "创建人") - private String createdBy; - - @Excel(name = "创建时间") - private Date createdTime; - - @Excel(name = "更新人") - private String updatedBy; - - @Excel(name = "更新时间") - private Date updatedTime;*/ - - @Excel(name = "所属组织") - @NotBlank(message = "不能为空") - private String agencyName; - - @Excel(name = "所属网格") - @NotBlank(message = "不能为空") - private String gridName; - - @Excel(name = "所属小区") - @NotBlank(message = "不能为空") - @Length(max=50,message = "不能超过50个字") - private String neighborHoodName; - - @Excel(name = "所属楼栋") - @NotBlank(message = "不能为空") - private String buildingName; - - @Excel(name = "单元号") - @NotNull(message = "不能为空") - private Integer buildingUnit; - - @Excel(name = "门牌号") - @NotBlank(message = "不能为空") - private String doorName; - - @Excel(name = "房屋类型") - @NotBlank(message = "不能为空") - private String houseType; - - @Excel(name = "房屋用途") - @NotBlank(message = "不能为空") - private String purpose; - - @Excel(name = "出租") - @NotBlank(message = "不能为空") - private String rentFlag; - - @Excel(name = "房主姓名") - @NotBlank(message = "不能为空") - private String ownerName; - - @Excel(name = "房主电话") - @NotBlank(message = "不能为空") - private String ownerPhone; - - @Excel(name = "房主身份证") - @NotBlank(message = "不能为空") - private String ownerIdCard; - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingErrorInfoModel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingErrorInfoModel.java index 7477c1a109..f2746aa90b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingErrorInfoModel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingErrorInfoModel.java @@ -12,6 +12,9 @@ import lombok.Data; @Data public class BuildingErrorInfoModel { + @Excel(name = "行号", width = 20) + private Integer num; + @Excel(name = "小区名称" , width = 20) private String neighborHoodName; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingInfoModel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingInfoModel.java index e76c391324..dac7c09015 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingInfoModel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingInfoModel.java @@ -1,5 +1,6 @@ package com.epmet.model; +import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import lombok.Data; @@ -35,4 +36,7 @@ public class BuildingInfoModel { @ExcelProperty(value = "户数") private Integer totalHouseNum; + @ExcelIgnore + private Integer num; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseErrorInfoModel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseErrorInfoModel.java index 4531b2c03f..c49ea51719 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseErrorInfoModel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseErrorInfoModel.java @@ -13,7 +13,7 @@ import org.hibernate.validator.constraints.Length; @Data public class HouseErrorInfoModel { - @Excel(name = "行号(不计算表头)", width = 20) + @Excel(name = "行号", width = 20) private Integer num; @Excel(name = "所属小区", width = 20) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java index be716f7c94..740892f4cd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java @@ -38,7 +38,7 @@ public class HouseInfoModel { @ExcelProperty(value = "房屋用途") private String purpose; - @ExcelProperty(value = "出租") + @ExcelProperty(value = "房屋状态") private String rentFlagString; @ExcelProperty(value = "房主姓名") diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java index 7451f1f996..cc0bc625ca 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java @@ -30,6 +30,8 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import static com.epmet.constant.ImportErrorMsgConstants.*; + /** * @Author zxc * @DateTime 2022/2/15 10:06 上午 @@ -84,6 +86,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener map = BeanUtil.beanToMap(value, false, true); redisUtils.hMSet(key, map); } - public CustomerAgencyDTO get(String agencyId){ + public AgencyInfoCache get(String agencyId){ String key = RedisKeys.getAgencyByIdKey(agencyId); Map resultMap = redisUtils.hGetAll(key); if (CollectionUtils.isEmpty(resultMap)) { return null; } - return BeanUtil.mapToBean(resultMap, CustomerAgencyDTO.class, true); + return BeanUtil.mapToBean(resultMap, AgencyInfoCache.class, true); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java index 01792daf8c..63ff8d25e5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java @@ -90,6 +90,11 @@ public class IcHouseRedis { return houseInfo; } + public void delHouseInfo(String houseId,String customerId){ + String key = RedisKeys.getHouseInfoCacheKey(houseId,customerId); + redisUtils.delete(key); + } + /** * @Description 存放房屋临时缓存 * @param customerId diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java index 81a9f10390..441995271b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java @@ -17,16 +17,17 @@ package com.epmet.service; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.BuildingTreeLevelDTO; -import com.epmet.dto.form.IcBulidingFormDTO; +import com.epmet.dto.form.IcBuildingListFormDTO; +import com.epmet.dto.form.IcBulidingAddFormDTO; +import com.epmet.dto.form.IcHouseListFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; -import com.epmet.dto.form.ListIcNeighborHoodFormDTO; import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultPagedDTO; -import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.dto.result.IcBuildingListResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; -import com.epmet.excel.IcBuildingExcel; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @@ -45,7 +46,7 @@ public interface BuildingService { - void updateBuilding(String customerId, IcBulidingFormDTO formDTO); + void updateBuilding(String customerId, IcBulidingAddFormDTO formDTO); /** * 删除小区 @@ -54,15 +55,14 @@ public interface BuildingService { void delBuilding(String buildingId); - void addBuilding(String customerId, IcBulidingFormDTO formDTO); + void addBuilding(String customerId, IcBulidingAddFormDTO formDTO); List treeList(String customerId, String staffId); + List treeIds(String customerId, String staffId); - List importExcel(String customerId, List list, String staffId, List numList); + PageData listBuilding(IcBuildingListFormDTO formDTO); - IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO); - - void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ; + void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception ; List buildingListByIds(List buildingIdList); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java index a651ed1615..6e294a8e7b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -17,15 +17,12 @@ package com.epmet.service; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.IcHouseFormDTO; -import com.epmet.dto.form.ImportInfoFormDTO; -import com.epmet.dto.form.ListIcNeighborHoodFormDTO; -import com.epmet.dto.form.NeighborHoodManageDelFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.HouseInfoDTO; -import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.dto.result.IcHouseListResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; -import com.epmet.excel.IcHouseExcel; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; @@ -40,10 +37,20 @@ import java.util.Set; */ public interface HouseService { - void addHouse(String customerId, IcHouseFormDTO formDTO); + void addHouse(String customerId, IcHouseAddFormDTO formDTO); - void updateHouse(String customerId, IcHouseFormDTO formDTO); + void updateHouse(String customerId, IcHouseAddFormDTO formDTO); + + /** + * 小寨子社区-合同签订后变更成出租状态 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/4/26 11:16 + */ + void update2Rent(RentHouseFormDTO formDTO); /** * 删除小区 @@ -51,20 +58,9 @@ public interface HouseService { */ void delHouse(String houseId); + PageData getHouseList(IcHouseListFormDTO formDTO); - List importExcel(String customerId, List list, String staffId, List numList); - - IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId, - String buildingId, - String ownerName, - String ownerPhone, - String neighborHoodName, - String buildingName, - String queryScene, - Integer pageNo, - Integer pageSize); - - void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception; + void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception; List queryListHouseInfo(Set houseIds, String customerId); @@ -79,4 +75,4 @@ public interface HouseService { void allDelete(NeighborHoodManageDelFormDTO formDTO); HouseInfoDTO getHouseInfoDTO(String customerId,String houseId); -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java index 423f218049..bd82a396c1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java @@ -8,6 +8,7 @@ import com.epmet.dto.IcHouseDTO; import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.form.HouseFormDTO; import com.epmet.dto.result.HouseListResultDTO; +import com.epmet.dto.result.HousesNameResultDTO; import com.epmet.entity.IcHouseEntity; import java.util.List; @@ -116,4 +117,12 @@ public interface IcHouseService extends BaseService { */ void houseUpdate(List houses); + /** + * Desc: 根据身份证查询房屋名 + * @param idCards + * @author zxc + * @date 2022/4/12 16:42 + */ + List getHousesNameByIdCards(List idCards); + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java index 3dcfaba0da..fb97d3add3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java @@ -23,7 +23,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.ImportGeneralDTO; -import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.entity.IcNeighborHoodEntity; @@ -154,5 +154,5 @@ public interface IcNeighborHoodService extends BaseService * @param params * @return */ - PageData openPage(IcNeighborHoodFormDTO params); + PageData openPage(IcNeighborHoodAddFormDTO params); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java index ff1a35f45a..24427a6657 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java @@ -17,13 +17,13 @@ package com.epmet.service; -import com.epmet.dto.form.IcNeighborHoodFormDTO; -import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.IcHouseListFormDTO; +import com.epmet.dto.form.IcNeighborHoodAddFormDTO; +import com.epmet.dto.form.IcNeighborHoodListFormDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; -import com.epmet.excel.IcNeighborHoodExcel; import javax.servlet.http.HttpServletResponse; -import java.util.List; /** * 小区表 @@ -33,24 +33,22 @@ import java.util.List; */ public interface NeighborHoodService{ - void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO); + void addNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO); - IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO); + PageData listNeighborhood(IcNeighborHoodListFormDTO formDTO); - void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO); + void updateNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO); /** * 删除小区 * @param neighborHoodId */ - void DelNeighborhood(String neighborHoodId); + void delNeighborhood(String neighborHoodId); /** * 导出数据 * @param formDTO * @param response */ - void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ; - - List importExcel(String customerId, List list, String staffId, List numList); -} \ No newline at end of file + void exportNeighborhoodinfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception ; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 7a81bd7fd0..c07985347c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -20,6 +20,7 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; @@ -490,16 +491,53 @@ public class AgencyServiceImpl implements AgencyService { @Override public CustomerAgencyDTO getAgencyById(String agencyId) { - CustomerAgencyDTO cachedAgency = customerAgencyRedis.get(agencyId); - if (cachedAgency == null) { - cachedAgency = new CustomerAgencyDTO(); + AgencyInfoCache agencyInfoCache = customerAgencyRedis.get(agencyId); + if (agencyInfoCache == null) { + agencyInfoCache = new AgencyInfoCache(); CustomerAgencyEntity agencyEntity = customerAgencyDao.selectById(agencyId); if (agencyEntity != null) { - BeanUtils.copyProperties(agencyEntity, cachedAgency); + //设置行政地区编码全路径 + if (StringUtils.isNotBlank(agencyEntity.getAreaCode()) && StringUtils.isNotBlank(agencyEntity.getParentAreaCode())) { + agencyInfoCache.setAreaCodePath(queryAreaCodePath(agencyEntity)); + } + BeanUtils.copyProperties(agencyEntity, agencyInfoCache); } - customerAgencyRedis.set(agencyId, cachedAgency); + customerAgencyRedis.set(agencyId, agencyInfoCache); + } + CustomerAgencyDTO customerAgencyDTO=ConvertUtils.sourceToTarget(agencyInfoCache,CustomerAgencyDTO.class); + return customerAgencyDTO; + } + + private List queryAreaCodePath(CustomerAgencyEntity 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 cachedAgency; + return areaCodePath; } @Override diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java index 04670fde28..3866a9c6ad 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -7,13 +7,18 @@ import com.alibaba.excel.read.metadata.ReadSheet; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -21,13 +26,10 @@ import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.*; import com.epmet.dto.BuildingTreeLevelDTO; import com.epmet.dto.IcBuildingDTO; -import com.epmet.dto.form.IcBulidingFormDTO; -import com.epmet.dto.form.ImportInfoFormDTO; -import com.epmet.dto.form.ImportTaskCommonFormDTO; -import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultPagedDTO; -import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.dto.result.IcBuildingListResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.entity.*; import com.epmet.enums.BuildingTypeEnums; @@ -36,8 +38,13 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.model.BuildingInfoModel; import com.epmet.model.ImportBuildingInfoListener; import com.epmet.redis.IcHouseRedis; -import com.epmet.service.*; +import com.epmet.service.BuildingService; +import com.epmet.service.IcBuildingService; +import com.epmet.service.IcBuildingUnitService; +import com.epmet.service.IcNeighborHoodService; import com.epmet.util.ExcelPoiUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -47,11 +54,12 @@ import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; import java.io.InputStream; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.ExecutorService; -import java.util.function.Function; import java.util.stream.Collectors; @Slf4j @@ -63,15 +71,10 @@ public class BuildingServiceImpl implements BuildingService { private IcBuildingService icBuildingService; @Resource private IcBuildingDao icBuildingDao; - @Autowired private IcBuildingUnitService icBuildingUnitService; - @Resource private IcHouseDao icHouseDao; - @Autowired - private IcHouseService icHouseService; - @Resource private CustomerAgencyDao customerAgencyDao; @Resource @@ -79,8 +82,6 @@ public class BuildingServiceImpl implements BuildingService { @Resource private IcNeighborHoodDao icNeighborHoodDao; @Resource - private CustomerStaffAgencyDao customerStaffAgencyDao; - @Resource private IcBuildingUnitDao icBuildingUnitDao; @Autowired private IcHouseRedis icHouseRedis; @@ -93,13 +94,13 @@ public class BuildingServiceImpl implements BuildingService { @Override @Transactional(rollbackFor = Exception.class) - public void addBuilding(String customerId, IcBulidingFormDTO formDTO) { + public void addBuilding(String customerId, IcBulidingAddFormDTO formDTO) { //同一小区下不能存在楼栋名字一样的 - Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),null); + Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(), formDTO.getBuildingName(), null); if (null != count && count > 0) { - throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(),EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); + throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); } - IcBuildingDTO icBuildingDTO= ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); + IcBuildingDTO icBuildingDTO = ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); icBuildingDTO.setCustomerId(customerId); IcBuildingEntity entity = ConvertUtils.sourceToTarget(icBuildingDTO, IcBuildingEntity.class); icBuildingDao.insert(entity); @@ -107,23 +108,23 @@ public class BuildingServiceImpl implements BuildingService { //设置楼宇单元 Integer totalUnitNum = formDTO.getTotalUnitNum(); List unitList = new ArrayList<>(); - for(int i =0 ;i treeList(String customerId, String staffId) { CustomerStaffInfoCacheResult agency = CustomerStaffRedis.getStaffInfo(customerId, staffId); - if(null == agency || StringUtils.isBlank(agency.getAgencyId())){ - log.error("com.epmet.service.impl.BuildingServiceImpl.treeList,没有找到工作人员所属的机关信息,用户Id:{}",staffId); + if (null == agency || StringUtils.isBlank(agency.getAgencyId())) { + log.error("com.epmet.service.impl.BuildingServiceImpl.treeList,没有找到工作人员所属的机关信息,用户Id:{}", staffId); return new ArrayList<>(); } @@ -134,7 +135,7 @@ public class BuildingServiceImpl implements BuildingService { List customerAgencyList = icBuildingDao.selectAgencyChildrenList(agency.getAgencyId()); customerAgencyList.add(customerAgency); - if(CollectionUtils.isEmpty(customerAgencyList)){ + if (CollectionUtils.isEmpty(customerAgencyList)) { return new ArrayList<>(); } @@ -153,14 +154,13 @@ public class BuildingServiceImpl implements BuildingService { }).collect(Collectors.toList()); - //2.获取组织所在网格 List agencyIdList = customerAgencyList.stream().map(BaseEpmetEntity::getId).collect(Collectors.toList()); // agencyIdList.add(customerAgency.getId()); List customerGridList = customerGridDao.selectList(new QueryWrapper().lambda().in(CustomerGridEntity::getPid, agencyIdList)); - if(CollectionUtils.isEmpty(customerGridList)){ - return covertToTree(customerAgency,agencyList); + if (CollectionUtils.isEmpty(customerGridList)) { + return covertToTree(customerAgency, agencyList); } List gridList = customerGridList.stream().map(item -> { @@ -184,9 +184,9 @@ public class BuildingServiceImpl implements BuildingService { .in(IcNeighborHoodEntity::getGridId, gridIdList) .orderByAsc(IcNeighborHoodEntity::getCreatedTime); List icNeighborHoodList = icNeighborHoodDao.selectList(queryWrapper); - if(CollectionUtils.isEmpty(icNeighborHoodList)){ + if (CollectionUtils.isEmpty(icNeighborHoodList)) { agencyList.addAll(gridList); - return covertToTree(customerAgency,agencyList); + return covertToTree(customerAgency, agencyList); } List neighbourHoodList = icNeighborHoodList.stream().map(item -> { BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); @@ -206,13 +206,13 @@ public class BuildingServiceImpl implements BuildingService { List neighborHoodIdList = icNeighborHoodList.stream().map(BaseEpmetEntity::getId).collect(Collectors.toList()); LambdaQueryWrapper buildingQueryWrapper = new QueryWrapper().lambda() .in(IcBuildingEntity::getNeighborHoodId, neighborHoodIdList) - .orderByAsc(IcBuildingEntity::getCreatedTime,IcBuildingEntity::getBuildingName); + .orderByAsc(IcBuildingEntity::getCreatedTime, IcBuildingEntity::getBuildingName); List icBuildingList = icBuildingDao.selectList(buildingQueryWrapper); - if(CollectionUtils.isEmpty(neighborHoodIdList)){ + if (CollectionUtils.isEmpty(neighborHoodIdList)) { agencyList.addAll(gridList); agencyList.addAll(neighbourHoodList); - return covertToTree(customerAgency,agencyList); + return covertToTree(customerAgency, agencyList); } //获取楼里已经有多少个房屋 LambdaQueryWrapper icHouseEntityWrapper = new QueryWrapper().lambda() @@ -246,10 +246,10 @@ public class BuildingServiceImpl implements BuildingService { // .in(IcHouseEntity::getBuildingId, item.getId()); // int count= icHouseDao.selectCount(icHouseEntityWrapper); int count = buildingHouseCountMap.getOrDefault(item.getId(), NumConstant.ZERO_L).intValue(); - if(NumConstant.ZERO==total){ - buildingTreeLevelDTO.setShowNum(String.format("%s/%s",count,count)); - }else{ - buildingTreeLevelDTO.setShowNum(String.format("%s/%s",count,total)); + if (NumConstant.ZERO == total) { + buildingTreeLevelDTO.setShowNum(String.format("%s/%s", count, count)); + } else { + buildingTreeLevelDTO.setShowNum(String.format("%s/%s", count, total)); } return buildingTreeLevelDTO; }).collect(Collectors.toList()); @@ -257,131 +257,78 @@ public class BuildingServiceImpl implements BuildingService { agencyList.addAll(gridList); agencyList.addAll(neighbourHoodList); agencyList.addAll(buildingList); - return covertToTree(customerAgency,agencyList); + return covertToTree(customerAgency, agencyList); } @Override - @Transactional(rollbackFor = Exception.class) - public List importExcel(String customerId, List list, String staffId, List numList) { - //2021.11.9 需求变更 当前工作人员只能导致自己所属组织下数据,网格名对应不上的数据舍弃【注:需求就这样】 sun - CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); - //组织名称不一样的数据舍弃 - Iterator iterator = list.iterator(); - while (iterator.hasNext()) { - IcBuildingExcel obj = iterator.next(); - if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { - numList.add(obj.getRowNum()); - iterator.remove(); - } + public List treeIds(String customerId, String staffId) { + List result = new ArrayList<>(); + CustomerStaffInfoCacheResult agency = CustomerStaffRedis.getStaffInfo(customerId, staffId); + if (null == agency || StringUtils.isBlank(agency.getAgencyId())) { + log.error("com.epmet.service.impl.BuildingServiceImpl.treeIds,没有找到工作人员所属的机关信息,用户Id:{}", staffId); + return new ArrayList<>(); } - //用于存储匹配不上的数据给前端的提示 如南宁社区不存在 - //StringBuffer str = new StringBuffer(""); - //end sun - //导入 - if(CollectionUtils.isEmpty(list)){ - return numList; + //1.获取所在组织及下级组织 + CustomerAgencyEntity customerAgency = customerAgencyDao.selectById(agency.getAgencyId()); + List customerAgencyList = icBuildingDao.selectAgencyChildrenList(agency.getAgencyId()); + customerAgencyList.add(customerAgency); + if (CollectionUtils.isEmpty(customerAgencyList)) { + return new ArrayList<>(); } - //查询所有组织和网格根据名字 - - - - //获取所有小区 list 根据组织和网格 - Set neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toSet()); - Set agencyNameList = list.stream().map(item -> item.getAgencyName()).collect(Collectors.toSet()); - Set gridNameList = list.stream().map(item -> item.getGridName()).collect(Collectors.toSet()); - List neighborHoodList = icNeighborHoodDao.selectListByName(customerId, new ArrayList(neighborNameList),new ArrayList(agencyNameList),new ArrayList(gridNameList)); -// List neighborHoodList = icNeighborHoodDao.selectList(new QueryWrapper().lambda().in(IcNeighborHoodEntity::getNeighborHoodName, neighborNameList)); - Map neighborHoodMap = neighborHoodList.stream().collect(Collectors.toMap(IcNeighborHoodEntity::getNeighborHoodName, Function.identity(),(key1, key2)->key1)); - - - //2.获取小区数据 - //封装数据 - List buildingEntityList = new ArrayList<>(); - List icBuildingUnitEntityList = new ArrayList<>(); - Iterator iterator1 = list.iterator(); - while (iterator1.hasNext()) { - IcBuildingExcel icBuildingExcel = iterator1.next(); - IcBuildingEntity entity = new IcBuildingEntity(); - String uuid = UUID.randomUUID().toString().replace("-", ""); - entity.setId(uuid); - entity.setCustomerId(customerId); - entity.setNeighborHoodId(Optional.ofNullable(neighborHoodMap.get(icBuildingExcel.getNeighborHoodName())).map(u->u.getId()).orElse(""));//neighborHoodMap.get(icBuildingExcel.getNeighborHoodName()).getId() - if ("".equals(entity.getNeighborHoodId())) { - //str.append("".equals(str) ? icBuildingExcel.getNeighborHoodName() : str.append("、").append(icBuildingExcel.getNeighborHoodName())); - numList.add(icBuildingExcel.getRowNum()); - iterator1.remove(); - continue; - } - entity.setBuildingName(icBuildingExcel.getBuildingName()); - entity.setType(BuildingTypeEnums.getKeyByValue(icBuildingExcel.getType())); - entity.setSort(0); - entity.setTotalUnitNum(icBuildingExcel.getTotalUnitNum()); - entity.setTotalFloorNum(icBuildingExcel.getTotalFloorNum()); - entity.setTotalHouseNum(icBuildingExcel.getTotalHouseNum()); - buildingEntityList.add(entity); - - Integer totalUnitNum = icBuildingExcel.getTotalUnitNum(); - //设置楼宇单元 - List unitList = new ArrayList<>(); - for(int i =0 ;i 0) { - //throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(),EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); - log.error(EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); - numList.add(icBuildingExcel.getRowNum()); - iterator1.remove(); - continue; - } - icBuildingUnitEntityList.addAll(unitList); + result.addAll(customerAgencyList.stream().map(m -> m.getId()).collect(Collectors.toList())); + List agencyList = customerAgencyList.stream().map(item -> { + BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); + buildingTreeLevelDTO.setId(item.getId()); + buildingTreeLevelDTO.setPId(item.getPid()); + buildingTreeLevelDTO.setLabel(item.getOrganizationName()); + buildingTreeLevelDTO.setLevel(item.getLevel()); + buildingTreeLevelDTO.setLongitude(item.getLongitude()); + buildingTreeLevelDTO.setLatitude(item.getLatitude()); + buildingTreeLevelDTO.setChildren(new ArrayList<>()); + //当前组织有几个下级组织 + buildingTreeLevelDTO.setShowNum(StrConstant.EPMETY_STR); + return buildingTreeLevelDTO; + }).collect(Collectors.toList()); + //2.获取组织所在网格 + List agencyIdList = customerAgencyList.stream().map(BaseEpmetEntity::getId).collect(Collectors.toList()); + List customerGridList = customerGridDao.selectList(new QueryWrapper().lambda().in(CustomerGridEntity::getPid, agencyIdList)); + if (CollectionUtils.isEmpty(customerGridList)) { + return result; } - //3.保存 - //4.新增单元 - icBuildingService.insertBatch(buildingEntityList); - icBuildingUnitService.insertBatch(icBuildingUnitEntityList); - - /* if(!"".equals(str)){ - return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str.append("不存在").toString()); - }*/ - return numList; + result.addAll(customerGridList.stream().map(m -> m.getId()).collect(Collectors.toList())); + return result; } @Override - public IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO) { - - IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); - IPage> resultMap = searchBuilding(formDTO); - result.setTotal(Long.valueOf(resultMap.getTotal()).intValue()); - result.setList(resultMap.getRecords()); - return result; + public PageData listBuilding(IcBuildingListFormDTO formDTO) { + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) + .doSelectPageInfo(() -> icBuildingDao.searchBuildingByPage(formDTO)); + List records = pageInfo.getList(); + records.forEach(item -> item.setBuildingType(BuildingTypeEnums.getTypeValue(item.getBuildingTypeKey()))); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); } @Override - public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + public void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception { //如果类型是building 查楼栋 //导出楼栋 List icBuildingExcels = searchAllBuilding(formDTO); TemplateExportParams templatePath = new TemplateExportParams("excel/building_export.xlsx"); - Map map = new HashMap<>(); - map.put("maplist",icBuildingExcels); - ExcelPoiUtils.exportExcel(templatePath ,map,"楼宇信息录入表",response); - return ; + Map map = new HashMap<>(); + map.put("maplist", icBuildingExcels); + ExcelPoiUtils.exportExcel(templatePath, map, "楼栋信息录入表", response); + return; } + @Override public List buildingListByIds(List buildingIdList) { return icBuildingDao.buildingListByIds(buildingIdList); } + @Override - public BuildingResultPagedDTO buildinglistbyidsPage(List buildingIdList,Integer pageNo, Integer pageSize) { - IPage page = new Page(pageNo,pageSize); + public BuildingResultPagedDTO buildinglistbyidsPage(List buildingIdList, Integer pageNo, Integer pageSize) { + IPage page = new Page(pageNo, pageSize); IPage buildingResultDTOIPage = icBuildingDao.buildingListByIds(page, buildingIdList); BuildingResultPagedDTO result = new BuildingResultPagedDTO(); result.setTotal(Long.valueOf(buildingResultDTOIPage.getTotal()).intValue()); @@ -391,29 +338,29 @@ public class BuildingServiceImpl implements BuildingService { } /** + * @param formDTO + * @param inputStream * @Description 楼宇导入 - * 根据左侧树选中的层级,可导入对应数据: + * 根据左侧树选中的层级,可导入对应数据: * 1. 选中社区可导入该社区下所有小区信息、楼宇信息、房屋信息(没有匹配的小区、楼宇均新增,网格没有对应的不新增); * 2. 选中网格可导入该网格下所有小区信息、楼宇信息、房屋信息(没有匹配的小区、楼宇均新增); * 3. 选中小区可导入该小区下所有楼宇信息、房屋信息(没有匹配的楼宇均新增); * 4. 选中楼宇可导入该楼宇下所有房屋信息。 - * @param formDTO - * @param file * @author zxc * @date 2022/2/13 10:15 上午 */ @Override - public Result buildingImportExcel(ImportInfoFormDTO formDTO, InputStream inputStream,Result importTask) throws IOException { + public Result buildingImportExcel(ImportInfoFormDTO formDTO, InputStream inputStream, Result importTask) { executorService.submit(() -> { ExcelReader excelReader = null; try { excelReader = EasyExcel.read(inputStream).build(); // 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener ReadSheet readSheet = EasyExcel.readSheet(0).head(BuildingInfoModel.class) - .registerReadListener(new ImportBuildingInfoListener(formDTO,icHouseRedis,icBuildingDao,neighborHoodService,epmetCommonServiceOpenFeignClient,importTask.getData().getTaskId())) + .registerReadListener(new ImportBuildingInfoListener(formDTO, icHouseRedis, icBuildingDao, neighborHoodService, epmetCommonServiceOpenFeignClient, importTask.getData().getTaskId())) .build(); excelReader.read(readSheet); - } catch (Exception e){ + } catch (Exception e) { ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); input.setOperatorId(formDTO.getUserId()); input.setTaskId(importTask.getData().getTaskId()); @@ -428,48 +375,19 @@ public class BuildingServiceImpl implements BuildingService { return new Result<>(); } - private List searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) { - -// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); -// neighborHoodEntityQueryWrapper.lambda() -// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) -// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) -// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) -// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); -// IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); - -// QueryWrapper buildingEntityQueryWrapper = new QueryWrapper<>(); -// buildingEntityQueryWrapper.lambda() -// .eq(!StringUtils.isEmpty(formDTO.getBuildingId()),IcBuildingEntity::getId,formDTO.getBuildingId()) -// .like(!StringUtils.isEmpty(formDTO.getBuildingName()),IcBuildingEntity::getBuildingName,formDTO.getBuildingName()); -// buildingEntityQueryWrapper.eq("a.DEL_FLAG","0"); + private List searchAllBuilding(IcHouseListFormDTO formDTO) { IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); building.setDelFlag("0"); IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); List icBuildingExcels = icBuildingDao.searchAllBuilding(building, house); - icBuildingExcels.forEach(item->{ + icBuildingExcels.forEach(item -> { item.setType(BuildingTypeEnums.getTypeValue(item.getType())); }); return icBuildingExcels; } - private IPage> searchBuilding(ListIcNeighborHoodFormDTO formDTO) { - IPage page = new Page(formDTO.getPageNo(),formDTO.getPageSize()); - - IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); - building.setDelFlag("0"); - IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); - IPage> mapIPage = icBuildingDao.searchBuildingByPage(page, building, house); - List> records = mapIPage.getRecords(); - records.forEach(item->{ - item.put("buildingType", BuildingTypeEnums.getTypeValue(item.get("buildingTypeKey"))); - }); - return mapIPage; - } - - - private List covertToTree(CustomerAgencyEntity customerAgency,List agencyList) { + private List covertToTree(CustomerAgencyEntity customerAgency, List agencyList) { BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); buildingTreeLevelDTO.setId(customerAgency.getId()); buildingTreeLevelDTO.setLabel(customerAgency.getOrganizationName()); @@ -477,7 +395,7 @@ public class BuildingServiceImpl implements BuildingService { buildingTreeLevelDTO.setLongitude(customerAgency.getLongitude()); buildingTreeLevelDTO.setLatitude(customerAgency.getLatitude()); buildingTreeLevelDTO.setChildren(new ArrayList<>()); - recursionCovertToTree(buildingTreeLevelDTO,agencyList); + recursionCovertToTree(buildingTreeLevelDTO, agencyList); List result = new ArrayList<>(); result.add(buildingTreeLevelDTO); return result; @@ -487,77 +405,90 @@ public class BuildingServiceImpl implements BuildingService { //获取子节点 List subList = customerAgencyList.stream().filter(item -> item.getPId().equals(parent.getId())).collect(Collectors.toList()); - for(BuildingTreeLevelDTO agencyEntity :subList){ - recursionCovertToTree(agencyEntity,customerAgencyList); + for (BuildingTreeLevelDTO agencyEntity : subList) { + recursionCovertToTree(agencyEntity, customerAgencyList); } parent.setChildren(subList); - if(!"building".equals(parent.getLevel())){ + if (!"building".equals(parent.getLevel())) { parent.setShowNum(CollectionUtils.isEmpty(subList) ? NumConstant.ZERO_STR : String.valueOf(subList.size())); } - parent.setShowName(String.format("%s(%s)",parent.getLabel(),parent.getShowNum())); + parent.setShowName(String.format("%s(%s)", parent.getLabel(), parent.getShowNum())); } - /** * 更新 + * * @param customerId * @param formDTO */ @Override @Transactional(rollbackFor = Exception.class) - public void updateBuilding(String customerId, IcBulidingFormDTO formDTO) { + public void updateBuilding(String customerId, IcBulidingAddFormDTO formDTO) { //同一小区下不能存在楼栋名字一样的 - Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),formDTO.getBuildingId()); + Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(), formDTO.getBuildingName(), formDTO.getBuildingId()); if (null != count && count > 0) { - throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(),EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); + throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); } - IcBuildingDTO icBuilding= icBuildingService.get(formDTO.getBuildingId()); + IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId()); - if(!icBuilding.getNeighborHoodId().equals(formDTO.getNeighborHoodId())){ + if (!icBuilding.getNeighborHoodId().equals(formDTO.getNeighborHoodId())) { //更新对应房屋小区id List icHouseEntities = icHouseDao.selectList(new QueryWrapper().lambda().eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId())); - if(!CollectionUtils.isEmpty(icHouseEntities)){ + if (!CollectionUtils.isEmpty(icHouseEntities)) { // - throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),"楼宇单元下存在房屋,无法更新"); -// icHouseEntities.forEach(item->{ -// item.setNeighborHoodId(formDTO.getNeighborHoodId()); -// }); -// icHouseService.updateBatchById(icHouseEntities); + throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(), "楼栋单元下存在房屋,无法更新"); } } - IcBuildingDTO icBuildingDTO= ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); + IcBuildingDTO icBuildingDTO = ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); icBuildingDTO.setId(formDTO.getBuildingId()); icBuildingDTO.setCustomerId(customerId); icBuildingService.update(icBuildingDTO); + + // 更新房屋名称 + icHouseDao.houseUpdateHouseName(formDTO.getBuildingId()); //更新楼宇单元 //如果楼宇单元大于之前的楼宇单元,新增单元 - Integer nowUnit= formDTO.getTotalUnitNum(); + Integer nowUnit = formDTO.getTotalUnitNum(); Integer unit = icBuilding.getTotalUnitNum(); - if(nowUnit>=unit){ + if (nowUnit < unit) { + //如果小于,判断是否存在房屋,如果存在就提示不能更改 + throw new EpmetException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(), EpmetErrorCode.ORG_EDIT_FAILED.getMsg(), "暂不支持单元号减小"); + } else { //新增单元 + List units = icBuildingUnitService.getUnitOptions(icBuilding.getId()); + Map unitMap = units.stream().collect(Collectors.toMap(OptionResultDTO::getCode, OptionResultDTO::getLabel)); List unitList = new ArrayList<>(); - for(int i =unit ;i houseList = icHouseDao.selectList(new QueryWrapper().lambda().eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId())); + if (!CollectionUtils.isEmpty(houseList)) { + houseList.forEach(house -> { + //删除房屋的缓存 + icHouseRedis.delHouseInfo(house.getId(), customerId); + }); + } + //删除楼栋缓存 + CustomerIcHouseRedis.delBuildingInfo(formDTO.getBuildingId()); } /** * 删除 + * * @param buildingId */ @Override @@ -565,13 +496,13 @@ public class BuildingServiceImpl implements BuildingService { public void delBuilding(String buildingId) { //如果存在房屋,无法删除 List icHouseEntities = icHouseDao.selectList(new QueryWrapper().lambda().eq(IcHouseEntity::getBuildingId, buildingId)); - if(!CollectionUtils.isEmpty(icHouseEntities)){ - throw new RenException(EpmetErrorCode.ORG_DEL_FAILED.getCode(),"楼宇单元下存在房屋,无法删除"); + if (!CollectionUtils.isEmpty(icHouseEntities)) { + throw new RenException(EpmetErrorCode.ORG_DEL_FAILED.getCode(), "楼栋单元下存在房屋,无法删除"); } //删除楼宇 icBuildingService.deleteById(buildingId); //删除楼宇单元 - icBuildingUnitDao.delete(new QueryWrapper().lambda().eq(IcBuildingUnitEntity::getBuildingId,buildingId)); + icBuildingUnitDao.delete(new QueryWrapper().lambda().eq(IcBuildingUnitEntity::getBuildingId, buildingId)); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 03458a90fd..75efdc6e38 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -4,17 +4,15 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelReader; import com.alibaba.excel.read.metadata.ReadSheet; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; -import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.OrgTypeEnum; 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.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.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -30,14 +28,12 @@ import com.epmet.dto.IcBuildingUnitDTO; import com.epmet.dto.IcHouseDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.HouseInfoDTO; -import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.dto.result.IcHouseListResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.NeighborHoodManageDelResultDTO; import com.epmet.entity.IcHouseEntity; import com.epmet.enums.HousePurposeEnums; -import com.epmet.enums.HouseRentFlagEnums; import com.epmet.enums.HouseTypeEnums; -import com.epmet.excel.IcHouseExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; @@ -46,6 +42,8 @@ import com.epmet.model.ImportHouseInfoListener; import com.epmet.redis.IcHouseRedis; import com.epmet.service.*; import com.epmet.util.ExcelPoiUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -99,7 +97,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { @Override @Transactional(rollbackFor = Exception.class) - public void addHouse(String customerId, IcHouseFormDTO formDTO) { + public void addHouse(String customerId, IcHouseAddFormDTO formDTO) { //同一楼栋,单元内,房屋名称唯一 Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(),null); if (null != count && count > 0) { @@ -107,13 +105,11 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { } IcHouseDTO icHouseDTO= ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class); icHouseDTO.setCustomerId(customerId); -// icHouseDTO.setRentFlag(formDTO.getRentFlag()); - icHouseDTO.setHouseName(getHouseName(formDTO)); icHouseService.save(icHouseDTO); } - private String getHouseName(IcHouseFormDTO formDTO){ + private String getHouseName(IcHouseAddFormDTO formDTO){ //设置房间名 楼栋-单元号-门牌号 IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId()); IcBuildingUnitDTO icBuildingUnit = icBuildingUnitService.get(formDTO.getBuildingUnitId()); @@ -130,7 +126,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { */ @Override @Transactional(rollbackFor = Exception.class) - public void updateHouse(String customerId, IcHouseFormDTO formDTO) { + public void updateHouse(String customerId, IcHouseAddFormDTO formDTO) { //同一楼栋,单元内,房屋名称唯一 Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(),formDTO.getDoorName(), formDTO.getHouseId()); if (null != count && count > 0) { @@ -145,6 +141,13 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { icHouseService.update(icHouseDTO); } + @Override + @Transactional(rollbackFor = Exception.class) + public void update2Rent(RentHouseFormDTO formDTO) { + IcHouseEntity entity = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + icHouseService.updateById(entity); + } + /** * 删除 * @param houseId @@ -162,184 +165,61 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { } @Override - @Transactional(rollbackFor = Exception.class) - public List importExcel(String customerId, List list, String staffId, List numList) { - //2021.11.10 需求变更 当前工作人员只能导致自己所属组织下数据,对应不上的数据舍弃【注:需求就这样】 sun - CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); - //组织名称不一样的数据舍弃 - Iterator iterator = list.iterator(); - while (iterator.hasNext()) { - IcHouseExcel obj = iterator.next(); - if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { - numList.add(obj.getRowNum()); - iterator.remove(); - } + public PageData getHouseList(IcHouseListFormDTO formDTO) { + + // 查询pids + String pids = null; + if (StringUtils.isNotBlank(formDTO.getAgencyId())) { + pids = getPids(formDTO.getAgencyId()); } - //用于存储匹配不上的数据给前端的提示 如南宁社区不存在 - //StringBuffer str = new StringBuffer(""); - //end sun - //导入 - if(CollectionUtils.isEmpty(list)){ - return numList; + if (StringUtils.isNotBlank(formDTO.getLevel()) && OrgTypeEnum.AGENCY.getCode().equals(formDTO.getLevel())){ + pids = getPids(formDTO.getAgencyId()); } - //获取所有小区 list -// List neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toList()); -// List neighborHoodList = icNeighborHoodDao.selectList(new QueryWrapper().lambda().in(IcNeighborHoodEntity::getNeighborHoodName, neighborNameList)); -// Map neighborHoodMap = neighborHoodList.stream().collect(Collectors.toMap(IcNeighborHoodEntity::getNeighborHoodName, Function.identity(),(key1, key2)->key1)); - - //获取所有楼宇 list -// List buildingNameList = list.stream().map(item -> item.getBuildingName()).collect(Collectors.toList()); - -// icBuildingDao.selectList(new QueryWrapper().lambda().in(IcBuildingEntity::getBuildingName, buildingNameList).in(); - Set neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toSet()); - Set buildingNameList = list.stream().map(item -> item.getBuildingName()).collect(Collectors.toSet()); - Set buildingUnitList = list.stream().map(item -> item.getBuildingUnit()).collect(Collectors.toSet()); - List> buildMapList = icBuildingDao.selectListByName(customerId, new ArrayList(neighborNameList),new ArrayList(buildingNameList),new ArrayList(buildingUnitList)); - //转Map - Map> buildMap = new HashMap<>(); - buildMapList.forEach(item->{ - buildMap.put(item.get("neighborName")+","+item.get("buildingName")+","+item.get("unitNum"),item); - }); - //封装数据 - List houseEntityList = new ArrayList<>(); - Iterator iterator1 = list.iterator(); - while (iterator1.hasNext()) { - IcHouseExcel icHouseExcel = iterator1.next(); - IcHouseEntity entity = new IcHouseEntity(); - String uuid = UUID.randomUUID().toString().replace("-", ""); - entity.setId(uuid); - entity.setCustomerId(customerId); - Map item = buildMap.get(icHouseExcel.getNeighborHoodName()+","+icHouseExcel.getBuildingName()+","+icHouseExcel.getBuildingUnit()); - - entity.setNeighborHoodId(String.valueOf(Optional.ofNullable(item).map(u->u.get("neighborId")).orElse(""))); - entity.setBuildingId(String.valueOf(Optional.ofNullable(item).map(u->u.get("buildingId")).orElse(""))); - entity.setBuildingUnitId(String.valueOf(Optional.ofNullable(item).map(u->u.get("buildingUnitId")).orElse(""))); - entity.setHouseName(icHouseExcel.getBuildingName()+"-"+icHouseExcel.getBuildingUnit()+"-"+icHouseExcel.getDoorName()); - if ("".equals(entity.getNeighborHoodId()) || "".equals(entity.getBuildingId()) || "".equals(entity.getBuildingUnitId())) { - //str.append("".equals(str) ? icHouseExcel.getBuildingName() + icHouseExcel.getBuildingUnit() : str.append("、").append(icHouseExcel.getBuildingName() + icHouseExcel.getBuildingUnit())); - numList.add(icHouseExcel.getRowNum()); - iterator1.remove(); - continue; - } - entity.setDoorName(icHouseExcel.getDoorName()); - entity.setHouseType(HouseTypeEnums.getKeyByValue(icHouseExcel.getHouseType())); - entity.setPurpose(HousePurposeEnums.getKeyByValue(icHouseExcel.getPurpose())); - entity.setRentFlag(HouseRentFlagEnums.getCodeByName(icHouseExcel.getRentFlag())); - entity.setOwnerName(icHouseExcel.getOwnerName()); - entity.setOwnerPhone(icHouseExcel.getOwnerPhone()); - entity.setOwnerIdCard(icHouseExcel.getOwnerIdCard()); - //同一楼栋,单元内,房屋名称唯一 - Integer count = icHouseDao.checkDoorNameUq(entity.getNeighborHoodId(), entity.getBuildingId(), entity.getBuildingUnitId(), entity.getDoorName(),null); - if (null != count && count > 0) { - //throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); - log.error(EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); - numList.add(icHouseExcel.getRowNum()); - iterator1.remove(); - continue; - } - houseEntityList.add(entity); + formDTO.setPids(pids); + PageInfo pageInfo = null; + if (formDTO.getIsPage()){ + pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()) + .doSelectPageInfo(() -> icHouseDao.searchHouseByPage(formDTO)); + }else{ + List resultDTOS = icHouseDao.searchHouseByPage(formDTO); + pageInfo = new PageInfo<>(resultDTOS,resultDTOS.size()); } - //3.保存 - icHouseService.insertBatch(houseEntityList); - - return numList; + List records = pageInfo.getList(); + records.forEach(item->{ + item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseTypeKey())); + item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurposeKey())); + }); + return new PageData<>(records,pageInfo.getTotal()); } - - @Override - public IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId, - String buildingId, - String ownerName, - String ownerPhone, - String neighborHoodName, - String buildingName, - String queryScene, - Integer pageNo, - Integer pageSize) { - IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); - //如果类型是house 查房屋 - //IPage> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize); - - // 查询pids + public String getPids(String agencyId){ String pids = null; - if (StringUtils.isNotBlank(ancestorAgencyId)) { - CustomerAgencyDTO agency = agencyservice.getAgencyById(ancestorAgencyId); - - if (agency == null) { - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败"); - } + CustomerAgencyDTO agency = agencyservice.getAgencyById(agencyId); - - if (NumConstant.ZERO_STR.equals(agency.getPid())) { - pids = ancestorAgencyId; - } else { - pids = agency.getPids().concat(StrConstant.COLON).concat(ancestorAgencyId); - } + if (agency == null) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败"); } - IPage page = new Page(pageNo,pageSize); - - IPage> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene); - List> records = mapIPage.getRecords(); - records.forEach(item->{ - item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey"))); - item.put("purpose", HousePurposeEnums.getTypeValue(item.get("purposeKey"))); - }); - result.setTotal(Long.valueOf(mapIPage.getTotal()).intValue()); - result.setList(records); - return result; + if (NumConstant.ZERO_STR.equals(agency.getPid())) { + pids = agencyId; + } else { + pids = agency.getPids().concat(StrConstant.COLON).concat(agencyId); + } + return pids; } @Override - public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + public void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception { //如果类型是house 查房屋 //导出房屋 - - List icHouseExcels = searchAllHouse(formDTO); + PageData icHouseExcels = getHouseList(formDTO); TemplateExportParams templatePath = new TemplateExportParams("excel/house_export.xlsx"); Map map = new HashMap<>(); - map.put("maplist",icHouseExcels); + map.put("maplist",icHouseExcels.getList()); ExcelPoiUtils.exportExcel(templatePath ,map,"房屋信息录入表",response); - - return ; } - private List searchAllHouse(ListIcNeighborHoodFormDTO formDTO) { - - //IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); - // - //IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); - - - IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); - house.setDelFlag("0"); - - List icHouseExcels = icHouseDao.searchAllHouse(house); - icHouseExcels.forEach(item->{ - item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseType())); - item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurpose())); - }); - return icHouseExcels; - } - - /*private IPage> searchHouse(String buildingId, - String ownerName, - String ownerPhone, - String neighborHoodName, - String buildingName, - Integer pageNo, - Integer pageSize) { - IPage page = new Page(pageNo,pageSize); - - IPage> mapIPage = icHouseDao.searchHouseByPage(page, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName); - List> records = mapIPage.getRecords(); - records.forEach(item->{ - item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey"))); - item.put("purpose", HousePurposeEnums.getTypeValue(item.get("purposeKey"))); - }); - return mapIPage; - }*/ @Override public List queryListHouseInfo(Set houseIdList, String customerId) { @@ -412,7 +292,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { } if (!CollectionUtils.isEmpty(exists)){ String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(",")); - EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含楼宇信息,暂无法删除",collect)); + EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含楼栋信息,暂无法删除",collect)); throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode()); } }else if (formDTO.getType().equals(CustomerGridConstant.BUILDING)){ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java index ae1fd471a9..2e800bbda5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java @@ -128,6 +128,7 @@ public class IcBuildingUnitServiceImpl extends BaseServiceImpl { OptionResultDTO dto = new OptionResultDTO(); dto.setValue(item.getId()); + dto.setCode(item.getUnitNum()); dto.setLabel(item.getUnitName()); return dto; }).collect(Collectors.toList()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index f0afc84a28..102dbc168f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -19,6 +19,7 @@ import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.form.HouseFormDTO; import com.epmet.dto.result.HouseListResultDTO; +import com.epmet.dto.result.HousesNameResultDTO; import com.epmet.entity.IcHouseEntity; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; @@ -126,6 +127,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl getHousesNameByIdCards(List idCards) { + if (CollectionUtils.isEmpty(idCards)){ + return new ArrayList<>(); + } + return baseDao.getHousesNameByIdCards(idCards); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java index b094f0c226..67a21aca56 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java @@ -48,7 +48,7 @@ import com.epmet.dao.IcBuildingDao; import com.epmet.dao.IcNeighborHoodDao; import com.epmet.dao.IcPropertyManagementDao; import com.epmet.dto.*; -import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; @@ -687,9 +687,10 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl openPage(IcNeighborHoodFormDTO params) { + public PageData openPage(IcNeighborHoodAddFormDTO params) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(IcNeighborHoodEntity::getAgencyId,params.getAgencyId()); + wrapper.eq(StringUtils.isNotBlank(params.getAgencyId()), IcNeighborHoodEntity::getAgencyId, params.getAgencyId()) + .eq(StringUtils.isNotBlank(params.getGridId()), IcNeighborHoodEntity::getGridId, params.getGridId()); PageData result = null; List list = null; if (params.getIsPage()){ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java index 0aeca0d13b..991469c313 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java @@ -2,13 +2,10 @@ package com.epmet.service.impl; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.OrgTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.NeighborhoodConstant; @@ -16,29 +13,33 @@ import com.epmet.dao.*; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.IcNeighborHoodPropertyDTO; -import com.epmet.dto.form.IcNeighborHoodFormDTO; -import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.form.IcHouseListFormDTO; +import com.epmet.dto.form.IcNeighborHoodAddFormDTO; +import com.epmet.dto.form.IcNeighborHoodListFormDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; -import com.epmet.entity.*; +import com.epmet.entity.IcHouseEntity; +import com.epmet.entity.IcNeighborHoodEntity; +import com.epmet.entity.IcNeighborHoodPropertyEntity; import com.epmet.excel.IcNeighborHoodExcel; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.IcNeighborHoodPropertyService; import com.epmet.service.IcNeighborHoodService; import com.epmet.service.NeighborHoodService; import com.epmet.util.ExcelPoiUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; -import java.util.*; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Function; -import java.util.stream.Collectors; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; @Slf4j @Service @@ -46,33 +47,19 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; - - @Autowired private IcNeighborHoodService icNeighborHoodService; - @Autowired private IcNeighborHoodPropertyService icNeighborHoodPropertyService; - @Resource private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao; - @Resource private IcNeighborHoodDao icNeighborHoodDao; - @Resource - private IcBuildingDao icBuildingDao; - @Resource - private IcHouseDao icHouseDao; - @Resource - private CustomerAgencyDao customerAgencyDao; - @Resource - private CustomerGridDao customerGridDao; - @Resource - private IcPropertyManagementDao icPropertyManagementDao; + @Override @Transactional(rollbackFor = Exception.class) - public void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { + public void addNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO) { //同一网格下,小区名称唯一 Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),null); if (null != count && count > 0) { @@ -105,45 +92,20 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { /** * 查询 * @param formDTO + * @return */ @Override - public IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO) { - String level = formDTO.getLevel(); - Integer pageNo = formDTO.getPageNo(); - Integer pageSize = formDTO.getPageSize(); - - - - IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); - - IPage> resultMap = searchNeighborhood(formDTO); - result.setTotal(Long.valueOf(resultMap.getTotal()).intValue()); - result.setList(resultMap.getRecords()); - - return result; - - } - - - - - - - private IPage> searchNeighborhood(ListIcNeighborHoodFormDTO formDTO) { - - IPage page = new Page(formDTO.getPageNo(),formDTO.getPageSize()); - - IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); - IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); - neighbor.setDelFlag("0"); + public PageData listNeighborhood(IcNeighborHoodListFormDTO formDTO) { if(NeighborhoodConstant.GRID.equals(formDTO.getLevel())){ //根据网格过滤 - neighbor.setGridId(formDTO.getId()); + formDTO.setGridId(formDTO.getId()); }else{ //根据组织过滤 - neighbor.setAgencyId(formDTO.getId()); + formDTO.setAgencyId(formDTO.getId()); } - return icNeighborHoodDao.searchNeighborhoodByPage(page, neighbor,house); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) + .doSelectPageInfo(() -> icNeighborHoodDao.searchNeighborhoodByPage(formDTO)); + return new PageData<>(pageInfo.getList(),pageInfo.getTotal()); } /** @@ -153,7 +115,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { */ @Override @Transactional(rollbackFor = Exception.class) - public void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { + public void updateNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO) { //同一客户下,小区名称唯一 Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),formDTO.getNeighborHoodId()); if (null != count && count > 0) { @@ -192,8 +154,6 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { //更新 icNeighborHoodPropertyService.updateById(icNeighborHoodProperty); } - - } } @@ -203,7 +163,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { */ @Override @Transactional(rollbackFor = Exception.class) - public void DelNeighborhood(String neighborHoodId) { + public void delNeighborhood(String neighborHoodId) { //删除小区 icNeighborHoodService.deleteById(neighborHoodId); //删除小区物业关联 @@ -220,10 +180,9 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { * @param response */ @Override - public void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + public void exportNeighborhoodinfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception { //导出小区 List icNeighborHoodExcels = searchAllNeighborhood(formDTO); -// ExcelUtils.exportExcelToTarget(response, "小区信息录入表", icNeighborHoodExcels, IcNeighborHoodExcel.class); TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_export.xlsx"); Map map = new HashMap<>(); @@ -231,119 +190,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { ExcelPoiUtils.exportExcel(templatePath ,map,"小区信息录入表",response); } - @Override - @Transactional(rollbackFor = Exception.class) - public List importExcel(String customerId,List list,String staffId, List numList) { - //2021.11.9 需求变更 当前工作人员只能导致自己所属组织下数据,网格名对应不上的数据舍弃【注:需求就这样】 sun - CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); - //查询当前组织下网格列表 - List customerGridList = customerGridDao.selectByPid(staffInfoCache.getAgencyId()); - //组织名称不一样的数据舍弃 - Iterator iterator = list.iterator(); - while (iterator.hasNext()) { - IcNeighborHoodExcel obj = iterator.next(); - if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { - numList.add(obj.getRowNum()); - iterator.remove(); - continue; - } - //当前组织下网格名不存在的也不允许导入 - AtomicBoolean br = new AtomicBoolean(true); - customerGridList.forEach(g->{ - if(obj.getGridName().trim().equals(g.getGridName())){ - br.set(false); - } - }); - if(br.get()){ - numList.add(obj.getRowNum()); - iterator.remove(); - } - - } - //end sun - - //导入 - if(CollectionUtils.isEmpty(list)){ - return numList; - } - //获取所有组织 list - List agencyNameList = list.stream().map(item -> item.getAgencyName()).collect(Collectors.toList()); - agencyNameList = agencyNameList.stream().distinct().collect(Collectors.toList()); - //获取所有网格 list - //List gridNameList = list.stream().map(item->item.getGridName()).collect(Collectors.toList()); - //获取所有物业 list - List propertyNameList = list.stream().map(item->item.getPropertyName()).collect(Collectors.toList()); - propertyNameList = propertyNameList.stream().distinct().collect(Collectors.toList()); - //查询对应的id - List customerAgencyList = customerAgencyDao.selectList(new QueryWrapper().lambda().in(CustomerAgencyEntity::getOrganizationName, agencyNameList)); - //List customerGridList = customerGridDao.selectList(new QueryWrapper().lambda().in(CustomerGridEntity::getGridName, gridNameList)); - List icPropertyManagementList = icPropertyManagementDao.selectList(new QueryWrapper().lambda().in(IcPropertyManagementEntity::getName, propertyNameList)); - - Map agencyMap = customerAgencyList.stream().collect(Collectors.toMap(CustomerAgencyEntity::getOrganizationName, Function.identity(),(key1, key2)->key1)); - Map gridMap = customerGridList.stream().collect(Collectors.toMap(CustomerGridEntity::getGridName,Function.identity(),(key1,key2)->key1)); - Map propertyMap = icPropertyManagementList.stream().collect(Collectors.toMap(IcPropertyManagementEntity::getName,Function.identity(),(key1,key2)->key1)); - - //封装数据 - List neighborHoodEntityList = new ArrayList<>(); - List icNeighborHoodPropertyEntityList = new ArrayList<>(); - Iterator iterator1 = list.iterator(); - while (iterator1.hasNext()) { - IcNeighborHoodExcel icNeighborHoodExcel = iterator1.next(); - //同一客户下,小区名称唯一 - Integer count = icNeighborHoodDao.checkNameUq(customerId,icNeighborHoodExcel.getNeighborHoodName(),null); - if (null != count && count > 0) { - //throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), icNeighborHoodExcel.getNeighborHoodName()+EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); - log.error(icNeighborHoodExcel.getNeighborHoodName()+EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); - numList.add(icNeighborHoodExcel.getRowNum()); - iterator1.remove(); - continue; - } - - IcNeighborHoodEntity entity = new IcNeighborHoodEntity(); - String uuid =UUID.randomUUID().toString().replace("-", ""); - entity.setId(uuid); - entity.setCustomerId(customerId); - entity.setNeighborHoodName(icNeighborHoodExcel.getNeighborHoodName()); - - entity.setAgencyId(Optional.ofNullable(agencyMap.get(icNeighborHoodExcel.getAgencyName().trim())).map(u->u.getId()).orElse("")); // agencyMap.get(icNeighborHoodExcel.getAgencyName()).getId()); - entity.setParentAgencyId(Optional.ofNullable(agencyMap.get(icNeighborHoodExcel.getAgencyName().trim())).map(u->u.getPid()).orElse(""));//agencyMap.get(icNeighborHoodExcel.getAgencyName()).getPid() - entity.setAgencyPids(Optional.ofNullable(agencyMap.get(icNeighborHoodExcel.getAgencyName().trim())).map(u->u.getPids()).orElse(""));//agencyMap.get(icNeighborHoodExcel.getAgencyName()).getPids() - entity.setGridId(Optional.ofNullable(gridMap.get(icNeighborHoodExcel.getGridName().trim())).map(u->u.getId()).orElse(""));//gridMap.get(icNeighborHoodExcel.getGridName()).getId() - //网格名对应不上的数据舍弃 - if ("".equals(entity.getGridId())) { - numList.add(icNeighborHoodExcel.getRowNum()); - iterator1.remove(); - continue; - } - entity.setAddress(icNeighborHoodExcel.getAddress()); - entity.setRemark(icNeighborHoodExcel.getRemark()); - neighborHoodEntityList.add(entity); - - IcNeighborHoodPropertyEntity entity1 = new IcNeighborHoodPropertyEntity(); - - entity1.setPropertyId(Optional.ofNullable(propertyMap.get(icNeighborHoodExcel.getPropertyName())).map(u->u.getId()).orElse("")); - entity1.setNeighborHoodId(uuid); - icNeighborHoodPropertyEntityList.add(entity1); - } - -// icNeighborHoodDao. - //保存 - icNeighborHoodService.insertBatch(neighborHoodEntityList); - icNeighborHoodPropertyService.insertBatch(icNeighborHoodPropertyEntityList); - - return numList; - } - - - - private List searchAllNeighborhood(ListIcNeighborHoodFormDTO formDTO) { -// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); -// neighborHoodEntityQueryWrapper.lambda() -// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) -// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) -// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) -// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); -// neighborHoodEntityQueryWrapper.eq("a.DEL_FLAG","0"); + private List searchAllNeighborhood(IcHouseListFormDTO formDTO) { IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); neighbor.setDelFlag("0"); if(OrgTypeEnum.GRID.getCode().equals(formDTO.getLevel())){ @@ -354,10 +201,4 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); return icNeighborHoodDao.searchAllNeighborhood(neighbor,house); } - - - - - - } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.15__alter_ic_house.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.15__alter_ic_house.sql new file mode 100644 index 0000000000..d624bf775a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.15__alter_ic_house.sql @@ -0,0 +1,2 @@ +ALTER TABLE `ic_house` +MODIFY COLUMN `RENT_FLAG` tinyint(1) NOT NULL COMMENT '1:出租 0:自住 2:闲置' AFTER `PURPOSE`; diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.16__add_index_ic_house.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.16__add_index_ic_house.sql new file mode 100644 index 0000000000..3bf8ad31eb --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.16__add_index_ic_house.sql @@ -0,0 +1,3 @@ +ALTER TABLE `epmet_gov_org`.`ic_house` + ADD INDEX `idx_building_id`(`BUILDING_ID`) USING BTREE COMMENT '楼宇id', + ADD INDEX `idx_hood_id`(`NEIGHBOR_HOOD_ID`) USING BTREE COMMENT '小区id'; diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx index 9460a651da..eb163082f3 100644 Binary files a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx index 027f37bcad..cf5681e1f4 100644 Binary files a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml index 37839f8e82..a78c7fc3f4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml @@ -64,7 +64,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 @@ -152,7 +147,7 @@ AND a.DEL_FLAG = #{building.delFlag} - + order by a.CREATED_TIME, a.BUILDING_NAME --> - select - a.HOUSE_NAME as houseName, + concat(b.BUILDING_NAME,'-',d.UNIT_NUM,'-',a.DOOR_NAME) as houseName, c.NEIGHBOR_HOOD_NAME as neighborHoodName, b.BUILDING_NAME as buildingName, - d.UNIT_NUM as unitNum, + CONCAT(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,*/ a.OWNER_PHONE as ownerPhone, a.OWNER_ID_CARD as ownerIdCard, @@ -167,24 +102,38 @@ 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 + ag.ORGANIZATION_NAME agencyName, + c.GRID_ID as gridId, + gr.GRID_NAME from ic_house a LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0' LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0' LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID and d.DEL_FLAG = '0' + LEFT JOIN customer_grid gr on gr.ID = c.GRID_ID and d.DEL_FLAG = '0' + LEFT JOIN customer_agency ag on ag.ID = c.AGENCY_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,107 +146,18 @@ AND b.BUILDING_NAME like CONCAT('%',#{buildingName},'%') - - /*排序规则:如果是社区查询则根据小区、楼栋、单元、房屋名字分别升序排序*/ - - - 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 - - - - - - + + + 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..2f3d335708 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 @@ -149,6 +143,7 @@ AND a.DEL_FLAG = #{neighbor.delFlag} + ORDER BY a.CREATED_TIME + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index d5fb91de45..054839bf02 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,26 @@ `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' + + AND `STATUS`='0' ORDER BY `NAME` @@ -292,7 +307,19 @@ AND customer_id = #{customerId} AND id_card = #{idCard} - +