diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java index 9068180318..59eb1e1e40 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.DictTreeResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.SysDictDataDTO; import com.epmet.dto.result.CorsConfigResultDTO; import com.epmet.feign.fallback.EpmetAdminOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; @@ -101,4 +102,7 @@ public interface EpmetAdminOpenFeignClient { @PostMapping("/sys/dict/data/dictlist") Result> dictList(@RequestBody DictListFormDTO formDTO); + + @PostMapping("/sys/dict/data/dictDataList/{dictType}") + Result> dictDataList(@PathVariable("dictType") String dictType); } diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java index 110ba490e3..98e7e7f0f0 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.dto.result.DictTreeResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.SysDictDataDTO; import com.epmet.dto.result.CorsConfigResultDTO; import com.epmet.feign.EpmetAdminOpenFeignClient; @@ -59,4 +60,9 @@ public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignCli public Result> dictList(DictListFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictList", formDTO); } + + @Override + public Result> dictDataList(String dictType) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictDataList", dictType); + } } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java index 3c3ac4d344..ce18026bf8 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java @@ -172,4 +172,9 @@ public class SysDictDataController { return new Result>().ok(sysDictDataService.dictMap(dictType)); } + @PostMapping("dictDataList/{dictType}") + public Result> dictDataList(@PathVariable("dictType") String dictType){ + List list=sysDictDataService.getDictDataList(dictType); + return new Result>().ok(list); + } } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java index 7ba543b6af..8c437ee27e 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java @@ -11,6 +11,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.DictTreeResultDTO; +import com.epmet.dto.SysDictDataDTO; import com.epmet.entity.DictData; import com.epmet.entity.SysDictDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -33,4 +34,6 @@ public interface SysDictDataDao extends BaseDao { List selectDictList(String dictType); List selectDictData(String dictType); + + List selectDictDataList(String dictType); } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java index b49e51fbdc..6277ab6d2f 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java @@ -90,4 +90,6 @@ public interface SysDictDataService extends BaseService { Map dictMap(String dictType); List dictListTree(String dictType); + + List getDictDataList(String dictType); } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java index bd042379dd..a7b6bff903 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java @@ -225,4 +225,9 @@ public class SysDictDataServiceImpl extends BaseServiceImpl getDictDataList(String dictType) { + return baseDao.selectDictDataList(dictType); + } + } diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.16__self_org_category.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.16__self_org_category.sql new file mode 100644 index 0000000000..4804535be7 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.16__self_org_category.sql @@ -0,0 +1,6 @@ +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1526493468551626753', 'self_org_category', '社区自组织类别', '社区自组织类别:文化队伍、楼委会、老友俱乐部、治安巡逻队、其他', 1, 0, 0, '1', '2022-05-17 17:22:58', '1', '2022-05-17 17:22:58'); +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 ('1526495882432299010', 1526493468551626753, '楼委会', 'lwh', '0', '楼委会', 2, 0, 0, '1', '2022-05-17 17:32:34', '1', '2022-05-17 17:32:34'); +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 ('1526495969778679810', 1526493468551626753, '老友俱乐部', 'lyjlb', '0', '老友俱乐部', 3, 0, 0, '1', '2022-05-17 17:32:55', '1', '2022-05-17 17:32:55'); +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 ('1526496168622243842', 1526493468551626753, '其他', 'other', '0', '其他', 5, 0, 0, '1', '2022-05-17 17:33:42', '1', '2022-05-17 17:33:51'); +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 ('1526495766724034562', 1526493468551626753, '文化队伍', 'whdw', '0', '文化队伍', 1, 0, 0, '1', '2022-05-17 17:32:06', '1', '2022-05-17 17:32:40'); +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 ('1526496054369402882', 1526493468551626753, '治安巡逻队', 'zaxld', '0', '治安巡逻队', 4, 0, 0, '1', '2022-05-17 17:33:15', '1', '2022-05-17 17:33:24'); \ No newline at end of file diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.17__add_dict.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.17__add_dict.sql new file mode 100644 index 0000000000..5d0ab88047 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.17__add_dict.sql @@ -0,0 +1,9 @@ + +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000013', 'ic_event', '事件管理', '', '13', '0', '0', '', '2022-05-17 18:23:27', '', '2022-05-17 18:23:27'); + +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 ('3000000000000000004', '1000000000000000013', '网格员手持终端', '4', '0', '', '4', '0', '0', '', '2022-05-17 18:39:18', '', '2022-05-17 18: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 ('3000000000000000003', '1000000000000000013', '12345', '3', '0', '', '3', '0', '0', '', '2022-05-17 18:39:18', '', '2022-05-17 18: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 ('3000000000000000002', '1000000000000000013', '社区电话', '2', '0', '', '2', '0', '0', '', '2022-05-17 18:39:18', '', '2022-05-17 18: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 ('3000000000000000001', '1000000000000000013', '多媒体反映', '1', '0', '', '1', '0', '0', '', '2022-05-17 18:39:18', '', '2022-05-17 18: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 ('3000000000000000000', '1000000000000000013', '随手拍/随时讲', '0', '0', '', '0', '0', '0', '', '2022-05-17 18:39:18', '', '2022-05-17 18:39:18'); + diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.18__alter_dict.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.18__alter_dict.sql new file mode 100644 index 0000000000..4e778ee121 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.18__alter_dict.sql @@ -0,0 +1 @@ +UPDATE `epmet_admin`.`sys_dict_type` SET `id`='1000000000000000013', `dict_type`='ic_event_source_type', `dict_name`='事件管理', `remark`='', `sort`='13', `DEL_FLAG`='0', `REVISION`='0', `CREATED_BY`='', `CREATED_TIME`='2022-05-17 18:23:27', `UPDATED_BY`='', `UPDATED_TIME`='2022-05-17 18:23:27' WHERE (`id`='1000000000000000013'); diff --git a/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml b/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml index ab8ee06fa8..94112d1c19 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml @@ -133,12 +133,36 @@ + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + + + + @@ -152,6 +176,10 @@ + + + + diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml index d7ea8fa27b..9330c7d779 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml @@ -33,4 +33,15 @@ a.sort asc + diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java index 3c0b35ff4d..749eef2360 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java @@ -147,12 +147,7 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { updatedTime = metaObject.getValue(FieldConstant.UPDATED_TIME_HUMP); } if (updatedTime == null) { - if(metaObject.hasGetter(FieldConstant.CREATED_TIME_HUMP)) { - updatedTime = metaObject.getValue(FieldConstant.CREATED_TIME_HUMP); - } - if(updatedTime == null) { - updatedTime = new Date(); - } + updatedTime = new Date(); } return updatedTime; } @@ -165,13 +160,7 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { } if (value == null) { - if(metaObject.hasGetter(FieldConstant.CREATED_BY_HUMP)) { - value = metaObject.getValue(FieldConstant.CREATED_BY_HUMP); - } - - if(null == value) { - value = Optional.ofNullable(loginUserUtil.getLoginUserId()).orElse(Constant.APP_USER_FLAG); - } + value = Optional.ofNullable(loginUserUtil.getLoginUserId()).orElse(Constant.APP_USER_FLAG); } return value; diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java index 9bbd564ea2..1a4b303c3c 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java @@ -88,4 +88,9 @@ public interface ConsomerGroupConstants { * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 */ String USER_DEMAND_FINISH_GROUP = "user_demand_finish_group"; + + /** + * 志愿者变更 + */ + String VOLUNTEER_CHANGE_EVENT_LISTENER_GROUP = "volunteer_change_event_listener_group"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java index b4e5d77cd9..beef085faa 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java @@ -73,5 +73,10 @@ public interface TopicConstants { /** * 社区服务,原居民需求 */ - String COMMUNITY_SERVICE="epmet_community_service"; + String COMMUNITY_SERVICE="community_service"; + + /** + * 志愿者 + */ + String VOLUNTEER ="volunteer"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IcHouseFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IcHouseFormDTO.java new file mode 100644 index 0000000000..5caca05c88 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IcHouseFormDTO.java @@ -0,0 +1,38 @@ +/** + * 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.commons.tools.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * epmet-user端调用gov-org端的入参 + * @author sun + */ +@Data +public class IcHouseFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + private String customerId; + private String houseId; + + +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseFormDTO.java new file mode 100644 index 0000000000..fc436b5b29 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseFormDTO.java @@ -0,0 +1,45 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * desc:rocketmq 基础参数 + * + * @author zhaoqifeng + * @dscription + * @date 2021/6/7 16:23 + */ +@NoArgsConstructor +@Data +public class MqBaseFormDTO implements Serializable { + private static final long serialVersionUID = -6616119263736477518L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 对象id 没有则查询全部 + */ + private String objectId; + + /** + * 对象id 没有则查询全部 + */ + private List objectIdList; + + public MqBaseFormDTO(String customerId, String objectId) { + this.customerId = customerId; + this.objectId = objectId; + } + + public MqBaseFormDTO(String customerId, List objectIdList) { + this.customerId = customerId; + this.objectIdList = objectIdList; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index 6375462f14..a813af8152 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -23,6 +23,8 @@ public enum DictTypeEnum { PATROL_WORK_TYPE("patrol_work_type", "例行工作分类", 13), GRID_TYPE("grid_type", "网格类型", 12), ITEM_TYPE_QUERY("item_type_query","居民信息组件查询方式",14), + SELF_ORG_CATEGORY("self_org_category","社区自组织分类",15), + IC_EVENT_SOURCE_TYPE("ic_event_source_type","事件管理",19), ; private final String code; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HomeMemberOperationEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HomeMemberOperationEnum.java new file mode 100644 index 0000000000..9009bdb141 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HomeMemberOperationEnum.java @@ -0,0 +1,42 @@ +package com.epmet.commons.tools.enums; + +/** + * 组织级别枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum HomeMemberOperationEnum { + + + ADD("add", "新增"), + UPDATE("update", "修改"), + DELETE("delele", "删除"); + + + private String code; + private String name; + + + HomeMemberOperationEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseQrcodeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseQrcodeEnum.java new file mode 100644 index 0000000000..09f17a92a3 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseQrcodeEnum.java @@ -0,0 +1,41 @@ +package com.epmet.commons.tools.enums; + +/** +* @describe: 一户一档二维码信息 +* @author wangtong +* @date 2022/6/1 13:34 +* @params +* @return +*/ +public enum HouseQrcodeEnum { + + SUFFIX(".png", "二维码格式的后缀"), + PREFIX_KEY("house_qrcode_pre", "二维码格式的前缀key"); +// PREFIX("https://epmet-dev.elinkservice.cn/cqrcode-ty/", "二维码地址的前缀"); + + + private String code; + private String name; + + + HouseQrcodeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyOrgTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyOrgTypeEnum.java new file mode 100644 index 0000000000..a0d1520e43 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyOrgTypeEnum.java @@ -0,0 +1,37 @@ +package com.epmet.commons.tools.enums; + +public enum PartyOrgTypeEnum { + + PROVINCIAL("0", "省委"), + MUNICIPAL("1", "市委"), + DISTRICT("2", "区委"), + WORKING("3", "党工委"), + PARTY("4", "党委"), + BRANCH("5", "支部"); + + + private String code; + private String name; + + + PartyOrgTypeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyPostEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyPostEnum.java new file mode 100644 index 0000000000..3985bc8f3b --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyPostEnum.java @@ -0,0 +1,61 @@ +package com.epmet.commons.tools.enums; + +import java.util.Objects; + +/** + * @author Administrator + */ +public enum PartyPostEnum { + //党员职务 + PTDY("0", "普通党员"), + ZBSJ("1", "支部书记"), + ZBWY("2", "支部委员"), + DWWY("3", "党委委员"), + + UN_KNOWN("8", "未知"); + + private String code; + private String name; + + + PartyPostEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + PartyPostEnum[] partyPostEnums = values(); + for (PartyPostEnum partyPostEnum : partyPostEnums) { + if (Objects.equals(partyPostEnum.getCode(), code)) { + return partyPostEnum.getName(); + } + } + return null; + } + + public static String getCode(String name) { + PartyPostEnum[] partyPostEnums = values(); + for (PartyPostEnum partyPostEnum : partyPostEnums) { + if (partyPostEnum.getName().equals(name)) { + return partyPostEnum.getCode(); + } + } + return null; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/SelfOrgCategoryEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/SelfOrgCategoryEnum.java new file mode 100644 index 0000000000..9be9765927 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/SelfOrgCategoryEnum.java @@ -0,0 +1,64 @@ +package com.epmet.commons.tools.enums; + +/** + * 社区自组织增加分类:文化队伍、楼委会、老友俱乐部、治安巡逻队、其他 + */ +public enum SelfOrgCategoryEnum { + // 文化队伍: #e70014 + // 楼委会: #f59701 + // 老友俱乐部: #8fc41e + // 治安巡逻队: #00a1be + // 其他: #0067b6 + + /** + * 环境变量枚举 + */ + + WHDW("whdw", "文化队伍", "#e70014", 1), + LWH("lwh", "楼委会", "#f59701", 2), + LYJLB("lyjlb", "老友俱乐部", "#8fc41e", 3), + ZAXLD("zaxld", "治安巡逻队", "#00a1be", 4), + OTHER("other", "其他", "#0067b6", 5), + ; + + private final String code; + private final String name; + private final String color; + private final Integer sort; + + + SelfOrgCategoryEnum(String code, String name, String color, Integer sort) { + this.code = code; + this.name = name; + this.color = color; + this.sort = sort; + } + + public static SelfOrgCategoryEnum getEnum(String code) { + SelfOrgCategoryEnum[] values = SelfOrgCategoryEnum.values(); + for (SelfOrgCategoryEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return SelfOrgCategoryEnum.OTHER; + + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + public String getColor() { + return color; + } + + public Integer getSort() { + return sort; + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 8140096f7d..6a66e1ae71 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -255,6 +255,8 @@ public enum EpmetErrorCode { IC_NAT(8924,"平台已存在记录,请去修改原有记录"), RESI_IC_NAT(8925,"已存在记录,请联系社区工作人员修改"), IC_MOVE_IN(8926,"居民信息中房屋信息与当前选择房屋不一致,是否更新?"), + NOT_REGEIST_RESI(8927,"未注册居民"), + UNIT_EXIST_HOUSES_ERROR(8928,"单元下存在房屋,不可修改单元数"), //通用错误码 start diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java index bb6bfe423b..da09442ea8 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java @@ -2,8 +2,10 @@ package com.epmet.commons.tools.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.CustomerGridFormDTO; +import com.epmet.commons.tools.dto.form.IcHouseFormDTO; import com.epmet.commons.tools.feign.fallback.CommonGovOrgFeignClientFallBackFactory; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.utils.Result; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -26,4 +28,13 @@ public interface CommonGovOrgFeignClient { @PostMapping("/gov/org/grid/getbaseinfo") Result getGridInfo(@RequestBody CustomerGridFormDTO customerGridFormDTO); + /** + * @Description 查询房屋信息 + * @Param houseInfo + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/18 14:29 + */ + @PostMapping("/gov/org/house/getHouseInfoCache") + Result getHouseInfoCache(@RequestBody IcHouseFormDTO houseInfo); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java index c54567c350..7f5097fd20 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java @@ -2,8 +2,10 @@ package com.epmet.commons.tools.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.CustomerGridFormDTO; +import com.epmet.commons.tools.dto.form.IcHouseFormDTO; import com.epmet.commons.tools.feign.CommonGovOrgFeignClient; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import org.springframework.stereotype.Component; @@ -22,5 +24,18 @@ public class CommonGovOrgFeignClientFallback implements CommonGovOrgFeignClient return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo", customerGridFormDTO); } + /** + * @param houseInfo + * @Description 查询房屋信息 + * @Param houseInfo + * @Return {@link Result< HouseInfoCache >} + * @Author zhaoqifeng + * @Date 2022/5/18 14:29 + */ + @Override + public Result getHouseInfoCache(IcHouseFormDTO houseInfo) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getHouseInfoCache", houseInfo); + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java index eb1632d1e6..1ce0a85c54 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java @@ -141,15 +141,16 @@ public class MaskProcessor { * @return */ private String maskIdCard(String originString) { + int clearTextLength = 12; // 仅将6位之后的全都打码 int length = originString.length(); - if (length <= 6) { + if (length <= clearTextLength) { return originString; } - String maskStr = StrUtil.repeatByLength("*", length - 6); + String maskStr = StrUtil.repeatByLength("*", length - clearTextLength); - return originString.replaceAll("^(\\d{6})[a-zA-Z0-9]*$", new StringBuilder("$1").append(maskStr).toString()); + return originString.replaceAll("^(\\d{10})\\d+([a-zA-Z0-9]{2})$", new StringBuilder("$1").append(maskStr).append("$2").toString()); } /** 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 2526eb8486..9e442c27e2 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 @@ -101,7 +101,7 @@ public class RedisKeys { * epmet:sys:security:user:token字符串 */ public static String getCpUserKey(String app, String client, String userId) { - return rootPrefix.concat("sys:security:user:").concat(app).concat(":").concat(client).concat(":").concat(userId); + return rootPrefix.concat("sys:security:user:").concat(app).concat(StrConstant.COLON).concat(client).concat(StrConstant.COLON).concat(userId); } /** @@ -200,7 +200,7 @@ public class RedisKeys { * @return */ public static String getRoleOpeScopesKey(String roleId, String opeKey) { - return rootPrefix.concat("gov:access:role:opescopes:").concat(roleId).concat(":").concat(opeKey); + return rootPrefix.concat("gov:access:role:opescopes:").concat(roleId).concat(StrConstant.COLON).concat(opeKey); } /** @@ -338,7 +338,7 @@ public class RedisKeys { * @return */ public static String getCustomerStatsCalFlag(String customerId) { - return getCustomerStatsCalKeyPrefix().concat(":").concat(customerId); + return getCustomerStatsCalKeyPrefix().concat(StrConstant.COLON).concat(customerId); } /** @@ -364,7 +364,7 @@ public class RedisKeys { * @return */ public static String getCustomerFootbarKey(String customerId, String appType) { - return rootPrefix.concat("footbar").concat(":").concat(customerId).concat(":").concat(appType); + return rootPrefix.concat("footbar").concat(StrConstant.COLON).concat(customerId).concat(StrConstant.COLON).concat(appType); } @@ -397,7 +397,7 @@ public class RedisKeys { * @date 2020.11.05 13:34 */ public static String getResiUserBadgeKey(String customerId, String userId) { - return rootPrefix.concat("badge:user:").concat(customerId).concat(":").concat(StringUtils.isBlank(userId) ? "*" : userId); + return rootPrefix.concat("badge:user:").concat(customerId).concat(StrConstant.COLON).concat(StringUtils.isBlank(userId) ? "*" : userId); } /** @@ -483,7 +483,7 @@ public class RedisKeys { **/ public static String getGroupMsgReadKey(String source, String groupId, String sourceId) { String currentMonth= DateUtils.getBeforeNMonth(NumConstant.ZERO); - return "groupread:".concat(currentMonth).concat(":").concat(source).concat(":").concat(groupId).concat(":").concat(sourceId); + return "groupread:".concat(currentMonth).concat(StrConstant.COLON).concat(source).concat(StrConstant.COLON).concat(groupId).concat(StrConstant.COLON).concat(sourceId); } /** @@ -497,7 +497,7 @@ public class RedisKeys { **/ public static String getGroupMsgShouldReadUser(String source, String groupId, String sourceId) { String currentMonth= DateUtils.getBeforeNMonth(NumConstant.ZERO); - return "groupread:user:".concat(currentMonth).concat(":").concat(source).concat(":").concat(groupId).concat(":").concat(sourceId); + return "groupread:user:".concat(currentMonth).concat(StrConstant.COLON).concat(source).concat(StrConstant.COLON).concat(groupId).concat(StrConstant.COLON).concat(sourceId); } /** @@ -560,7 +560,7 @@ public class RedisKeys { * @date 2021.09.23 17:38:37 */ public static String getQuestionnaireAccessKey(String userId, String qKey) { - return rootPrefix.concat("questionnaire:accesskey:").concat(userId).concat(":").concat(qKey); + return rootPrefix.concat("questionnaire:accesskey:").concat(userId).concat(StrConstant.COLON).concat(qKey); } /** @@ -594,7 +594,7 @@ public class RedisKeys { * @date 2021.10.25 17:49:43 */ public static String loginTicket(String app, String ticket) { - return rootPrefix.concat("sys:security:ticket:").concat(app).concat(":").concat(ticket); + return rootPrefix.concat("sys:security:ticket:").concat(app).concat(StrConstant.COLON).concat(ticket); } /** @@ -660,7 +660,7 @@ public class RedisKeys { } public static String getHouseInfoCacheKey(String houseId,String customerId){ - return rootPrefix.concat("house:").concat(customerId).concat(":").concat(houseId); + return rootPrefix.concat("house:").concat(customerId).concat(StrConstant.COLON).concat(houseId); } /** @@ -682,7 +682,7 @@ public class RedisKeys { * @return */ public static String icResiImportTypeKey(String importTag, String type) { - return icResiImportBaseKey(importTag).concat(":").concat(type); + return icResiImportBaseKey(importTag).concat(StrConstant.COLON).concat(type); } /** @@ -693,7 +693,7 @@ public class RedisKeys { * @return */ public static String icResiImportResiCategoryKey(String importTag, String type, String resiId) { - return icResiImportTypeKey(importTag, type).concat(":").concat(resiId); + return icResiImportTypeKey(importTag, type).concat(StrConstant.COLON).concat(resiId); } /** @@ -704,7 +704,7 @@ public class RedisKeys { * @date 2022/2/14 9:38 上午 */ public static String getTemporaryHouseInfoCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryHouse:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryHouse:").concat(customerId).concat(StrConstant.COLON).concat(userId); } /** @@ -715,7 +715,7 @@ public class RedisKeys { * @date 2022/2/14 9:38 上午 */ public static String getTemporaryGridInfoCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryGrid:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryGrid:").concat(customerId).concat(StrConstant.COLON).concat(userId); } /** @@ -726,7 +726,7 @@ public class RedisKeys { * @date 2022/2/14 9:39 上午 */ public static String getTemporaryNeighborHoodInfoCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryNeighborHood:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryNeighborHood:").concat(customerId).concat(StrConstant.COLON).concat(userId); } /** @@ -737,7 +737,7 @@ public class RedisKeys { * @date 2022/2/14 9:39 上午 */ public static String getTemporaryBuildingInfoCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryBuilding:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryBuilding:").concat(customerId).concat(StrConstant.COLON).concat(userId); } /** @@ -748,15 +748,15 @@ public class RedisKeys { * @date 2022/2/14 1:54 下午 */ public static String getTemporaryBuildingUnitInfoCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryBuildingUnit:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryBuildingUnit:").concat(customerId).concat(StrConstant.COLON).concat(userId); } public static String getTemporaryImportResultCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryResult:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryResult:").concat(customerId).concat(StrConstant.COLON).concat(userId); } - public static String getCustomerMenuList(String customerId, Integer type) { - return getCustomerMenuListPrefix().concat(customerId).concat(":type:")+type; + public static String getCustomerMenuList(String customerId, Integer type, String tableName) { + return getCustomerMenuListPrefix().concat("type:").concat(type.toString()).concat(":tableName:").concat(tableName).concat(StrConstant.COLON).concat(customerId); } /** @@ -764,7 +764,7 @@ public class RedisKeys { * @return */ public static String getCustomerMenuListPrefix() { - return rootPrefix.concat("oper:access:nav:customerId:"); + return rootPrefix.concat("gov:access:nav:"); } /** 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 6f2e4959e0..81cd3dd878 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 @@ -1,11 +1,14 @@ package com.epmet.commons.tools.redis.common; import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.dto.form.IcHouseFormDTO; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.CommonAggFeignClient; +import com.epmet.commons.tools.feign.CommonGovOrgFeignClient; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import lombok.extern.slf4j.Slf4j; @@ -28,6 +31,8 @@ public class CustomerIcHouseRedis { private RedisUtils redisUtils; @Autowired private CommonAggFeignClient commonAggFeignClient; + @Autowired + private CommonGovOrgFeignClient govOrgFeignClient; private static CustomerIcHouseRedis customerIcHouseRedis; @PostConstruct @@ -62,6 +67,35 @@ public class CustomerIcHouseRedis { return buildInfoResult.getData(); } + /** + * @Description 获取房屋信息 + * @Param customerId + * @Param houseId + * @Return {@link HouseInfoCache} + * @Author zhaoqifeng + * @Date 2022/5/18 14:37 + */ + public static HouseInfoCache getHouseInfo(String customerId, String houseId){ + String key = RedisKeys.getHouseInfoCacheKey(houseId,customerId); + Map house = customerIcHouseRedis.redisUtils.hGetAll(key); + if (!MapUtils.isEmpty(house)) { + return ConvertUtils.mapToEntity(house, HouseInfoCache.class); + } + IcHouseFormDTO formDTO = new IcHouseFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setHouseId(houseId); + Result houseInfoResult = customerIcHouseRedis.govOrgFeignClient.getHouseInfoCache(formDTO); + if (!houseInfoResult.success()){ + throw new RenException("查询房屋信息失败..."); + } + if (null == houseInfoResult.getData()){ + return null; + } + Map map = BeanUtil.beanToMap(houseInfoResult.getData(), false, true); + customerIcHouseRedis.redisUtils.hMSet(key, map); + return houseInfoResult.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/HouseInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java new file mode 100644 index 0000000000..075a954290 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java @@ -0,0 +1,109 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 房屋信息缓存 + * @author Administrator + */ +@Data +public class HouseInfoCache implements Serializable { + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 小区详细地址 + */ + private String neighborAddress; + /** + * 小区id + */ + private String neighborHoodId; + /** + * 小区名称 + */ + private String neighborHoodName; + + + /** + * 所属楼栋id + */ + private String buildingId; + /** + * 楼栋名称 + */ + private String buildingName; + + + /** + * 所属单元id + */ + private String buildingUnitId; + /** + * 单元名 + */ + private String unitName; + + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,1楼房,2平房,3别墅 + */ + private String houseType; + + private String houseName; + + /** + * 楼的经度 + */ + private String buildingLongitude; + /** + * 楼的纬度 + */ + private String buildingLatitude; + + /** + * 小区名+楼栋名+单元名+房屋名 + */ + private String allName; + + private String customerId; + + /** + * 小区所在的组织id + */ + private String agencyId; + /** + * eg:市北区-阜新路街道-南宁社区 + */ + private String agencyPathName; + /** + * 组织的area_code + */ + private String areaCode; + + /** + * 网格id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 房屋编码 + */ + private String houseCode; + /** + * 二维码地址 + */ + private String houseQrcodeUrl; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HouseQRcodeUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HouseQRcodeUtils.java new file mode 100644 index 0000000000..bb667af0c9 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HouseQRcodeUtils.java @@ -0,0 +1,171 @@ +package com.epmet.commons.tools.utils; + + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.WriterException; +import com.google.zxing.client.j2se.MatrixToImageConfig; +import com.google.zxing.client.j2se.MatrixToImageWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.common.CharacterSetECI; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; +import lombok.extern.slf4j.Slf4j; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; + +/** + * Date: 2022/06/7 10:01 + * Description:房屋一户一码生成工具类 + */ +@Slf4j +public class HouseQRcodeUtils { + /** + * 二维码颜色 默认是黑色 + */ + private static final Color QRCOLOR = Color.black; + /** + * 背景颜色 + */ + private static final Color BGWHITE = Color.white; + public static final int WIDTH = 800; + public static final int HEIGHT = 800; + public static final int MARGIN = 10; + public static final int FONTSIZE = 40; + + + + /** + * 房屋一户一码生成-指定像素 + * + * @param contents 说明 + * @return BufferedImage + * @throws Exception + */ + public static BufferedImage drawHouseQRImage(String pressText, String contents) throws Exception { + BufferedImage qRImage = null; + if (contents == null || "".equals(contents)) { + throw new Exception("content说明不能为空"); + } + // 二维码参数设置 + HashMap hints = new HashMap<>(); + hints.put(EncodeHintType.CHARACTER_SET, CharacterSetECI.UTF8); // 编码设置 + hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // 安全等级,最高h + hints.put(EncodeHintType.MARGIN, MARGIN); // 设置margin=0-10 + + // 二维码图片的生成 + BarcodeFormat format = BarcodeFormat.QR_CODE; + // 创建矩阵容器 + BitMatrix matrix = null; + try { + matrix = new MultiFormatWriter().encode(contents, format, WIDTH, HEIGHT, hints); + } catch (WriterException e) { + log.error("method exception", e); + } + + // 设置矩阵转为图片的参数 + MatrixToImageConfig toImageConfig = new MatrixToImageConfig(QRCOLOR.getRGB(), BGWHITE.getRGB()); + + // 矩阵转换图像 + qRImage = MatrixToImageWriter.toBufferedImage(matrix, toImageConfig); + return pressHouseText(pressText, qRImage); + } + + /** + * @param pressText 二维码下方插入文字 + * @param image 需要添加文字的图片 + * @为图片添加文字 + */ + private static BufferedImage pressHouseText(String pressText, BufferedImage image) throws Exception { + + BufferedImage outImage = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); + //计算文字开始的位置 + //x开始的位置:(图片宽度-字体大小*字的个数)/2 + int startX = (WIDTH - (FONTSIZE * pressText.length())) / 2; + //y开始的位置:图片高度-(图片高度-图片宽度)/2 +// int startY = HEIGHT - (HEIGHT - WIDTH) / 2 + FONTSIZE; + int startY = 740; + + int imageW = outImage.getWidth(); + int imageH = outImage.getHeight(); + Graphics2D g = outImage.createGraphics(); + g.drawImage(image, 0, 0, imageW, imageH, null); + g.setColor(QRCOLOR); + g.setFont(new Font("Noto Sans SC Light", Font.BOLD, FONTSIZE)); + g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g.setBackground(Color.white); +// 获取文字数量 按照字节展示 + int size = pressText.getBytes("GBK").length; +// 获取一行最多能容纳多少文字 按照文字字节展示 + int maxSize = (WIDTH / FONTSIZE - 2) * 2; + if (size > maxSize) { + int v = size % maxSize; + for (int a = 0; a < (size / maxSize); a++) { + String s = outStringByByte(pressText, maxSize); + g.drawString(s, (WIDTH - (FONTSIZE * (WIDTH / FONTSIZE - 2))) / 2, startY); + pressText = pressText.substring(s.length(), pressText.length()); + startY = startY + 35; + } + if (v != 0) { + g.drawString(pressText, (WIDTH - (FONTSIZE * v)) / 2, startY); + } + } else { + g.drawString(pressText, (WIDTH - ((pressText.getBytes("GBK").length) / 2) * FONTSIZE) / 2, startY); + } + + g.dispose(); + return outImage; + } + + + + /** + * 保存二维码图片到本地 + * + * @param contents + * @throws Exception + */ + public static void createImg(String pressText, String contents, String filename, String filePath) throws Exception { + BufferedImage qRImageWithLogo = drawHouseQRImage(pressText, contents); + // 写入返回 + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ImageIO.write(qRImageWithLogo, "jpg", baos); + //图片类型 + String imageType = "jpg"; + //生成二维码存放文件 + File file = new File(filePath + filename + ".jpg"); + if (!file.exists()) { + file.mkdirs(); + } + ImageIO.write(qRImageWithLogo, imageType, file); + baos.close(); + } + + + private static String outStringByByte(String str, int len) throws IOException { + byte[] btf = str.getBytes("GBK"); + int count = 0; + + for (int j = len - 1; j >= 0; j--) { + if (btf[j] < 0) { + count++; + } else { + break; + } + } + + if (count % 2 == 0) { + return new String(btf, 0, len, "GBK"); + } else { + return new String(btf, 0, len - 1, "GBK"); + } + } + +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 4fd11ba0c2..4fe6be37da 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -143,6 +143,41 @@ public class HttpClientManager { } + /** + * desc: 发送json post 请求 + * param: url,jsonStrParam + * return: CallResult + * date: 2019/2/21 9:12 + * + * @author: jianjun liu + */ + public Result sendPostAndHeader(String url, Map paramsMap, Map headerMap) { + + try { + HttpPost httppost = new HttpPost(url); + httppost.setConfig(requestConfig); + + httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_FORM_URL_ENCODED); + if (null != headerMap){ + headerMap.forEach((k,v) -> { + httppost.addHeader(k,v); + }); + } + List list = new ArrayList(); + for (String key : paramsMap.keySet()) { + list.add(new BasicNameValuePair(key, String.valueOf(paramsMap.get(key)))); + } + UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(list, UTF8); + httppost.setEntity(urlEncodedFormEntity); + + return execute(httppost, false); + } catch (Exception e) { + log.error("send exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + + } + /** * desc: 发送json post 请求 * param: url,jsonStrParam diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTree.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTree.java new file mode 100644 index 0000000000..8f28cef145 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTree.java @@ -0,0 +1,45 @@ +package com.epmet.commons.tools.utils; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class NodeTree implements Serializable { + private static final long serialVersionUID = 8020505121785861117L; + /** + * 主键 + */ + private String id; + /** + * 上级ID + */ + private String pid; + /** + * 子节点列表 + */ + private List children = new ArrayList<>(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPid() { + return pid; + } + + public void setPid(String pid) { + this.pid = pid; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTreeUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTreeUtils.java new file mode 100644 index 0000000000..1c3df168ee --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTreeUtils.java @@ -0,0 +1,31 @@ +package com.epmet.commons.tools.utils; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +public class NodeTreeUtils { + + public static List build(List treeNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(treeNodes.size()); + for(T treeNode : treeNodes){ + nodeMap.put(treeNode.getId(), treeNode); + } + + for(T node : nodeMap.values()) { + T parent = nodeMap.get(node.getPid()); + if(parent != null && !(node.getId().equals(parent.getId()))){ + parent.getChildren().add(node); + continue; + } + + result.add(node); + } + + return result; + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java index 1a7f37a932..7eae78be1d 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java @@ -50,6 +50,8 @@ public class ProjectDTO implements Serializable { */ private String agencyId; + private String gridId; + /** * 来源:议题issue */ diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.java index 8d566b72ef..1b8f73993b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.java @@ -109,6 +109,16 @@ public class ProjectProcessDTO implements Serializable { */ private String costWorkdays; + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; + /** * 删除标识:0.未删除 1.已删除 */ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java index a0dc4073d4..0f7a9e2cb7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java @@ -187,5 +187,13 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { * 18、当前组织内:来源于工作人员上报事件的项目:结案无需解决数 */ private Integer workEventUnResolvedCount; + /** + * 19、当前组织内:来源于事件管理的项目:结案已解决数 + */ + private Integer icEventResolvedCount; + /** + * 20、当前组织内:来源于事件管理的项目:结案无需解决数 + */ + private Integer icEventUnResolvedCount; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index cd77750bee..8682ec5876 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1201,9 +1201,12 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve Integer eventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getEventUnResolvedCount).sum(); Integer workEventResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getWorkEventResolvedCount).sum(); Integer workEventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getWorkEventUnResolvedCount).sum(); + Integer icEventResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getIcEventResolvedCount).sum(); + Integer icEventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getIcEventUnResolvedCount).sum(); Integer closedProjectTotal = issueResolvedCount + issueUnResolvedCount+projectResolvedCount + projectUnResolvedCount + eventResolvedCount + eventUnResolvedCount - + workEventResolvedCount + workEventUnResolvedCount; + + workEventResolvedCount + workEventUnResolvedCount + +icEventResolvedCount + icEventUnResolvedCount; resultDTO.setProblemResolvedCount(closedProjectTotal); resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, closedProjectTotal)); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 051bffb00c..330f564b25 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -631,7 +631,8 @@ ISSUE_PROJECT_RESOLVED_COUNT+ISSUE_PROJECT_UN_RESOLVED_COUNT +APPROVAL_PROJECT_RESOLVED_COUNT+APPROVAL_PROJECT_UN_RESOLVED_COUNT +EVENT_RESOLVED_COUNT+EVENT_UN_RESOLVED_COUNT - +WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, + +WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT + +IC_EVENT_RESOLVED_COUNT+IC_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio, concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio, concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio, @@ -654,7 +655,8 @@ ISSUE_PROJECT_RESOLVED_COUNT+ISSUE_PROJECT_UN_RESOLVED_COUNT +APPROVAL_PROJECT_RESOLVED_COUNT+APPROVAL_PROJECT_UN_RESOLVED_COUNT +EVENT_RESOLVED_COUNT+EVENT_UN_RESOLVED_COUNT - +WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, + +WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT + +IC_EVENT_RESOLVED_COUNT+IC_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio, concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio, concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio, @@ -693,7 +695,9 @@ EVENT_RESOLVED_COUNT, EVENT_UN_RESOLVED_COUNT, WORK_EVENT_RESOLVED_COUNT, - WORK_EVENT_UN_RESOLVED_COUNT + WORK_EVENT_UN_RESOLVED_COUNT, + IC_EVENT_RESOLVED_COUNT, + IC_EVENT_UN_RESOLVED_COUNT FROM fact_agency_govern_daily WHERE diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java index 5767491aa3..2f438b7bb8 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java @@ -147,6 +147,16 @@ public class FactAgencyGovernDailyDTO implements Serializable { */ private Integer workEventUnResolvedCount; + /** + * 19、当前组织内:来源于事件管理的项目:结案已解决数 + */ + private Integer icEventResolvedCount; + + /** + * 20、当前组织内:来源于事件管理的项目:结案无需解决数 + */ + private Integer icEventUnResolvedCount; + /** * 未出当前网格的,结案项目数 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java index e1122d933b..55dad7ab07 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java @@ -158,6 +158,16 @@ public class FactGridGovernDailyDTO implements Serializable { */ private Integer workEventUnResolvedCount; + /** + * 19、当前组织内:来源于事件管理的项目:结案已解决数 + */ + private Integer icEventResolvedCount; + + /** + * 20、当前组织内:来源于事件管理的项目:结案无需解决数 + */ + private Integer icEventUnResolvedCount; + /** * 15、未出当前网格的,结案项目数=11+12+13+14 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyUserHouseDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyUserHouseDailyDTO.java new file mode 100644 index 0000000000..862f85649f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyUserHouseDailyDTO.java @@ -0,0 +1,148 @@ +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class FactAgencyUserHouseDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,customer_id+AGENCY_ID+date_id只有一条记录 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 组织id + */ + private String agencyId; + + /** + * agency_id所属的机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 组织i所属的组织id + */ + private String pid; + + /** + * 组织i所有上级id + */ + private String pids; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridUserHouseDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridUserHouseDailyDTO.java new file mode 100644 index 0000000000..1da0d57339 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridUserHouseDailyDTO.java @@ -0,0 +1,139 @@ +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class FactGridUserHouseDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,customer_id+grid_id+date_id只有一条记录 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有上级id + */ + private String pids; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactNeighborhoodUserHouseDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactNeighborhoodUserHouseDailyDTO.java new file mode 100644 index 0000000000..a491bbdd3d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactNeighborhoodUserHouseDailyDTO.java @@ -0,0 +1,144 @@ +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class FactNeighborhoodUserHouseDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,customer_id+grid_id+date_id只有一条记录 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有上级id + */ + private String pids; + + /** + * 小区ID + */ + private String neighbourhoodsId; + + /** + * 小区名称 + */ + private String neighborHoodName; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/FactUserHouseFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/FactUserHouseFormDTO.java new file mode 100644 index 0000000000..ed7492dbee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/FactUserHouseFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.stats.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class FactUserHouseFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * level + */ + private String level; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/FactUserHouseResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/FactUserHouseResultDTO.java new file mode 100644 index 0000000000..37c080deee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/FactUserHouseResultDTO.java @@ -0,0 +1,169 @@ +package com.epmet.dto.stats.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class FactUserHouseResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,customer_id+AGENCY_ID+date_id只有一条记录 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织id + */ + private String agencyName; + + /** + * 小区ID + */ + private String neighbourhoodsId; + + /** + * 小区名称 + */ + private String neighborHoodName; + + /** + * agency_id所属的机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 组织i所属的组织id + */ + private String pid; + + /** + * 组织i所有上级id + */ + private String pids; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 595977d64c..0aedb1d83e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -13,6 +13,7 @@ import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.GridUserInfoDTO; @@ -368,4 +369,10 @@ public interface DataStatisticalOpenFeignClient { @PostMapping("/data/stats/screenextract/data_check") Result dataCheck(@RequestBody ExtractOriginFormDTO formDTO); + + @PostMapping("/data/stats/factAgencyUserHouseDaily/userHouseStatGrid") + Result userHouseStatGrid(@RequestBody FactUserHouseFormDTO formDTO); + + @PostMapping("/data/stats/factAgencyUserHouseDaily/userHouseStatAgency") + Result userHouseStatAgency(@RequestBody FactUserHouseFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 43e2a3445c..6ebe9d5004 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -14,6 +14,7 @@ import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.GridUserInfoDTO; @@ -351,4 +352,14 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result dataCheck(ExtractOriginFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "dataCheck", formDTO); } + + @Override + public Result userHouseStatGrid(FactUserHouseFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userHouseStatGrid", formDTO); + } + + @Override + public Result userHouseStatAgency(FactUserHouseFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userHouseStatAgency", formDTO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index 07cb835339..93e0966db2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -85,6 +85,8 @@ public interface ProjectConstant { String PROJECT_ORIGIN_EVENT="resi_event"; String PROJECT_ORIGIN_WORK_EVENT="work_event"; + + String IC_EVENT="ic_event"; /** * 自办 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactUserHouseController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactUserHouseController.java new file mode 100644 index 0000000000..6dfe03236b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactUserHouseController.java @@ -0,0 +1,103 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.excel.FactUserHouseExcel; +import com.epmet.service.stats.FactUserHouseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@RestController +@RequestMapping("factAgencyUserHouseDaily") +public class FactUserHouseController { + + @Autowired + private FactUserHouseService factUserHouseService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = factUserHouseService.page(params); + return new Result>().ok(page); + } + + /** + * 合计 + * + * @param params + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/31 9:48 + */ + @RequestMapping("total") + public Result total(@RequestParam Map params) { + FactUserHouseResultDTO dto = factUserHouseService.total(params); + return new Result().ok(dto); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = factUserHouseService.list(params); + if (list.isEmpty()) { + FactUserHouseResultDTO dto = new FactUserHouseResultDTO(); + list.add(dto); + } + ExcelUtils.exportExcelToTarget(response, null, list, FactUserHouseExcel.class); + } + + /** + * 统计网格纬度 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/31 9:48 + */ + @PostMapping("userHouseStatGrid") + public Result userHouseStatGrid(@RequestBody FactUserHouseFormDTO formDTO) { + factUserHouseService.statGrid(formDTO); + return new Result(); + } + + /** + * 统计小区纬度 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/31 9:48 + */ + @PostMapping("userHouseStatNeighborhood") + public Result userHouseStatNeighborhood(@RequestBody FactUserHouseFormDTO formDTO) { +// factUserHouseService.statNeighborhood(formDTO); + return new Result(); + } + + /** + * 统计组织纬度 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/31 9:48 + */ + @PostMapping("userHouseStatAgency") + public Result userHouseStatAgency(@RequestBody FactUserHouseFormDTO formDTO) { + factUserHouseService.statAgency(formDTO); + return new Result(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/IcHouseDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/IcHouseDao.java new file mode 100644 index 0000000000..b6af5aa3b2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/IcHouseDao.java @@ -0,0 +1,24 @@ +package com.epmet.dao.org; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.org.IcHouseEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcHouseDao extends BaseDao { + + List houseStat(FactUserHouseFormDTO formDTO); + + List neighborhoodStatStat(FactUserHouseFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java new file mode 100644 index 0000000000..3bbdef4df6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java @@ -0,0 +1,26 @@ +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Mapper +public interface FactAgencyUserHouseDailyDao extends BaseDao { + + List listPage(Map params); + + List getTotal(Map params); + + void deleteByDateId(FactUserHouseFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridUserHouseDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridUserHouseDailyDao.java new file mode 100644 index 0000000000..515333fc6f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridUserHouseDailyDao.java @@ -0,0 +1,28 @@ +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactGridUserHouseDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Mapper +public interface FactGridUserHouseDailyDao extends BaseDao { + + List listPage(Map params); + + List getTotal(Map params); + + List statAgency(FactUserHouseFormDTO formDTO); + + void deleteByDateId(FactUserHouseFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactNeighborhoodUserHouseDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactNeighborhoodUserHouseDailyDao.java new file mode 100644 index 0000000000..f5b26bc331 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactNeighborhoodUserHouseDailyDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Mapper +public interface FactNeighborhoodUserHouseDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/IcResiUserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/IcResiUserDao.java new file mode 100644 index 0000000000..56b1cb5fd1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/IcResiUserDao.java @@ -0,0 +1,40 @@ +/** + * 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.dao.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.user.IcResiUserEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface IcResiUserDao extends BaseDao { + + List userStat(FactUserHouseFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java index 523f482902..7e0c4ad338 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java @@ -186,4 +186,14 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { */ private Integer districtDeptClosedCount; + /** + * 19、当前组织内:来源于事件管理的项目:结案已解决数 + */ + private Integer icEventResolvedCount; + /** + * 20、当前组织内:来源于事件管理的项目:结案无需解决数 + */ + private Integer icEventUnResolvedCount; + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java index 204a3591ff..4120ed76c5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java @@ -186,6 +186,16 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { */ private Integer workEventUnResolvedCount; + /** + * 19、当前组织内:来源于事件管理的项目:结案已解决数 + */ + private Integer icEventResolvedCount; + + /** + * 20、当前组织内:来源于事件管理的项目:结案无需解决数 + */ + private Integer icEventUnResolvedCount; + /** * 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/IcHouseEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/IcHouseEntity.java new file mode 100644 index 0000000000..889f5b3d86 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/IcHouseEntity.java @@ -0,0 +1,110 @@ +/** + * 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.entity.org; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_house") +public class IcHouseEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 所属单元id + */ + private String buildingUnitId; + + /** + * 房屋名字后台插入时生成 + */ + private String houseName; + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,这里存储字典value就可以 + */ + private String houseType; + + /** + * 存储字典value + */ + private String purpose; + + /** + * 1出租;0未出租 + */ + private Integer rentFlag; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房主身份证号 + */ + private String ownerIdCard; + + /** + * 排序 + */ + private BigDecimal sort; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyUserHouseDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyUserHouseDailyEntity.java new file mode 100644 index 0000000000..2426a984d5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyUserHouseDailyEntity.java @@ -0,0 +1,118 @@ +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_user_house_daily") +public class FactAgencyUserHouseDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 组织id + */ + private String agencyId; + + /** + * agency_id所属的机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 组织i所属的组织id + */ + private String pid; + + /** + * 组织i所有上级id + */ + private String pids; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridUserHouseDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridUserHouseDailyEntity.java new file mode 100644 index 0000000000..58075e335e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridUserHouseDailyEntity.java @@ -0,0 +1,109 @@ +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_grid_user_house_daily") +public class FactGridUserHouseDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有上级id + */ + private String pids; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactNeighborhoodUserHouseDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactNeighborhoodUserHouseDailyEntity.java new file mode 100644 index 0000000000..53b963b560 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactNeighborhoodUserHouseDailyEntity.java @@ -0,0 +1,114 @@ +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_neighborhood_user_house_daily") +public class FactNeighborhoodUserHouseDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有上级id + */ + private String pids; + + /** + * 小区ID + */ + private String neighbourhoodsId; + + /** + * 小区名称 + */ + private String neighborHoodName; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java new file mode 100644 index 0000000000..4a2260b045 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java @@ -0,0 +1,513 @@ +/** + * 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.entity.user; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_user") +public class IcResiUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 单元id + */ + private String unitId; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 是否本地户籍 + */ + private String isBdhj; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 备注 + */ + private String remarks; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系人电话 + */ + private String contactsMobile; + + /** + * 九小场所url + */ + private String ninePlace; + + /** + * 是否党员 + */ + private String isParty; + + /** + * 是否低保户 + */ + private String isDbh; + + /** + * 是否保障房 + */ + private String isEnsureHouse; + + /** + * 是否失业 + */ + private String isUnemployed; + + /** + * 是否育龄妇女 + */ + private String isYlfn; + + /** + * 是否退役军人 + */ + private String isVeterans; + + /** + * 是否统战人员 + */ + private String isUnitedFront; + + /** + * 是否信访人员 + */ + private String isXfry; + + /** + * 是否志愿者 + */ + private String isVolunteer; + + /** + * 是否老年人 + */ + private String isOldPeople; + + /** + * 是否空巢 + */ + private String isKc; + + /** + * 是否失独 + */ + private String isSd; + + /** + * 是否失能 + */ + private String isSn; + + /** + * 是否失智 + */ + private String isSz; + + /** + * 是否残疾 + */ + private String isCj; + + /** + * 是否大病 + */ + private String isDb; + + /** + * 是否慢病 + */ + private String isMb; + + /** + * 是否特殊人群 + */ + private String isSpecial; + + /** + * 是否租户【是:1 否:0】 + */ + private String isTenant; + + /** + * 是否流动人口【是:1 否:0】 + */ + private String isFloating; + + /** + * 文化程度【字典表】 + */ + private String culture; + + /** + * 文化程度备注 + */ + private String cultureRemakes; + + /** + * 特长【字典表】 + */ + private String specialSkill; + + /** + * 兴趣爱好 + */ + private String hobby; + + /** + * 兴趣爱好备注 + */ + private String hobbyRemakes; + + /** + * 宗教信仰 + */ + private String faith; + + /** + * 宗教信仰备注 + */ + private String faithRemakes; + + /** + * 残疾类别【字典表】 + */ + private String cjlb; + + /** + * 残疾登记(状况)【字典表】 + */ + private String cjzk; + + /** + * 残疾证号 + */ + private String cjzh; + + /** + * 残疾说明 + */ + private String cjsm; + + /** + * 有无监护人【yes no】 + */ + private String ynJdr; + + /** + * 有无技能特长【yes no】 + */ + private String ynJntc; + + /** + * 有无劳动能力 + */ + private String ynLdnl; + + /** + * 有无非义务教育阶段助学【yes no】 + */ + private String ynFywjyjdzx; + + /** + * 所患大病 + */ + private String shdb; + + /** + * 患大病时间 + */ + private String dbsj; + + /** + * 所患慢性病 + */ + private String shmxb; + + /** + * 患慢性病时间 + */ + private String mxbsj; + + /** + * 是否参保 + */ + private String isCb; + + /** + * 自付金额 + */ + private String zfje; + + /** + * 救助金额 + */ + private String jzje; + + /** + * 救助时间[yyyy-MM-dd] + */ + private String jzsj; + + /** + * 享受救助明细序号 + */ + private String jzmxxh; + + /** + * 健康信息备注 + */ + private String healthRemakes; + + /** + * 工作单位 + */ + private String gzdw; + + /** + * 职业 + */ + private String zy; + + /** + * 离退休时间 + */ + private String ltxsj; + + /** + * 工作信息备注 + */ + private String workRemake; + + /** + * 退休金额 + */ + private String txje; + + /** + * 月收入 + */ + private String ysr; + + /** + * 籍贯 + */ + private String jg; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 人户情况 + */ + private String rhzk; + + /** + * 居住信息备注 + */ + private String jzxxRemakes; + + /** + * 民族【字典表】 + */ + private String mz; + + /** + * 与户主关系【字典表】 + */ + private String yhzgx; + + /** + * 居住情况【字典表】 + */ + private String jzqk; + + /** + * 婚姻状况【字典表】 + */ + private String hyzk; + + /** + * 配偶情况【字典表】 + */ + private String poqk; + + /** + * 有无赡养人 + */ + private String ynSyr; + + /** + * 与赡养人关系【字典表】 + */ + private String ysyrgx; + + /** + * 赡养人电话 + */ + private String syrMobile; + + /** + * 家庭信息备注 + */ + private String jtxxRemakes; + + /** + * 用户状态【0:正常;1:迁出;2:注销】 + */ + private String status; + + /** + * 用户详细状态:01:新增、02:导入、03:迁入、04:新生、11:迁出、21死亡 + */ + private String subStatus; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + + /** + * 预留字段6 + */ + private String field6; + + /** + * 预留字段7 + */ + private String field7; + + /** + * 预留字段8 + */ + private String field8; + + /** + * 预留字段9 + */ + private String field9; + + /** + * 预留字段10 + */ + private String field10; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/FactUserHouseExcel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/FactUserHouseExcel.java new file mode 100644 index 0000000000..47e4445591 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/FactUserHouseExcel.java @@ -0,0 +1,56 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class FactUserHouseExcel { + + @Excel(name = "组织结构") + private String agencyName; + + @Excel(name = "小区数") + private Integer neighbourhoodsCount; + + @Excel(name = "房屋数") + private Integer houseCount; + + @Excel(name = "自住房屋数") + private Integer houseSelfCount; + + @Excel(name = "出租房屋数") + private Integer houseLeaseCount; + + @Excel(name = "闲置房屋数") + private Integer houseIdleCount; + + @Excel(name = "居民总数") + private Integer userCount; + + @Excel(name = "常住人口数") + private Integer userResiCount; + + @Excel(name = "流动人口数") + private Integer userFloatCount; + + @Excel(name = "新增房屋数") + private Integer houseIncr; + + @Excel(name = "新增人口数") + private Integer userIncr; + + @Excel(name = "修改房屋数") + private Integer houseModify; + + @Excel(name = "修改人口数") + private Integer userModify; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index ccf0ee8597..75fd5d4d4f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -285,6 +285,32 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl icEventProjectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.RESOLVED, + ProjectConstant.IC_EVENT); + if (!icEventProjectResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = icEventProjectResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setIcEventResolvedCount(dto.getSum()); + } + }); + } + //2022-5-23 当前组织内:来源于事件管理的项目:结案无需解决数 + Map icEventProjectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.UNRESOLVED, + ProjectConstant.IC_EVENT); + if (!icEventProjectUnResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = icEventProjectUnResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setIcEventUnResolvedCount(dto.getSum()); + } + }); + } + + // 2.党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) agencyGovernDailyList.forEach(item -> { int count = item.getInGroupTopicResolvedCount() + item.getInGroupTopicUnResolvedCount(); @@ -423,6 +449,8 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl eventProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_EVENT,DimObjectStatusConstant.UNRESOLVED); Map workEventProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_WORK_EVENT,DimObjectStatusConstant.RESOLVED); Map workEventProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_WORK_EVENT,DimObjectStatusConstant.UNRESOLVED); + Map icEventProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.IC_EVENT,DimObjectStatusConstant.RESOLVED); + Map icEventProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.IC_EVENT,DimObjectStatusConstant.UNRESOLVED); Map inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ZERO_STR); Map inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ZERO_STR); Map dtoMap=getGovernGridClosedTotalCommonDTOMap(customerId,gridIds); @@ -182,6 +184,16 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl + * 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.service.org; + +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; + +import java.util.List; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface HouseService { + + /** + * 房屋统计 + * + * @param formDTO + * @return java.util.List + * @author zhy + * @date 2022/5/30 13:33 + */ + List houseStat(FactUserHouseFormDTO formDTO); + + /** + * 小区统计 + * + * @param formDTO + * @return java.util.List + * @author zhy + * @date 2022/5/30 13:33 + */ + List neighborhoodStat(FactUserHouseFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/HouseServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/HouseServiceImpl.java new file mode 100644 index 0000000000..efcb8612ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/HouseServiceImpl.java @@ -0,0 +1,32 @@ +package com.epmet.service.org.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.org.IcHouseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.org.IcHouseEntity; +import com.epmet.service.org.HouseService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Slf4j +@DataSource(DataSourceConstant.GOV_ORG) +@Service +public class HouseServiceImpl extends BaseServiceImpl implements HouseService, ResultDataResolver { + + @Override + public List houseStat(FactUserHouseFormDTO formDTO) { + return baseDao.houseStat(formDTO); + } + + @Override + public List neighborhoodStat(FactUserHouseFormDTO formDTO) { + return baseDao.neighborhoodStatStat(formDTO); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java new file mode 100644 index 0000000000..9a31152d55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java @@ -0,0 +1,111 @@ +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactAgencyUserHouseDailyDTO; +import com.epmet.dto.stats.FactGridUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface FactAgencyUserHouseDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 分页合计 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + FactUserHouseResultDTO getTotal(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 查询导出数据 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List listExport(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactAgencyUserHouseDailyDTO + * @author generator + * @date 2022-05-27 + */ + FactAgencyUserHouseDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(FactAgencyUserHouseDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(FactAgencyUserHouseDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-27 + */ + void delete(String[] ids); + + /** + * 物理删除历史数据 + * + * @param formDTO + * @return void + * @author zhy + * @date 2022/5/30 13:32 + */ + void deleteByDateId(FactUserHouseFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridUserHouseDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridUserHouseDailyService.java new file mode 100644 index 0000000000..36dd9046a5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridUserHouseDailyService.java @@ -0,0 +1,120 @@ +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactGridUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactGridUserHouseDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface FactGridUserHouseDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 页面合计 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + FactUserHouseResultDTO getTotal(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 查询导出数据 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List listExport(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGridUserHouseDailyDTO + * @author generator + * @date 2022-05-27 + */ + FactGridUserHouseDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(FactGridUserHouseDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(FactGridUserHouseDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-27 + */ + void delete(String[] ids); + + /** + * 物理删除历史数据 + * + * @param formDTO + * @return void + * @author zhy + * @date 2022/5/30 13:32 + */ + void deleteByDateId(FactUserHouseFormDTO formDTO); + + /** + * 根据网格统计组织数据 + * + * @param formDTO + * @return java.util.List + * @author zhy + * @date 2022/5/30 13:32 + */ + List statAgency(FactUserHouseFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactNeighborhoodUserHouseDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactNeighborhoodUserHouseDailyService.java new file mode 100644 index 0000000000..2b8f79e32c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactNeighborhoodUserHouseDailyService.java @@ -0,0 +1,78 @@ +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactNeighborhoodUserHouseDailyDTO; +import com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +public interface FactNeighborhoodUserHouseDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-01 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-01 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactNeighborhoodUserHouseDailyDTO + * @author generator + * @date 2022-06-01 + */ + FactNeighborhoodUserHouseDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-01 + */ + void save(FactNeighborhoodUserHouseDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-01 + */ + void update(FactNeighborhoodUserHouseDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-01 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactUserHouseService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactUserHouseService.java new file mode 100644 index 0000000000..a962859465 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactUserHouseService.java @@ -0,0 +1,68 @@ +package com.epmet.service.stats; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactAgencyUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; + +import java.util.List; +import java.util.Map; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface FactUserHouseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 页面合计 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + FactUserHouseResultDTO total(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 人房网格数据 + * + * @param formDTO + * @return void + * @author zhy + * @date 2022/5/30 13:31 + */ + void statGrid(FactUserHouseFormDTO formDTO); + + /** + * 人房组织数据 + * + * @param formDTO + * @return void + * @author zhy + * @date 2022/5/30 13:31 + */ + void statAgency(FactUserHouseFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java index 9ff2671fbb..044f6e63d1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java @@ -81,9 +81,11 @@ public class DimGridServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); + String customerId = (String)params.get("customerId"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(customerId), "CUSTOMER_ID", customerId); return wrapper; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyUserHouseDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyUserHouseDailyServiceImpl.java new file mode 100644 index 0000000000..8fbf82b671 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyUserHouseDailyServiceImpl.java @@ -0,0 +1,121 @@ +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactAgencyUserHouseDailyDao; +import com.epmet.dto.stats.FactAgencyUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity; +import com.epmet.service.stats.FactAgencyUserHouseDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class FactAgencyUserHouseDailyServiceImpl extends BaseServiceImpl implements FactAgencyUserHouseDailyService { + + @Autowired + private LoginUserUtil loginUserUtil; + + @Override + public PageData page(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + IPage page = getPage(params); + List list = baseDao.listPage(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public FactUserHouseResultDTO getTotal(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + List list = baseDao.getTotal(params); + + // 只有当日数据直接展示,否则需要统计时间段内两天差值进行Incr和Modify数据计算 + if (list.size() == NumConstant.ZERO) { + return null; + } else if (list.size() == NumConstant.ONE) { + return list.get(0); + } else { + FactUserHouseResultDTO first = list.get(0); + FactUserHouseResultDTO last = list.get(list.size() - 1); + FactUserHouseResultDTO dto = last; + dto.setHouseIncr(last.getHouseIncr() - first.getHouseIncr()); + dto.setHouseModify(last.getHouseModify() - first.getHouseModify()); + dto.setUserIncr(last.getUserIncr() - first.getUserIncr()); + dto.setUserModify(last.getUserModify() - first.getUserModify()); + return dto; + } + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactAgencyUserHouseDailyDTO.class); + } + + @Override + public List listExport(Map params) { + return baseDao.listPage(params); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactAgencyUserHouseDailyDTO get(String id) { + FactAgencyUserHouseDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactAgencyUserHouseDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactAgencyUserHouseDailyDTO dto) { + FactAgencyUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyUserHouseDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactAgencyUserHouseDailyDTO dto) { + FactAgencyUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyUserHouseDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void deleteByDateId(FactUserHouseFormDTO formDTO) { + baseDao.deleteByDateId(formDTO); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridUserHouseDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridUserHouseDailyServiceImpl.java new file mode 100644 index 0000000000..0aaa1f0c2e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridUserHouseDailyServiceImpl.java @@ -0,0 +1,130 @@ +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactGridUserHouseDailyDao; +import com.epmet.dto.stats.FactGridUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactGridUserHouseDailyEntity; +import com.epmet.service.stats.FactGridUserHouseDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class FactGridUserHouseDailyServiceImpl extends BaseServiceImpl implements FactGridUserHouseDailyService { + + @Autowired + private LoginUserUtil loginUserUtil; + + @Override + public PageData page(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + IPage page = getPage(params); + List list = baseDao.listPage(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public FactUserHouseResultDTO getTotal(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + List list = baseDao.getTotal(params); + + // 只有当日数据直接展示,否则需要统计时间段内两天差值进行Incr和Modify数据计算 + if (list.size() == NumConstant.ZERO) { + return null; + } else if (list.size() == NumConstant.ONE) { + return list.get(0); + } else { + FactUserHouseResultDTO first = list.get(0); + FactUserHouseResultDTO last = list.get(list.size() - 1); + FactUserHouseResultDTO dto = last; + dto.setHouseIncr(last.getHouseIncr() - first.getHouseIncr()); + dto.setHouseModify(last.getHouseModify() - first.getHouseModify()); + dto.setUserIncr(last.getUserIncr() - first.getUserIncr()); + dto.setUserModify(last.getUserModify() - first.getUserModify()); + return dto; + } + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGridUserHouseDailyDTO.class); + } + + @Override + public List listExport(Map params) { + return baseDao.listPage(params); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String dateId = (String) params.get("dateId"); + String customerId = (String) params.get("customerId"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(dateId), "DATE_ID", dateId); + wrapper.eq(StringUtils.isNotBlank(customerId), "CUSTOMER_ID", customerId); + + return wrapper; + } + + @Override + public FactGridUserHouseDailyDTO get(String id) { + FactGridUserHouseDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGridUserHouseDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGridUserHouseDailyDTO dto) { + FactGridUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGridUserHouseDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGridUserHouseDailyDTO dto) { + FactGridUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGridUserHouseDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void deleteByDateId(FactUserHouseFormDTO formDTO) { + baseDao.deleteByDateId(formDTO); + } + + @Override + public List statAgency(FactUserHouseFormDTO formDTO) { + return baseDao.statAgency(formDTO); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactNeighborhoodUserHouseDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactNeighborhoodUserHouseDailyServiceImpl.java new file mode 100644 index 0000000000..ad6e7f152c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactNeighborhoodUserHouseDailyServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactNeighborhoodUserHouseDailyDao; +import com.epmet.dto.stats.FactNeighborhoodUserHouseDailyDTO; +import com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity; +import com.epmet.service.stats.FactNeighborhoodUserHouseDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Service +public class FactNeighborhoodUserHouseDailyServiceImpl extends BaseServiceImpl implements FactNeighborhoodUserHouseDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactNeighborhoodUserHouseDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactNeighborhoodUserHouseDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactNeighborhoodUserHouseDailyDTO get(String id) { + FactNeighborhoodUserHouseDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactNeighborhoodUserHouseDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactNeighborhoodUserHouseDailyDTO dto) { + FactNeighborhoodUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactNeighborhoodUserHouseDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactNeighborhoodUserHouseDailyDTO dto) { + FactNeighborhoodUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactNeighborhoodUserHouseDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactUserHouseServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactUserHouseServiceImpl.java new file mode 100644 index 0000000000..6b34fda27a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactUserHouseServiceImpl.java @@ -0,0 +1,229 @@ +package com.epmet.service.stats.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.OrgLevelEnum; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.stats.FactGridUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity; +import com.epmet.entity.stats.FactGridUserHouseDailyEntity; +import com.epmet.service.org.HouseService; +import com.epmet.service.stats.DimGridService; +import com.epmet.service.stats.FactAgencyUserHouseDailyService; +import com.epmet.service.stats.FactGridUserHouseDailyService; +import com.epmet.service.stats.FactUserHouseService; +import com.epmet.service.user.IcResiUserService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class FactUserHouseServiceImpl implements FactUserHouseService { + + @Autowired + private FactAgencyUserHouseDailyService factAgencyUserHouseDailyService; + + @Autowired + private FactGridUserHouseDailyService factGridUserHouseDailyService; + + @Autowired + private HouseService houseService; + + @Autowired + private IcResiUserService icResiUserService; + + @Autowired + private DimGridService dimGridService; + + @Override + public PageData page(Map params) { + PageData page = null; + if (params.containsKey("startTime") && params.containsKey("endTime")) { + if (StringUtils.isNotBlank(params.get("startTime").toString()) && StringUtils.isNotBlank(params.get("endTime").toString())) { + params.put("dateId", StringUtils.EMPTY); + } else { + params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE)); + } + } else { + params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE)); + } + if (params.containsKey("level")) { + if (OrgLevelEnum.GRID.getCode().equals(params.get("level").toString()) || OrgLevelEnum.COMMUNITY.getCode().equals(params.get("level").toString())) { + page = factGridUserHouseDailyService.page(params); + } else { + page = factAgencyUserHouseDailyService.page(params); + } + } + return page; + } + + @Override + public FactUserHouseResultDTO total(Map params) { + FactUserHouseResultDTO dto = null; + // 不查询时间段默认查询当天 + if (params.containsKey("startTime") && params.containsKey("endTime")) { + if (StringUtils.isNotBlank(params.get("startTime").toString()) && StringUtils.isNotBlank(params.get("endTime").toString())) { + params.put("dateId", StringUtils.EMPTY); + } else { + params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE)); + } + } else { + params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE)); + } + // 网格纬度查询网格统计表,其余纬度查询组织统计表 + if (params.containsKey("level")) { + if (OrgLevelEnum.GRID.getCode().equals(params.get("level").toString())) { + dto = factGridUserHouseDailyService.getTotal(params); + } else { + dto = factAgencyUserHouseDailyService.getTotal(params); + } + } + return dto; + } + + @Override + public List list(Map params) { + List list = new ArrayList<>(); + if (params.containsKey("level")) { + if (OrgLevelEnum.GRID.getCode().equals(params.get("level").toString()) || OrgLevelEnum.COMMUNITY.getCode().equals(params.get("level").toString())) { + list = factGridUserHouseDailyService.listExport(params); + } else { + list = factAgencyUserHouseDailyService.listExport(params); + } + } + FactUserHouseResultDTO dto = total(params); + if (dto != null) { + dto.setAgencyName("合计"); + } + list.add(dto); + return list; + } + + @Override + public void statGrid(FactUserHouseFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + String dateId = formDTO.getDateId(); + String customerId = formDTO.getCustomerId(); + + // 先删除历史 + factGridUserHouseDailyService.deleteByDateId(formDTO); + + // 保证小区是全部网格后,其余数据进行循环匹配 + List neiList = houseService.neighborhoodStat(formDTO); + List houseList = houseService.houseStat(formDTO); + List userList = icResiUserService.userStat(formDTO); + + List addList = new ArrayList<>(); + + neiList.forEach(item -> { + String gridId = item.getGridId(); + FactUserHouseResultDTO dto = new FactUserHouseResultDTO(); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setDateId(dateId); + dto.setGridId(gridId); + dto.setPid(item.getPid()); + dto.setPids(item.getPids()); + dto.setNeighbourhoodsCount(item.getNeighbourhoodsCount()); + + Optional houseOptional = houseList.stream().filter(house -> gridId.equals(house.getGridId()) && customerId.equals(house.getCustomerId())).findFirst(); + if (houseOptional.isPresent()) { + dto.setHouseCount(houseOptional.get().getHouseCount()); + dto.setHouseSelfCount(houseOptional.get().getHouseSelfCount()); + dto.setHouseLeaseCount(houseOptional.get().getHouseLeaseCount()); + dto.setHouseIdleCount(houseOptional.get().getHouseIdleCount()); + dto.setHouseIncr(houseOptional.get().getHouseIncr()); + dto.setHouseModify(houseOptional.get().getHouseModify()); + } else { + dto.setHouseCount(NumConstant.ZERO); + dto.setHouseSelfCount(NumConstant.ZERO); + dto.setHouseLeaseCount(NumConstant.ZERO); + dto.setHouseIdleCount(NumConstant.ZERO); + dto.setHouseIncr(NumConstant.ZERO); + dto.setHouseModify(NumConstant.ZERO); + } + + Optional userOptional = userList.stream().filter(user -> gridId.equals(user.getGridId()) && customerId.equals(user.getCustomerId())).findFirst(); + if (userOptional.isPresent()) { + dto.setUserCount(userOptional.get().getUserCount()); + dto.setUserResiCount(userOptional.get().getUserResiCount()); + dto.setUserFloatCount(userOptional.get().getUserFloatCount()); + dto.setUserIncr(userOptional.get().getUserIncr()); + dto.setUserModify(userOptional.get().getUserModify()); + } else { + dto.setUserCount(NumConstant.ZERO); + dto.setUserResiCount(NumConstant.ZERO); + dto.setUserFloatCount(NumConstant.ZERO); + dto.setUserIncr(NumConstant.ZERO); + dto.setUserModify(NumConstant.ZERO); + } + addList.add(dto); + }); + + List entityList = ConvertUtils.sourceToTarget(addList, FactGridUserHouseDailyEntity.class); + factGridUserHouseDailyService.insertBatch(entityList); + } + + @Override + public void statAgency(FactUserHouseFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + + Map params = new HashMap<>(); + params.put("dateId", formDTO.getDateId()); + params.put("customerId", formDTO.getCustomerId()); + List list = factGridUserHouseDailyService.list(params); + if (list.isEmpty()) { + return; + } + + // 先删除历史 + factAgencyUserHouseDailyService.deleteByDateId(formDTO); + + // 使用机构表左关联,对不同纬度的机构进行分组统计 + formDTO.setLevel("community"); + List commList = factGridUserHouseDailyService.statAgency(formDTO); + if (!commList.isEmpty()) { + commList.forEach(item -> item.setDateId(formDTO.getDateId())); + factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(commList, FactAgencyUserHouseDailyEntity.class)); + } + formDTO.setLevel("street"); + List streetList = factGridUserHouseDailyService.statAgency(formDTO); + if (!streetList.isEmpty()) { + streetList.forEach(item -> item.setDateId(formDTO.getDateId())); + factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(streetList, FactAgencyUserHouseDailyEntity.class)); + } + formDTO.setLevel("district"); + List districtList = factGridUserHouseDailyService.statAgency(formDTO); + if (!districtList.isEmpty()) { + districtList.forEach(item -> item.setDateId(formDTO.getDateId())); + factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(districtList, FactAgencyUserHouseDailyEntity.class)); + } + formDTO.setLevel("city"); + List cityList = factGridUserHouseDailyService.statAgency(formDTO); + if (!cityList.isEmpty()) { + cityList.forEach(item -> item.setDateId(formDTO.getDateId())); + factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(cityList, FactAgencyUserHouseDailyEntity.class)); + } + formDTO.setLevel("province"); + List provinceList = factGridUserHouseDailyService.statAgency(formDTO); + if (!provinceList.isEmpty()) { + provinceList.forEach(item -> item.setDateId(formDTO.getDateId())); + factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(provinceList, FactAgencyUserHouseDailyEntity.class)); + } + + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/IcResiUserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/IcResiUserService.java new file mode 100644 index 0000000000..3f2289edef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/IcResiUserService.java @@ -0,0 +1,45 @@ +/** + * 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.service.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.user.IcResiUserEntity; + +import java.util.List; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface IcResiUserService extends BaseService { + + /** + * 居民统计 + * + * @param formDTO + * @return java.util.List + * @author zhy + * @date 2022/5/30 13:33 + */ + List userStat(FactUserHouseFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/IcResiUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/IcResiUserServiceImpl.java new file mode 100644 index 0000000000..b48086d053 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/IcResiUserServiceImpl.java @@ -0,0 +1,50 @@ +/** + * 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.service.user.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.user.IcResiUserDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.user.IcResiUserEntity; +import com.epmet.service.user.IcResiUserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMET_USER) +@Service +public class IcResiUserServiceImpl extends BaseServiceImpl implements IcResiUserService, ResultDataResolver { + + @Override + public List userStat(FactUserHouseFormDTO formDTO) { + return baseDao.userStat(formDTO); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.31__alter_govern.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.31__alter_govern.sql new file mode 100644 index 0000000000..53d0a39910 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.31__alter_govern.sql @@ -0,0 +1,11 @@ + +ALTER TABLE `fact_agency_govern_daily` +ADD COLUMN `IC_EVENT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '19、当前组织内:来源于事件管理的项目:结案已解决数' AFTER `WORK_EVENT_UN_RESOLVED_COUNT`, +ADD COLUMN `IC_EVENT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '20、当前组织内:来源于事件管理的项目:结案无需解决数' AFTER `IC_EVENT_RESOLVED_COUNT`; + + +ALTER TABLE `epmet_data_statistical`.`fact_grid_govern_daily` + ADD COLUMN `IC_EVENT_RESOLVED_COUNT` int(11) NULL DEFAULT 0 COMMENT '19、当前组织内:来源于事件管理的项目:结案已解决数' AFTER `WORK_EVENT_UN_RESOLVED_COUNT`, + ADD COLUMN `IC_EVENT_UN_RESOLVED_COUNT` int(11) NULL DEFAULT 0 COMMENT '20、当前组织内:来源于事件管理的项目:结案无需解决数' AFTER `IC_EVENT_RESOLVED_COUNT`; + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.32__fact_grid_user_house_daily.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.32__fact_grid_user_house_daily.sql new file mode 100644 index 0000000000..a5ce1a6c8b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.32__fact_grid_user_house_daily.sql @@ -0,0 +1,85 @@ +/* + Navicat Premium Data Transfer + + Source Server : epmet_cloud_dev_statistical + Source Server Type : MySQL + Source Server Version : 50726 + Source Host : 192.168.1.140:3306 + Source Schema : epmet_data_statistical + + Target Server Type : MySQL + Target Server Version : 50726 + File Encoding : 65001 + + Date: 31/05/2022 13:29:46 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for fact_grid_user_house_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_grid_user_house_daily`; +CREATE TABLE `fact_grid_user_house_daily` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格id', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所属的组织id', + `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所有上级id', + `NEIGHBOURHOODS_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '小区总数', + `HOUSE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '房屋总数', + `HOUSE_SELF_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '自住房屋总数', + `HOUSE_LEASE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '出租房屋总数', + `HOUSE_IDLE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '闲置房屋总数', + `USER_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '居民总数', + `USER_RESI_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '常住居民总数', + `USER_FLOAT_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '流动居民总数', + `HOUSE_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增房屋数', + `HOUSE_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改房屋数', + `USER_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增居民数', + `USER_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改居民数', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '网格的人房信息统计数,按天统计' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for fact_agency_user_house_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_agency_user_house_daily`; +CREATE TABLE `fact_agency_user_house_daily` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织id', + `LEVEL` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所属的组织id', + `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所有上级id', + `NEIGHBOURHOODS_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '小区总数', + `HOUSE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '房屋总数', + `HOUSE_SELF_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '自住房屋总数', + `HOUSE_LEASE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '出租房屋总数', + `HOUSE_IDLE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '闲置房屋总数', + `USER_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '居民总数', + `USER_RESI_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '常住居民总数', + `USER_FLOAT_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '流动居民总数', + `HOUSE_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增房屋数', + `HOUSE_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改房屋数', + `USER_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增居民数', + `USER_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改居民数', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '人房信息统计数,按天统计' ROW_FORMAT = DYNAMIC; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml index 90d3242709..1a92303138 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml @@ -138,11 +138,35 @@ + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + + + + @@ -166,6 +190,10 @@ + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 83158a9711..cdf8395fd2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -141,7 +141,7 @@ WHERE 1 = 1 - AND f.ORIGIN = 'issue' + AND f.ORIGIN IN('issue', 'ic_event') AND f.PROJECT_STATUS = 'closed' AND f.CUSTOMER_ID = #{customerId} ) a @@ -468,7 +468,7 @@ AND fm.MONTH_ID = #{monthId} AND fm.PROJECT_STATUS = 'closed' AND fm.GRID_ID != '' - AND fm.ORIGIN = 'issue' + AND fm.ORIGIN IN('issue', 'ic_event') ) a GROUP BY GRID_ID @@ -490,7 +490,7 @@ WHERE fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} AND fm.PROJECT_STATUS = 'closed' - AND fm.ORIGIN = 'issue' + AND fm.ORIGIN IN('issue', 'ic_event') ) a GROUP BY AGENCY_ID @@ -680,7 +680,7 @@ fm.CUSTOMER_ID = #{customerId} AND fm.PROJECT_STATUS = 'closed' AND fm.GRID_ID != '' - AND fm.ORIGIN = 'issue' + AND fm.ORIGIN IN('issue', 'ic_event') ) a GROUP BY GRID_ID @@ -701,7 +701,7 @@ INNER JOIN fact_origin_project_main_daily fm ON fm.PIDS LIKE CONCAT( '%', da.ID, '%' ) WHERE fm.CUSTOMER_ID = #{customerId} AND fm.PROJECT_STATUS = 'closed' - AND fm.ORIGIN = 'issue' + AND fm.ORIGIN IN('issue', 'ic_event') ) a GROUP BY AGENCY_ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml new file mode 100644 index 0000000000..eb15b27feb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml @@ -0,0 +1,66 @@ + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index f309d79bf4..2949e36b6f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -58,7 +58,7 @@ FROM project WHERE DEL_FLAG = '0' - AND (ORIGIN = 'issue' OR ORIGIN = 'resi_event') + AND ORIGIN IN('issue', 'resi_event', 'ic_event') AND STATUS = 'closed' AND CUSTOMER_ID = #{customerId} AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') #{date} @@ -72,7 +72,7 @@ FROM project WHERE DEL_FLAG = '0' - AND (ORIGIN = 'issue' OR ORIGIN = 'resi_event') + AND ORIGIN IN('issue', 'resi_event', 'ic_event') AND STATUS = 'closed' AND CUSTOMER_ID = #{customerId} AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') = #{date} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyUserHouseDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyUserHouseDailyDao.xml new file mode 100644 index 0000000000..9752b42407 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyUserHouseDailyDao.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + fact_agency_user_house_daily + WHERE + DATE_ID = #{dateId} + AND CUSTOMER_ID = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml new file mode 100644 index 0000000000..b46b9467eb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + fact_grid_user_house_daily + WHERE + DATE_ID = #{dateId} + AND CUSTOMER_ID = #{customerId} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactNeighborhoodUserHouseDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactNeighborhoodUserHouseDailyDao.xml new file mode 100644 index 0000000000..41e6a25a05 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactNeighborhoodUserHouseDailyDao.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/IcResiUserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/IcResiUserDao.xml new file mode 100644 index 0000000000..0c0d3c76ce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/IcResiUserDao.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java index e6e567c43b..8c439aa218 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java @@ -18,6 +18,7 @@ public interface ImportTaskConstants { String BIZ_TYPE_ATTENTION_NAT = "attention_nat"; String BIZ_TYPE_ATTENTION_VACCINATION = "attention_vaccination"; String BIZ_TYPE_ATTENTION_TRIP_REPORT = "attention_vaccination"; + String BIZ_TYPE_IC_PARTY_MEMBER = "ic_party_member"; /** * 核酸检测 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java index f74f2697e9..95ad773777 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java @@ -17,6 +17,7 @@ package com.epmet.dto; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -42,6 +43,7 @@ public class IcCommunitySelfOrganizationPersonnelDTO implements Serializable { /** * 客户ID */ + @JsonIgnore private String customerId; /** @@ -62,31 +64,37 @@ public class IcCommunitySelfOrganizationPersonnelDTO implements Serializable { /** * */ + @JsonIgnore private Integer delFlag; /** * 乐观锁 */ + @JsonIgnore private String revision; /** * 创建人 */ + @JsonIgnore private String createdBy; /** * 创建时间 */ + @JsonIgnore private Date createdTime; /** * 更新人 */ + @JsonIgnore private String updatedBy; /** * 更新时间 */ + @JsonIgnore private Date updatedTime; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java index 30b24a8498..79168ae29e 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java @@ -150,6 +150,15 @@ public class IcUserDemandRecDTO implements Serializable { */ private Integer awardPoint; + /** + * 来源[需求录入:demand 事件管理:ic_event] + */ + private String origin; + /** + * 来源Id[目前只有来源事件管理的有值] + */ + private String originId; + /** * 删除标识:0.未删除 1.已删除 */ 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 3a931390b8..29a338232f 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 @@ -1,7 +1,9 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; import lombok.Data; +import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -18,36 +20,40 @@ public class AddCommunitySelfOrganizationFormDTO implements Serializable { private static final long serialVersionUID = -4996925380900678065L; - public interface AddCommunitySelfOrganizationForm{} + public interface AddCommunitySelfOrganizationForm extends CustomerClientShowGroup {} /** * 组织名称 */ - @NotBlank(message = "organizationName不能为空",groups = AddCommunitySelfOrganizationForm.class) + @NotBlank(message = "组织名称不能为空",groups = AddCommunitySelfOrganizationForm.class) + @Length(max = 50,message = "组织名称最多输入50字",groups = AddCommunitySelfOrganizationForm.class) private String organizationName; + @NotBlank(message = "分类不能为空", groups = AddCommunitySelfOrganizationForm.class) + private String categoryCode; + /** * 组织人数 */ - @NotNull(message = "organizationPersonCount不能为空",groups = AddCommunitySelfOrganizationForm.class) + @NotNull(message = "组织人数不能为空",groups = AddCommunitySelfOrganizationForm.class) private Integer organizationPersonCount; /** * 负责人姓名 */ - @NotBlank(message = "principalName不能为空",groups = AddCommunitySelfOrganizationForm.class) + @NotBlank(message = "负责人不能为空",groups = AddCommunitySelfOrganizationForm.class) private String principalName; /** * 负责人电话 */ - @NotBlank(message = "principalPhone不能为空",groups = AddCommunitySelfOrganizationForm.class) + @NotBlank(message = "联系电话",groups = AddCommunitySelfOrganizationForm.class) private String principalPhone; /** * 服务事项 */ - @NotBlank(message = "serviceItem不能为空",groups = AddCommunitySelfOrganizationForm.class) + @NotBlank(message = "服务事项不能为空",groups = AddCommunitySelfOrganizationForm.class) private String serviceItem; /** @@ -63,6 +69,7 @@ public class AddCommunitySelfOrganizationFormDTO implements Serializable { /** * 经度 */ + @NotBlank(message = "位置坐标不能为空",groups = AddCommunitySelfOrganizationForm.class) private String longitude; /** diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CategorySelfOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CategorySelfOrgFormDTO.java new file mode 100644 index 0000000000..bdfa1825f6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CategorySelfOrgFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +@Data +public class CategorySelfOrgFormDTO extends PageFormDTO implements Serializable { + /** + * 默认展示全部,此列可空 + */ + private String categoryCode; + + /** + * token中获取 + */ + @NotBlank(message = "customerId不能为空",groups = PageFormDTO.AddUserInternalGroup.class) + private String customerId; + /** + * token中获取 + */ + @NotBlank(message = "staffId不能为空",groups = PageFormDTO.AddUserInternalGroup.class) + private String staffId; + + /** + * 当前登录用户所属组织id + */ + private String agencyId; + +} 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 5d634afaa3..7a8fba0899 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 @@ -48,4 +48,6 @@ public class CommunitySelfOrganizationListFormDTO implements Serializable { private Integer ranking; private String remark; + + private String categoryCode; } 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 32556b2c27..6c8eb94baa 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 @@ -26,6 +26,12 @@ public class EditCommunitySelfOrganizationFormDTO implements Serializable { @NotBlank(message = "organizationName不能为空",groups = EditCommunitySelfOrganizationForm.class) private String organizationName; + /** + * 分类编码 + */ + @NotBlank(message = "categoryCode不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String categoryCode; + /** * 组织人数 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java new file mode 100644 index 0000000000..2ef86fc61c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyTypepercentFormDTO { + + private static final long serialVersionUID = -3833404131164761022L; + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空") + private String agencyId; + + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListFormDTO.java new file mode 100644 index 0000000000..d2b78256ff --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/17 18:45 + * @DESC + */ +@Data +public class PartyUnitListFormDTO implements Serializable { + + private static final long serialVersionUID = 8059924463686783668L; + + /** + * 联建单位IDs + */ + private List partyUnitIds; + + /** + * 社区自组织IDs + */ + private List communitySelfIds; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListbriefFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListbriefFormDTO.java new file mode 100644 index 0000000000..f57e73479c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListbriefFormDTO.java @@ -0,0 +1,73 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyUnitListbriefFormDTO implements Serializable { + + private static final long serialVersionUID = -2776705671944626707L; + + /** + * 页码 + */ + @NotNull + @Min(1) + private Integer pageNo; + + /** + * 每页记录数 + */ + @NotNull + private Integer pageSize; + + /** + * 网格id + */ +// private String gridId; + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空") + private String agencyId; + + /** + * 单位名称 + */ + private String unitName; + + /** + * 服务事项 + */ + private String serviceMatter; + + /** + * 分类 + */ + private String type; + + /** + * 联系人 + */ + private String contact; + + /** + * 联系人电话 + */ + private String contactMobile; + + private String customerId; + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcEventCommentToDemandFromDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcEventCommentToDemandFromDTO.java new file mode 100644 index 0000000000..21161a301b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcEventCommentToDemandFromDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class IcEventCommentToDemandFromDTO implements Serializable { + private static final long serialVersionUID = 591380873862126679L; + + //客户Id + private String customerId; + //需求Id + private String demandRecId; + //评价满意度【 不满意:bad、基本满意:good、非常满意:perfect 】 + private String satisfaction; + //当前操作工作人员Id + private String staffId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ReportDemandFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ReportDemandFormDTO.java index 267254bc3b..34b457ffe2 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ReportDemandFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ReportDemandFormDTO.java @@ -109,4 +109,28 @@ public class ReportDemandFormDTO implements Serializable { */ private String latitude; + /** + * 来源[需求录入:demand 事件管理:ic_event] + */ + private String origin; + /** + * 来源Id[目前只有来源事件管理的有值] + */ + private String originId; + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + + /** + * 志愿者:居民端爱心互助的志愿者userId; + */ + private String serverId; + + /** + * 服务方姓名 + */ + private String serverName; + } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceListFormDTO.java new file mode 100644 index 0000000000..f923bd1301 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceListFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +@Data +public class ServiceListFormDTO extends PageFormDTO implements Serializable { + @NotBlank(message = "type不能为空:志愿者:volunteer;社区自组织:community_org", groups = PageFormDTO.AddUserInternalGroup.class) + private String type; + + /** + * 服务方id , + * 可能是来源于多元主题分析里的社区自组织,也可能是来源于志愿者 + */ + @NotBlank(message = "serverId不能为空", groups = PageFormDTO.AddUserInternalGroup.class) + private String serverId; + + private String customerId; + /** + * volunteer时传入此参数 + */ + private String idCard; + + private List serverIds; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java index bfeb9203e2..e4aa06f5e3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java @@ -79,4 +79,11 @@ public class UserDemandPageFormDTO extends PageFormDTO implements Serializable { * 搜索关键词 */ private String keyword; + + + /** + * 需求id + */ + private String demandRecId; + } 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 b7a7627030..563ccf0928 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 @@ -33,6 +33,20 @@ public class CommunitySelfOrganizationListDTO implements Serializable { */ private String organizationName; + /** + * 分类,来源于字典表dictType=self_org_category; + */ + private String categoryCode; + /** + * 分类名称 + */ + private String categoryName; + + /** + * 分类的颜色 用于多元数据分析-地图 + */ + private String color; + /** * 服务事项 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java new file mode 100644 index 0000000000..5a5112a4a8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class PartyTypepercentResultDTO { + + private static final long serialVersionUID = -5256798094892121661L; + + /** + * 联建单位类型 + */ + private String label; + + /** + * 数量 + */ + private Integer value; + + /** + * 联建单位编码 + */ + private String code; + + /** + * 联建单位数量占比(%) + */ + private String percent; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListResultDTO.java new file mode 100644 index 0000000000..e6aabc3d85 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/17 18:45 + * @DESC + */ +@Data +public class PartyUnitListResultDTO implements Serializable { + + private static final long serialVersionUID = 8059924463686783008L; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位名字 + */ + private String assistanceUnitName; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java new file mode 100644 index 0000000000..87ecc54bcb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyUnitListbrieResultDTO implements Serializable { + + private static final long serialVersionUID = -300315089751537091L; + + /** + * id + */ + private String id; + + /** + * 所属网格 + */ +// private String gridName; + + /** + * 所属网格id + */ +// private String gridId; + + /** + * 分类 + */ + private String type; + + /** + * 服务事项 + */ + private String serviceMatter; + + /** + * 单位名称 + */ + private String unitName; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SelfOrgCategoryTotalResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SelfOrgCategoryTotalResDTO.java new file mode 100644 index 0000000000..c99e723d0f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SelfOrgCategoryTotalResDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 多元主体分析-社区自组织饼图 + */ +@Data +public class SelfOrgCategoryTotalResDTO implements Serializable { + + private String categoryCode; + private String categoryName; + /** + * 当前分类下的社区自组织数量 + */ + private Integer total; + private String color; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java index c235915430..bbf2c8f3ff 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java @@ -139,4 +139,13 @@ public class DemandRecResultDTO implements Serializable { private String longitude; // 纬度,需求人是ic的居民时,取所住楼栋的中心点位 private String latitude; + + /** + * 来源[需求录入:demand 事件管理:ic_event] + */ + private String origin; + /** + * 来源Id[目前只有来源事件管理的有值] + */ + private String originId; } 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 133cb6200c..755a5d881d 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 @@ -4,11 +4,18 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.AutoEvaluateDemandFormDTO; import com.epmet.dto.form.CommonCustomerFormDTO; +import com.epmet.dto.form.IcDemandFormDTO; +import com.epmet.dto.form.PartyUnitListFormDTO; +import com.epmet.dto.form.demand.DemandRecId; +import com.epmet.dto.form.demand.IcEventCommentToDemandFromDTO; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.form.resi.VolunteerCommonFormDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory; @@ -107,4 +114,47 @@ public interface EpmetHeartOpenFeignClient { @PostMapping("/heart/icresidemanddict/demandoption") Result> getDemandOptions(); + + /** + * Desc: 获取联建单位名字 + * @param formDTO + * @author zxc + * @date 2022/5/17 17:53 + */ + @PostMapping("/heart/icpartyunit/getPartyUnitList") + Result> getPartyUnitList(@RequestBody PartyUnitListFormDTO formDTO); + + /** + * @description 事件管理-转需求 + **/ + @PostMapping("/heart/residemand/iceventtodemand") + Result icEventToDemand(@RequestBody IcDemandFormDTO formDTO); + + /** + * @description 事件评价时同步=评价结果到需求 + **/ + @PostMapping("/heart/userdemand/iceventcomment") + Result icEventComment(@RequestBody IcEventCommentToDemandFromDTO formDTO); + + + /** + * 获取客户下志愿者列表 + * + * @Param customerId + * @Return {@link Result< List< IcVolunteerPolyDTO>>} + * @Author zhaoqifeng + * @Date 2022/5/19 11:14 + */ + @PostMapping("/heart/resi/volunteer/getVolunteerList/{customerId}") + Result> getVolunteerList(@PathVariable("customerId") String customerId); + + /** + * 添加志愿者 + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/30 11:10 + */ + @PostMapping("/heart/resi/volunteer/addVolunteer") + Result addVolunteer(@RequestBody ResiVolunteerAuthenticateFormDTO formDTO); } 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 a0af921435..e818a49b04 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 @@ -5,11 +5,18 @@ import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.AutoEvaluateDemandFormDTO; import com.epmet.dto.form.CommonCustomerFormDTO; +import com.epmet.dto.form.IcDemandFormDTO; +import com.epmet.dto.form.PartyUnitListFormDTO; +import com.epmet.dto.form.demand.DemandRecId; +import com.epmet.dto.form.demand.IcEventCommentToDemandFromDTO; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.form.resi.VolunteerCommonFormDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.EpmetHeartOpenFeignClient; @@ -108,4 +115,47 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli public Result> getDemandOptions() { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getDemandOptions", null); } + + @Override + public Result> getPartyUnitList(PartyUnitListFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getPartyUnitList", formDTO); + } + + @Override + public Result icEventToDemand(IcDemandFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "icEventToDemand", formDTO); + } + + @Override + public Result icEventComment(IcEventCommentToDemandFromDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "icEventComment", formDTO); + } + + /** + * 获取客户下志愿者列表 + * + * @param customerId + * @Param customerId + * @Return {@link Result< List< IcVolunteerPolyDTO >>} + * @Author zhaoqifeng + * @Date 2022/5/19 11:14 + */ + @Override + public Result> getVolunteerList(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getVolunteerList", customerId); + } + + /** + * 添加志愿者 + * + * @param formDTO + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/30 11:10 + */ + @Override + public Result addVolunteer(ResiVolunteerAuthenticateFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "addVolunteer", formDTO); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java index 9df5db60c2..399e9c7e81 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java @@ -34,8 +34,10 @@ import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcCommunitySelfOrganizationDTO; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListDTO; import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.SelfOrgCategoryTotalResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.excel.ExportCommunitySelfOrganizationExcel; import com.epmet.excel.IcCommunitySelfOrganizationExcel; @@ -281,4 +283,45 @@ public class IcCommunitySelfOrganizationController { ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class); return new Result>().ok(icCommunitySelfOrganizationService.queryServiceList(formDTO)); } + + /** + * 多元主体分析-各分类下的社区自组织数量饼图 + * + * @param tokenDto + * @return + */ + @PostMapping("/total-pie") + public Result> totalPie(@LoginUser TokenDto tokenDto) { + return new Result>().ok(icCommunitySelfOrganizationService.querySelfOrgCategoryTotal(tokenDto.getCustomerId(), tokenDto.getUserId())); + } + + /** + * 多元主体分析-分类下的社区自组织列表 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("/category-list") + public Result> queryCategoryList(@LoginUser TokenDto tokenDto, @RequestBody CategorySelfOrgFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(true); + return new Result>().ok(icCommunitySelfOrganizationService.queryCategoryList(formDTO)); + } + + /** + * 003、多元主题分析-地图(详情信息已包含) + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("/coordinate-list") + public Result> queryCoordinateList(@LoginUser TokenDto tokenDto, @RequestBody CategorySelfOrgFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); + return new Result>().ok(icCommunitySelfOrganizationService.queryCoordinateList(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index 2d9ae33d75..236e0d3b99 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -1,20 +1,3 @@ -/** - * 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.controller; import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; @@ -36,9 +19,14 @@ import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.PartyUnitListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; +import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.excel.IcPartyUnitExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; @@ -53,10 +41,12 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; import java.io.IOException; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @@ -85,14 +75,14 @@ public class IcPartyUnitController { @PostMapping("list") - public Result> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO){ + public Result> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); PageData page = icPartyUnitService.search(formDTO); return new Result>().ok(page); } @PostMapping("detail") - public Result get(@RequestBody IcPartyUnitDTO formDTO){ + public Result get(@RequestBody IcPartyUnitDTO formDTO) { AssertUtils.isBlank(formDTO.getId(), "id"); IcPartyUnitDTO data = icPartyUnitService.get(formDTO.getId()); return new Result().ok(data); @@ -100,7 +90,7 @@ public class IcPartyUnitController { @PostMapping("save") @NoRepeatSubmit - public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyUnitDTO dto){ + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyUnitDTO dto) { //效验数据 dto.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -109,7 +99,7 @@ public class IcPartyUnitController { } @PostMapping("delete") - public Result delete(@RequestBody IcPartyUnitDTO dto){ + public Result delete(@RequestBody IcPartyUnitDTO dto) { //效验数据 AssertUtils.isBlank(dto.getId(), "id"); icPartyUnitService.delete(dto.getId()); @@ -149,21 +139,22 @@ public class IcPartyUnitController { * @return */ @PostMapping("servicelist") - public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){ + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class); + ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class); return new Result>().ok(icPartyUnitService.queryServiceList(formDTO)); } @PostMapping("option") - public Result> option(@RequestBody IcPartyUnitDTO dto){ + public Result> option(@RequestBody IcPartyUnitDTO dto) { AssertUtils.isBlank(dto.getAgencyId(), "agencyId"); return new Result>().ok(icPartyUnitService.option(dto)); } /** * 数据导入 + * * @Param tokenDto * @Param response * @Param file @@ -215,7 +206,7 @@ public class IcPartyUnitController { * @Date 2021/12/8 14:52 */ @PostMapping("typestatistics") - public Result> typeStatistics(@RequestBody PartyActivityFormDTO formDTO){ + public Result> typeStatistics(@RequestBody PartyActivityFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(icPartyUnitService.typeStatistics(formDTO)); } @@ -228,11 +219,42 @@ public class IcPartyUnitController { * @Date 2021/12/9 10:11 */ @PostMapping("distribution") - public Result> distribution(@RequestBody PartyActivityFormDTO formDTO){ + public Result> distribution(@RequestBody PartyActivityFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(icPartyUnitService.distribution(formDTO)); } + /** + * 联建单位-简要信息列表 + * + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/5/18 13:54 + */ + @PostMapping("/listbrief") + public Result getListbrief(@RequestBody PartyUnitListbriefFormDTO form, @LoginUser TokenDto tokenDto) { + form.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(form); + PageData data = icPartyUnitService.getListbrief(form); + return new Result().ok(data); + } + + /** + * 联建单位-按分类统计数量及占比 + * + * @param form + * @return com.epmet.commons.tools.utils.Result> + * @author LZN + * @date 2022/5/18 16:42 + */ + @PostMapping("/statistics/typepercent") + public Result> getTypepercent(@RequestBody PartyTypepercentFormDTO form,@LoginUser TokenDto tokenDto) { + form.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(form); + List dto = icPartyUnitService.getTypepercent(form); + return new Result>().ok(dto); + } /** * 计算区域化党建单位的群众满意度 @@ -241,8 +263,8 @@ public class IcPartyUnitController { * @return */ @PostMapping("cal-partyunit-satisfation") - public Result calPartyUnitSatisfation(@RequestBody ServerSatisfactionCalFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO,ServerSatisfactionCalFormDTO.AddUserInternalGroup.class); + public Result calPartyUnitSatisfation(@RequestBody ServerSatisfactionCalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ServerSatisfactionCalFormDTO.AddUserInternalGroup.class); icPartyUnitService.calPartyUnitSatisfation(formDTO); return new Result(); } @@ -267,4 +289,27 @@ public class IcPartyUnitController { } } } + + /** + * Desc: 获取联建单位名字 + * @param formDTO + * @author zxc + * @date 2022/5/17 17:53 + */ + @PostMapping("/getPartyUnitList") + public Result> getPartyUnitList(@RequestBody PartyUnitListFormDTO formDTO){ + return new Result>().ok(icPartyUnitService.getPartyUnitList(formDTO)); + } + + /** + * Desc: 协办单位列表 + * @param tokenDto + * @author zxc + * @date 2022/5/18 13:37 + */ + @PostMapping("assistanceUnitList") + public Result> getAssistanceUnitList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icPartyUnitService.getAssistanceUnitList(tokenDto)); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 1d14501080..9c53742254 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -380,5 +380,15 @@ public class IcUserDemandRecController implements ResultDataResolver { return new Result().ok(result); } + /** + * @Author sun + * @Description 事件评价时同步=评价结果到需求 + **/ + @PostMapping("iceventcomment") + public Result icEventComment(@RequestBody IcEventCommentToDemandFromDTO formDTO) { + icUserDemandRecService.icEventComment(formDTO); + return new Result(); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java index b798d0fe0c..1bb797aa61 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java @@ -10,12 +10,15 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; import com.epmet.commons.tools.enums.EventEnum; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.SystemMessageType; import com.epmet.constant.UserDemandConstant; import com.epmet.dto.form.AutoEvaluateDemandFormDTO; +import com.epmet.dto.form.IcDemandFormDTO; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.demand.*; @@ -267,4 +270,29 @@ public class ResiDemandController { demandSatisfactionService.evaluateDemandAuto(formDTO); return new Result(); } + + /** + * 事件管理-转需求 + * + * @return + */ + @PostMapping("iceventtodemand") + public Result icEventToDemand(@RequestBody IcDemandFormDTO formDTO) { + ReportDemandFormDTO dto = ConvertUtils.sourceToTarget(formDTO, ReportDemandFormDTO.class); + return new Result().ok(icUserDemandRecService.saveOrUpdateDemand(dto)); + } + + /** + * 根据服务方id查询,服务过的需求列表 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("service-list") + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(icUserDemandRecService.queryServiceList(formDTO)); + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java index 410cbdf981..b54acc67ec 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -18,9 +18,14 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; 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.constant.SystemMessageType; +import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; @@ -30,6 +35,8 @@ import com.epmet.dto.form.resi.VolunteerCommonFormDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.VolunteerInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -49,6 +56,8 @@ public class ResiVolunteerController { @Autowired private VolunteerInfoService volunteerInfoService; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; /** * 志愿者认证 @@ -64,6 +73,19 @@ public class ResiVolunteerController { formDTO.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(formDTO, ResiVolunteerAuthenticateFormDTO.AddUserShowGroup.class, ResiVolunteerAuthenticateFormDTO.AddUserInternalGroup.class); volunteerInfoService.authenticate(formDTO); + + //发送志愿者人员消息变动 + boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendRocketMqMsg(SystemMessageType.VOLUNTEER_CHANGED, new MqBaseFormDTO(tokenDto.getCustomerId(), tokenDto.getUserId())); + if (!flag){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"发送志愿者变动消息失败","发送志愿者变动消息失败"); + } + + return new Result(); + } + + @PostMapping("addVolunteer") + public Result addVolunteer(@RequestBody ResiVolunteerAuthenticateFormDTO formDTO) { + volunteerInfoService.addVolunteer(formDTO); return new Result(); } @@ -170,4 +192,9 @@ public class ResiVolunteerController { volunteerInfoService.modifyVolunteerGrid(volunteerInfoDTO); return new Result(); } + + @PostMapping("getVolunteerList/{customerId}") + public Result> getVolunteerList(@PathVariable("customerId") String customerId) { + return new Result>().ok(volunteerInfoService.getVolunteerList(customerId)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java index e8fc375773..5899abc96f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java @@ -19,8 +19,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcCommunitySelfOrganizationDTO; +import com.epmet.dto.form.CategorySelfOrgFormDTO; import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; import com.epmet.dto.result.CommunitySelfOrganizationListDTO; +import com.epmet.dto.result.SelfOrgCategoryTotalResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcCommunitySelfOrganizationEntity; import org.apache.ibatis.annotations.Mapper; @@ -65,4 +67,10 @@ public interface IcCommunitySelfOrganizationDao extends BaseDao selectOrgByOrgName(@Param("names")List names, @Param("customerId") String customerId); List selectOrgByCustomerId(@Param("customerId") String customerId); + + List selectCountGroupByCategory(@Param("customerId") String customerId,@Param("agencyId") String agencyId); + + List queryCategoryList(CategorySelfOrgFormDTO formDTO); + + List queryCoordinateList(CategorySelfOrgFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java index faddda7644..d8a1e502b0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java @@ -19,7 +19,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.dto.form.PartyTypepercentFormDTO; +import com.epmet.dto.form.PartyUnitListbriefFormDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; +import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyUnitEntity; import org.apache.ibatis.annotations.Mapper; @@ -27,6 +32,7 @@ import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; import java.util.List; +import java.util.Map; /** * 联建单位 @@ -39,22 +45,24 @@ public interface IcPartyUnitDao extends BaseDao { /** * 需求指派,选择区域化党建单位,调用此接口 + * * @param agencyIds * @param unitName * @return */ List selectListByAgencyId(@Param("agencyIds") List agencyIds, @Param("unitName") String unitName, - @Param("customerId")String customerId); + @Param("customerId") String customerId); /** * 单位分类统计 + * * @Param agencyId * @Return {@link java.util.List} * @Author zhaoqifeng * @Date 2021/12/8 15:25 */ - List getTypeStatistics(@Param("agencyId")String agencyId); + List getTypeStatistics(@Param("agencyId") String agencyId); /** * @Description 联建单位分布 @@ -63,7 +71,49 @@ public interface IcPartyUnitDao extends BaseDao { * @Author zhaoqifeng * @Date 2021/12/9 14:24 */ - List getDistribution(@Param("agencyId")String agencyId); + List getDistribution(@Param("agencyId") String agencyId); int updateSatisfaction(@Param("partyUnitId") String serverId, @Param("satisfaction") BigDecimal satisfaction); -} \ No newline at end of file + + /** + * Desc: 获取联建单位名字 + * @param ids + * @author zxc + * @date 2022/5/17 17:53 + */ + List getPartyUnitList(@Param("ids") List ids); + + /** + * Desc: 获取社区自组织名字 + * @param ids + * @author zxc + * @date 2022/5/17 18:51 + */ + List getCommunitySelfList(@Param("ids") List ids); + + /** + * Desc: 协办单位列表 + * @param agencyId + * @author zxc + * @date 2022/5/18 13:48 + */ + List getAssistanceUnitList(@Param("agencyId")String agencyId,@Param("pid")String pid); + + /** + * 联建单位-简要信息列表 + * + * @param form + * @return java.util.List + * @author LZN + * @date 2022/5/18 13:54 + */ + List getListbrief(@Param("form") PartyUnitListbriefFormDTO form, @Param("customerId") String customerId); + + /** + * 联建单位-按分类统计数量及占比 + * + * @param agencyId + */ + List getTypepercent(@Param("agencyId") String agencyId, + @Param("customerId") String customerId); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index f3781ceea6..01ab0ad96d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -20,9 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.PointRecordFormDTO; -import com.epmet.dto.form.demand.IcResiUserDemandFromDTO; -import com.epmet.dto.form.demand.PageListAnalysisFormDTO; -import com.epmet.dto.form.demand.UserDemandPageFormDTO; +import com.epmet.dto.form.demand.*; import com.epmet.dto.result.PointRecordDTO; import com.epmet.dto.result.ServicePointDTO; import com.epmet.dto.result.demand.*; @@ -140,4 +138,6 @@ public interface IcUserDemandRecDao extends BaseDao { * @Date 2022/1/21 15:53 */ List getServicePoint(@Param("customerId")String customerId, @Param("serviceType")String serviceType); + + List queryServiceList(ServiceListFormDTO formDTO); } \ No newline at end of file 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 01db2e7108..0268a247fb 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 @@ -67,6 +67,11 @@ public class IcCommunitySelfOrganizationEntity extends BaseEpmetEntity { */ private String organizationName; + /** + * 分类,来源于字典表dictType=self_org_category; + */ + private String categoryCode; + /** * 组织人数 */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java index 0d54cd6184..a07bc2d161 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java @@ -149,7 +149,7 @@ public class IcUserDemandRecEntity extends BaseEpmetEntity { private Integer awardPoint; /** - * 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择 + * 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择 */ private String serviceLocation; @@ -171,4 +171,12 @@ public class IcUserDemandRecEntity extends BaseEpmetEntity { * 需求人是ic的居民时,记录下住的房屋id */ private String demandUserHouseId; + /** + * 来源[需求录入:demand 事件管理:ic_event] + */ + private String origin; + /** + * 来源Id[目前只有来源事件管理的有值] + */ + private String originId; } 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 140d821022..73e0747958 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 @@ -15,6 +15,9 @@ public class ExportCommunitySelfOrganizationExcel { @Excel(name = "组织名称", width = 40, needMerge = true) private String organizationName; + @Excel(name = "分类", width = 40, needMerge = true) + private String categoryName; + @Excel(name = "组织人数", width = 20, needMerge = true) private Integer organizationPersonCount; 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 10a10f21ad..a0e4133890 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 @@ -20,6 +20,10 @@ public class ImportCommunitySelfOrganization extends ExcelVerifyInfo { @NotBlank(message = "不能为空") private String organizationName; + @Excel(name = "分类", needMerge = true) + @NotBlank(message = "不能为空") + private String categoryCode; + @Excel(name = "组织人数", needMerge = true) //@NotNull(message = "不能为空") private Integer organizationPersonCount; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java index 6a61e4a199..14008a7ce2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java @@ -21,12 +21,11 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcCommunitySelfOrganizationDTO; -import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; -import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; -import com.epmet.dto.form.DelCommunitySelfOrganizationFormDTO; -import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListDTO; import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; +import com.epmet.dto.result.SelfOrgCategoryTotalResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcCommunitySelfOrganizationEntity; @@ -160,4 +159,26 @@ public interface IcCommunitySelfOrganizationService extends BaseService queryListById(List communityOrgIds); + + /** + * 多元主体分析-各分类下的社区自组织数量饼图 + * @param customerId + * @param userId + * @return + */ + List querySelfOrgCategoryTotal(String customerId, String userId); + + /** + * 多元主体分析-分类下的社区自组织列表 + * @param formDTO + * @return + */ + PageData queryCategoryList(CategorySelfOrgFormDTO formDTO); + + /** + * 多元主体分析-地图坐标,及详情 + * @param formDTO + * @return + */ + PageData queryCoordinateList(CategorySelfOrgFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java index d8e5285297..53ddf81e19 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java @@ -1,20 +1,3 @@ -/** - * 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.service; import com.epmet.commons.mybatis.service.BaseService; @@ -24,9 +7,15 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.form.PartyTypepercentFormDTO; import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.PartyUnitListFormDTO; +import com.epmet.dto.form.PartyUnitListbriefFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; +import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyUnitEntity; import org.springframework.web.multipart.MultipartFile; @@ -34,6 +23,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; +import java.util.Map; /** * 联建单位 @@ -81,7 +71,7 @@ public interface IcPartyUnitService extends BaseService { * @author generator * @date 2021-11-19 */ - void save(TokenDto tokenDto, IcPartyUnitDTO dto); + void save(TokenDto tokenDto, IcPartyUnitDTO dto); /** @@ -124,6 +114,7 @@ public interface IcPartyUnitService extends BaseService { /** * 导入数据 + * * @Param tokenDto * @Param response * @Param file @@ -144,6 +135,7 @@ public interface IcPartyUnitService extends BaseService { /** * 联建单位分布 + * * @Param formDTO * @Return {@link List< PartyUnitDistributionResultDTO>} * @Author zhaoqifeng @@ -153,9 +145,41 @@ public interface IcPartyUnitService extends BaseService { /** * 计算区域化党建单位的群众满意度 + * * @param formDTO */ void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO); List queryListById(List partyUnitIds); -} \ No newline at end of file + + /** + * Desc: 获取联建单位名字 + * @param formDTO + * @author zxc + * @date 2022/5/17 17:53 + */ + List getPartyUnitList(PartyUnitListFormDTO formDTO); + + /** + * Desc: 协办单位列表 + * @param tokenDto + * @author zxc + * @date 2022/5/18 13:37 + */ + List getAssistanceUnitList(TokenDto tokenDto); + + + /** + * 联建单位-简要信息列表 + * + * @param form + */ + PageData getListbrief(PartyUnitListbriefFormDTO form); + + /** + * 联建单位-按分类统计数量及占比 + * + * @param form + */ + List getTypepercent(PartyTypepercentFormDTO form); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index 5e86b438ed..eb5f2f89fc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -247,4 +247,17 @@ public interface IcUserDemandRecService extends BaseService getServicePoint(String customerId, String serviceType); + + /** + * 根据服务方id查询,服务过的需求列表 + * @param formDTO + * @return + */ + PageData queryServiceList(ServiceListFormDTO formDTO); + + /** + * @Author sun + * @Description 事件评价时同步=评价结果到需求 + **/ + void icEventComment(IcEventCommentToDemandFromDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index 7cd4d30769..fefbde5c95 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; @@ -48,7 +49,7 @@ public interface VolunteerInfoService extends BaseService { * @Date 10:09 2020-07-23 **/ void authenticate(ResiVolunteerAuthenticateFormDTO formDTO); - + void addVolunteer(ResiVolunteerAuthenticateFormDTO formDTO); /** * 志愿者认证界面,获取用户基础信息+志愿者信息 * @@ -117,4 +118,13 @@ public interface VolunteerInfoService extends BaseService { * @param volunteerInfoDTO */ void modifyVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO); + + /** + * 获取客户下志愿者 + * @Param customerId + * @Return {@link List< IcVolunteerPolyDTO>} + * @Author zhaoqifeng + * @Date 2022/5/19 10:58 + */ + List getVolunteerList(String customerId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java index 1443592a16..1fdc20516d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java @@ -12,6 +12,8 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.enums.SelfOrgCategoryEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -32,17 +34,16 @@ import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcCommunitySelfOrganizationDao; import com.epmet.dao.IcUserDemandRecDao; import com.epmet.dto.IcCommunitySelfOrganizationDTO; +import com.epmet.dto.SysDictDataDTO; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; -import com.epmet.dto.result.CommunitySelfOrganizationListDTO; -import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; -import com.epmet.dto.result.ServicePointDTO; -import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcCommunitySelfOrganizationEntity; import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; import com.epmet.excel.CommunitySelfOrgImportExcel; import com.epmet.excel.ImportCommunitySelfOrganization; +import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.OssFeignClient; import com.epmet.service.IcCommunitySelfOrganizationPersonnelService; @@ -51,6 +52,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory; @@ -93,6 +95,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl page(Map params) { @@ -313,6 +317,11 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl> dictMapRes=adminOpenFeignClient.dictMap(DictTypeEnum.SELF_ORG_CATEGORY.getCode()); + Map dictMap = dictMapRes.success() && MapUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData() : new HashMap<>(); + if (formDTO.getIsPage()){ PageInfo objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectCommunitySelfOrganizationList(formDTO)); result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal()))); @@ -321,6 +330,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl> dictMapRes = adminOpenFeignClient.dictMap(DictTypeEnum.SELF_ORG_CATEGORY.getCode()); + Map categoryMap = dictMapRes.success() && MapUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData() : new HashMap<>(); list.forEach(l -> { IcCommunitySelfOrganizationEntity e = ConvertUtils.sourceToTarget(l, IcCommunitySelfOrganizationEntity.class); e.setCustomerId(tokenDto.getCustomerId()); @@ -547,7 +561,13 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl persons = new ArrayList<>(); AtomicReference bl = new AtomicReference<>(false); StringBuffer msg = new StringBuffer(""); @@ -688,4 +708,76 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl querySelfOrgCategoryTotal(String customerId, String staffId) { + Result> dictDataListRes = adminOpenFeignClient.dictDataList(DictTypeEnum.SELF_ORG_CATEGORY.getCode()); + if (!dictDataListRes.success() || CollectionUtils.isEmpty(dictDataListRes.getData())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区自组织分类查询异常"); + } + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(customerId, staffId); + List list = baseDao.selectCountGroupByCategory(customerId, staffInfo.getAgencyId()); + Map map = list.stream().collect(Collectors.toMap(SelfOrgCategoryTotalResDTO::getCategoryCode, SelfOrgCategoryTotalResDTO::getTotal, (key1, key2) -> key2)); + List resultList = new ArrayList<>(); + for (SysDictDataDTO dict : dictDataListRes.getData()) { + SelfOrgCategoryTotalResDTO resDTO = new SelfOrgCategoryTotalResDTO(); + resDTO.setCategoryCode(dict.getDictValue()); + resDTO.setCategoryName(dict.getDictLabel()); + resDTO.setTotal(map.containsKey(dict.getDictValue()) ? map.get(dict.getDictValue()) : NumConstant.ZERO); + resDTO.setColor(SelfOrgCategoryEnum.getEnum(dict.getDictValue()).getColor()); + resultList.add(resDTO); + } + return resultList; + } + + private CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId); + if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前工作人员信息异常"); + } + return staffInfo; + } + + /** + * 多元主体分析-分类下的社区自组织列表 + * + * @param formDTO + * @return + */ + @Override + public PageData queryCategoryList(CategorySelfOrgFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo=getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageInfo pageInfo= PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.queryCategoryList(formDTO)); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } + + /** + * 多元主体分析-地图坐标,及详情 + * + * @param formDTO + * @return + */ + @Override + public PageData queryCoordinateList(CategorySelfOrgFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo=getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + List list=baseDao.queryCoordinateList(formDTO); + for (CommunitySelfOrganizationListDTO dto : list) { + dto.setColor(SelfOrgCategoryEnum.getEnum(dto.getCategoryCode()).getColor()); + if (StringUtils.isNotBlank(dto.getCategoryCode())) { + dto.setCategoryName(SelfOrgCategoryEnum.getEnum(dto.getCategoryCode()).getName()); + } + + } + return new PageData<>(list, NumConstant.ONE_NEG); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 3924261510..b5d4c4aa4e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -39,7 +39,10 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.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.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelPoiUtils; @@ -51,8 +54,13 @@ import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.PartyUnitListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; +import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceStatDTO; @@ -126,10 +134,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); PageInfo pageInfo = new PageInfo<>(list); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); - Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 - List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取单位积分 Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); dtoList.forEach(item -> { @@ -140,12 +148,12 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl()); } - if(StringUtils.isBlank(item.getSatisfaction())){ + if (StringUtils.isBlank(item.getSatisfaction())) { item.setSatisfaction(StrConstant.HYPHEN); - }else{ - item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); + } else { + item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2, BigDecimal.ROUND_HALF_UP).toString()); } - item.setScore(null == pointMap.get(item.getId())?NumConstant.ZERO:pointMap.get(item.getId())); + item.setScore(null == pointMap.get(item.getId()) ? NumConstant.ZERO : pointMap.get(item.getId())); }); return new PageData<>(dtoList, pageInfo.getTotal()); } @@ -162,10 +170,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); - Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 - List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取单位积分 Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); dtoList.forEach(item -> { @@ -176,13 +184,13 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl()); } - item.setScore(null == pointMap.get(item.getId())?NumConstant.ZERO:pointMap.get(item.getId())); + item.setScore(null == pointMap.get(item.getId()) ? NumConstant.ZERO : pointMap.get(item.getId())); }); return dtoList; } - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -198,14 +206,14 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl pointMap = icUserDemandRecService.getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT); dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA))); - dto.setScore(null == pointMap.get(id)?NumConstant.ZERO:pointMap.get(id)); + dto.setScore(null == pointMap.get(id) ? NumConstant.ZERO : pointMap.get(id)); } return dto; } @Override @Transactional(rollbackFor = Exception.class) - public void save(TokenDto tokenDto, IcPartyUnitDTO dto) { + public void save(TokenDto tokenDto, IcPartyUnitDTO dto) { IcPartyUnitEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitEntity.class); CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); entity.setAgencyId(staff.getAgencyId()); @@ -217,7 +225,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); - if(StringUtils.isBlank(entity.getId())) { + if (StringUtils.isBlank(entity.getId())) { if (CollectionUtils.isNotEmpty(list)) { throw new EpmetException(EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getCode(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg()); } @@ -256,19 +264,19 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl} * @Author zhaoqifeng * @Date 2021/11/22 14:35 @@ -345,8 +353,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //1.数据校验 Iterator iterator = result.iterator(); while (iterator.hasNext()) { @@ -517,6 +525,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl distribution(PartyActivityFormDTO formDTO) { - Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); List list = baseDao.getDistribution(formDTO.getAgencyId()); if (CollectionUtils.isEmpty(list)) { return Collections.emptyList(); @@ -571,29 +580,116 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(),formDTO.getServiceType()); + List list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(), formDTO.getServiceType()); for (ServiceStatDTO serviceStatDTO : list) { if (0 != serviceStatDTO.getDemandCount()) { BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP); - baseDao.updateSatisfaction(serviceStatDTO.getServerId(),result); + baseDao.updateSatisfaction(serviceStatDTO.getServerId(), result); } } } @Override public List queryListById(List partyUnitIds) { - if(CollectionUtils.isNotEmpty(partyUnitIds)){ + if (CollectionUtils.isNotEmpty(partyUnitIds)) { return baseDao.selectBatchIds(partyUnitIds); } return Collections.EMPTY_LIST; } + /** + * Desc: 获取联建单位名字 + * @param formDTO + * @author zxc + * @date 2022/5/17 17:53 + */ + @Override + public ListgetPartyUnitList(PartyUnitListFormDTO formDTO) { + List result = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(formDTO.getPartyUnitIds())){ + result.addAll(baseDao.getPartyUnitList(formDTO.getPartyUnitIds())); + } + if (CollectionUtils.isNotEmpty(formDTO.getCommunitySelfIds())){ + result.addAll(baseDao.getCommunitySelfList(formDTO.getCommunitySelfIds())); + } + return result; + } + + /** + * Desc: 协办单位列表 + * @param tokenDto + * @author zxc + * @date 2022/5/18 13:37 + */ + @Override + public List getAssistanceUnitList(TokenDto tokenDto) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员信息"+tokenDto.getUserId()); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new EpmetException("未查询到此组织信息"+staffInfo.getAgencyId()); + } + return baseDao.getAssistanceUnitList(staffInfo.getAgencyId(),agencyInfo.getPid()); + } + + @Override + public PageData getListbrief(PartyUnitListbriefFormDTO form) { + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + PageHelper.startPage(form.getPageNo(), form.getPageSize()); + List dto = baseDao.getListbrief(form, form.getCustomerId()); + + dto.forEach(item -> { + item.setType(unitTypeMap.getData().get(item.getType())); + }); + + // 获取gridName + /*for (PartyUnitListbrieResultDTO item : dto) { + if (StringUtils.isNotEmpty(item.getGridId())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); + if (null != gridInfo) { + item.setGridName(gridInfo.getGridName()); + } + } + }*/ + PageInfo info = new PageInfo<>(dto); + return new PageData<>(dto, info.getTotal()); + } + + @Override + public List getTypepercent(PartyTypepercentFormDTO form) { + + DictListFormDTO dictFromDTO = new DictListFormDTO(); + dictFromDTO.setDictType(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> dictResult = epmetAdminOpenFeignClient.dictList(dictFromDTO); + if (!dictResult.success()) { + throw new EpmetException(dictResult.getCode()); + } + + List result = baseDao.getTypepercent(form.getAgencyId(),form.getCustomerId()); + Map map = result.stream().collect(Collectors.toMap(PartyTypepercentResultDTO::getCode, PartyTypepercentResultDTO::getValue)); + + int sum = result.stream().mapToInt(PartyTypepercentResultDTO::getValue).sum(); + + return dictResult.getData().stream().map(item -> { + PartyTypepercentResultDTO dto = new PartyTypepercentResultDTO(); + dto.setLabel(item.getLabel()); + dto.setCode(item.getValue()); + dto.setValue(null == map.get(item.getValue()) ? NumConstant.ZERO : map.get(item.getValue())); + dto.setPercent((Integer.parseInt(item.getValue()) * 100) / sum + "%"); + return dto; + }).collect(Collectors.toList()); + + } + private String getServiceMatter(Map map, String matter) { List matters = Arrays.asList(matter.split(StrConstant.COLON)); List list = matters.stream().map(map::get).collect(Collectors.toList()); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 433f118f42..b552251007 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -36,6 +36,7 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ReadFlagConstant; @@ -51,10 +52,7 @@ import com.epmet.dto.form.demand.*; import com.epmet.dto.result.*; import com.epmet.dto.result.demand.*; import com.epmet.entity.*; -import com.epmet.feign.EpmetAdminOpenFeignClient; -import com.epmet.feign.EpmetMessageOpenFeignClient; -import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.*; import com.epmet.service.*; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -67,6 +65,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -108,6 +107,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); + Map serviceTypeMap=serviceTypeRes.success()&& MapUtils.isNotEmpty(serviceTypeRes.getData())?serviceTypeRes.getData():new HashMap<>(); + //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + String str = serviceTypeMap.containsKey(serviceEntity.getServiceType())?serviceEntity.getServerName().concat("(").concat(serviceTypeMap.get(serviceEntity.getServiceType())).concat(")"):StrConstant.EPMETY_STR; + + ColseProjectOrDemandFormDTO dto = new ColseProjectOrDemandFormDTO(); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setUserId(formDTO.getUserId()); + dto.setIcEventId(entity.getOriginId()); + dto.setType("demand"); + dto.setServiceParty(str); + dto.setActualServiceTime(DateUtils.format(formDTO.getServiceStartTime(), DateUtils.DATE_TIME_PATTERN)+"至"+DateUtils.format(formDTO.getServiceEndTime(), DateUtils.DATE_TIME_PATTERN)); + Result result = govProjectOpenFeignClient.closeProjectOrDemand(dto); + if (!result.success()) { + throw new RenException("需求完成,修改事件管理数据失败..."); + } + } + //2022-5-19 sun end return finishResultDTO; } @@ -1375,6 +1397,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl queryServiceList(ServiceListFormDTO formDTO) { + List serverIds = new ArrayList<>(); + if ("community_org".equals(formDTO.getType())) { + serverIds.add(formDTO.getServerId()); + } else if ("volunteer".equals(formDTO.getType())) { + // 根据身份证号查询ic_resi_user.id+epmetUserId + Result> userIdRes = epmetUserOpenFeignClient.getAllUserIds(formDTO.getIdCard(), formDTO.getCustomerId()); + if (!userIdRes.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据身份证号查询用户id异常", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } + if (CollectionUtils.isNotEmpty(userIdRes.getData())) { + serverIds.addAll(userIdRes.getData()); + } + } + formDTO.setServerIds(serverIds); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.queryServiceList(formDTO)); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } + + /** + * @Author sun + * @Description 事件评价时同步=评价结果到需求 + **/ + @Override + public void icEventComment(IcEventCommentToDemandFromDTO formDTO) { + //1.校验需求是否存在且是否已评价 + IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); + if (null == entity || NumConstant.ONE_STR.equals(entity.getEvaluateFlag())) { + log.warn(String.format("需求不存在或已完成评价,需求Id->%s", formDTO.getDemandRecId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在或评价"); + } + + //2.新增评价记录 + IcUserDemandSatisfactionEntity satisfactionEntity = new IcUserDemandSatisfactionEntity(); + satisfactionEntity.setCustomerId(formDTO.getCustomerId()); + satisfactionEntity.setDemandRecId(formDTO.getDemandRecId()); + satisfactionEntity.setUserType("staff"); + satisfactionEntity.setUserId(formDTO.getStaffId()); + satisfactionEntity.setEvaluateTime(new Date()); + satisfactionEntity.setScore(("perfect".equals(formDTO.getSatisfaction()) ? new BigDecimal(5) : ("good".equals(formDTO.getSatisfaction()) ? new BigDecimal(3) : ("bad".equals(formDTO.getSatisfaction()) ? BigDecimal.ONE : BigDecimal.ZERO)))); + demandSatisfactionDao.insert(satisfactionEntity); + + //3.新增操作日志记录 + IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setDemandRecId(formDTO.getDemandRecId()); + logEntity.setUserType("staff"); + logEntity.setUserId(formDTO.getStaffId()); + logEntity.setActionCode(""); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + + //4.更新需求主表数据状态 + entity.setStatus("finished"); + entity.setFinishResult("resolved"); + entity.setEvaluateFlag(true); + baseDao.updateById(entity); + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index 846e342657..b5aab903d0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -39,10 +39,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.SystemMessageType; import com.epmet.dao.VolunteerInfoDao; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.HeartUserInfoDTO; -import com.epmet.dto.VolunteerInfoDTO; +import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; @@ -189,6 +186,33 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if (!gridInfoRes.success() || null == gridInfoRes.getData()) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询网格信息失败"); + } + insertVolunteer.setGridName(gridInfoRes.getData().getGridName()); + insertVolunteer.setPid(gridInfoRes.getData().getPid()); + insertVolunteer.setPids(gridInfoRes.getData().getPids()); + baseDao.insert(insertVolunteer); + + //更新用户信息表的 是否是志愿者标识 + HeartUserInfoDTO userInfoDTO = new HeartUserInfoDTO(); + userInfoDTO.setUserId(formDTO.getUserId()); + userInfoDTO.setVolunteerFlag(true); + heartUserInfoService.updateHeartUserInfoByUserId(userInfoDTO); + } + } + private void grantActPoints(ResiVolunteerAuthenticateFormDTO formDTO){ //MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); //mq的事件类型 @@ -424,4 +448,35 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2022/5/19 10:58 + */ + @Override + public List getVolunteerList(String customerId) { + if (StringUtils.isBlank(customerId)) { + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(VolunteerInfoEntity::getCustomerId, customerId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + IcVolunteerPolyDTO dto = new IcVolunteerPolyDTO(); + dto.setCustomerId(item.getCustomerId()); + dto.setAgencyId(item.getPid()); + dto.setAgencyPids(item.getPids()); + dto.setUserId(item.getUserId()); + dto.setVolunteerCategory("qita"); + return dto; + }).collect(Collectors.toList()); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.15__self_org_category.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.15__self_org_category.sql new file mode 100644 index 0000000000..928b038945 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.15__self_org_category.sql @@ -0,0 +1,8 @@ +alter table ic_community_self_organization +add COLUMN CATEGORY_CODE VARCHAR(32) DEFAULT NULL COMMENT '分类,来源于字典表dictType=self_org_category;'; + + + +ALTER TABLE `ic_user_demand_rec` +ADD COLUMN `ORIGIN` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'demand' COMMENT '来源[需求录入:demand 事件管理:ic_event]' AFTER `DEMAND_USER_HOUSE_ID`, +ADD COLUMN `ORIGIN_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '来源Id[目前只有来源事件管理的有值]' AFTER `ORIGIN`; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.16__self_org_categorydefaultother.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.16__self_org_categorydefaultother.sql new file mode 100644 index 0000000000..64a82e8c86 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.16__self_org_categorydefaultother.sql @@ -0,0 +1,4 @@ +update ic_community_self_organization set CATEGORY_CODE='other' +where DEL_FLAG='0' +and CATEGORY_CODE is not null +and CATEGORY_CODE !=''; \ 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 0903571a1a..4293f65f43 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 @@ -16,7 +16,8 @@ ORGANIZATION_CREATED_TIME = #{organizationCreatedTime}, REMARK = #{remark}, UPDATED_TIME = NOW(), - UPDATED_BY = #{updatedBy} + UPDATED_BY = #{updatedBy}, + CATEGORY_CODE =#{categoryCode} WHERE DEL_FLAG = 0 AND ID = #{orgId} @@ -38,7 +39,10 @@ SELECT so.ORGANIZATION_NAME AS organizationName, + so.CATEGORY_CODE AS categoryCode, so.ORGANIZATION_PERSON_COUNT AS organizationPersonCount, IFNULL(DATE_FORMAT(so.ORGANIZATION_CREATED_TIME,'%Y-%m-%d'),DATE_FORMAT(so.CREATED_TIME,'%Y-%m-%d')) AS organizationCreatedTime, so.PRINCIPAL_NAME AS principalName, @@ -116,4 +121,61 @@ AND customer_id = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index d7f02b7109..38316f51c1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -73,6 +73,109 @@ ORDER BY ID + + + + + + + + + + + update ic_party_unit diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index 02432b91c5..1f36306bf0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -85,7 +85,9 @@ CASE WHEN R.DEMAND_USER_TYPE='mini_resi' THEN R.DEMAND_USER_ID ELSE '' END - ) as epmetUserId + ) as epmetUserId, + r.ORIGIN AS origin, + r.ORIGIN_ID AS originId FROM ic_user_demand_rec r left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' ) @@ -129,6 +131,9 @@ AND DATE_FORMAT(r.WANT_SERVICE_TIME,'%Y-%m-%d') #{wantServiceEndTime} + + and r.id = #{demandRecId} + order by r.WANT_SERVICE_TIME desc,r.CREATED_TIME asc @@ -641,4 +646,23 @@ GROUP BY b.SERVER_ID - \ No newline at end of file + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/self_org_import_template.xlsx b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/self_org_import_template.xlsx index 0893eff404..0f67e0f0e1 100644 Binary files a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/self_org_import_template.xlsx and b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/self_org_import_template.xlsx differ diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index 784acb4a3b..94736be79e 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -114,6 +114,12 @@ 2.0.0 compile + + com.epmet + open-data-worker-client + 2.0.0 + compile + diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserHouseService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserHouseService.java new file mode 100644 index 0000000000..58c930e1a1 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserHouseService.java @@ -0,0 +1,27 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; + +public interface StatsUserHouseService { + + /** + * 人房信息统计 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/30 10:25 + */ + Result execUserHouseGridStatistical(FactUserHouseFormDTO formDTO); + + /** + * 人房信息统计 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/30 10:25 + */ + Result execUserHouseAgencyStatistical(FactUserHouseFormDTO formDTO); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserHouseServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserHouseServiceImpl.java new file mode 100644 index 0000000000..30875e947b --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserHouseServiceImpl.java @@ -0,0 +1,30 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.StatsUserHouseService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +@Service +public class StatsUserHouseServiceImpl implements StatsUserHouseService { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + @Override + public Result execUserHouseGridStatistical(FactUserHouseFormDTO formDTO) { + return dataStatisticalOpenFeignClient.userHouseStatGrid(formDTO); + } + + @Override + public Result execUserHouseAgencyStatistical(FactUserHouseFormDTO formDTO) { + return dataStatisticalOpenFeignClient.userHouseStatAgency(formDTO); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluationTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluationTask.java new file mode 100644 index 0000000000..348d37bbad --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluationTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.alibaba.fastjson.JSON; +import com.epmet.dto.form.AutoEvaluationFormDTO; +import com.epmet.feign.GovProjectOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @DateTime 2022/5/18 17:53 + * @DESC + */ +@Slf4j +@Component("autoEvaluationTask") +public class AutoEvaluationTask implements ITask{ + + @Autowired + private GovProjectOpenFeignClient projectOpenFeignClient; + + @Override + public void run(String params) { + AutoEvaluationFormDTO formDTO = new AutoEvaluationFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, AutoEvaluationFormDTO.class); + } + projectOpenFeignClient.autoEvaluation(formDTO); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/GuardarDatosTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/GuardarDatosTask.java new file mode 100644 index 0000000000..4a1376a5fd --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/GuardarDatosTask.java @@ -0,0 +1,41 @@ +package com.epmet.task; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.feign.GuardarDatosFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * 获取流动人口的数据存入ca_开头的表 + * + * @param + * @author LZN + * @return + * @date 2022/6/6 14:39 + */ +@Component("guardarDatosTask") +@Slf4j +public class GuardarDatosTask implements ITask { + + @Resource + private GuardarDatosFeignClient guardarDatosFeignClient; + + @Override + public void run(String params) { + PreserVationFormDTO formDTO = new PreserVationFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, PreserVationFormDTO.class); + } + Result result = guardarDatosFeignClient.guardarDatosTask(formDTO); + if (result.success()) { + log.debug("定时任务执行成功"); + } else { + log.debug("定时任务执行失败" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserHouseTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserHouseTask.java new file mode 100644 index 0000000000..1a32b7c1c7 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserHouseTask.java @@ -0,0 +1,48 @@ +package com.epmet.task; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.service.StatsUserHouseService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 人房 + * + * @author zhy + * @date 2022/5/30 10:23 + */ +@Component("statsUserHouseTask") +public class StatsUserHouseTask implements ITask { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsUserHouseService statsUserHouseService; + + @Override + public void run(String params) { + logger.info("StatsUserHouseTask定时任务正在执行,参数为:{}", params); + FactUserHouseFormDTO formDTO = new FactUserHouseFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, FactUserHouseFormDTO.class); + } + Result result = statsUserHouseService.execUserHouseGridStatistical(formDTO); + if (result.success()) { + logger.info("StatsUserHouseTask-grid定时任务执行成功"); + } else { + logger.error("StatsUserHouseTask-grid定时任务执行失败:" + result.getMsg()); + } + + result = statsUserHouseService.execUserHouseAgencyStatistical(formDTO); + if (result.success()) { + logger.info("StatsUserHouseTask-agency定时任务执行成功"); + } else { + logger.error("StatsUserHouseTask-agency定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcVolunteerDataExtractionTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcVolunteerDataExtractionTask.java new file mode 100644 index 0000000000..b599811e13 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcVolunteerDataExtractionTask.java @@ -0,0 +1,45 @@ +package com.epmet.task.ic; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.task.ITask; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/23 10:58 + */ +@Slf4j +@Component("icVolunteerDataExtractionTask") +public class IcVolunteerDataExtractionTask implements ITask { + + @Resource + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * 执行定时任务接口 + * + * @param params 参数,多参数使用JSON数据 + */ + @Override + public void run(String params) { + log.info("icVolunteerDataExtractionTask定时任务正在执行,参数为:{}", params); + ExtractOriginFormDTO formDTO = new ExtractOriginFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, ExtractOriginFormDTO.class); + } + Result result = epmetUserOpenFeignClient.volunteerDataExtraction(formDTO.getCustomerId()); + if (result.success()) { + log.info("icVolunteerDataExtractionTask定时任务正在执行定时任务执行成功"); + } else { + log.warn("icVolunteerDataExtractionTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java index ca857bf0f5..13f409ca36 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java @@ -105,6 +105,11 @@ public interface SystemMessageType { */ String IC_RESI_USER_DEL = "ic_resi_user_del"; + /** + * 志愿者变动 + */ + String VOLUNTEER_CHANGED = "volunteer_changed"; + /** * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 */ diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java index 57ac759211..08991d8a8b 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java @@ -207,4 +207,9 @@ public interface UserMessageTypeConstant { * ic_user_demand_rec.id */ String DEMAND="demand"; + + /** + * ic_event,新事件 + */ + String IC_EVENT="ic_event"; } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java index 24dbd8694f..dba68dfe74 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java @@ -1,9 +1,13 @@ package com.epmet.dto.form; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import javax.validation.constraints.NotNull; +@AllArgsConstructor +@NoArgsConstructor @Data public class SystemMsgFormDTO { diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java index fa5d21967a..debd15686f 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java @@ -3,6 +3,7 @@ package com.epmet.send; import com.alibaba.fastjson.JSON; import com.epmet.commons.rocketmq.messages.*; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.SystemMessageType; import com.epmet.dto.form.SystemMsgFormDTO; @@ -207,6 +208,35 @@ public class SendMqMsgUtil { return true; } log.error("发送(项目变动)系统消息到message服务失败:{},msg:{}", JSON.toJSONString(sendMsgResult), JSON.toJSONString(systemMsgFormDTO)); + } catch (Exception e) { + log.error("sendProjectMqMsg exception", e); + } + return false; + } + + /** + * desc: 发送mq消息 + * + * @param msgContent + * @return boolean + * @author LiuJanJun + * @date 2021/4/23 3:01 下午 + * @remark 失败重试1次,调用端自行判断如果失败是否要继续执行 + */ + public boolean sendRocketMqMsg(String msgType, MqBaseFormDTO msgContent) { + try { + SystemMsgFormDTO form = new SystemMsgFormDTO(msgType,msgContent); + Result sendMsgResult; + log.info("sendRocketMqMsg param:{}",msgContent); + int retryTime = 0; + do { + sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + } while ((sendMsgResult == null || !sendMsgResult.success()) && retryTime++ < NumConstant.TWO); + + if (sendMsgResult != null && sendMsgResult.success()) { + return true; + } + log.error("发送系统消息到message服务失败:{},msg:{}", JSON.toJSONString(sendMsgResult), JSON.toJSONString(form)); } catch (Exception e) { log.error("sendMqMsg exception", e); } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java index 77fe52d141..3e210d13a0 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java @@ -230,6 +230,10 @@ public class SystemMessageServiceImpl implements SystemMessageService { case SystemMessageType.FINISH_USER_DEMAND: topic=TopicConstants.COMMUNITY_SERVICE; break; + //志愿者变动 + case SystemMessageType.VOLUNTEER_CHANGED: + topic=TopicConstants.VOLUNTEER; + break; default: logger.error("getTopicByMsgType msgType:{} is not support for any topic", msgType); } diff --git a/epmet-module/epmet-oss/epmet-oss-client/pom.xml b/epmet-module/epmet-oss/epmet-oss-client/pom.xml index 7e307f1777..3b07913b6e 100644 --- a/epmet-module/epmet-oss/epmet-oss-client/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-client/pom.xml @@ -33,6 +33,11 @@ commons-fileupload 1.3.3 + + net.coobird + thumbnailator + 0.4.8 + diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 1b79042fbc..b265308eaf 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -148,6 +148,19 @@ public class OssController { return ossService.uploadImg(file, null); } + /** + * 压缩上传 + * + * @param file + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/24 13:32 + */ + @PostMapping("compressuploadimg") + public Result compressUploadImg(@RequestParam("file") MultipartFile file) { + return ossService.compressUploadImg(file, null); + } + @PostMapping("uploadwximg") public Result uploadWxImg(@RequestPart("media") MultipartFile media) { return ossService.uploadImg(media, null); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java index ae9625ee66..d9e210c006 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java @@ -31,6 +31,8 @@ public interface OssService extends BaseService { Result uploadImg(MultipartFile file, String privacy); + Result compressUploadImg(MultipartFile file, String privacy); + Result extUpload(MultipartFile file, String fileName, String privacy); Result uploadVariedFile(MultipartFile file); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 6fab1be511..40d5d7b492 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.entity.OssEntity; import com.epmet.exception.ModuleErrorCode; import com.epmet.service.OssService; import lombok.extern.slf4j.Slf4j; +import net.coobird.thumbnailator.Thumbnails; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -37,8 +38,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; +import java.math.BigDecimal; import java.util.Map; @Slf4j @@ -94,6 +100,37 @@ public class OssServiceImpl extends BaseServiceImpl implement return new Result().ok(dto); } + @Override + public Result compressUploadImg(MultipartFile file, String privacy) { + if (file.isEmpty()) { + return new Result().error(ModuleErrorCode.UPLOAD_FILE_EMPTY); + } + //上传文件 + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + String url = null; + String ossDomain = null; + try { + byte[] fileBytes = compressPicCycle(file.getBytes(),200L,0.3); + AbstractCloudStorageService storageService = OssFactory.build(); + url = storageService.uploadSuffix(fileBytes, extension, privacy); + ossDomain = storageService.getOssDomain(privacy); + } catch (IOException e) { + logger.error("图片上传异常", e); + throw new RenException("图片上传异常"); + + } + //保存文件信息 + OssEntity ossEntity = new OssEntity(); + ossEntity.setUrl(url); + + baseDao.insert(ossEntity); + //文件信息 + UploadImgResultDTO dto = new UploadImgResultDTO(); + dto.setUrl(url); + dto.setDomain(ossDomain); + return new Result().ok(dto); + } + @Override public Result extUpload(MultipartFile file, String fileName, String privacy) { try { @@ -262,5 +299,33 @@ public class OssServiceImpl extends BaseServiceImpl implement return ossDomain.concat(File.separator).concat(ossPrefix).concat(File.separator).concat(filePath); } + /** + * + * @param bytes 原图片字节数组 + * @param desFileSize 指定图片大小,单位 kb + * @param accuracy 精度,递归压缩的比率,建议小于0.9 + * @return + */ + private byte[] compressPicCycle(byte[] bytes, long desFileSize, double accuracy) throws IOException{ + // 获取目标图片 + long fileSize = bytes.length; + System.out.println("=====fileSize======== "+fileSize); + // 判断图片大小是否小于指定图片大小 + if(fileSize <= desFileSize * 1024){ + return bytes; + } + //计算宽高 + BufferedImage bim = ImageIO.read(new ByteArrayInputStream(bytes)); + int imgWidth = bim.getWidth(); + System.out.println(imgWidth+"====imgWidth====="); + int imgHeight = bim.getHeight(); + int desWidth = new BigDecimal(imgWidth).multiply( new BigDecimal(accuracy)).intValue(); + System.out.println(desWidth+"====desWidth====="); + int desHeight = new BigDecimal(imgHeight).multiply( new BigDecimal(accuracy)).intValue(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); //字节输出流(写入到内存) + Thumbnails.of(new ByteArrayInputStream(bytes)).size(desWidth, desHeight).outputQuality(accuracy).toOutputStream(baos); + //如果不满足要求,递归直至满足要求 + return compressPicCycle(baos.toByteArray(), desFileSize, accuracy); + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml index c6a2ee5d59..63a188f67c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml @@ -137,12 +137,36 @@ + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + + + + @@ -156,6 +180,10 @@ + + + + diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java index fb130e9c65..91ef00b75a 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java @@ -22,7 +22,6 @@ import com.epmet.dto.result.MenuResourceDTO; import lombok.Data; import java.io.Serializable; -import java.util.Date; import java.util.List; @@ -77,36 +76,6 @@ public class GovMenuDTO extends TreeStringNode implements Serializab */ private Integer sort; - /** - * 删除标识:0.未删除 1.已删除 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - /** * 菜单资源 */ @@ -121,4 +90,9 @@ public class GovMenuDTO extends TreeStringNode implements Serializab * 是否显示,1:显示 0不显示 */ private Integer showFlag; -} \ No newline at end of file + + /** + * 用于区分哪个端的菜单 eg:管理平台(gov_menu)、数据分析平台(data_menu) + */ + private String tableName; +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java index d3a67c889f..20636cfc3a 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java @@ -11,7 +11,6 @@ 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.GovMenuDTO; -import com.epmet.dto.result.MenuResourceDTO; import com.epmet.service.GovMenuService; import com.epmet.service.GovResourceService; import org.springframework.beans.factory.annotation.Autowired; @@ -45,11 +44,8 @@ public class GovMenuController { } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - GovMenuDTO data = govMenuService.get(id); - - //菜单资源列表 - List resourceList = govResourceService.getMenuResourceList(id); + public Result get(@PathVariable("id") String id,String tableName){ + GovMenuDTO data = govMenuService.get(id,tableName); return new Result().ok(data); } @@ -101,8 +97,8 @@ public class GovMenuController { * @return Result> */ @GetMapping("list") - public Result> list(Integer type){ - List list = govMenuService.getMenuList(type); + public Result> list(Integer type,String tableName){ + List list = govMenuService.getMenuList(type,tableName); return new Result>().ok(list); } @@ -113,8 +109,8 @@ public class GovMenuController { * @return List */ @GetMapping("nav") - public Result> nav(@LoginUser TokenDto tokenDto){ - List list = govMenuService.getUserMenuNavList(tokenDto); + public Result> nav(@LoginUser TokenDto tokenDto, String tableName){ + List list = govMenuService.getUserMenuNavList(tokenDto,tableName); return new Result>().ok(list); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java index ba05556dc1..d1902baca6 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

* https://www.renren.io - * + *

* 版权所有,侵权必究! */ @@ -24,21 +24,22 @@ import java.util.List; @Mapper public interface GovMenuDao extends BaseDao { - GovMenuEntity getById(@Param("id") String id, @Param("language") String language); + GovMenuEntity getById(@Param("id") String id, @Param("language") String language, @Param("tableName") String tableName); /** * 查询所有菜单列表 * - * @param type 菜单类型 - * @param language 语言 + * @param type 菜单类型 + * @param language 语言 + * @param tableName */ - List getMenuList(@Param("type") Integer type, @Param("language") String language); + List getMenuList(@Param("type") Integer type, @Param("language") String language, @Param("tableName") String tableName); /** * 查询用户菜单列表 * - * @param userId 用户ID - * @param type 菜单类型 + * @param userId 用户ID + * @param type 菜单类型 * @param language 语言 */ List getUserMenuList(@Param("userId") String userId, @Param("type") Integer type, @Param("language") String language); @@ -46,7 +47,8 @@ public interface GovMenuDao extends BaseDao { /** * 根据父菜单,查询子菜单 - * @param pid 父菜单ID + * + * @param pid 父菜单ID */ List getListPid(String pid); @@ -54,8 +56,9 @@ public interface GovMenuDao extends BaseDao { * 查询客户菜单列表 * * @param customerId 客户id - * @param type 菜单类型 - * @param language 语言 + * @param type 菜单类型 + * @param language 语言 + * @param tableName */ - List getCustomerMenuList(@Param("customerId") String customerId, @Param("type") Integer type, @Param("language") String language); + List getCustomerMenuList(@Param("customerId") String customerId, @Param("type") Integer type, @Param("language") String language, @Param("tableName") String tableName); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java index 911e42f59a..64dcb0fb1c 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java @@ -45,11 +45,12 @@ public class GovCustomerMenuRedis { * desc:保存客户菜单缓存 * @param customerId * @param type + * @param tableName * @see com.epmet.enums.MenuTypeEnum */ - public void setCustomerMenuList(String customerId, Integer type, List govMenuDTOS) { + public void setCustomerMenuList(String customerId, Integer type, List govMenuDTOS, String tableName) { if (checkParam(customerId, type) && !CollectionUtils.isEmpty(govMenuDTOS) && StringUtils.isNotBlank(govMenuDTOS.get(NumConstant.ZERO).getName())) { - String key = RedisKeys.getCustomerMenuList(customerId, type); + String key = RedisKeys.getCustomerMenuList(customerId, type, tableName); redisUtils.set(key, govMenuDTOS, RedisUtils.DEFAULT_EXPIRE); } } @@ -57,11 +58,12 @@ public class GovCustomerMenuRedis { * desc:获取客户菜单缓存 * @param customerId * @param type + * @param tableName * @see com.epmet.enums.MenuTypeEnum */ - public List getCustomerMenuList(String customerId, Integer type) { + public List getCustomerMenuList(String customerId, Integer type, String tableName) { if (checkParam(customerId, type)) { - String key = RedisKeys.getCustomerMenuList(customerId, type); + String key = RedisKeys.getCustomerMenuList(customerId, type, tableName); return (List) redisUtils.get(key); } return null; diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java index b5c0cf12a3..0e87946dc5 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java @@ -59,11 +59,12 @@ public interface GovMenuService extends BaseService { * 单条查询 * * @param id + * @param tableName * @return GovMenuDTO * @author generator * @date 2020-03-18 */ - GovMenuDTO get(String id); + GovMenuDTO get(String id, String tableName); /** * 默认保存 @@ -117,15 +118,17 @@ public interface GovMenuService extends BaseService { * 菜单列表 * * @param type 菜单类型 + * @param tableName */ - List getMenuList(Integer type); + List getMenuList(Integer type, String tableName); /** * 用户菜单导航 * @param tokenDto 用户信息 + * @param tableName * @return java.util.List */ - List getUserMenuNavList(TokenDto tokenDto); + List getUserMenuNavList(TokenDto tokenDto, String tableName); /** * 获取用户权限标识 @@ -141,4 +144,4 @@ public interface GovMenuService extends BaseService { List getListPid(String pid); void clearOperUserAccess(String app, String client, String userId); -} \ No newline at end of file +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java index 63bde3c678..2dbb4abe05 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -94,8 +94,9 @@ public class GovMenuServiceImpl extends BaseServiceImpl getMenuList(Integer type) { - List menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + public List getMenuList(Integer type, String tableName) { + tableName = getTableName(tableName); + List menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage(), tableName); List dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); @@ -189,7 +208,7 @@ public class GovMenuServiceImpl extends BaseServiceImpl getUserMenuNavList(TokenDto tokenDto) { + public List getUserMenuNavList(TokenDto tokenDto, String tableName) { // List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient()); // if(menuList == null){ // menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); @@ -198,7 +217,8 @@ public class GovMenuServiceImpl extends BaseServiceImpl * @Author zhangyong * @Date 15:51 2021-03-16 **/ - private List getCustomerMenuList(String customerId, Integer type) { - List govMenuDTOS = govCustomerMenuRedis.getCustomerMenuList(customerId,type); + private List getCustomerMenuList(String customerId, Integer type, String tableName) { + List govMenuDTOS = govCustomerMenuRedis.getCustomerMenuList(customerId,type,tableName); if (!CollectionUtils.isEmpty(govMenuDTOS)){ return govMenuDTOS; } - List menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage()); + List menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage(),tableName); List dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); govMenuDTOS = TreeUtils.buildTree(dtoList); - govCustomerMenuRedis.setCustomerMenuList(customerId,type,govMenuDTOS); + govCustomerMenuRedis.setCustomerMenuList(customerId,type,govMenuDTOS,tableName); return govMenuDTOS; } @@ -235,7 +256,8 @@ public class GovMenuServiceImpl extends BaseServiceImpl menuList; // if(govUserDTOResult.getData().getSuperAdmin() == SuperAdminEnum.YES.value()){ - menuList = baseDao.getMenuList(MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); + //目前不支持角色 菜单 + menuList = baseDao.getMenuList(MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage(), null); // }else{ // menuList = baseDao.getUserMenuList(tokenDto.getUserId(), MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); // } @@ -267,7 +289,7 @@ public class GovMenuServiceImpl extends BaseServiceImpl select t1.*, - (select lang.field_value from gov_language lang where lang.table_name='gov_menu' and lang.field_name='name' + (select lang.field_value from gov_language lang where lang.table_name=#{tableName} and lang.field_name='name' and lang.table_id=t1.pid and lang.language=#{language}) as parentName, - (select lang.field_value from gov_language lang where lang.table_name='gov_menu' and lang.field_name='name' + (select lang.field_value from gov_language lang where lang.table_name=#{tableName} and lang.field_name='name' and lang.table_id=t1.id and lang.language=#{language}) as name from gov_menu t1 where t1.id = #{id} and t1.del_flag = 0 SELECT - * + c.*, + ( + case when p.CATEGORY_NAME is not null and p.CATEGORY_NAME !='' then p.CATEGORY_NAME + else '' + end + )as parentCategoryName FROM - issue_project_category_dict + issue_project_category_dict c + left join issue_project_category_dict p on (c.PID=p.id and p.customer_id = #{customerId}) WHERE - del_flag = '0' - AND customer_id = #{customerId} + c.del_flag = '0' + AND c.customer_id = #{customerId} - id = #{id} + c.id = #{id} ORDER BY - sort ASC + c.sort ASC diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseCodeInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseCodeInfoDTO.java new file mode 100644 index 0000000000..7189bcfee0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseCodeInfoDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class IcHouseCodeInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 最大的楼栋编码序列号 + */ + private String buildingMaxNum; + + /** + * 该楼栋下最大的房屋编码序列号 + */ + private String houseMaxNum; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java index f25311b2db..42163539ce 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java @@ -111,6 +111,12 @@ public class IcHouseDTO implements Serializable { */ private BigDecimal sort; + /** + * 房屋编码 + */ + private String houseCode; + private String houseQrcodeUrl; + /** * 删除标识 0未删除、1已删除 */ @@ -141,4 +147,9 @@ public class IcHouseDTO implements Serializable { */ private Date updatedTime; + /** + * 备注 + */ + private String remark; + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseQrcodeFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseQrcodeFormDTO.java new file mode 100644 index 0000000000..85925ec8f0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseQrcodeFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-01 13:44 + **/ +@Data +public class HouseQrcodeFormDTO implements Serializable { + + @NotNull(message = "id不可为空") + private String id; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java index 440b2323bb..8882060a2e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java @@ -101,6 +101,11 @@ public class IcHouseAddFormDTO implements Serializable { */ private String ownerIdCard; + /** + * 备注 + */ + private String remark; + private BigDecimal sort = NumConstant.ZERO_DECIMAL; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseInfoFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseInfoFormDTO.java new file mode 100644 index 0000000000..adde362546 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseInfoFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** +* @describe: 根据房屋编码获取房屋信息 +* @author wangtong +* @date 2022/6/1 18:17 +* @params +* @return +*/ +@Data +public class IcHouseInfoFormDTO extends PageFormDTO { + + private static final long serialVersionUID = -1L; + + + @NotNull(message = "房屋编码不可为空") + private String houseCode; + + private String customerId; + +} 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 index b57f0bdadc..060cfd4c19 100644 --- 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 @@ -70,4 +70,25 @@ public class IcHouseListFormDTO extends PageFormDTO { */ private String sortType; + /** + * 房屋用途 + */ + private String purpose; + + /** + * 备注 + */ + private String remark; + + /** + * 开始日期 eg:20220505 + */ + private String updateStartDate; + + /** + * 结束日期 eg:20220505 + */ + private String updateEndDate; + + private String customerId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgTreeByUserAndTypeFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgTreeByUserAndTypeFormDTO.java new file mode 100644 index 0000000000..1114c0276c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgTreeByUserAndTypeFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-05-18 16:46 + **/ +@Data +public class OrgTreeByUserAndTypeFormDTO implements Serializable { + + @NotNull(message ="组织id不可为空") + private String agencyId; + + /** + * 党组织类型 0省委,1市委,2区委,3党工委,4党委 + */ + @NotNull(message ="组织类型不可为空") + private String orgType; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + + private List orgTypeList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/TestFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/TestFormDTO.java new file mode 100644 index 0000000000..2443e66a94 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/TestFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** +* @describe: 根据房屋编码获取房屋信息 +* @author wangtong +* @date 2022/6/1 18:17 +* @params +* @return +*/ +@Data +public class TestFormDTO extends PageFormDTO { + + private static final long serialVersionUID = -1L; + + private String buildingId; + + private String customerId; + + private String areaCode; + + private String houseId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyAddressBookTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyAddressBookTreeResultDTO.java new file mode 100644 index 0000000000..33e3fd3737 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyAddressBookTreeResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.result; + + +import com.epmet.commons.tools.utils.NodeTree; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AgencyAddressBookTreeResultDTO extends NodeTree implements Serializable { + + private static final long serialVersionUID = -1993037593855768962L; + + /** + * 父id + */ + private String pid; + + /** + * 名字 + */ + private String name; + + /** + * 级别 + */ + private String level; + + /** + * 创建时间 + */ + private Date createTime; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CreateHouseCodeAndUrlDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CreateHouseCodeAndUrlDTO.java new file mode 100644 index 0000000000..01dcdf11b6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CreateHouseCodeAndUrlDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-06 15:08 + **/ +@Data +public class CreateHouseCodeAndUrlDTO implements Serializable { + + /** + * 房屋id + */ + private String houseId; + + /** + * 客户id + */ + private String customerId; + + /** + * 楼栋id + */ + private String buildingId; + + /** + * 区划代码 + */ + private String areaCode; + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DelAgencyGridIdResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DelAgencyGridIdResultDTO.java new file mode 100644 index 0000000000..b11a7b6a00 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DelAgencyGridIdResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 无效组织、网格Id列表 + */ +@Data +public class DelAgencyGridIdResultDTO implements Serializable { + + //组织Id集合 + private List agencyIdList; + //网格Id集合 + private List gridIdList; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java index ae5a6d07ba..aa2b2fffca 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java @@ -91,4 +91,20 @@ public class HouseInfoDTO implements Serializable { * 组织的area_code */ private String areaCode; + /** + * 网格id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 房屋编码 + */ + private String houseCode; + /** + * 二维码地址 + */ + private String houseQrcodeUrl; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseInfoResultDTO.java new file mode 100644 index 0000000000..d958f1494b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseInfoResultDTO.java @@ -0,0 +1,65 @@ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:房屋列表结果类 + * + * @author liujianjun + */ +@Data +public class IcHouseInfoResultDTO implements Serializable { + + + private static final long serialVersionUID = 4963952996288796744L; + + /** + * 所属网格 + */ + private String gridName; + private String gridId; + + /** + * 所属小区 + */ + private String neighborHoodId; + private String neighborHoodName; + + /** + * 所属楼栋 + */ + private String buildingId; + private String buildingName; + + /** + * 所属单元id + */ + private String buildingUnitId; + private String unitName; + + /** + * 房间名称 + */ + private String houseName; + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋id + */ + private String houseId; + + /** + * 客户id + */ + private String customerId; + + + +} 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 index 4c1b40288f..03346cb6fc 100644 --- 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 @@ -16,6 +16,8 @@ public class IcHouseListResultDTO implements Serializable { private static final long serialVersionUID = 4963952996288796744L; + private String customerId; + private String houseId; private String doorName; @@ -79,7 +81,13 @@ public class IcHouseListResultDTO implements Serializable { */ private String ownerIdCard; + private String remark; + private Double sort; + /** + * 房屋编码 + */ + private String houseCode; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseQrcodeConfigDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseQrcodeConfigDTO.java new file mode 100644 index 0000000000..d1b837b86f --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseQrcodeConfigDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-07 18:34 + **/ +@Data +public class IcHouseQrcodeConfigDTO implements Serializable { + + private String customerId; + + private String qrcodePre; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PartyOrgTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PartyOrgTreeResultDTO.java new file mode 100644 index 0000000000..510c1c1fe0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PartyOrgTreeResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-05-18 16:48 + **/ +@Data +public class PartyOrgTreeResultDTO implements Serializable { + + /** + * 行政组织id + */ + private String id; + + /** + * 行政组织pid + */ + private String pid; + + /** + * 行政组织名称 + */ + private String name; + + /** + * 行政组织等级 + */ + private String level; + + /** + * 行政组织父ids + */ + private String pids; + + private List children = new ArrayList<>(); +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubOrgResDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubOrgResDTO.java new file mode 100644 index 0000000000..8bc06550a1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubOrgResDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 当前组织的直属下级(下级组织+直属网格) + */ +@Data +public class SubOrgResDTO implements Serializable { + private String orgId; + /** + * agency + * grid + */ + private String orgType; + private String orgName; + private String pid; + private String pids; +} 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 e2c0ae2359..81ad4df7e2 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 @@ -94,17 +94,17 @@ public interface GovOrgOpenFeignClient { * @param partyBranchId * @return com.epmet.commons.tools.utils.Result * @author yinzuomei - * @description 根据党支部id,查询党支部信息 + * @description 根据党支部id, 查询党支部信息 * @Date 2020/6/17 18:01 **/ @GetMapping(value = "gov/org/customerpartybranch/get/{id}") Result getPartyBranchById(@PathVariable("id") String partyBranchId); /** - * @return com.epmet.commons.tools.utils.Result * @param partyBranchId + * @return com.epmet.commons.tools.utils.Result * @author yinzuomei - * @description 根据党支部id,删除党支部(存在党员的不允许删除) + * @description 根据党支部id, 删除党支部(存在党员的不允许删除) * @Date 2020/6/17 18:08 **/ @GetMapping(value = "gov/org/customerpartybranch/delete/{id}") @@ -121,8 +121,8 @@ public interface GovOrgOpenFeignClient { Result queryGridInfo(@PathVariable("gridId") String gridId); /** - * @return com.epmet.commons.tools.utils.Result * @param partyBranchId + * @return com.epmet.commons.tools.utils.Result * @author yinzuomei * @description 党支部宗人数-1 * @Date 2020/6/18 18:28 @@ -158,8 +158,8 @@ public interface GovOrgOpenFeignClient { Result> listGridsbystaffid(@PathVariable("staffId") String staffId); /** - * @return com.epmet.commons.tools.utils.Result * @param staffId + * @return com.epmet.commons.tools.utils.Result * @author yinzuomei * @description 发布活动-主办方列表 * @Date 2020/7/23 20:47 @@ -168,7 +168,6 @@ public interface GovOrgOpenFeignClient { Result querySponsorList(@PathVariable("staffId") String staffId); /** - * * @Description 根据网格id查询网格名称 * @Author zxc * @CreatedTime 2020/4/27 9:22 @@ -177,20 +176,19 @@ public interface GovOrgOpenFeignClient { Result getGridNameByGridId(@RequestBody BelongGridNameFormDTO formDTO); /** - * @return com.epmet.commons.tools.utils.Result> * @param staffOrgFormDTO + * @return com.epmet.commons.tools.utils.Result> * @Author yinzuomei * @Description 获取客户对应的根级组织名称 * @Date 2020/4/20 21:37 **/ - @PostMapping(value = "/gov/org/customeragency/getStaffOrgList",consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "/gov/org/customeragency/getStaffOrgList", consumes = MediaType.APPLICATION_JSON_VALUE) Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO); /** - * @description 通过staffId查询跟组织列表 - * * @param input * @return + * @description 通过staffId查询跟组织列表 * @author wxz * @date 2021.10.25 14:53:53 */ @@ -198,8 +196,8 @@ public interface GovOrgOpenFeignClient { Result> getStaffOrgListByStaffId(@RequestBody RootOrgListByStaffIdFormDTO input); /** - * @Description 查询一个网格下的所有工作人员 * @param gridIdFormDTO + * @Description 查询一个网格下的所有工作人员 * @author zxc * @date 2020/8/13 10:46 上午 */ @@ -207,8 +205,8 @@ public interface GovOrgOpenFeignClient { Result> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO); /** - * @Description 查询部门下工作人员 * @param formDTO + * @Description 查询部门下工作人员 * @author zxc * @date 2020/8/13 2:46 下午 */ @@ -216,8 +214,8 @@ public interface GovOrgOpenFeignClient { Result> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO); /** - * @Description 查询客户下的网格数量 * @param customerIdFormDTO + * @Description 查询客户下的网格数量 * @author zxc * @date 2020/8/14 9:31 上午 */ @@ -225,8 +223,8 @@ public interface GovOrgOpenFeignClient { Result selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO); /** - * @Description 查询机关下工作人员 * @param formDTO + * @Description 查询机关下工作人员 * @author zxc * @date 2020/8/17 */ @@ -234,19 +232,19 @@ public interface GovOrgOpenFeignClient { Result> getAgencyStaffs(@RequestBody AgencyIdFormDTO formDTO); /** - * @Description User模块调用gov-org查询工作人员所在机关的信息以及客户信息 * @param result * @return + * @Description User模块调用gov-org查询工作人员所在机关的信息以及客户信息 * @author wangc * @date 2020.08.17 14:11 - **/ + **/ @PostMapping("/gov/org/customeragency/staffinfoext") Result staffInfoExt(@RequestBody ExtStaffInfoResultDTO result); /** - * @Description 根据staffId,查询当前这个用户的数据权限,对外接口 * @param staffId * @return + * @Description 根据staffId,查询当前这个用户的数据权限,对外接口 * @author wangc * @date 2020.08.17 17:30 **/ @@ -254,9 +252,9 @@ public interface GovOrgOpenFeignClient { Result staffPermissionExt(@PathVariable(value = "staffId") String staffId); /** + * @param result ExtStaffInfoResultDTO.class + * @return Result * @Description User模块调用gov-org查询用户所在机关的信息以及客户信息 - * @param result ExtStaffInfoResultDTO.class - * @return Result * @author wangc * @date 2020.08.17 13:52 **/ @@ -289,7 +287,7 @@ public interface GovOrgOpenFeignClient { Result organizeTree(@PathVariable("agencyId") String agencyId); /** - * @Description 查询org信息 + * @Description 查询org信息 * @Param orgInfoFormDTO * @author zxc * @date 2020/11/10 2:55 下午 @@ -307,8 +305,8 @@ public interface GovOrgOpenFeignClient { Result> getGridListByGridIds(List gridIdList); /** - * @Description 查询网格名 不限制是否同步条件 SYNC_FLAG * @param gridIdList + * @Description 查询网格名 不限制是否同步条件 SYNC_FLAG * @author zxc * @date 2022/1/12 9:37 上午 */ @@ -316,9 +314,9 @@ public interface GovOrgOpenFeignClient { Result> getAllGridListByGridIds(List gridIdList); /** - * @Description 根据网格Id查询用户数据 * @param customerGridFormDTO * @return com.epmet.commons.tools.utils.Result + * @Description 根据网格Id查询用户数据 * @Author liushaowen * @Date 2020/11/18 15:34 */ @@ -337,8 +335,9 @@ public interface GovOrgOpenFeignClient { /** * 根据 网格id,查询同属于一个社区下的所有网格id + * * @param gridId - * @return com.epmet.commons.tools.utils.Result> + * @return com.epmet.commons.tools.utils.Result> * @Author zhangyong * @Date 17:44 2020-12-28 **/ @@ -355,7 +354,7 @@ public interface GovOrgOpenFeignClient { Result getProcessorList(@PathVariable("agencyId") String agencyId); /** - * @Description 查询网格下的网格员 + * @Description 查询网格下的网格员 * @Param gridIds * @author zxc * @date 2021/6/8 3:36 下午 @@ -364,17 +363,17 @@ public interface GovOrgOpenFeignClient { Result> selectGridStaffByGridIds(@RequestBody List gridIds); /** - * @return com.epmet.commons.tools.utils.Result * @param customerId + * @return com.epmet.commons.tools.utils.Result * @author yinzuomei - * @description 根据customerId查询参数(area_code_switch)值open: 选择地区编码必填;closed: 无需选择地区编码;;0409新增返参;没配置,返回closed + * @description 根据customerId查询参数(area_code_switch)值open: 选择地区编码必填;closed: 无需选择地区编码;;0409新增返参;没配置,返回closed * @Date 2021/6/24 16:11 **/ @GetMapping(value = "/gov/org/customeragency/getareacodeswitch/{customerId}") - Result getAreaCodeSwitch(@PathVariable("customerId")String customerId); + Result getAreaCodeSwitch(@PathVariable("customerId") String customerId); /** - * @Description 根据网格ID查询pids + * @Description 根据网格ID查询pids * @Param gridId * @author zxc * @date 2021/7/16 9:52 上午 @@ -384,6 +383,7 @@ public interface GovOrgOpenFeignClient { /** * 工作人员的个人信息 + * * @param fromDTO * @return */ @@ -391,25 +391,25 @@ public interface GovOrgOpenFeignClient { Result queryStaffProfile(@RequestBody StaffInfoFromDTO fromDTO); /** - * @Description 查询工作人员名字 【xx组织-章三】 + * @Description 查询工作人员名字 【xx组织-章三】 * @Param userId * @author zxc * @date 2021/8/4 4:23 下午 */ @PostMapping("/gov/org/staff/staffname") - Result staffName(@RequestParam("userId")String userId); + Result staffName(@RequestParam("userId") String userId); /** - * @Description 查询网格名字 + * @Description 查询网格名字 * @Param gridName * @author zxc * @date 2021/8/4 4:26 下午 */ @PostMapping("/gov/org/customergrid/selectgridname") - Result gridName(@RequestParam("gridId")String gridId); + Result gridName(@RequestParam("gridId") String gridId); /** - * @Description 根据类型查询组织名称 + * @Description 根据类型查询组织名称 * @Param formList * @author zxc * @date 2021/8/4 6:14 下午 @@ -418,19 +418,19 @@ public interface GovOrgOpenFeignClient { Result> selectOrgNameByType(@RequestBody List formList); /** - * @Description 根据人查询所在组织 + * @Description 根据人查询所在组织 * @Param userId * @author zxc * @date 2021/8/5 10:08 上午 */ @PostMapping("/gov/org/customergrid/selectorgsbyuserid") - Result> selectOrgsByUserId(@RequestParam("userId")String userId); + Result> selectOrgsByUserId(@RequestParam("userId") String userId); /** * 架构里面的人 * * @param formDTO - * @return com.epmet.commons.tools.utils.Result> + * @return com.epmet.commons.tools.utils.Result> * @author yinzuomei * @date 2021/8/19 2:27 下午 */ @@ -459,9 +459,8 @@ public interface GovOrgOpenFeignClient { @PostMapping("/gov/org/grid/getbaseinfo") Result getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO); - @PostMapping(value = "/gov/org/house/queryListHouseInfo",consumes = MediaType.APPLICATION_JSON_VALUE) - Result> queryListHouseInfo(@RequestBody Set houseIds, @RequestParam("customerId") String customerId); - + @PostMapping(value = "/gov/org/house/queryListHouseInfo", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> queryListHouseInfo(@RequestBody Set houseIds, @RequestParam("customerId") String customerId); /** @@ -476,6 +475,7 @@ public interface GovOrgOpenFeignClient { /** * 获取网格下支部小组 + * * @Param formDTO * @Return {@link Result>} * @Author zhaoqifeng @@ -518,13 +518,13 @@ public interface GovOrgOpenFeignClient { Result> getNeighborHoodOptions(IcNeighborHoodDTO dto); /** - * @Description 查询房屋信息 * @param idCard + * @Description 查询房屋信息 * @author zxc * @date 2021/11/3 3:30 下午 */ @PostMapping("/gov/org/ichouse/selecthouseinfobyidcard") - Result> selectHouseInfoByIdCard(@RequestParam("idCard")String idCard,@RequestParam("customerId")String customerId); + Result> selectHouseInfoByIdCard(@RequestParam("idCard") String idCard, @RequestParam("customerId") String customerId); @GetMapping("/gov/org/ichouse/{id}") Result get(@PathVariable("id") String id); @@ -533,7 +533,7 @@ public interface GovOrgOpenFeignClient { Result> buildingListByIds(@RequestBody List buildingIdList); @PostMapping("/gov/org/building/buildinglistbyidsPage/{pageNo}/{pageSize}") - Result buildinglistbyidsPage(@RequestBody List buildingIdList,@PathVariable("pageNo") Integer pageNo,@PathVariable("pageSize")Integer pageSize); + Result buildinglistbyidsPage(@RequestBody List buildingIdList, @PathVariable("pageNo") Integer pageNo, @PathVariable("pageSize") Integer pageSize); @PostMapping("/gov/org/icneighborhood/getlistbyids") Result> getListByIds(@RequestBody List ids); @@ -542,18 +542,19 @@ public interface GovOrgOpenFeignClient { Result> getGridIListByAgency(@PathVariable("agencyId") String agencyId); /** - * @Description 查询下级agencyId * @param orgId + * @Description 查询下级agencyId * @author zxc * @date 2021/12/9 4:42 下午 */ @PostMapping("/gov/org/agency/getsonagencyid") - Result> getSonAgencyId(@RequestParam("orgId")String orgId,@RequestParam("type")String type); + Result> getSonAgencyId(@RequestParam("orgId") String orgId, @RequestParam("type") String type); // /icbuilding/{id}?id=demoData /** * 根据ID查询楼栋信息 + * * @param id * @return */ @@ -562,6 +563,7 @@ public interface GovOrgOpenFeignClient { /** * 通过ID查询小区信息 + * * @param id * @return */ @@ -571,6 +573,7 @@ public interface GovOrgOpenFeignClient { /** * 运营端-客户管理,修改客户信息,调用gov-org服务,修改组织区划开关,修改根组织areaCode入参。 + * * @param formDTO * @return */ @@ -591,6 +594,7 @@ public interface GovOrgOpenFeignClient { /** * 查询单元 + * * @param id * @return */ @@ -599,15 +603,17 @@ public interface GovOrgOpenFeignClient { /** * Desc: 查询网格下所有的工作人员 + * * @param gridId * @author zxc * @date 2022/3/21 16:02 */ @PostMapping("/gov/org/customerstaffgrid/getallstaffbygridid") - Result> getAllStaffByGridId(@RequestParam("gridId")String gridId); + Result> getAllStaffByGridId(@RequestParam("gridId") String gridId); /** * Desc: 根据身份证查询房屋名 + * * @param idCards * @author zxc * @date 2022/4/12 16:42 @@ -617,11 +623,42 @@ public interface GovOrgOpenFeignClient { /** * Desc: 房屋更新 - * @param tokenDTO + * <<<<<<< HEAD + * ======= + *

+ * >>>>>>> feature/dev_sunjiatan + * * @param formDTO * @author zxc * @date 2022/5/11 09:46 */ @PostMapping("/gov/org/house/houseupdate") Result houseUpdate(@RequestBody IcHouseAddFormDTO formDTO); + + /** + * 直属网格+下一级组织 + * + * @param agencyId + * @return + */ + @GetMapping("/gov/org/customeragency/subOrgList/{agencyId}") + Result> subOrgList(@PathVariable("agencyId") String agencyId); + + /** + * @Author sun + * @Description 获取当前组织及下级无效组织、网格Id列表 + **/ + @PostMapping(value = "/gov/org/customeragency/getDelAgencyGridIdList/{agencyId}") + Result getDelAgencyGridIdList(@PathVariable("agencyId") String agencyId); + + /** + * 根据房屋编码查询房屋信息 + * + * @param houseCode + * @return com.epmet.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2022/6/1/0001 16:18 + */ + @GetMapping("/gov/org/ichouse/getbyhousecode/{houseCode}") + Result getByHouseCode(@PathVariable("houseCode") String houseCode); } 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 595fd11928..6270575319 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 @@ -67,12 +67,12 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { @Override public Result queryGridInfo(String gridId) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo",gridId); + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo", gridId); } @Override public Result decrPartyBranchMember(String partyBranchId) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "decrPartyBranchMember",partyBranchId); + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "decrPartyBranchMember", partyBranchId); } @Override @@ -276,7 +276,7 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { } @Override - public Result> queryListHouseInfo(Set houseIds ,String customerId) { + public Result> queryListHouseInfo(Set houseIds, String customerId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListHouseInfo", houseIds, customerId); } @@ -311,7 +311,7 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { } @Override - public Result> selectHouseInfoByIdCard(String idCard,String customerId) { + public Result> selectHouseInfoByIdCard(String idCard, String customerId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectHouseInfoByIdCard", idCard, customerId); } @@ -324,9 +324,10 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> buildingListByIds(List buildingIdList) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildingListByIds", buildingIdList); } + @Override - public Result buildinglistbyidsPage(List buildingIdList,Integer pageNo,Integer pageSize) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildinglistbyidsPage", buildingIdList,pageNo,pageSize); + public Result buildinglistbyidsPage(List buildingIdList, Integer pageNo, Integer pageSize) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildinglistbyidsPage", buildingIdList, pageNo, pageSize); } @Override @@ -340,8 +341,8 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { } @Override - public Result> getSonAgencyId(String orgId,String type) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getSonAgencyId", orgId,type); + public Result> getSonAgencyId(String orgId, String type) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getSonAgencyId", orgId, type); } @Override @@ -372,7 +373,7 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { @Override public Result> getStaffGridList(String customerId, String orgId, String orgType) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridList",customerId, orgId, orgType); + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridList", customerId, orgId, orgType); } /** @@ -400,7 +401,28 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { } @Override - public Result houseUpdate( IcHouseAddFormDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "houseUpdate",formDTO); + public Result houseUpdate(IcHouseAddFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "houseUpdate", formDTO); + } + + /** + * 直属网格+下一级组织 + * + * @param agencyId + * @return + */ + @Override + public Result> subOrgList(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "subOrgList", agencyId); + } + + @Override + public Result getByHouseCode(String houseCode) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getByHouseCode", houseCode); + } + + @Override + public Result getDelAgencyGridIdList(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDelAgencyGridIdList", agencyId); } } 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 0156f0e042..85f0d846f7 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,6 +9,7 @@ public interface ImportErrorMsgConstants { String EXIST_ERROR = "数据已存在"; String UNIT_ERROR = "暂不支持单元数减小"; + String UNIT_EXIST_HOUSES_ERROR = "单元下存在房屋,不可修改单元数"; String DOCUMENT_EXIST_ERROR = "文件中存在重复数据"; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 659b411519..e917eacf59 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -94,15 +94,15 @@ public class AgencyController { public Result addAgency(@LoginUser TokenDto tokenDTO, @RequestBody AddAgencyFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); //机构级别是市级以上则市、区县名称可不传值,是区县级以上则区县名称可不传值 - if(!CustomerAgencyConstant.PROVINCE_LEVEL.equals(formDTO.getLevel())&&!CustomerAgencyConstant.CITY_LEVEL.equals(formDTO.getLevel())){ - if(StringUtils.isBlank(formDTO.getCity())){ + if (!CustomerAgencyConstant.PROVINCE_LEVEL.equals(formDTO.getLevel()) && !CustomerAgencyConstant.CITY_LEVEL.equals(formDTO.getLevel())) { + if (StringUtils.isBlank(formDTO.getCity())) { throw new RenException(CustomerAgencyConstant.CITY_EXCEPTION); } - if(StringUtils.isBlank(formDTO.getDistrict())){ + if (StringUtils.isBlank(formDTO.getDistrict())) { throw new RenException(CustomerAgencyConstant.DISTRICT_EXCEPTION); } - }else if(!CustomerAgencyConstant.PROVINCE_LEVEL.equals(formDTO.getLevel())){ - if(StringUtils.isBlank(formDTO.getCity())){ + } else if (!CustomerAgencyConstant.PROVINCE_LEVEL.equals(formDTO.getLevel())) { + if (StringUtils.isBlank(formDTO.getCity())) { throw new RenException(CustomerAgencyConstant.CITY_EXCEPTION); } } @@ -118,13 +118,13 @@ public class AgencyController { **/ @PostMapping("addagency-v2") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_SUBAGENCY_CREATE) - public Result addAgencyV2(@LoginUser TokenDto tokenDTO,@RequestBody AddAgencyV2FormDTO formDTO) { + public Result addAgencyV2(@LoginUser TokenDto tokenDTO, @RequestBody AddAgencyV2FormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AddAgencyV2FormDTO.DefaultUserShowGroup.class, AddAgencyV2FormDTO.AddUserInternalGroup.class); if (formDTO.getAreaCodeSwitch().equals(CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN)) { ValidatorUtils.validateEntity(formDTO, AddAgencyV2FormDTO.AreaCodeGroup.class); } //当前客户下,同级组织中,组织名称不允许重复 - customerAgencyService.checkAgencyName(formDTO.getAgencyName(),tokenDTO.getCustomerId(),null,formDTO.getParentAgencyId()); + customerAgencyService.checkAgencyName(formDTO.getAgencyName(), tokenDTO.getCustomerId(), null, formDTO.getParentAgencyId()); AddAgencyResultDTO resultDTO = agencyService.addAgencyV2(formDTO); //2021-11-30 推送mq,数据同步到中介库 start @@ -141,6 +141,7 @@ public class AgencyController { /** * 添加根级组织 + * * @param form * @return */ @@ -175,7 +176,7 @@ public class AgencyController { formDTO.setUserId(tokenDTO.getUserId()); formDTO.setCustomerId(tokenDTO.getCustomerId()); ValidatorUtils.validateEntity(formDTO, EditAgencyFormDTO.DefaultUserShowGroup.class, EditAgencyFormDTO.AddUserInternalGroup.class); - Result result = agencyService.editAgency(formDTO); + Result result = agencyService.editAgency(formDTO); //2021-10-18 推送mq,数据同步到中介库 start【中介库只放了组织的名称、级别,所以涉及批量修改pname的操作不涉及同步中间库】 OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); @@ -245,6 +246,7 @@ public class AgencyController { /** * 根据Id查询agency + * * @param agencyId * @return */ @@ -259,6 +261,7 @@ public class AgencyController { /** * 根据staffId查询 + * * @param staffId * @return */ @@ -275,6 +278,7 @@ public class AgencyController { /** * 查询客户根级组织 + * * @param customerId * @return */ @@ -286,6 +290,7 @@ public class AgencyController { /** * 批量查询客户根级组织 + * * @param customerIds * @return */ @@ -324,100 +329,101 @@ public class AgencyController { } /** - * @Description 【地图配置】删除 * @param formDTO + * @Description 【地图配置】删除 * @author zxc * @date 2021/10/25 9:30 上午 */ @PostMapping("mapdelarea") - public Result mapDelArea(@RequestBody MapDelAreaFormDTO formDTO){ + public Result mapDelArea(@RequestBody MapDelAreaFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, MapDelAreaFormDTO.MapDelAreaForm.class); agencyService.mapDelArea(formDTO); return new Result(); } /** - * @Description 【地图配置】新增 * @param formDTO + * @Description 【地图配置】新增 * @author zxc * @date 2021/10/25 9:58 上午 */ @PostMapping("mapaddarea") - public Result mapAddArea(@RequestBody MapAddAreaFormDTO formDTO){ + public Result mapAddArea(@RequestBody MapAddAreaFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, MapAddAreaFormDTO.MapAddAreaForm.class); agencyService.mapAddArea(formDTO); return new Result(); } /** - * @Description 【地图配置】组织查询 * @param formDTO * @param tokenDto + * @Description 【地图配置】组织查询 * @author zxc * @date 2021/10/25 10:50 上午 */ @PostMapping("maporg") - public Result mapOrg(@RequestBody MapOrgFormDTO formDTO, @LoginUser TokenDto tokenDto){ - return new Result().ok(agencyService.mapOrg(formDTO,tokenDto)); + public Result mapOrg(@RequestBody MapOrgFormDTO formDTO, @LoginUser TokenDto tokenDto) { + return new Result().ok(agencyService.mapOrg(formDTO, tokenDto)); } /** - * @Description 查询楼栋信息 * @param formDTO + * @Description 查询楼栋信息 * @author zxc * @date 2021/11/2 9:18 上午 */ @PostMapping("baseinfofamilybuilding") - public Result> baseInfoFamilyBuilding(@RequestBody BaseInfoFamilyBuildingFormDTO formDTO){ + public Result> baseInfoFamilyBuilding(@RequestBody BaseInfoFamilyBuildingFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, BaseInfoFamilyBuildingFormDTO.BaseInfoFamilyBuildingForm.class); return new Result>().ok(agencyService.baseInfoFamilyBuilding(formDTO)); } /** - * @Description 查询下级agencyId * @param orgId + * @Description 查询下级agencyId * @author zxc * @date 2021/12/9 4:42 下午 */ @PostMapping("getsonagencyid") - public Result> getSonAgencyId(@RequestParam("orgId")String orgId,@RequestParam("type")String type){ - return new Result>().ok(agencyService.getSonAgencyId(orgId,type)); + public Result> getSonAgencyId(@RequestParam("orgId") String orgId, @RequestParam("type") String type) { + return new Result>().ok(agencyService.getSonAgencyId(orgId, type)); } /** * Desc: 生成某类型下的二维码 + * * @param formDTO * @author zxc * @date 2022/3/2 10:32 上午 */ @PostMapping("create-qrcode") - public void createQrCode(@LoginUser TokenDto tokenDto, @RequestBody CreateQrCodeFormDTO formDTO, HttpServletResponse response){ + public void createQrCode(@LoginUser TokenDto tokenDto, @RequestBody CreateQrCodeFormDTO formDTO, HttpServletResponse response) { ValidatorUtils.validateEntity(formDTO, CreateQrCodeFormDTO.CreateQrCodeForm.class); String id = formDTO.getId(); String type = formDTO.getType(); String name = ""; try { - if (type.equals(OrgInfoConstant.COMMUNITY)){ + if (type.equals(OrgInfoConstant.COMMUNITY)) { CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(id); - if (customerAgencyDTO == null){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"组织信息不存在"); + if (customerAgencyDTO == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组织信息不存在"); } name = customerAgencyDTO.getOrganizationName(); - }else if (type.equals(OrgInfoConstant.NEIGHBOR_HOOD)){ + } else if (type.equals(OrgInfoConstant.NEIGHBOR_HOOD)) { IcNeighborHoodDTO icNeighborHoodDTO = neighborHoodService.get(id); - if (icNeighborHoodDTO == null){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"小区信息不存在"); + if (icNeighborHoodDTO == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "小区信息不存在"); } name = icNeighborHoodDTO.getNeighborHoodName(); } //url组成:数字社区地址?小区id&用户id //String url = "https://demo.tduckapp.com/s/7314b64b3a26455ab793fb8c640856b6?id="+id; String url = EnvEnum.getCurrentEnv().getUrl() - .replace("cloud","open") + .replace("cloud", "open") .replace("api/", StrConstant.EPMETY_STR) .concat("epmet-oper-gov/#/caiji/") .concat(id).concat("?") - .concat("name=").concat(URLEncoder.encode(name,StrConstant.UTF_8)).concat(StrConstant.AND_MARK) + .concat("name=").concat(URLEncoder.encode(name, StrConstant.UTF_8)).concat(StrConstant.AND_MARK) .concat("customerId=").concat(tokenDto.getCustomerId()).concat(StrConstant.AND_MARK) .concat("type=").concat(type).concat(StrConstant.AND_MARK) .concat("userId=").concat(tokenDto.getUserId()) @@ -429,18 +435,18 @@ public class AgencyController { ImageIO.write(image, "png", imageOutput); InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); long length = imageOutput.length(); - String fileName = name+".png"; + String fileName = name + ".png"; response.setContentType("application/octet-stream"); - response.setContentLength((int)length); - response.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode(fileName, StrConstant.UTF_8)); + response.setContentLength((int) length); + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, StrConstant.UTF_8)); //输出流 byte[] bytes = new byte[1024]; OutputStream outputStream = response.getOutputStream(); long count = 0; - while(count < length){ + while (count < length) { int len = inputStream.read(bytes, 0, 1024); - count +=len; + count += len; outputStream.write(bytes, 0, len); } outputStream.flush(); @@ -451,12 +457,28 @@ public class AgencyController { /** * Desc: 查询工作人员所属组织下的所有社区 + * * @param tokenDto * @author zxc * @date 2022/3/21 15:13 */ @PostMapping("community-list") - public Result> getCommunityList(@LoginUser TokenDto tokenDto){ + public Result> getCommunityList(@LoginUser TokenDto tokenDto) { return new Result>().ok(agencyService.getCommunityList(tokenDto)); } + + /** + * 通讯录树状结构 + * + * @param name + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author LZN + * @date 2022/5/16 10:42 + */ + @GetMapping("/orgtree/{name}/{customerId}") + public Result> getAddressTree(@PathVariable String name, @PathVariable String customerId) { + List dto = agencyService.getAddressTree(name, customerId); + return new Result>().ok(dto); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index e097d3b38d..557a987c09 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -313,6 +313,20 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.staffPermissionExt(tokenDto.getUserId())); } + /** + * @describe: 通过用户所属的行政组织和行政类型,查询下级的组织树 + * @author wangtong + * @date 2022/5/18 16:50 + * @params [formDto] + * @return com.epmet.commons.tools.utils.Result> + */ + @GetMapping("getOrgTreeByUserAndType") + Result> getOrgTreeByUserAndType(@LoginUser TokenDto tokenDTO,OrgTreeByUserAndTypeFormDTO formDto){ + ValidatorUtils.validateEntity(formDto); + formDto.setCustomerId(tokenDTO.getCustomerId()); + return customerAgencyService.getOrgTreeByUserAndType(formDto); + } + /** * @Description 根据组织或网格或吧部门获取组织信息 * @Param formDTO @@ -415,4 +429,25 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.rootAgencyGridTree(formDTO.getAgencyId())); } + /** + * 当前agencyId的下一级组织+直属网格 + * @param agencyId + * @return + */ + @GetMapping("subOrgList/{agencyId}") + public Result> subOrgList(@PathVariable("agencyId") String agencyId) { + List list = customerAgencyService.subOrgList(agencyId); + return new Result>().ok(list); + } + + /** + * @Author sun + * @Description 获取当前组织及下级无效组织、网格Id列表 + **/ + @PostMapping("getDelAgencyGridIdList/{agencyId}") + public Result getDelAgencyGridIdList(@PathVariable("agencyId") String agencyId) { + return new Result().ok(customerAgencyService.getDelAgencyGridIdList(agencyId)); + } + + } 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 8e6ad94ea2..bb960749f5 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 @@ -30,19 +30,28 @@ import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.IcHouseFormDTO; +import com.epmet.commons.tools.enums.HouseQrcodeEnum; 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.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.HouseQRcodeUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.poi.excel.handler.ExcelFillRowMergeStrategy; import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constants.ImportTaskConstants; +import com.epmet.dao.IcHouseDao; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.entity.CustomerOrgParameterEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.HouseService; @@ -58,9 +67,12 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.imageio.ImageIO; +import javax.imageio.stream.ImageOutputStream; import javax.servlet.http.HttpServletResponse; -import java.io.InputStream; -import java.io.PrintWriter; +import java.awt.image.BufferedImage; +import java.io.*; +import java.net.URLEncoder; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -87,9 +99,15 @@ public class HouseController implements ResultDataResolver { @Autowired private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + + @Autowired + private IcHouseDao icHouseDao; + @PostMapping("houselist") @MaskResponse(fieldNames = {"ownerIdCard", "ownerPhone"}, - fieldsMaskType = { MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE }) + fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE}) public Result> houseList(@LoginUser TokenDto loginUser, @RequestBody IcHouseListFormDTO formDTO) { //效验数据 LoginUserDetailsResultDTO loginUserDetail = getLoginUserDetailsResultDTO(loginUser, "【查询房屋】查询当前staff所在组织信息失败"); @@ -146,7 +164,7 @@ public class HouseController implements ResultDataResolver { @NoRepeatSubmit @PostMapping("houseadd") - public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseAddFormDTO formDTO) { + public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseAddFormDTO formDTO) throws Exception { //效验数据 ValidatorUtils.validateEntity(formDTO, IcHouseAddFormDTO.AddShowGroup.class); String customerId = tokenDTO.getCustomerId(); @@ -288,6 +306,12 @@ public class HouseController implements ResultDataResolver { return new Result().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(), houseId)); } + @PostMapping("getHouseInfoCache") + public Result getHouseInfoCache(@RequestBody IcHouseFormDTO houseInfo) { + HouseInfoDTO house = houseService.getHouseInfoDTO(houseInfo.getCustomerId(), houseInfo.getHouseId()); + return new Result().ok(ConvertUtils.sourceToTarget(house, HouseInfoCache.class)); + } + /** * @Author sun * @Description 【人房】房屋总数饼图 @@ -312,12 +336,13 @@ public class HouseController implements ResultDataResolver { /** * Desc: 根据类型更新排序 + * * @param formDTO * @author zxc * @date 2022/5/6 08:50 */ @PostMapping("update-sort") - public Result updateSort(@RequestBody UpdateSortFormDTO formDTO){ + public Result updateSort(@RequestBody UpdateSortFormDTO formDTO) { houseService.updateSort(formDTO); return new Result(); } @@ -339,7 +364,7 @@ public class HouseController implements ResultDataResolver { formDTO.setIsPage(false); formDTO.setPageSize(NumConstant.TEN_THOUSAND); //效验数据 - if (StringUtils.isBlank(formDTO.getAgencyId())){ + if (StringUtils.isBlank(formDTO.getAgencyId())) { LoginUserDetailsResultDTO loginUserDetail = getLoginUserDetailsResultDTO(tokenDto, "【查询房屋】查询当前staff所在组织信息失败"); formDTO.setAgencyId(loginUserDetail.getAgencyId()); } @@ -359,34 +384,34 @@ public class HouseController implements ResultDataResolver { .registerWriteHandler(horizontalCellStyleStrategy) .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) .build(); - int[] mergeRowArr = new int[]{0,1,2,3,4,5,6,7,8,9,10,11,12}; + int[] mergeRowArr = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; //冻结表头 2行 FreezeAndFilter writeHandler = new FreezeAndFilter(); writeHandler.rowSplit = 2; //ExcelFillCellMergeStrategy mergeStrategy = new ExcelFillCellMergeStrategy(2,mergeRowArr,false); - ExcelFillRowMergeStrategy mergeStrategy2 = new ExcelFillRowMergeStrategy(mergeRowArr,false); + ExcelFillRowMergeStrategy mergeStrategy2 = new ExcelFillRowMergeStrategy(mergeRowArr, false); WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1") .head(HouseMemberResultDTO.class) .registerWriteHandler(mergeStrategy2) .registerWriteHandler(writeHandler) .build(); PageData dataList = null; - Cache haveSearchCache = CacheBuilder.newBuilder().maximumSize(NumConstant.ONE_HUNDRED).expireAfterWrite(NumConstant.THIRTY, TimeUnit.MINUTES).build(); + Cache haveSearchCache = CacheBuilder.newBuilder().maximumSize(NumConstant.ONE_HUNDRED).expireAfterWrite(NumConstant.THIRTY, TimeUnit.MINUTES).build(); do { - dataList = houseService.getHouseUser(tokenDto,formDTO,haveSearchCache); + dataList = houseService.getHouseUser(tokenDto, formDTO, haveSearchCache); formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); long start = System.currentTimeMillis(); //设置合并策略中的 本次数据的总条数 - mergeStrategy2.setSecTotalCount(dataList.getList().size()+1); + mergeStrategy2.setSecTotalCount(dataList.getList().size() + 1); excelWriter.write(dataList.getList(), writeSheet); - log.info("getHouseUser doWrite cost:{}ms",System.currentTimeMillis() - start); - if (CollectionUtils.isEmpty(dataList.getList())){ + log.info("getHouseUser doWrite cost:{}ms", System.currentTimeMillis() - start); + if (CollectionUtils.isEmpty(dataList.getList())) { break; } - }while (dataList.getTotal() == formDTO.getPageSize()); + } while (dataList.getTotal() == formDTO.getPageSize()); //获取导出配置 haveSearchCache.invalidateAll(); @@ -395,15 +420,137 @@ public class HouseController implements ResultDataResolver { response.setCharacterEncoding("UTF-8"); response.setHeader("content-type", "application/json; charset=UTF-8"); PrintWriter printWriter = response.getWriter(); - Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); printWriter.write(JSON.toJSONString(result)); printWriter.close(); } finally { - if (excelWriter != null){ + if (excelWriter != null) { excelWriter.finish(); } - log.info("getHouseUser final cost:{}ms",System.currentTimeMillis() - startTime); + log.info("getHouseUser final cost:{}ms", System.currentTimeMillis() - startTime); } } + /** + * @return void + * @describe: 下载房屋一户一码 + * @author wangtong + * @date 2022/6/1 17:24 + * @params [formDTO, response] + */ + @PostMapping("createHouseQrcode") + public void createQrCode(@RequestBody HouseQrcodeFormDTO formDTO, HttpServletResponse response) { + ValidatorUtils.validateEntity(formDTO); + try { + IcHouseListResultDTO house = icHouseDao.selectHouseQrcodeById(formDTO.getId()); + if (null == house) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到房屋信息", "未查到房屋信息"); + } + //url组成:小程序地址?房屋编码 + CustomerOrgParameterEntity codePre = icHouseDao.selectByCustomerId(house.getCustomerId(), HouseQrcodeEnum.PREFIX_KEY.getCode()); + if(null == codePre){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "请先维护二维码前缀信息", "请先维护二维码前缀信息"); + } + String url = codePre.getParameterValue() + house.getHouseCode(); + BufferedImage image = HouseQRcodeUtils.drawHouseQRImage(house.getBuildingName() + house.getUnitNum() + house.getDoorName(), url); + //BufferedImage 转 InputStream + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream); + ImageIO.write(image, "png", imageOutput); + InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); + long length = imageOutput.length(); + String fileName = house.getBuildingName() + house.getUnitNum() + house.getDoorName() + ".png"; + response.setContentType("application/octet-stream"); + response.setContentLength((int) length); + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, StrConstant.UTF_8)); + + //输出流 + byte[] bytes = new byte[1024]; + OutputStream outputStream = response.getOutputStream(); + long count = 0; + while (count < length) { + int len = inputStream.read(bytes, 0, 1024); + count += len; + outputStream.write(bytes, 0, len); + } + outputStream.flush(); + } catch (Exception e) { + log.error("method exception", e); + } + } + + /** + * @return void + * @describe: 批量下载一户一档的二维码 + * @author wangtong + * @date 2022/5/31 17:58 + * @params [loginUser, formDTO, response] + */ + @NoRepeatSubmit + @PostMapping(value = "/downloadZip") + public void downloadZip(@LoginUser TokenDto loginUser, @RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception { + //效验数据 + LoginUserDetailsResultDTO loginUserDetail = getLoginUserDetailsResultDTO(loginUser, "【查询房屋】查询当前staff所在组织信息失败"); + formDTO.setAgencyId(loginUserDetail.getAgencyId()); + formDTO.setCustomerId(loginUser.getCustomerId()); + ValidatorUtils.validateEntity(formDTO); + houseService.downloadZip(response, formDTO); + } + + /** + * @return com.epmet.dto.result.IcHouseInfoResultDTO + * @describe: 根据房屋编码获取信息 + * @author wangtong + * @date 2022/6/1 18:24 + * @params [formDTO] + */ + @PostMapping("getHouseInfoByCode") + public Result getHouseInfoByCode(@LoginUser TokenDto loginUser, @RequestBody IcHouseInfoFormDTO formDTO) { + //效验数据 + ValidatorUtils.validateEntity(formDTO); + formDTO.setCustomerId(loginUser.getCustomerId()); + return houseService.getHouseInfoByCode(formDTO); + + } + + /** + * @describe: 批量生成房屋的房屋编码和一户一档二维码 + * @author wangtong + * @date 2022/6/6 14:39 + * @params [] + * @return java.lang.String + */ + @NoRepeatSubmit + @PostMapping("createBatchHouseCodeAndUrl") + public Result createBatchHouseCodeAndUrl(@LoginUser TokenDto loginUser) { + return houseService.createBatchHouseCodeAndUrl(loginUser); + + } + + /** + * @describe: 测试生成Service接口-生成房屋编码 + * @author wangtong + * @date 2022/6/6 14:39 + * @params [formDTO] + * @return java.lang.String + */ + @PostMapping("createHouseCode") + public String createHouseCode(@RequestBody TestFormDTO formDTO) { + //效验数据 + return houseService.createHouseCode(formDTO.getCustomerId(), formDTO.getBuildingId(), formDTO.getAreaCode()); + + } + + /** + * @describe: 测试生成Service接口-生成房屋一户一档二维码 + * @author wangtong + * @date 2022/6/6 14:40 + * @params [formDTO] + * @return java.lang.String + */ + @PostMapping("createHouseQrcodeUrl") + public String createHouseQrcodeUrl(@RequestBody TestFormDTO formDTO) throws Exception { + return houseService.createHouseQrcodeUrl(formDTO.getHouseId(),null); + + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseCodeInfoController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseCodeInfoController.java new file mode 100644 index 0000000000..c063dd3256 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseCodeInfoController.java @@ -0,0 +1,82 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +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.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcHouseCodeInfoDTO; +import com.epmet.excel.IcHouseCodeInfoExcel; +import com.epmet.service.IcHouseCodeInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@RestController +@RequestMapping("icHouseCodeInfo") +public class IcHouseCodeInfoController { + + @Autowired + private IcHouseCodeInfoService icHouseCodeInfoService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icHouseCodeInfoService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcHouseCodeInfoDTO data = icHouseCodeInfoService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcHouseCodeInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icHouseCodeInfoService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcHouseCodeInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icHouseCodeInfoService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icHouseCodeInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icHouseCodeInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcHouseCodeInfoExcel.class); + } + + + +} 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 edbdde8625..e6f1522353 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 @@ -90,4 +90,8 @@ public class IcHouseController { return new Result>().ok(icHouseService.getHousesNameByIdCards(idCards)); } + @GetMapping("getbyhousecode/{houseCode}") + public Result getByHouseCode(@PathVariable("houseCode") String houseCode){ + return new Result().ok(icHouseService.getByHouseCode(houseCode)); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 5e7cd8713a..a63c7e0ff7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.OrgTreeByUserAndTypeFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; @@ -295,26 +296,53 @@ public interface CustomerAgencyDao extends BaseDao { /** * desc:获取组织和网格的数据 树形sql + * * @param agencyId * @return */ ExtStaffPermissionResultDTO selectAgencyAndGridById(@Param("agencyId") String agencyId); + /** * @Description 【事件】社区服务热线 * @author sun **/ OrgMobileResultDTO getAgencyMobile(@Param("gridId") String gridId); - int updateSubAgencyAreaCodeById(@Param("customerId")String customerId, @Param("agencyId")String agencyId, @Param("operateUserId") String operateUserId); + int updateSubAgencyAreaCodeById(@Param("customerId") String customerId, @Param("agencyId") String agencyId, @Param("operateUserId") String operateUserId); /** * Desc: 查询组织下的社区 + * * @param customerId * @param agencyId * @author zxc * @date 2022/3/21 15:23 */ - List getCommunityList(@Param("customerId")String customerId, @Param("agencyId")String agencyId); + List getCommunityList(@Param("customerId") String customerId, @Param("agencyId") String agencyId); + + List selectSubOrg(String agencyId); + + /** + * @return java.util.List + * @describe: 通过用户所属的行政组织和行政类型,查询下级的组织树 + * @author wangtong + * @date 2022/5/18 17:23 + * @params [formDto] + */ + List getOrgTreeByUserAndType(OrgTreeByUserAndTypeFormDTO formDto); + + /** + * 通讯录树 + * + * @param name + * @param customerId + * @return java.util.List + * @author LZN + * @date 2022/5/16 10:44 + */ + List getAddressTree(@Param("name") String name, + @Param("customerId") String customerId); + List getDelAgencyIdList(@Param("agencyId") String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index 3de988ec2c..737e579fa5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -382,4 +382,6 @@ public interface CustomerGridDao extends BaseDao { * @return */ int updateTotalUser(@Param("gridId") String gridId, @Param("incrCount") long incrCount); + + List getDelGridIdList(@Param("agencyId") String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java index 69465df911..147f25f7d2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java @@ -20,6 +20,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.IcBuildingUnitEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 楼栋单元信息 @@ -29,5 +32,22 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcBuildingUnitDao extends BaseDao { - + + /** + * Desc: 根据楼栋ID获取单元IDs + * @param buildingId + * @param size + * @author zxc + * @date 2022/5/31 15:46 + */ + List getUnitIdByBuildingId(@Param("buildingId")String buildingId,@Param("size")Integer size); + + /** + * Desc: 删除单元 + * @param ids + * @author zxc + * @date 2022/5/31 16:04 + */ + void delUnit(@Param("ids")List ids); + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseCodeInfoDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseCodeInfoDao.java new file mode 100644 index 0000000000..fd67785cb4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseCodeInfoDao.java @@ -0,0 +1,43 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcHouseCodeInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Mapper +public interface IcHouseCodeInfoDao extends BaseDao { + + /** + * @describe: 通过客户id和楼栋id查询 + * @author wangtong + * @date 2022/6/1 17:01 + * @params [customerId, buildingId] + * @return com.epmet.entity.IcHouseCodeInfoEntity + */ + IcHouseCodeInfoEntity selectByCuIdAndBuilId(@Param("customerId") String customerId,@Param("buildingId") String buildingId); + + /** + * @describe: 查询数据库里最大的楼栋编号 + * @author wangtong + * @date 2022/6/1 17:15 + * @params [] + * @return com.epmet.entity.IcHouseCodeInfoEntity + */ + IcHouseCodeInfoEntity selectMaxHouseMaxNum(); + + /** + * @describe: 根据客户id和楼栋id更新房屋最大编码 + * @author wangtong + * @date 2022/6/2 9:37 + * @params [codeEntity] + * @return void + */ + void updateByCuIdAndBuId(IcHouseCodeInfoEntity codeEntity); +} 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 e1cb4de562..0b6bdcfd93 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 @@ -4,6 +4,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.form.IcHouseListFormDTO; import com.epmet.dto.result.*; +import com.epmet.entity.CustomerOrgParameterEntity; import com.epmet.entity.IcHouseEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -27,45 +28,49 @@ public interface IcHouseDao extends BaseDao { HouseInfoDTO queryHouseInfoByHouseId(@Param("houseId") String houseId); /** - * @Description 查询房屋信息 * @param idCard + * @Description 查询房屋信息 * @author zxc * @date 2021/11/3 3:30 下午 */ - List selectHouseInfoByIdCard(@Param("idCard") String idCard,@Param("customerId")String customerId); + List selectHouseInfoByIdCard(@Param("idCard") String idCard, @Param("customerId") String customerId); Integer checkDoorNameUq(@Param("neighborHoodId") String neighborHoodId, - @Param("buildingId")String buildingId, - @Param("buildingUnitId")String buildingUnitId, - @Param("doorName")String doorName, - @Param("houseId")String houseId); + @Param("buildingId") String buildingId, + @Param("buildingUnitId") String buildingUnitId, + @Param("doorName") String doorName, + @Param("houseId") String houseId); /** * Desc: 根据小区IDs查询小区下是否有存在楼栋的 + * * @param ids * @author zxc * @date 2022/3/2 9:51 上午 */ - List selectExistBuildingByNeighborHoodIds(@Param("ids")List ids); + List selectExistBuildingByNeighborHoodIds(@Param("ids") List ids); /** * Desc: 根据楼栋IDs查询楼栋下是否有存在房屋的 + * * @param ids * @author zxc * @date 2022/3/2 9:53 上午 */ - List selectExistHouseByBuildingIds(@Param("ids")List ids); + List selectExistHouseByBuildingIds(@Param("ids") List ids); /** * Desc: 根据房屋ID查询名字 + * * @param ids * @author zxc * @date 2022/3/2 11:00 上午 */ - List selectHouseNames(@Param("ids")List ids); + List selectHouseNames(@Param("ids") List ids); /** * Desc: 批量更新房屋信息 + * * @param houses * @author zxc * @date 2022/3/25 10:22 @@ -74,6 +79,7 @@ public interface IcHouseDao extends BaseDao { /** * Desc: 根据身份证查询房屋名 + * * @param idCards * @author zxc * @date 2022/4/12 16:42 @@ -82,11 +88,12 @@ public interface IcHouseDao extends BaseDao { /** * Desc: 根据楼栋ID修改房屋名 + * * @param buildingId * @author zxc * @date 2022/4/26 13:49 */ - void houseUpdateHouseName(@Param("buildingId")String buildingId); + void houseUpdateHouseName(@Param("buildingId") String buildingId); /** * @Author sun @@ -96,10 +103,55 @@ public interface IcHouseDao extends BaseDao { /** * Desc: 根据房屋ID获取房屋信息 + * * @param houseId * @author zxc * @date 2022/5/10 09:23 */ HouseAgencyInfoResultDTO getHouseAgencyInfo(@Param("houseId") String houseId); + /** + * Desc: 获取单元下的房屋数 + * + * @param unitIds + * @author zxc + * @date 2022/5/31 15:53 + */ + Integer getHouseCountByUnitIds(@Param("unitIds") List unitIds); + + /** + * @return com.epmet.dto.result.IcHouseListResultDTO + * @describe: 通过id查询房屋信息 + * @author wangtong + * @date 2022/6/1 13:56 + * @params [id] + */ + IcHouseListResultDTO selectHouseQrcodeById(@Param("id") String id); + + /** + * @return com.epmet.entity.IcHouseEntity + * @describe: 通过房屋编码获取信息 + * @author wangtong + * @date 2022/6/1 18:29 + * @params [houseCode] + */ + IcHouseEntity selectByHouseCode(@Param("houseCode") String houseCode); + + /** + * @return java.util.List + * @describe: 查询需要补充房屋编码和URL的房屋信息 + * @author wangtong + * @date 2022/6/6 15:09 + * @params [] + */ + List selectBatchHouseCodeAndUrl(@Param("customerId") String customerId); + + /** + * @describe: 通过客户id查询 + * @author wangtong + * @date 2022/6/7 18:36 + * @params [customerId] + * @return com.epmet.dto.result.IcHouseQrcodeConfigDTO + */ + CustomerOrgParameterEntity selectByCustomerId(@Param("customerId") String customerId, @Param("preKey") String preKey); } 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 d835e2e65d..ca929081cc 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 @@ -89,4 +89,6 @@ public interface IcNeighborHoodDao extends BaseDao { void delProperty(@Param("neighborHoodIds")List neighborHoodIds); void updateOneNeighborHood(ImportGeneralDTO info); + + String getAreaCode(@Param("neighborHoodId")String neighborHoodId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseCodeInfoEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseCodeInfoEntity.java new file mode 100644 index 0000000000..73fd19862c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseCodeInfoEntity.java @@ -0,0 +1,40 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_house_code_info") +public class IcHouseCodeInfoEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 最大的楼栋编码序列号 + */ + private String buildingMaxNum; + + /** + * 该楼栋下最大的房屋编码序列号 + */ + private String houseMaxNum; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java index 362740e9c2..5940608292 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java @@ -107,4 +107,14 @@ public class IcHouseEntity extends BaseEpmetEntity { */ private BigDecimal sort; + /** + * 备注 + */ + private String remark; + + /** + * 房屋编码 + */ + private String houseCode; + private String houseQrcodeUrl; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseCodeInfoExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseCodeInfoExcel.java new file mode 100644 index 0000000000..8e7d11bbed --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseCodeInfoExcel.java @@ -0,0 +1,30 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class IcHouseCodeInfoExcel { + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "所属楼栋id") + private String buildingId; + + @Excel(name = "最大的楼栋编码序列号") + private Integer buildingMaxNum; + + @Excel(name = "该楼栋下最大的房屋编码序列号") + private Integer houseMaxNum; + + +} \ No newline at end of file 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 94de07dbbc..e567bf017d 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 @@ -188,7 +188,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener baseInfoFamilyBuilding(BaseInfoFamilyBuildingFormDTO formDTO); /** - * @Description 查询下级agencyId * @param orgId + * @Description 查询下级agencyId * @author zxc * @date 2021/12/9 4:42 下午 */ - List getSonAgencyId(String orgId,String type); + List getSonAgencyId(String orgId, String type); /** * Desc: 查询工作人员所属组织下的所有社区 + * * @param tokenDto * @author zxc * @date 2022/3/21 15:13 */ List getCommunityList(TokenDto tokenDto); + /** + * 通讯录树状结构 + * + * @param name + * @param customerId + * @return java.util.List + * @author LZN + * @date 2022/5/16 10:43 + */ + List getAddressTree(String name, String customerId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 855fae6038..f3ac3c7212 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -288,4 +288,26 @@ public interface CustomerAgencyService extends BaseService * @author sun **/ AgencyTreeResultDTO rootAgencyGridTree(String agencyId); + + /** + * 当前agencyId的下一级组织+直属网格 + * @param agencyId + * @return + */ + List subOrgList(String agencyId); + + /** + * @describe: 通过用户所属的行政组织和行政类型,查询下级的组织树 + * @author wangtong + * @date 2022/5/18 16:53 + * @params [formDto] + * @return com.epmet.commons.tools.utils.Result> + */ + Result> getOrgTreeByUserAndType(OrgTreeByUserAndTypeFormDTO formDto); + + /** + * @Author sun + * @Description 获取当前组织及下级无效组织、网格Id列表 + **/ + DelAgencyGridIdResultDTO getDelAgencyGridIdList(String agencyId); } 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 e60bfb50ae..701f164790 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 @@ -117,4 +117,50 @@ public interface HouseService { * @return */ PageData getHouseUser(TokenDto tokenDto, IcHouseListFormDTO formDTO, Cache haveSearchCache); + + /** + * @describe: 批量下载一户一档的二维码 + * @author wangtong + * @date 2022/5/31 18:00 + * @params [formDTO] + * @return void + */ + void downloadZip(HttpServletResponse response,IcHouseListFormDTO formDTO) throws Exception; + + /** + * @describe: 生成自增的房屋编码,编码规则: + * 国家统计局社区区划代码(370211010042)12位数字+楼栋序列码(5位数字自增)+房屋码(5位数字自增) + * @author wangtong + * @date 2022/6/1 16:58 + * @params [customerId-客户id, buildingId-楼栋id, areaCode-区划代码] + * @return java.lang.String + */ + String createHouseCode(String customerId,String buildingId,String areaCode); + + /** + * @describe: 生成一户一码的二维码地址 + * @author wangtong + * @date 2022/6/1 17:41 + * @params [houseId] + * @return java.lang.String + */ + String createHouseQrcodeUrl(String houseId,String houseCode) throws Exception; + + /** + * @describe: 根据房屋编码获取信息 + * @author wangtong + * @date 2022/6/1 18:24 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result + */ + Result getHouseInfoByCode(IcHouseInfoFormDTO formDTO); + + /** + * @describe: 批量生成房屋的房屋编码和一户一档二维码 + * @author wangtong + * @date 2022/6/6 14:44 + * @params [] + * @return com.epmet.commons.tools.utils.Result + */ + Result createBatchHouseCodeAndUrl(TokenDto loginUser); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseCodeInfoService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseCodeInfoService.java new file mode 100644 index 0000000000..2b424e9fbe --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseCodeInfoService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcHouseCodeInfoDTO; +import com.epmet.entity.IcHouseCodeInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +public interface IcHouseCodeInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-01 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-01 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcHouseCodeInfoDTO + * @author generator + * @date 2022-06-01 + */ + IcHouseCodeInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-01 + */ + void save(IcHouseCodeInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-01 + */ + void update(IcHouseCodeInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-01 + */ + void delete(String[] ids); +} \ 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 bd82a396c1..161aad6c4e 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 @@ -92,12 +92,12 @@ public interface IcHouseService extends BaseService { List getHouseOption(HouseFormDTO formDTO); /** - * @Description 查询房屋信息 * @param idCard + * @Description 查询房屋信息 * @author zxc * @date 2021/11/3 3:30 下午 */ - List selectHouseInfoByIdCard(String idCard,String customerId); + List selectHouseInfoByIdCard(String idCard, String customerId); /** * @Description 楼栋下房屋列表 @@ -111,6 +111,7 @@ public interface IcHouseService extends BaseService { /** * Desc: 批量更新房屋信息 + * * @param houses * @author zxc * @date 2022/3/25 10:22 @@ -119,10 +120,20 @@ public interface IcHouseService extends BaseService { /** * Desc: 根据身份证查询房屋名 + * * @param idCards * @author zxc * @date 2022/4/12 16:42 */ List getHousesNameByIdCards(List idCards); + /** + * 根据房屋编码查询房屋信息 + * + * @param houseCode + * @return com.epmet.dto.IcHouseDTO + * @author work@yujt.net.cn + * @date 2022/6/1/0001 16:21 + */ + IcHouseDTO getByHouseCode(String houseCode); } \ No newline at end of file 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 c07985347c..4b11db9a40 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 @@ -33,6 +33,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.NodeTreeUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerAgencyConstant; import com.epmet.constant.OrgInfoConstant; @@ -156,15 +157,18 @@ public class AgencyServiceImpl implements AgencyService { Result result = new Result(); CustomerAgencyEntity originalEntity = customerAgencyDao.selectById(formDTO.getAgencyId()); //当前客户下,同级组织中,组织名称不允许重复 - customerAgencyService.checkAgencyName(formDTO.getAgencyName(),originalEntity.getCustomerId(),originalEntity.getId(),originalEntity.getPid()); + customerAgencyService.checkAgencyName(formDTO.getAgencyName(), originalEntity.getCustomerId(), originalEntity.getId(), originalEntity.getPid()); originalEntity.setOrganizationName(formDTO.getAgencyName()); originalEntity.setCode(formDTO.getCode()); originalEntity.setContacts(formDTO.getContacts()); originalEntity.setMobile(formDTO.getMobile()); - if(StringUtils.isNotBlank(formDTO.getLatitude())){ + //利用mybatis 拦截器填充值 + originalEntity.setUpdatedTime(null); + originalEntity.setUpdatedBy(null); + if (StringUtils.isNotBlank(formDTO.getLatitude())) { originalEntity.setLatitude(formDTO.getLatitude()); } - if(StringUtils.isNotBlank(formDTO.getLongitude())){ + if (StringUtils.isNotBlank(formDTO.getLongitude())) { originalEntity.setLongitude(formDTO.getLongitude()); } originalEntity.setCenterAddress(formDTO.getCenterAddress()); @@ -207,20 +211,20 @@ public class AgencyServiceImpl implements AgencyService { } //3:循环组织列表,查询每一个组织的所有上级组织重新拼接所有上级名称(allParentName)字段值 List editList = new ArrayList<>(); - agencyList.forEach(agency->{ + agencyList.forEach(agency -> { //3-1:查询当前组织的所有上级组织 List listStr = Arrays.asList(agency.getPids().split(":")); List parentList = customerAgencyDao.selectPAgencyById(listStr); //3-2:重新拼接当前组织的所有上级名称字段值,将组织Id和拼好的值存入集合 StringBuffer allParentName = new StringBuffer(); - parentList.forEach(parents->{ - if(StringUtils.isBlank(allParentName)){ + parentList.forEach(parents -> { + if (StringUtils.isBlank(allParentName)) { allParentName.append(parents.getName()); - }else { + } else { allParentName.append("-").append(parents.getName()); } }); - CustomerAgencyEntity customerAgencyEntity = ConvertUtils.sourceToTarget(agency,CustomerAgencyEntity.class); + CustomerAgencyEntity customerAgencyEntity = ConvertUtils.sourceToTarget(agency, CustomerAgencyEntity.class); customerAgencyEntity.setAllParentName(allParentName.toString()); customerAgencyEntity.setUpdatedBy(formDTO.getUserId()); editList.add(customerAgencyEntity); @@ -240,11 +244,12 @@ public class AgencyServiceImpl implements AgencyService { /** * 所有下家组织、网格、部门的area_code,parent_area_code置为空 * 直属组织parent_area_code、直属网格+直属部门的area_code更新为最新值 + * * @param customerId * @param formDTO * @param originalAreaCode */ - private void updateSubOrg(String customerId, EditAgencyFormDTO formDTO,String originalAreaCode) { + private void updateSubOrg(String customerId, EditAgencyFormDTO formDTO, String originalAreaCode) { //如果原来这个组织有area_code再去更新,没有其实应该按照pids去更新。 customerAgencyDao.updateSubAgencyAreaCodeById(customerId, formDTO.getAgencyId(), formDTO.getUserId()); //网格的 @@ -254,40 +259,39 @@ public class AgencyServiceImpl implements AgencyService { //1、更新直属网格的areaCode LambdaUpdateWrapper updateGridWrapper = new LambdaUpdateWrapper<>(); - updateGridWrapper.eq(CustomerGridEntity::getPid,formDTO.getAgencyId()) + updateGridWrapper.eq(CustomerGridEntity::getPid, formDTO.getAgencyId()) .set(CustomerGridEntity::getAreaCode, formDTO.getAreaCode()) - .set(CustomerGridEntity::getUpdatedBy,formDTO.getUserId()) - .set(CustomerGridEntity::getUpdatedTime,new Date()); - int subGridRows=customerGridDao.update(null,updateGridWrapper); - log.info(String.format("更新了%s个直属网格的area_code",subGridRows)); + .set(CustomerGridEntity::getUpdatedBy, formDTO.getUserId()) + .set(CustomerGridEntity::getUpdatedTime, new Date()); + int subGridRows = customerGridDao.update(null, updateGridWrapper); + log.info(String.format("更新了%s个直属网格的area_code", subGridRows)); // 2、更新直属部门的area_code LambdaUpdateWrapper updateDeptWrapper = new LambdaUpdateWrapper<>(); - updateDeptWrapper.eq(CustomerDepartmentEntity::getAgencyId,formDTO.getAgencyId()) + updateDeptWrapper.eq(CustomerDepartmentEntity::getAgencyId, formDTO.getAgencyId()) .set(CustomerDepartmentEntity::getAreaCode, formDTO.getAreaCode()) - .set(CustomerDepartmentEntity::getUpdatedBy,formDTO.getUserId()) - .set(CustomerDepartmentEntity::getUpdatedTime,new Date()); - int gridRows=customerDepartmentDao.update(null,updateDeptWrapper); - log.info(String.format("更新了%s个直属部门的area_code",gridRows)); + .set(CustomerDepartmentEntity::getUpdatedBy, formDTO.getUserId()) + .set(CustomerDepartmentEntity::getUpdatedTime, new Date()); + int gridRows = customerDepartmentDao.update(null, updateDeptWrapper); + log.info(String.format("更新了%s个直属部门的area_code", gridRows)); // 3、更新下级组织的parent_area_code LambdaUpdateWrapper updateAgencyWrapper = new LambdaUpdateWrapper<>(); - updateAgencyWrapper.eq(CustomerAgencyEntity::getPid,formDTO.getAgencyId()) + updateAgencyWrapper.eq(CustomerAgencyEntity::getPid, formDTO.getAgencyId()) .set(CustomerAgencyEntity::getParentAreaCode, formDTO.getAreaCode()) - .set(CustomerAgencyEntity::getUpdatedBy,formDTO.getUserId()) - .set(CustomerAgencyEntity::getUpdatedTime,new Date()); + .set(CustomerAgencyEntity::getUpdatedBy, formDTO.getUserId()) + .set(CustomerAgencyEntity::getUpdatedTime, new Date()); Integer rows = customerAgencyDao.update(null, updateAgencyWrapper); - log.info(String.format("更新了%s个下级组织的parent_area_code",rows)); + log.info(String.format("更新了%s个下级组织的parent_area_code", rows)); } /** - * * @param formDTO 编辑组织入参 - * @param parent 当前编辑组织的上级组织 + * @param parent 当前编辑组织的上级组织 * @return 返回组织区划编码 */ private String getAgencyNewAreaCode(EditAgencyFormDTO formDTO, CustomerAgencyEntity parent) { - String newAreaCode=""; + String newAreaCode = ""; if (!"other".equals(formDTO.getAreaCode())) { //校验除了当前组织外,areaCode是否被使用过 List agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(formDTO.getAreaCode(), formDTO.getAgencyId()); @@ -295,7 +299,7 @@ public class AgencyServiceImpl implements AgencyService { //已经被占用,提示 throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg()); } - newAreaCode=formDTO.getAreaCode(); + newAreaCode = formDTO.getAreaCode(); } else { //如果选择的是other,需要自定义一个编码 AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO(); @@ -310,16 +314,17 @@ public class AgencyServiceImpl implements AgencyService { throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg()); } } - newAreaCode=addAreaCodeResult.getData(); + newAreaCode = addAreaCodeResult.getData(); } return newAreaCode; } /** * 如果当前客户开启了areaCode,校验参数逼单 + * * @param formDTO */ - private void checkEditAgencyFormDTO(EditAgencyFormDTO formDTO,CustomerAgencyEntity originalEntity) { + private void checkEditAgencyFormDTO(EditAgencyFormDTO formDTO, CustomerAgencyEntity originalEntity) { //根组织不允许修改 if (StringUtils.isNotBlank(originalEntity.getPid()) && !NumConstant.ZERO_STR.equals(originalEntity.getPid())) { //03.23:平阴线上版本与产品主线版本差距太大,平阴的修改组织只能修改组织名称。 @@ -364,14 +369,14 @@ public class AgencyServiceImpl implements AgencyService { return result; } //3:组织下有网格,不允许删除 - int gridCount = customerGridDao.selectGridCountByAgencyId(formDTO.getAgencyId()); + int gridCount = customerGridDao.selectGridCountByAgencyId(formDTO.getAgencyId()); if (gridCount > NumConstant.ZERO) { result.setCode(EpmetErrorCode.NOT_DEL_AGENCY_GRID.getCode()); result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY_GRID.getMsg()); return result; } //4:删除当前机关组织(逻辑删) - if (customerAgencyDao.delByAgencyId(formDTO.getAgencyId(),loginUserUtil.getLoginUserId()) < NumConstant.ONE) { + if (customerAgencyDao.delByAgencyId(formDTO.getAgencyId(), loginUserUtil.getLoginUserId()) < NumConstant.ONE) { log.error(CustomerAgencyConstant.DEL_EXCEPTION); throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); } @@ -403,24 +408,24 @@ public class AgencyServiceImpl implements AgencyService { agencysResultDTO.setMobile(entity.getMobile()); agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId())); agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); - agencysResultDTO.setAreaCode(StringUtils.isNotBlank(entity.getAreaCode())?entity.getAreaCode():StrConstant.EPMETY_STR); + agencysResultDTO.setAreaCode(StringUtils.isNotBlank(entity.getAreaCode()) ? entity.getAreaCode() : StrConstant.EPMETY_STR); //查询组织区划的名称 if (null != entity && StringUtils.isNotBlank(entity.getAreaCode())) { switch (entity.getLevel()) { case CustomerAgencyConstant.PROVINCE_LEVEL: - agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getProvince()) ? entity.getProvince():entity.getOrganizationName()); + agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getProvince()) ? entity.getProvince() : entity.getOrganizationName()); break; case CustomerAgencyConstant.CITY_LEVEL: - agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCity()) ? entity.getCity():entity.getOrganizationName()); + agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCity()) ? entity.getCity() : entity.getOrganizationName()); break; case CustomerAgencyConstant.DISTRICT: - agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getDistrict()) ? entity.getDistrict():entity.getOrganizationName()); + agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getDistrict()) ? entity.getDistrict() : entity.getOrganizationName()); break; case CustomerAgencyConstant.STREET_LEVEL: - agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getStreet()) ? entity.getStreet():entity.getOrganizationName()); + agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getStreet()) ? entity.getStreet() : entity.getOrganizationName()); break; case CustomerAgencyConstant.COMMUNITY_LEVEL: - agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCommunity()) ? entity.getCommunity():entity.getOrganizationName()); + agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCommunity()) ? entity.getCommunity() : entity.getOrganizationName()); break; default: agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); @@ -504,7 +509,7 @@ public class AgencyServiceImpl implements AgencyService { } customerAgencyRedis.set(agencyId, agencyInfoCache); } - CustomerAgencyDTO customerAgencyDTO=ConvertUtils.sourceToTarget(agencyInfoCache,CustomerAgencyDTO.class); + CustomerAgencyDTO customerAgencyDTO = ConvertUtils.sourceToTarget(agencyInfoCache, CustomerAgencyDTO.class); return customerAgencyDTO; } @@ -547,7 +552,7 @@ public class AgencyServiceImpl implements AgencyService { @Override public CustomerAgencyDTO getCustomerRootAgency(String customerId) { - CustomerAgencyDTO root=customerAgencyDao.getCustomerRootAgency(customerId); + CustomerAgencyDTO root = customerAgencyDao.getCustomerRootAgency(customerId); if (null != root) { root.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(customerId)); } @@ -652,17 +657,17 @@ public class AgencyServiceImpl implements AgencyService { } AddAgencyResultDTO resultDTO = new AddAgencyResultDTO(); resultDTO.setAreaCodeSwitch(formDTO.getAreaCodeSwitch()); - CustomerAgencyEntity insertEntity=this.constructInsertEntity(formDTO,parent); + CustomerAgencyEntity insertEntity = this.constructInsertEntity(formDTO, parent); //判断areaCodeSwitch:open: 选择地区编码必填;closed: 无需选择地区编码 if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { //校验areaCode是否被使用过 if (!"other".equals(formDTO.getAreaCode())) { - List agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(insertEntity.getAreaCode(),null); + List agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(insertEntity.getAreaCode(), null); if (CollectionUtils.isNotEmpty(agencyIds)) { //已经被占用,提示 throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg()); } - }else{ + } else { //如果选择的是other,需要自定义一个编码 AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO(); addAreaCodeFormDTO.setCurrentAreaLevel(formDTO.getLevel()); @@ -688,19 +693,19 @@ public class AgencyServiceImpl implements AgencyService { } /** - * @Description 【地图配置】删除 * @param formDTO + * @Description 【地图配置】删除 * @author zxc * @date 2021/10/25 9:30 上午 */ @Override public void mapDelArea(MapDelAreaFormDTO formDTO) { - customerAgencyDao.delMapArea(formDTO.getOrgId(),formDTO.getLevel()); + customerAgencyDao.delMapArea(formDTO.getOrgId(), formDTO.getLevel()); } /** - * @Description 【地图配置】新增 * @param formDTO + * @Description 【地图配置】新增 * @author zxc * @date 2021/10/25 9:58 上午 */ @@ -710,14 +715,14 @@ public class AgencyServiceImpl implements AgencyService { } /** + * @param formDTO + * @param tokenDto * @Description 【地图配置】组织查询 * 根据level查询去查询不同的表,类型,组织:agency,网格:grid,小区:neighborHood * 组织类型去查 customer_agency,看本级是不是 community,是,下级组织就是网格,查询customer_grid,不是,继续查customer_agency * 网格类型去查 查询customer_grid,下级去查 ic_neighbor_hood, * 当前组织没有经纬度的话,直接赋值根组织的经纬度, * 下级组织经纬度为空的话,直接赋值上级的经纬度 - * @param formDTO - * @param tokenDto * @author zxc * @date 2021/10/25 10:50 上午 */ @@ -725,38 +730,38 @@ public class AgencyServiceImpl implements AgencyService { public MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO, TokenDto tokenDto) { MapOrgResultDTO result = new MapOrgResultDTO(); LambdaQueryWrapper qw = new LambdaQueryWrapper(); - qw.eq(CustomerAgencyEntity::getPid, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getDelFlag, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getCustomerId,tokenDto.getCustomerId()); + qw.eq(CustomerAgencyEntity::getPid, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getDelFlag, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getCustomerId, tokenDto.getCustomerId()); CustomerAgencyEntity customerAgencyEntity = customerAgencyDao.selectOne(qw); - if (StringUtils.isBlank(formDTO.getOrgId())){ + if (StringUtils.isBlank(formDTO.getOrgId())) { CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); - if (null == staffInfo){ + if (null == staffInfo) { return result; } formDTO.setOrgId(staffInfo.getAgencyId()); formDTO.setLevel(OrgInfoConstant.AGENCY); } - if (StringUtils.isNotBlank(customerAgencyEntity.getLatitude())){ + if (StringUtils.isNotBlank(customerAgencyEntity.getLatitude())) { result.setLatitude(new BigDecimal(customerAgencyEntity.getLatitude())); } - if (StringUtils.isNotBlank(customerAgencyEntity.getLongitude())){ + if (StringUtils.isNotBlank(customerAgencyEntity.getLongitude())) { result.setLongitude(new BigDecimal(customerAgencyEntity.getLongitude())); } - if (formDTO.getLevel().equals(OrgInfoConstant.AGENCY)){ + if (formDTO.getLevel().equals(OrgInfoConstant.AGENCY)) { CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getOrgId()); - result = ConvertUtils.sourceToTarget(entity,MapOrgResultDTO.class); + result = ConvertUtils.sourceToTarget(entity, MapOrgResultDTO.class); result.setName(entity.getOrganizationName()); result.setLevel(formDTO.getLevel()); result.setAgencyLevel(entity.getLevel()); //经纬度 如果本级没有则取根级组织的 根级没有就空着 - if (StringUtils.isNotBlank(entity.getLatitude())){ + if (StringUtils.isNotBlank(entity.getLatitude())) { result.setLatitude(new BigDecimal(entity.getLatitude())); } - if (StringUtils.isNotBlank(entity.getLongitude())){ + if (StringUtils.isNotBlank(entity.getLongitude())) { result.setLongitude(new BigDecimal(entity.getLongitude())); } - if (entity.getLevel().equals(OrgInfoConstant.COMMUNITY)){ + if (entity.getLevel().equals(OrgInfoConstant.COMMUNITY)) { List son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.GRID); - if (CollectionUtils.isNotEmpty(son)){ + if (CollectionUtils.isNotEmpty(son)) { MapOrgResultDTO finalResult = result; son.forEach(s -> { s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? finalResult.getLatitude() : new BigDecimal(s.getLatitudeOrigin())); @@ -764,15 +769,15 @@ public class AgencyServiceImpl implements AgencyService { }); } result.setChildren(CollectionUtils.isEmpty(son) ? new ArrayList<>() : son); - }else { + } else { List dtoList = new ArrayList<>(); List son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.AGENCY); - if (CollectionUtils.isNotEmpty(son)){ + if (CollectionUtils.isNotEmpty(son)) { dtoList.addAll(son); } // 直属网格 List directlySub = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.GRID); - if (CollectionUtils.isNotEmpty(directlySub)){ + if (CollectionUtils.isNotEmpty(directlySub)) { dtoList.addAll(directlySub); } for (MapSonOrgResultDTO d : dtoList) { @@ -781,21 +786,21 @@ public class AgencyServiceImpl implements AgencyService { } result.setChildren(dtoList); } - }else if (formDTO.getLevel().equals(OrgInfoConstant.GRID)){ + } else if (formDTO.getLevel().equals(OrgInfoConstant.GRID)) { CustomerGridEntity entity = customerGridDao.selectById(formDTO.getOrgId()); - result = ConvertUtils.sourceToTarget(entity,MapOrgResultDTO.class); + result = ConvertUtils.sourceToTarget(entity, MapOrgResultDTO.class); result.setName(entity.getGridName()); result.setLevel(formDTO.getLevel()); result.setAgencyLevel(OrgInfoConstant.GRID); //经纬度 如果本级没有则取根级组织的 根级没有就空着 - if (StringUtils.isNotBlank(entity.getLatitude())){ + if (StringUtils.isNotBlank(entity.getLatitude())) { result.setLatitude(new BigDecimal(entity.getLatitude())); } - if (StringUtils.isNotBlank(entity.getLongitude())){ + if (StringUtils.isNotBlank(entity.getLongitude())) { result.setLongitude(new BigDecimal(entity.getLongitude())); } List son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.NEIGHBOR_HOOD); - if (CollectionUtils.isNotEmpty(son)){ + if (CollectionUtils.isNotEmpty(son)) { for (MapSonOrgResultDTO s : son) { s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? result.getLatitude() : new BigDecimal(s.getLatitudeOrigin())); s.setLongitude(StringUtils.isBlank(s.getLongitudeOrigin()) ? result.getLongitude() : new BigDecimal(s.getLongitudeOrigin())); @@ -807,35 +812,35 @@ public class AgencyServiceImpl implements AgencyService { } /** - * @Description 查询楼栋信息 * @param formDTO + * @Description 查询楼栋信息 * @author zxc * @date 2021/11/2 9:18 上午 */ @Override public List baseInfoFamilyBuilding(BaseInfoFamilyBuildingFormDTO formDTO) { List result = icBuildingDao.baseInfoFamilyBuilding(formDTO.getNeighborHoodId()); - if (CollectionUtils.isEmpty(result)){ + if (CollectionUtils.isEmpty(result)) { return new ArrayList<>(); } return result; } /** - * @Description 查询下级agencyId * @param orgId + * @Description 查询下级agencyId * @author zxc * @date 2021/12/9 4:42 下午 */ @Override - public List getSonAgencyId(String orgId,String type) { + public List getSonAgencyId(String orgId, String type) { List result = new ArrayList<>(); - if (type.equals("community")){ + if (type.equals("community")) { result = customerAgencyDao.getSonGridId(orgId); - }else { + } else { result = customerAgencyDao.getSonAgencyId(orgId); } - if (CollectionUtils.isNotEmpty(result)){ + if (CollectionUtils.isNotEmpty(result)) { return result; } return new ArrayList<>(); @@ -843,6 +848,7 @@ public class AgencyServiceImpl implements AgencyService { /** * Desc: 查询工作人员所属组织下的所有社区 + * * @param tokenDto * @author zxc * @date 2022/3/21 15:13 @@ -850,20 +856,35 @@ public class AgencyServiceImpl implements AgencyService { @Override public List getCommunityList(TokenDto tokenDto) { CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); - if (null == staffInfo){ - throw new EpmetException("未查询到工作人员信息"+staffInfo.getStaffId()); + if (null == staffInfo) { + throw new EpmetException("未查询到工作人员信息" + staffInfo.getStaffId()); } String agencyId = staffInfo.getAgencyId(); AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId); - if (null == agencyInfo){ - throw new EpmetException("查询组织信息失败"+agencyInfo); + if (null == agencyInfo) { + throw new EpmetException("查询组织信息失败" + agencyInfo); } - if (agencyInfo.getLevel().equals(CustomerAgencyConstant.COMMUNITY_LEVEL)){ + if (agencyInfo.getLevel().equals(CustomerAgencyConstant.COMMUNITY_LEVEL)) { return new ArrayList<>(); } return customerAgencyDao.getCommunityList(tokenDto.getCustomerId(), agencyId); } + /** + * 通讯录树 + * + * @param name + * @param customerId + * @return java.util.List + * @author LZN + * @date 2022/5/16 10:45 + */ + @Override + public List getAddressTree(String name, String customerId) { + List list = customerAgencyDao.getAddressTree(name, customerId); + return NodeTreeUtils.build(list); + } + private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) { CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class); insertEntity.setOrganizationName(formDTO.getAgencyName()); @@ -879,8 +900,7 @@ public class AgencyServiceImpl implements AgencyService { insertEntity.setPids(parent.getPids().concat(StrConstant.COLON).concat(parent.getId())); insertEntity.setAllParentName(parent.getAllParentName().concat(StrConstant.HYPHEN).concat(parent.getOrganizationName())); } - switch(parent.getLevel()) - { + switch (parent.getLevel()) { case CustomerAgencyConstant.PROVINCE_LEVEL: insertEntity.setLevel(CustomerAgencyConstant.CITY_LEVEL); insertEntity.setProvince(parent.getProvince()); @@ -908,7 +928,7 @@ public class AgencyServiceImpl implements AgencyService { insertEntity.setCommunity(formDTO.getAreaName()); break; default: - log.info("parent.getLevel()="+parent.getLevel()); + log.info("parent.getLevel()=" + parent.getLevel()); break; } return insertEntity; 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 ceab6ed43d..c1863e5cd0 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 @@ -454,7 +454,20 @@ public class BuildingServiceImpl implements BuildingService { Integer unit = icBuilding.getTotalUnitNum(); if (nowUnit < unit) { //如果小于,判断是否存在房屋,如果存在就提示不能更改 - throw new EpmetException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(), EpmetErrorCode.ORG_EDIT_FAILED.getMsg(), "暂不支持单元号减小"); + /** + * 校验规则,单元号倒序,校验(原来的单元数 - 现在单元数)个单元下是不是存在房屋,存在房屋不能更新 + * 2022-05-31修改逻辑,可以修改变小,先去校验,单元下存在房屋就报错,不存在,删除对应单元,更新楼栋单元数 + */ + Integer size = unit - nowUnit; + List ids = icBuildingUnitDao.getUnitIdByBuildingId(formDTO.getBuildingId(), size); + if (!CollectionUtils.isEmpty(ids)){ + Integer houseCount = icHouseDao.getHouseCountByUnitIds(ids); + if (houseCount.compareTo(NumConstant.ZERO) != NumConstant.ZERO){ + throw new EpmetException(EpmetErrorCode.UNIT_EXIST_HOUSES_ERROR.getCode()); + } + icBuildingUnitDao.delUnit(ids); + } +// throw new EpmetException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(), EpmetErrorCode.ORG_EDIT_FAILED.getMsg(), "暂不支持单元号减小"); } else { //新增单元 List units = icBuildingUnitService.getUnitOptions(icBuilding.getId()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index ceb47e21f9..f21337742e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.enums.PartyOrgTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; @@ -44,6 +45,7 @@ import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerDepartmentEntity; import com.epmet.entity.CustomerGridEntity; import com.epmet.entity.CustomerOrgParameterEntity; +import com.epmet.enums.OrgLevelEnums; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; @@ -1442,4 +1444,102 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl> getOrgTreeByUserAndType(OrgTreeByUserAndTypeFormDTO formDto) { + List orgTypeList = new ArrayList<>(); + //根据组织类型筛选,例如本账号所属市北区,但只筛选市北区下面的的街道组织 + if(PartyOrgTypeEnum.PROVINCIAL.getCode().equals(formDto.getOrgType())){ + //省委 + CollectionUtils.addAll(orgTypeList, + OrgLevelEnums.PROVINCE.getLevel(), + OrgLevelEnums.CITY.getLevel(), + OrgLevelEnums.DISTRICT.getLevel(), + OrgLevelEnums.STREET.getLevel(), + OrgLevelEnums.COMMUNITY.getLevel(), + OrgLevelEnums.GRID.getLevel()); + }else if(PartyOrgTypeEnum.MUNICIPAL.getCode().equals(formDto.getOrgType())){ + //市委 + CollectionUtils.addAll(orgTypeList, + OrgLevelEnums.CITY.getLevel(), + OrgLevelEnums.DISTRICT.getLevel(), + OrgLevelEnums.STREET.getLevel(), + OrgLevelEnums.COMMUNITY.getLevel(), + OrgLevelEnums.GRID.getLevel()); + }else if(PartyOrgTypeEnum.DISTRICT.getCode().equals(formDto.getOrgType())){ + //区委 + CollectionUtils.addAll(orgTypeList, + OrgLevelEnums.DISTRICT.getLevel(), + OrgLevelEnums.STREET.getLevel(), + OrgLevelEnums.COMMUNITY.getLevel(), + OrgLevelEnums.GRID.getLevel()); + }else if(PartyOrgTypeEnum.WORKING.getCode().equals(formDto.getOrgType())){ + //党工委-街道 + CollectionUtils.addAll(orgTypeList, + OrgLevelEnums.STREET.getLevel(), + OrgLevelEnums.COMMUNITY.getLevel(), + OrgLevelEnums.GRID.getLevel()); + }else if(PartyOrgTypeEnum.PARTY.getCode().equals(formDto.getOrgType())){ + //党委-社区 + CollectionUtils.addAll(orgTypeList, + OrgLevelEnums.COMMUNITY.getLevel(), + OrgLevelEnums.GRID.getLevel()); + } + formDto.setOrgTypeList(orgTypeList); + + List list = baseDao.getOrgTreeByUserAndType(formDto); + return new Result>().ok(build(list)); + } + + /** + * 构建树节点 + */ + public static List build(List treeNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(treeNodes.size()); + for(PartyOrgTreeResultDTO treeNode : treeNodes){ + nodeMap.put(treeNode.getId(), treeNode); + } + + for(PartyOrgTreeResultDTO node : nodeMap.values()) { + PartyOrgTreeResultDTO parent = nodeMap.get(node.getPid()); + if(parent != null && !(node.getId().equals(parent.getId()))){ + parent.getChildren().add(node); + continue; + } + + result.add(node); + } + + return result; + } + + /** + * 当前agencyId的下一级组织+直属网格 + * + * @param agencyId + * @return + */ + @Override + public List subOrgList(String agencyId) { + return baseDao.selectSubOrg(agencyId); + } + + /** + * @Author sun + * @Description 获取当前组织及下级无效组织、网格Id列表 + **/ + @Override + public DelAgencyGridIdResultDTO getDelAgencyGridIdList(String agencyId) { + DelAgencyGridIdResultDTO resultDTO = new DelAgencyGridIdResultDTO(); + //查询当前组织及下级无效组织列表 + List agencyIdList = baseDao.getDelAgencyIdList(agencyId); + //查询当做组织及下级无效网格列表 + List gridIdList = customerGridDao.getDelGridIdList(agencyId); + resultDTO.setAgencyIdList(agencyIdList); + resultDTO.setGridIdList(gridIdList); + return resultDTO; + } + } 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 0d23fd40fa..3887f57c1b 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 @@ -8,17 +8,23 @@ import com.alibaba.fastjson.JSON; 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.HouseQrcodeEnum; 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.ExceptionUtils; 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.CustomerIcHouseRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.FileUtils; +import com.epmet.commons.tools.utils.HouseQRcodeUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerGridConstant; import com.epmet.constants.ImportTaskConstants; @@ -26,15 +32,15 @@ import com.epmet.dao.*; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.entity.IcHouseChangeDetailEntity; -import com.epmet.entity.IcHouseChangeRecordEntity; -import com.epmet.entity.IcHouseEntity; +import com.epmet.entity.*; import com.epmet.enums.HouseChangeEnums; import com.epmet.enums.HousePurposeEnums; import com.epmet.enums.HouseRentFlagEnums; import com.epmet.enums.HouseTypeEnums; +import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OssFeignClient; import com.epmet.model.HouseInfoModel; import com.epmet.model.ImportHouseInfoListener; import com.epmet.redis.IcHouseRedis; @@ -45,21 +51,30 @@ import com.github.pagehelper.PageInfo; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.lang3.StringUtils; +import org.apache.http.entity.ContentType; 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.web.multipart.commons.CommonsMultipartFile; import javax.annotation.Resource; +import javax.imageio.ImageIO; import javax.servlet.http.HttpServletResponse; -import java.io.InputStream; +import java.awt.image.BufferedImage; +import java.io.*; +import java.net.URLEncoder; import java.text.NumberFormat; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; @Slf4j @Service @@ -68,7 +83,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { /** * 导出房屋内家庭成员时本地缓存 */ - private static final Cache> memberCacheMap = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.MINUTES).expireAfterWrite(30,TimeUnit.MINUTES).build(); + private static final Cache> memberCacheMap = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.MINUTES).expireAfterWrite(30, TimeUnit.MINUTES).build(); @Autowired private IcHouseService icHouseService; @@ -104,34 +119,56 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { private IcHouseChangeDetailService changeDetailService; @Autowired private HouseService houseService; + @Autowired + private IcHouseCodeInfoDao icHouseCodeInfoDao; + @Autowired + private OssFeignClient ossFeignClient; + @Autowired + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; @Override @Transactional(rollbackFor = Exception.class) public void addHouse(String customerId, IcHouseAddFormDTO formDTO) { //同一楼栋,单元内,房屋名称唯一 - Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(),null); + Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(), null); if (null != count && count > 0) { throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); } - IcHouseDTO icHouseDTO= ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class); + + IcHouseEntity icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); icHouseDTO.setCustomerId(customerId); icHouseDTO.setHouseName(getHouseName(formDTO)); - icHouseService.save(icHouseDTO); + //获取所属组织地区码 + String areaCode = icNeighborHoodDao.getAreaCode(formDTO.getNeighborHoodId()); + if (StringUtils.isNotBlank(areaCode)) { + areaCode = numberAfterFillZero(areaCode, NumConstant.TWELVE); + icHouseDTO.setHouseCode(createHouseCode(customerId, formDTO.getBuildingId(), areaCode)); + } + icHouseDao.insert(icHouseDTO); + IcHouseEntity entity = new IcHouseEntity(); + entity.setId(icHouseDTO.getId()); + try { + entity.setHouseQrcodeUrl(createHouseQrcodeUrl(icHouseDTO.getId(),null)); + } catch (Exception e) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败","二维码生成失败"); + } + icHouseDao.updateById(entity); } - private String getHouseName(IcHouseAddFormDTO formDTO){ + private String getHouseName(IcHouseAddFormDTO formDTO) { //设置房间名 楼栋-单元号-门牌号 IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId()); IcBuildingUnitDTO icBuildingUnit = icBuildingUnitService.get(formDTO.getBuildingUnitId()); String doorName = formDTO.getDoorName(); - String buildingName = Optional.ofNullable(icBuilding).map(u->u.getBuildingName()).orElse(""); - String unitName = Optional.ofNullable(icBuildingUnit).map(u->u.getUnitNum()).orElse(""); - return new StringBuilder().append(buildingName).append("-").append(unitName).append("-").append(doorName).toString(); + String buildingName = Optional.ofNullable(icBuilding).map(u -> u.getBuildingName()).orElse(""); + String unitName = Optional.ofNullable(icBuildingUnit).map(u -> u.getUnitNum()).orElse(""); + return new StringBuilder().append(buildingName).append("-").append(unitName).append("-").append(doorName).toString(); } /** * 更新 + * * @param customerId * @param formDTO */ @@ -139,7 +176,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { @Transactional(rollbackFor = Exception.class) public void updateHouse(String customerId, IcHouseAddFormDTO formDTO) { //同一楼栋,单元内,房屋名称唯一 - Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(),formDTO.getDoorName(), formDTO.getHouseId()); + Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(), formDTO.getHouseId()); if (null != count && count > 0) { throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); } @@ -155,11 +192,12 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { houseChangeRecord(formDTO.getHouseId(), customerId, icHouseDTO); icHouseService.update(icHouseDTO); //删除房屋缓存 - icHouseRedis.delHouseInfo(formDTO.getHouseId(),customerId); + icHouseRedis.delHouseInfo(formDTO.getHouseId(), customerId); } /** * Desc: 房屋变更记录 + * * @param houseId * @param customerId * @param houseDTO @@ -168,18 +206,18 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { */ @Transactional(rollbackFor = Exception.class) @Override - public void houseChangeRecord(String houseId, String customerId, IcHouseDTO houseDTO){ + public void houseChangeRecord(String houseId, String customerId, IcHouseDTO houseDTO) { IcHouseEntity entity = icHouseService.selectById(houseId); entity.setOwnerName(null == entity.getOwnerName() ? "" : entity.getOwnerName()); entity.setOwnerPhone(null == entity.getOwnerPhone() ? "" : entity.getOwnerPhone()); entity.setOwnerIdCard(null == entity.getOwnerIdCard() ? "" : entity.getOwnerIdCard()); - if (null == entity){ + if (null == entity) { throw new EpmetException("不存在此房屋..."); } StringBuilder sbBefore = new StringBuilder(); StringBuilder sbAfter = new StringBuilder(); List entityList = new ArrayList<>(); - if (!houseDTO.getHouseType().equals(entity.getHouseType())){ + if (!houseDTO.getHouseType().equals(entity.getHouseType())) { sbAfter.append(HouseChangeEnums.HOUSE_TYPE.getColumnName()).append(":").append(null == houseDTO.getHouseTypeName() ? HouseTypeEnums.getTypeValue(houseDTO.getHouseType()) : houseDTO.getHouseTypeName()).append(";"); sbBefore.append(HouseChangeEnums.HOUSE_TYPE.getColumnName()).append(":").append(HouseTypeEnums.getTypeValue(entity.getHouseType())).append(";"); IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity(); @@ -188,7 +226,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { e.setChangeAfter(null == houseDTO.getHouseTypeName() ? HouseTypeEnums.getTypeValue(houseDTO.getHouseType()) : houseDTO.getHouseTypeName()); entityList.add(e); } - if (!houseDTO.getPurpose().equals(entity.getPurpose())){ + if (!houseDTO.getPurpose().equals(entity.getPurpose())) { sbAfter.append(HouseChangeEnums.PURPOSE.getColumnName()).append(":").append(null == houseDTO.getPurposeName() ? HousePurposeEnums.getTypeValue(houseDTO.getPurpose()) : houseDTO.getPurposeName()).append(";"); sbBefore.append(HouseChangeEnums.PURPOSE.getColumnName()).append(":").append(HousePurposeEnums.getTypeValue(entity.getPurpose())).append(";"); IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity(); @@ -197,7 +235,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { e.setChangeBefore(HousePurposeEnums.getTypeValue(entity.getPurpose())); entityList.add(e); } - if (!houseDTO.getRentFlag().equals(entity.getRentFlag())){ + if (!houseDTO.getRentFlag().equals(entity.getRentFlag())) { sbAfter.append(HouseChangeEnums.RENT_FLAG.getColumnName()).append(":").append(null == houseDTO.getRentName() ? HouseRentFlagEnums.getTypeValue(houseDTO.getRentFlag()) : houseDTO.getRentName()).append(";"); sbBefore.append(HouseChangeEnums.RENT_FLAG.getColumnName()).append(":").append(HouseRentFlagEnums.getTypeValue(entity.getRentFlag())).append(";"); IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity(); @@ -206,7 +244,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { e.setChangeBefore(HouseRentFlagEnums.getTypeValue(entity.getRentFlag())); entityList.add(e); } - if (null != houseDTO.getOwnerName() && !houseDTO.getOwnerName().equals(entity.getOwnerName())){ + if (null != houseDTO.getOwnerName() && !houseDTO.getOwnerName().equals(entity.getOwnerName())) { sbAfter.append(HouseChangeEnums.OWNER_NAME.getColumnName()).append(":").append(StringUtils.isNotBlank(houseDTO.getOwnerName()) ? houseDTO.getOwnerName() : "无").append(";"); sbBefore.append(HouseChangeEnums.OWNER_NAME.getColumnName()).append(":").append(StringUtils.isNotBlank(entity.getOwnerName()) ? entity.getOwnerName() : "无").append(";"); IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity(); @@ -215,7 +253,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { e.setChangeBefore(StringUtils.isNotBlank(entity.getOwnerName()) ? entity.getOwnerName() : "无"); entityList.add(e); } - if (null != houseDTO.getOwnerPhone() && !houseDTO.getOwnerPhone().equals(entity.getOwnerPhone())){ + if (null != houseDTO.getOwnerPhone() && !houseDTO.getOwnerPhone().equals(entity.getOwnerPhone())) { sbAfter.append(HouseChangeEnums.OWNER_PHONE.getColumnName()).append(":").append(StringUtils.isNotBlank(houseDTO.getOwnerPhone()) ? houseDTO.getOwnerPhone() : "无").append(";"); sbBefore.append(HouseChangeEnums.OWNER_PHONE.getColumnName()).append(":").append(StringUtils.isNotBlank(entity.getOwnerPhone()) ? entity.getOwnerPhone() : "无").append(";"); IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity(); @@ -224,7 +262,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { e.setChangeBefore(StringUtils.isNotBlank(entity.getOwnerPhone()) ? entity.getOwnerPhone() : "无"); entityList.add(e); } - if (null != houseDTO.getOwnerIdCard() && !houseDTO.getOwnerIdCard().equals(entity.getOwnerIdCard())){ + if (null != houseDTO.getOwnerIdCard() && !houseDTO.getOwnerIdCard().equals(entity.getOwnerIdCard())) { sbAfter.append(HouseChangeEnums.OWNER_ID_CARD.getColumnName()).append(":").append(StringUtils.isNotBlank(houseDTO.getOwnerIdCard()) ? houseDTO.getOwnerIdCard() : "无").append(";"); sbBefore.append(HouseChangeEnums.OWNER_ID_CARD.getColumnName()).append(":").append(StringUtils.isNotBlank(entity.getOwnerIdCard()) ? entity.getOwnerIdCard() : "无").append(";"); IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity(); @@ -233,7 +271,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { e.setChangeBefore(StringUtils.isNotBlank(entity.getOwnerIdCard()) ? entity.getOwnerIdCard() : "无"); entityList.add(e); } - if (StringUtils.isNotBlank(sbAfter)){ + if (StringUtils.isNotBlank(sbAfter)) { String before = sbBefore.substring(NumConstant.ZERO, sbBefore.length() - NumConstant.ONE); String after = sbAfter.substring(NumConstant.ZERO, sbAfter.length() - NumConstant.ONE); HouseAgencyInfoResultDTO houseAgencyInfo = icHouseDao.getHouseAgencyInfo(houseId); @@ -259,15 +297,16 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { /** * 删除 + * * @param houseId */ @Override @Transactional(rollbackFor = Exception.class) public void delHouse(String houseId) { //单个删除房屋,房屋内有居民不允许删除 - NeighborHoodManageDelFormDTO formDTO=new NeighborHoodManageDelFormDTO(); + NeighborHoodManageDelFormDTO formDTO = new NeighborHoodManageDelFormDTO(); formDTO.setType(CustomerGridConstant.HOUSE); - List ids=new ArrayList<>(); + List ids = new ArrayList<>(); ids.add(houseId); formDTO.setIds(ids); allDelete(formDTO); @@ -281,24 +320,25 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { if (StringUtils.isNotBlank(formDTO.getAgencyId())) { pids = getPids(formDTO.getAgencyId()); } - if (StringUtils.isNotBlank(formDTO.getLevel()) && OrgTypeEnum.AGENCY.getCode().equals(formDTO.getLevel())){ + if (StringUtils.isNotBlank(formDTO.getLevel()) && OrgTypeEnum.AGENCY.getCode().equals(formDTO.getLevel())) { pids = getPids(formDTO.getAgencyId()); } formDTO.setPids(pids); - PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()) - .doSelectPageInfo(() -> icHouseDao.searchHouseByPage(formDTO)); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) + .doSelectPageInfo(() -> icHouseDao.searchHouseByPage(formDTO)); List records = pageInfo.getList(); - records.forEach(item->{ + records.forEach(item -> { item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseTypeKey())); item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurposeKey())); }); - return new PageData<>(records == null? new ArrayList<>():records,pageInfo.getTotal()); + return new PageData<>(records == null ? new ArrayList<>() : records, pageInfo.getTotal()); } - public String getPids(String agencyId){ + + public String getPids(String agencyId) { String pids = null; CustomerAgencyDTO agency = agencyservice.getAgencyById(agencyId); @@ -319,33 +359,33 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { public void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception { //如果类型是house 查房屋 //导出房屋 - PageData icHouseExcels = new PageData<>(new ArrayList<>(),NumConstant.ZERO); + PageData icHouseExcels = new PageData<>(new ArrayList<>(), NumConstant.ZERO); List list = new ArrayList<>(); Integer pageNo = NumConstant.ONE; do { formDTO.setPageNo(pageNo); icHouseExcels = getHouseList(formDTO); - if (CollectionUtils.isEmpty(icHouseExcels.getList())){ + if (CollectionUtils.isEmpty(icHouseExcels.getList())) { break; } list.addAll(icHouseExcels.getList()); pageNo++; - }while (icHouseExcels.getList().size() == formDTO.getPageSize()); + } while (icHouseExcels.getList().size() == formDTO.getPageSize()); TemplateExportParams templatePath = new TemplateExportParams("excel/house_export.xlsx"); - Map map = new HashMap<>(); + Map map = new HashMap<>(); map.put("maplist", list); - ExcelPoiUtils.exportExcel(templatePath ,map,"房屋信息录入表",response); + ExcelPoiUtils.exportExcel(templatePath, map, "房屋信息录入表", response); } @Override public List queryListHouseInfo(Set houseIdList, String customerId) { - if(org.apache.commons.collections4.CollectionUtils.isEmpty(houseIdList)){ + if (org.apache.commons.collections4.CollectionUtils.isEmpty(houseIdList)) { return new ArrayList<>(); } List result = new ArrayList<>(); houseIdList.forEach(h -> { HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(h, customerId); - if (null != houseInfo){ + if (null != houseInfo) { result.add(houseInfo); } }); @@ -360,11 +400,11 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { excelReader = EasyExcel.read(inputStream).build(); // 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener ReadSheet readSheet = EasyExcel.readSheet(0).head(HouseInfoModel.class) - .registerReadListener(new ImportHouseInfoListener(formDTO,icBuildingDao,icHouseRedis,neighborHoodService,icHouseService,epmetCommonServiceOpenFeignClient,importTask.getData().getTaskId(),houseService)) + .registerReadListener(new ImportHouseInfoListener(formDTO, icBuildingDao, icHouseRedis, neighborHoodService, icHouseService, epmetCommonServiceOpenFeignClient, importTask.getData().getTaskId(), houseService)) .build(); excelReader.read(readSheet); - } catch (Exception e){ - log.error("dispose exception",e); + } catch (Exception e) { + log.error("dispose exception", e); ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); input.setOperatorId(formDTO.getUserId()); input.setTaskId(importTask.getData().getTaskId()); @@ -381,79 +421,80 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { /** * Desc 小区管理中批量删除 + * * @param formDTO * @author zxc * @date 2022/3/1 4:57 下午 */ @Override public void allDelete(NeighborHoodManageDelFormDTO formDTO) { - if (CollectionUtils.isEmpty(formDTO.getIds())){ + if (CollectionUtils.isEmpty(formDTO.getIds())) { return; } List ids = formDTO.getIds(); - if (formDTO.getType().equals(CustomerGridConstant.NEIGHBORHOOD)){ + if (formDTO.getType().equals(CustomerGridConstant.NEIGHBORHOOD)) { List exists = icHouseDao.selectExistBuildingByNeighborHoodIds(ids); - if (!CollectionUtils.isEmpty(exists)){ + if (!CollectionUtils.isEmpty(exists)) { exists.forEach(e -> { for (int i = NumConstant.ZERO; i < ids.size(); i++) { - if (ids.get(i).equals(e.getNeighborHoodId())){ + if (ids.get(i).equals(e.getNeighborHoodId())) { ids.remove(i); continue; } } }); } - if (!CollectionUtils.isEmpty(ids)){ + if (!CollectionUtils.isEmpty(ids)) { icNeighborHoodDao.deleteBatchIds(ids); } - if (!CollectionUtils.isEmpty(exists)){ + 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)){ + } else if (formDTO.getType().equals(CustomerGridConstant.BUILDING)) { List exists = icHouseDao.selectExistHouseByBuildingIds(ids); - if (!CollectionUtils.isEmpty(exists)){ + if (!CollectionUtils.isEmpty(exists)) { exists.forEach(e -> { for (int i = NumConstant.ZERO; i < ids.size(); i++) { - if (ids.get(i).equals(e.getBuildingId())){ + if (ids.get(i).equals(e.getBuildingId())) { ids.remove(i); continue; } } }); } - if (!CollectionUtils.isEmpty(ids)){ + if (!CollectionUtils.isEmpty(ids)) { icBuildingDao.deleteBatchIds(ids); } - if (!CollectionUtils.isEmpty(exists)){ + 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.HOUSE)){ + } else if (formDTO.getType().equals(CustomerGridConstant.HOUSE)) { Result> existUsers = epmetUserOpenFeignClient.getExistUserByHouseIds(ids); - if (!existUsers.success()){ + if (!existUsers.success()) { throw new EpmetException("根据房屋IDs查询房屋下是否有存在居民失败..."); } List exists = existUsers.getData(); - if (!CollectionUtils.isEmpty(exists)){ + if (!CollectionUtils.isEmpty(exists)) { exists.forEach(e -> { for (int i = NumConstant.ZERO; i < ids.size(); i++) { - if (ids.get(i).equals(e)){ + if (ids.get(i).equals(e)) { ids.remove(i); continue; } } }); } - if (!CollectionUtils.isEmpty(ids)){ + if (!CollectionUtils.isEmpty(ids)) { icHouseDao.deleteBatchIds(ids); } - if (!CollectionUtils.isEmpty(exists)){ + if (!CollectionUtils.isEmpty(exists)) { List list = icHouseDao.selectHouseNames(exists); String collect = list.stream().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()); } } @@ -464,8 +505,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(houseId, customerId); if (null != houseInfo && StringUtils.isNotBlank(houseInfo.getAgencyId())) { AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(houseInfo.getAgencyId()); - houseInfo.setAgencyPathName(StringUtils.isNotBlank(agencyInfoCache.getAllParentName())?agencyInfoCache.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyInfoCache.getOrganizationName()):agencyInfoCache.getOrganizationName()); - houseInfo.setAreaCode(StringUtils.isNotBlank(agencyInfoCache.getAreaCode())?agencyInfoCache.getAreaCode():StrConstant.EPMETY_STR); + houseInfo.setAgencyPathName(StringUtils.isNotBlank(agencyInfoCache.getAllParentName()) ? agencyInfoCache.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyInfoCache.getOrganizationName()) : agencyInfoCache.getOrganizationName()); + houseInfo.setAreaCode(StringUtils.isNotBlank(agencyInfoCache.getAreaCode()) ? agencyInfoCache.getAreaCode() : StrConstant.EPMETY_STR); } else { houseInfo.setAgencyPathName(StrConstant.EPMETY_STR); houseInfo.setAreaCode(StrConstant.EPMETY_STR); @@ -575,6 +616,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { /** * Desc: 根据类型更新排序 + * * @param formDTO * @author zxc * @date 2022/5/6 08:50 @@ -582,10 +624,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { @Override @Transactional(rollbackFor = Exception.class) public void updateSort(UpdateSortFormDTO formDTO) { - if (formDTO.getType().equals(CustomerGridConstant.HOUSE)){ + if (formDTO.getType().equals(CustomerGridConstant.HOUSE)) { IcHouseDTO icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class); icHouseService.update(icHouseDTO); - }else if(formDTO.getType().equals(CustomerGridConstant.BUILDING)){ + } else if (formDTO.getType().equals(CustomerGridConstant.BUILDING)) { IcBuildingDTO icBuildingDTO = ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); icBuildingService.update(icBuildingDTO); } @@ -604,53 +646,53 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { int searchLevel = 0; //如果小区id不为空 则直接查询小区内的居民 - if (StringUtils.isNotEmpty(formDTO.getNeighborHoodId())){ + if (StringUtils.isNotEmpty(formDTO.getNeighborHoodId())) { searchLevel = 1; } //如果楼宇id不为空 则直接查询楼宇内的居民 - if (StringUtils.isNotEmpty(formDTO.getBuildingId())){ + if (StringUtils.isNotEmpty(formDTO.getBuildingId())) { searchLevel = 2; } //如果有具体的查询套件 则直接按照房屋Id 来查 - if (StringUtils.isNotEmpty(formDTO.getOwnerName()) || StringUtils.isNotEmpty(formDTO.getOwnerPhone()) || StringUtils.isNotEmpty(formDTO.getRentFlag())){ + if (StringUtils.isNotEmpty(formDTO.getOwnerName()) || StringUtils.isNotEmpty(formDTO.getOwnerPhone()) || StringUtils.isNotEmpty(formDTO.getRentFlag())) { searchLevel = 3; } - long start = System.currentTimeMillis(); + long start = System.currentTimeMillis(); PageData houseData = this.getHouseList(formDTO); - log.info("getHouseUser getHoseList cost:{}ms",System.currentTimeMillis() - start); + log.info("getHouseUser getHoseList cost:{}ms", System.currentTimeMillis() - start); List resultList = new ArrayList<>(); - PageData result = new PageData<>(resultList,houseData.getList().size()); + PageData result = new PageData<>(resultList, houseData.getList().size()); int finalSearchLevel = searchLevel; - AtomicInteger num = new AtomicInteger((formDTO.getPageNo()-1) * formDTO.getPageSize()); + AtomicInteger num = new AtomicInteger((formDTO.getPageNo() - 1) * formDTO.getPageSize()); - houseData.getList().forEach(o ->{ + houseData.getList().forEach(o -> { resiParam.setAgencyId(o.getAgencyId()); - if (finalSearchLevel == 1){ + if (finalSearchLevel == 1) { resiParam.setNeighborHoodId(o.getNeighborHoodId()); } - if (finalSearchLevel == 2){ + if (finalSearchLevel == 2) { resiParam.setBuildingId(o.getBuildingId()); } - if (finalSearchLevel == 3){ + if (finalSearchLevel == 3) { resiParam.setHouseId(o.getHouseId()); } - this.getHouseMembers(resiParam, memberCacheMap,haveSearchCache); + this.getHouseMembers(resiParam, memberCacheMap, haveSearchCache); List members = memberCacheMap.getIfPresent(o.getHouseId()); //序号 一个houseId为一个序号 int n = num.incrementAndGet(); //没有住户 则直接写房屋 - if (CollectionUtils.isEmpty(members)){ + if (CollectionUtils.isEmpty(members)) { HouseMemberResultDTO resultDTO = ConvertUtils.sourceToTarget(o, HouseMemberResultDTO.class); resultDTO.setNum(n); resultList.add(resultDTO); return; } //有住户 房屋信息是重复的 - members.forEach(m->{ + members.forEach(m -> { HouseMemberResultDTO resultDTO = ConvertUtils.sourceToTarget(m, HouseMemberResultDTO.class); resultDTO.setNum(n); resultDTO.setAgencyName(o.getAgencyName()); @@ -673,37 +715,38 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { /** * desc:分情况获取 房屋内居民 + * * @param resiParam * @param memberMap * @param haveSearchCache */ public void getHouseMembers(RentTenantDataFormDTO resiParam, Cache> memberMap, Cache haveSearchCache) { - String searchKey = resiParam.getHouseId()+resiParam.getBuildingId()+resiParam.getNeighborHoodId()+resiParam.getGridId()+resiParam.getAgencyId(); + String searchKey = resiParam.getHouseId() + resiParam.getBuildingId() + resiParam.getNeighborHoodId() + resiParam.getGridId() + resiParam.getAgencyId(); Boolean haveSearch = haveSearchCache.getIfPresent(searchKey); //log.info("getHouseUser getHouseMembers searchKey:"+searchKey); - if (haveSearch!= null && haveSearch){ + if (haveSearch != null && haveSearch) { return; } long startT = System.currentTimeMillis(); - haveSearchCache.put(searchKey,true); + haveSearchCache.put(searchKey, true); List memberListTemp = null; resiParam.setPageNo(NumConstant.ONE); do { Result> memberResult = epmetUserOpenFeignClient.getHouseMemberList(resiParam); - log.debug("=======查询居民:"+ resiParam.getPageNo()+",size:"+resiParam.getPageSize()+",result:"+memberResult.getData().size()); + log.debug("=======查询居民:" + resiParam.getPageNo() + ",size:" + resiParam.getPageSize() + ",result:" + memberResult.getData().size()); if (!memberResult.success()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用user服务失败"); } memberListTemp = memberResult.getData(); - log.debug("=======查询居民结果:"+ JSON.toJSONString(memberListTemp)); + log.debug("=======查询居民结果:" + JSON.toJSONString(memberListTemp)); if (CollectionUtils.isEmpty(memberListTemp)) { break; } - resiParam.setPageNo(resiParam.getPageNo()+1); + resiParam.setPageNo(resiParam.getPageNo() + 1); memberListTemp.forEach(h -> memberMap.put(h.getHomeId(), h.getHouseMemberList())); } while (memberListTemp.size() == resiParam.getPageSize()); - log.info("getHouseUser getHouseMembers cost:{}ms,param:{}",System.currentTimeMillis() - startT,JSON.toJSONString(resiParam)); + log.info("getHouseUser getHouseMembers cost:{}ms,param:{}", System.currentTimeMillis() - startT, JSON.toJSONString(resiParam)); } /** @@ -760,4 +803,236 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { return list; } + + @Override + public void downloadZip(HttpServletResponse response, IcHouseListFormDTO formDTO) throws Exception { + // 查询pids + String pids = null; + if (StringUtils.isNotBlank(formDTO.getAgencyId())) { + pids = getPids(formDTO.getAgencyId()); + } + if (StringUtils.isNotBlank(formDTO.getLevel()) && OrgTypeEnum.AGENCY.getCode().equals(formDTO.getLevel())) { + pids = getPids(formDTO.getAgencyId()); + } + formDTO.setPids(pids); + + //response + response.reset(); + //文件的名称 + String downloadFilename = "二维码压缩包.zip"; + //转换中文否则可能会产生乱码 + downloadFilename = URLEncoder.encode(downloadFilename, "UTF-8"); + // 指明response的返回对象是文件流 + response.setContentType("application/octet-stream; charset=UTF-8"); + //设置下载格式和名称 + response.setHeader("Content-Disposition", "attachment;filename=" + downloadFilename); + ZipOutputStream zip = new ZipOutputStream(response.getOutputStream()); + + List houseList = icHouseDao.searchHouseByPage(formDTO); + + //获取一户一码前缀地址 + CustomerOrgParameterEntity codePre = icHouseDao.selectByCustomerId(formDTO.getCustomerId(), HouseQrcodeEnum.PREFIX_KEY.getCode()); + if(null == codePre){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "请先维护二维码前缀信息", "请先维护二维码前缀信息"); + } + for (IcHouseListResultDTO house : houseList) { + + BufferedImage image = HouseQRcodeUtils.drawHouseQRImage(house.getBuildingName() + house.getUnitNum() + house.getDoorName(), + codePre.getParameterValue() + house.getHouseCode()); + + try { + byte[] buf = new byte[8192]; + int len; + //添加到zip + zip.putNextEntry(new ZipEntry(getFileName(house))); + InputStream inputStream = bufferedImageToInputStream(image); + //输出压缩包 + while ((len = inputStream.read(buf)) > 0) { + zip.write(buf, 0, len); + } + inputStream.close(); + } catch (IOException e) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组装zip信息有误", "组装zip信息有误"); + } + } + zip.close(); + } + + /** + * 将BufferedImage转换为InputStream + * + * @param image: 图片流 + * @date 2022/4/8 15:29 + * @author YD + */ + public static InputStream bufferedImageToInputStream(BufferedImage image) throws IOException { + ByteArrayOutputStream os = new ByteArrayOutputStream(); + ImageIO.write(image, "png", os); + try (InputStream input = new ByteArrayInputStream(os.toByteArray())) { + return input; + } + } + + /** + * 获取文件名 + */ + public static String getFileName(IcHouseListResultDTO house) { + return house.getNeighborHoodName() + File.separator + house.getBuildingName() + File.separator + house.getUnitNum() + File.separator + house.getDoorName() + HouseQrcodeEnum.SUFFIX.getCode(); + } + + @Override + public String createHouseCode(String customerId, String buildingId, String areaCode) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(buildingId) || StringUtils.isBlank(areaCode)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); + } + String result = ""; + IcHouseCodeInfoEntity codeEntity = icHouseCodeInfoDao.selectByCuIdAndBuilId(customerId, buildingId); + if (null == codeEntity) { + //查询数据库里最大的楼栋编号 + IcHouseCodeInfoEntity maxCodeEntity = icHouseCodeInfoDao.selectMaxHouseMaxNum(); + //新增楼栋信息 + IcHouseCodeInfoEntity newEntity = new IcHouseCodeInfoEntity(); + if (null != maxCodeEntity) { + Integer buildingMaxNum = Integer.valueOf(maxCodeEntity.getBuildingMaxNum()) + 1; + result = areaCode + getNewMaxIndex(buildingMaxNum) + "00001"; + newEntity.setBuildingMaxNum(getNewMaxIndex(buildingMaxNum)); + newEntity.setHouseMaxNum("00001"); + } else { + //数据库里面的第一条数据 + result = areaCode + "00001" + "00001"; + newEntity.setBuildingMaxNum("00001"); + newEntity.setHouseMaxNum("00001"); + } + newEntity.setCustomerId(customerId); + newEntity.setBuildingId(buildingId); + icHouseCodeInfoDao.insert(newEntity); + } else { + Integer houseMaxNum = Integer.valueOf(codeEntity.getHouseMaxNum()) + 1; + result = areaCode + codeEntity.getBuildingMaxNum() + getNewMaxIndex(houseMaxNum); + //更新该楼栋下最大的房间编号 + codeEntity.setHouseMaxNum(getNewMaxIndex(houseMaxNum)); + icHouseCodeInfoDao.updateByCuIdAndBuId(codeEntity); + } + return result; + } + + @Override + public String createHouseQrcodeUrl(String houseId,String houseCode) throws Exception { + if (StringUtils.isBlank(houseId)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "房屋id不可为空", "房屋id不可为空"); + } + IcHouseListResultDTO house = icHouseDao.selectHouseQrcodeById(houseId); + if (null == house) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到房屋信息", "未查到房屋信息"); + } + //url组成:小程序地址?房屋编码 + CustomerOrgParameterEntity codePre = icHouseDao.selectByCustomerId(house.getCustomerId(), HouseQrcodeEnum.PREFIX_KEY.getCode()); + if(null == codePre){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "请先维护二维码前缀信息", "请先维护二维码前缀信息"); + } + //默认使用传参的houseCode,如果没有则使用数据库查询到的houseCode + String url = ""; + if(StringUtils.isBlank(houseCode)){ + url = codePre.getParameterValue() + house.getHouseCode(); + }else{ + url = codePre.getParameterValue() + houseCode; + } + + String fileName = house.getBuildingName() + house.getUnitNum() + house.getDoorName() + ".png"; + BufferedImage image = HouseQRcodeUtils.drawHouseQRImage(house.getBuildingName() + house.getUnitNum() + house.getDoorName(), url); + + + FileItem fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, FileUtils.getAndCreateDirUnderEpmetFilesDir("temp").toFile()) + .createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName); + OutputStream os = fileItem.getOutputStream(); + Result uploadResult = null; + try { + ImageIO.write(image, "png", os); + uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + } catch (Exception e) { + String errormsg = ExceptionUtils.getErrorStackTrace(e); + log.error("上传一户一档二维码:{}", errormsg); + } finally { + try { + os.close(); + } catch (IOException e) { + String errormsg = ExceptionUtils.getErrorStackTrace(e); + log.error("上传一户一档二维码关闭输出流:{}", errormsg); + } + try { + fileItem.delete(); + } catch (Exception e) { + String errormsg = ExceptionUtils.getErrorStackTrace(e); + log.error("上传一户一档二维码删除临时文件:{}", errormsg); + } + } + if (uploadResult == null || !uploadResult.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "上传一户一档二维码失败", "上传一户一档二维码失败"); + } else { + return uploadResult.getData().getUrl(); + } + } + + @Override + public Result getHouseInfoByCode(IcHouseInfoFormDTO formDTO) { + IcHouseEntity house = icHouseDao.selectByHouseCode(formDTO.getHouseCode()); + if(null == house){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查询到相关房屋","未查询到相关房屋"); + } + HouseInfoCache cache = CustomerIcHouseRedis.getHouseInfo(formDTO.getCustomerId(), house.getId()); + IcHouseInfoResultDTO resut = ConvertUtils.sourceToTarget(cache, IcHouseInfoResultDTO.class); + resut.setHouseId(cache.getHomeId()); + return new Result().ok(resut); + } + + + @Override + public Result createBatchHouseCodeAndUrl(TokenDto loginUser) { + List houseList = icHouseDao.selectBatchHouseCodeAndUrl(loginUser.getCustomerId()); + houseList.forEach(house->{ + IcHouseEntity entity = icHouseDao.selectById(house.getHouseId()); + if(StringUtils.isNotBlank(house.getAreaCode())){ + String areaCode = numberAfterFillZero(house.getAreaCode(), NumConstant.TWELVE); + entity.setHouseCode(createHouseCode(house.getCustomerId(),house.getBuildingId(),areaCode)); + + try { + entity.setHouseQrcodeUrl(createHouseQrcodeUrl(house.getHouseId(),entity.getHouseCode())); + } catch (Exception e) { + e.printStackTrace(); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败:"+house.getHouseId(),"二维码生成失败:"+house.getHouseId()); + } + } + icHouseDao.updateById(entity); + }); + return new Result().ok("批量生成成功"); + } + + + /** + * @return java.lang.String + * @describe: 把数字转换成5位的字符串,不够的前面补0 + * @author wangtong + * @date 2022/6/1 14:27 + * @params [maxIndex] + */ + private String getNewMaxIndex(Integer maxIndex) { + String result = maxIndex.toString(); + while (result.length() < 5) { + result = "0" + result; + } + return result; + } + + private String numberAfterFillZero(String str, int length) { + StringBuilder buffer = new StringBuilder(str); + if (buffer.length() >= length) { + return buffer.toString(); + } else { + while (buffer.length() < length) { + buffer.append("0"); + } + } + return buffer.toString(); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseCodeInfoServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseCodeInfoServiceImpl.java new file mode 100644 index 0000000000..aa9f67bc10 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseCodeInfoServiceImpl.java @@ -0,0 +1,87 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcHouseCodeInfoDao; +import com.epmet.dto.IcHouseCodeInfoDTO; +import com.epmet.entity.IcHouseCodeInfoEntity; +import com.epmet.redis.IcHouseCodeInfoRedis; +import com.epmet.service.IcHouseCodeInfoService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Service +public class IcHouseCodeInfoServiceImpl extends BaseServiceImpl implements IcHouseCodeInfoService { + + @Autowired + private IcHouseCodeInfoRedis icHouseCodeInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcHouseCodeInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcHouseCodeInfoDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcHouseCodeInfoDTO get(String id) { + IcHouseCodeInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcHouseCodeInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcHouseCodeInfoDTO dto) { + IcHouseCodeInfoEntity entity = ConvertUtils.sourceToTarget(dto, IcHouseCodeInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcHouseCodeInfoDTO dto) { + IcHouseCodeInfoEntity entity = ConvertUtils.sourceToTarget(dto, IcHouseCodeInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file 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 e884a6904c..1e8ef58148 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 @@ -1,8 +1,10 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.Wrapper; 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.Wrappers; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -78,8 +80,8 @@ public class IcHouseServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -152,7 +154,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); - if(CollectionUtils.isEmpty(list)) { + if (CollectionUtils.isEmpty(list)) { return Collections.emptyList(); } return list.stream().map(item -> { @@ -165,15 +167,15 @@ public class IcHouseServiceImpl extends BaseServiceImpl selectHouseInfoByIdCard(String idCard,String customerId) { - List result = baseDao.selectHouseInfoByIdCard(idCard,customerId); - if (CollectionUtils.isEmpty(result)){ + public List selectHouseInfoByIdCard(String idCard, String customerId) { + List result = baseDao.selectHouseInfoByIdCard(idCard, customerId); + if (CollectionUtils.isEmpty(result)) { return new ArrayList<>(); } return result; @@ -189,19 +191,19 @@ public class IcHouseServiceImpl extends BaseServiceImpl getHouseList(TokenDto tokenDto, HouseFormDTO formDTO) { + public List getHouseList(TokenDto tokenDto, HouseFormDTO formDTO) { //查询楼栋下房屋列表 LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId()); wrapper.last("ORDER BY CONVERT ( HOUSE_NAME USING gbk ) ASC"); List list = baseDao.selectList(wrapper); - if(CollectionUtils.isEmpty(list)) { + if (CollectionUtils.isEmpty(list)) { return Collections.emptyList(); } //获取居民分类列表 IcResiCategoryStatsConfigDTO categoryDto = new IcResiCategoryStatsConfigDTO(); categoryDto.setCustomerId(tokenDto.getCustomerId()); - Result> categoryResult = operCustomizeOpenFeignClient.getCategoryList(categoryDto); + Result> categoryResult = operCustomizeOpenFeignClient.getCategoryList(categoryDto); if (!categoryResult.success()) { throw new RenException(categoryResult.getCode(), categoryResult.getMsg()); } @@ -220,7 +222,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl getHousesNameByIdCards(List idCards) { - if (CollectionUtils.isEmpty(idCards)){ + if (CollectionUtils.isEmpty(idCards)) { return new ArrayList<>(); } return baseDao.getHousesNameByIdCards(idCards); } + @Override + public IcHouseDTO getByHouseCode(String houseCode) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(IcHouseEntity::getHouseCode, houseCode); + return ConvertUtils.sourceToTarget(baseDao.selectOne(lqw), IcHouseDTO.class); + } } \ 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 ee0d37afef..c54ea3a436 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 @@ -44,10 +44,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerGridConstant; import com.epmet.constants.ImportTaskConstants; -import com.epmet.dao.CustomerGridDao; -import com.epmet.dao.IcBuildingDao; -import com.epmet.dao.IcNeighborHoodDao; -import com.epmet.dao.IcPropertyManagementDao; +import com.epmet.dao.*; import com.epmet.dto.*; import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; @@ -121,6 +118,10 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl page(Map params) { @@ -598,7 +599,23 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl ids = icBuildingUnitDao.getUnitIdByBuildingId(building.getId(), size); + if (!org.springframework.util.CollectionUtils.isEmpty(ids)){ + Integer houseCount = icHouseDao.getHouseCountByUnitIds(ids); + if (houseCount.compareTo(NumConstant.ZERO) != NumConstant.ZERO){ + info.setBuildingUnitNumStatus(true); + }else { + icBuildingUnitDao.delUnit(ids); + icBuildingService.updateBuilding(info); + } + } }else { info.setBuildingId(building.getId()); icBuildingService.updateBuilding(info); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ConvertToMultipartFile.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ConvertToMultipartFile.java new file mode 100644 index 0000000000..c458f63908 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ConvertToMultipartFile.java @@ -0,0 +1,64 @@ +package com.epmet.util; + +import org.springframework.web.multipart.MultipartFile; + +import java.io.*; + +public class ConvertToMultipartFile implements MultipartFile { + private byte[] fileBytes; + String name; + String originalFilename; + String contentType; + boolean isEmpty; + long size; + + public ConvertToMultipartFile(byte[] fileBytes, String name, String originalFilename, String contentType, + long size) { + this.fileBytes = fileBytes; + this.name = name; + this.originalFilename = originalFilename; + this.contentType = contentType; + this.size = size; + this.isEmpty = false; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getOriginalFilename() { + return originalFilename; + } + + @Override + public String getContentType() { + return contentType; + } + + @Override + public boolean isEmpty() { + return isEmpty; + } + + @Override + public long getSize() { + return size; + } + + @Override + public byte[] getBytes() throws IOException { + return fileBytes; + } + + @Override + public InputStream getInputStream() throws IOException { + return new ByteArrayInputStream(fileBytes); + } + + @Override + public void transferTo(File dest) throws IOException, IllegalStateException { + new FileOutputStream(dest).write(fileBytes); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.20__alter_ic_house.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.20__alter_ic_house.sql new file mode 100644 index 0000000000..5c2deb613e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.20__alter_ic_house.sql @@ -0,0 +1 @@ +ALTER TABLE epmet_gov_org.ic_house ADD REMARK varchar(255) NULL COMMENT '备注'; diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.21__alter_ic_house.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.21__alter_ic_house.sql new file mode 100644 index 0000000000..88dbfe6db5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.21__alter_ic_house.sql @@ -0,0 +1,10 @@ +alter table ic_house add COLUMN `HOUSE_CODE` varchar(32) DEFAULT NULL COMMENT '房屋编码'; +alter table ic_house add COLUMN `HOUSE_QRCODE_URL` varchar(255) DEFAULT NULL COMMENT '一户一码的二维码地址'; + + +CREATE TABLE `ic_house_code_info` ( + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `BUILDING_ID` varchar(64) NOT NULL COMMENT '所属楼栋id', + `BUILDING_MAX_NUM` varchar(10) NOT NULL COMMENT '最大的楼栋编码序列号', + `HOUSE_MAX_NUM` varchar(10) NOT NULL COMMENT '该楼栋下最大的房屋编码序列号' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房屋编码辅助表'; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.22__alter_customer_org_parameter.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.22__alter_customer_org_parameter.sql new file mode 100644 index 0000000000..40b17e3ae3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.22__alter_customer_org_parameter.sql @@ -0,0 +1,15 @@ + +alter table customer_org_parameter modify column PARAMETER_VALUE varchar(256); + + +INSERT INTO `epmet_gov_org`.`customer_org_parameter`(`ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('5', '3fdd0380deff5b30f45376cdf995d1c1', 'house_qrcode_pre', '一户一码前缀', 'https://epmet-cloud.elinkservice.cn/cqrcode-wxls/', '', '0', 0, 'APP_USER', '2022-06-08 09:22:52', 'APP_USER', '2022-06-08 09:22:52'); + +INSERT INTO `epmet_gov_org`.`customer_org_parameter`(`ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('6', '1530123370795233281', 'house_qrcode_pre', '一户一码前缀', 'https://epmet-cloud.elinkservice.cn/cqrcode-sjt/', '', '0', 0, 'APP_USER', '2022-06-08 09:22:52', 'APP_USER', '2022-06-08 09:22:52'); + +update `ic_house` + set HOUSE_CODE = null, + HOUSE_QRCODE_URL = null; + +delete + FROM `ic_house_code_info` + where 1=1; diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml index d6eb972115..49d364c747 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml @@ -138,12 +138,36 @@ + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + + + + @@ -157,6 +181,10 @@ + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index d8314ee8b5..37169a21a4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -744,6 +744,61 @@ AND CUSTOMER_ID = #{customerId} AND CONCAT(PIDS,':',ID) LIKE CONCAT('%',#{agencyId},'%') + UPDATE customer_agency @@ -756,4 +811,61 @@ AND CUSTOMER_ID = #{customerId} AND pids LIKE concat('%',#{agencyId}, '%' ) + + + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 0f08fce996..e428bc42c6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -846,6 +846,17 @@ ) + + + UPDATE customer_grid SET total_user = total_user+#{incrCount} where id = #{gridId} and del_flag = '0' 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 7e0d3bde18..92c486f24a 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 @@ -48,10 +48,18 @@ SET TOTAL_UNIT_NUM = #{totalUnitNum}, TOTAL_FLOOR_NUM = #{totalFloorNum}, TOTAL_HOUSE_NUM = #{totalHouseNum}, - BUILDING_LEADER_NAME = #{buildingLeaderName}, - BUILDING_LEADER_MOBILE = #{buildingLeaderMobile}, - SORT = #{sort}, - TYPE = #{type}, + + BUILDING_LEADER_NAME = #{buildingLeaderName}, + + + BUILDING_LEADER_MOBILE = #{buildingLeaderMobile}, + + + SORT = #{sort}, + + + TYPE = #{type}, + UPDATED_TIME = NOW() WHERE ID = #{buildingId} diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml index 0ee38da368..09f334b42d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml @@ -3,19 +3,20 @@ - - - - - - - - - - - - - + + + UPDATE ic_building_unit + SET DEL_FLAG = '1', + UPDATED_TIME = NOW() + WHERE ID IN ( + #{id} + ) + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseCodeInfoDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseCodeInfoDao.xml new file mode 100644 index 0000000000..385a13b216 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseCodeInfoDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + update ic_house_code_info + set HOUSE_MAX_NUM=#{houseMaxNum} + where CUSTOMER_ID = #{customerId} + and BUILDING_ID = #{buildingId} + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 53d4ff2277..81ca8c415d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -100,6 +100,7 @@ a.OWNER_NAME as ownerName, a.OWNER_PHONE as ownerPhone, a.OWNER_ID_CARD as ownerIdCard, + a.HOUSE_CODE, a.ID as houseId, c.ID as neighborHoodId, @@ -112,7 +113,9 @@ ag.ORGANIZATION_NAME agencyName, c.GRID_ID as gridId, gr.GRID_NAME, - IFNULL(a.sort,0) as sort + IFNULL(a.sort,0) as sort, + IFNULL(a.REMARK,'') AS remark, + a.CUSTOMER_ID 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' @@ -121,6 +124,7 @@ LEFT JOIN customer_agency ag on ag.ID = c.AGENCY_ID and d.DEL_FLAG = '0' 1 = 1 + and a.del_flag = '0' 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 @@ -164,7 +168,22 @@ AND a.rent_flag = #{rentFlag} - and a.del_flag = '0' + + AND a.PURPOSE = #{purpose} + + + AND a.REMARK like CONCAT('%',#{remark},'%') + + + AND ((DATE_FORMAT(a.CREATED_TIME,'%Y%m%d') >= #{updateStartDate} AND DATE_FORMAT(a.CREATED_TIME,'%Y%m%d') #{updateEndDate}) + OR (DATE_FORMAT(a.UPDATED_TIME,'%Y%m%d') >= #{updateStartDate} AND DATE_FORMAT(a.UPDATED_TIME,'%Y%m%d') #{updateEndDate})) + + + AND (DATE_FORMAT(a.CREATED_TIME,'%Y%m%d') #{updateEndDate}) OR ((DATE_FORMAT(a.UPDATED_TIME,'%Y%m%d')) #{updateEndDate}) + + + AND (DATE_FORMAT(a.CREATED_TIME,'%Y%m%d') =]]> #{updateStartDate}) OR ((DATE_FORMAT(a.UPDATED_TIME,'%Y%m%d')) =]]> #{updateStartDate}) + #排序规则:根据小区、楼栋、单元、门牌号(分别按照数字和中文)分别升序排序 ORDER BY @@ -249,11 +268,16 @@ IFNULL(ib.LATITUDE,'') as buildingLatitude, ih.CUSTOMER_ID AS customerId, concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.DOOR_NAME,'')) AS allName, - n.AGENCY_ID as agencyId + n.AGENCY_ID as agencyId, + n.GRID_ID, + gr.GRID_NAME, + ih.HOUSE_CODE, + ih.HOUSE_QRCODE_URL FROM ic_house ih left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id AND n.DEL_FLAG = '0') left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id AND ib.DEL_FLAG = '0') left JOIN ic_building_unit u ON ( ih.BUILDING_UNIT_ID = u.ID AND u.DEL_FLAG = '0') + left join customer_grid gr ON (gr.id=n.GRID_ID and gr.ABANDON_FLAG=0 and gr.DEL_FLAG=0) WHERE ih.DEL_FLAG = '0' AND ih.ID = #{houseId} @@ -330,9 +354,12 @@ AND neighbor_hood_id IN ( - select id from ic_neighbor_hood - where del_flag = '0' - and (agency_id = #{orgId} OR agency_pids LIKE CONCAT('%', #{orgId}, '%')) + select a.id from ic_neighbor_hood a + + inner join customer_agency b on a.agency_id = b.id and b.del_flag = '0' + inner join customer_grid c on a.grid_id = c.id and c.del_flag = '0' + where a.del_flag = '0' + and (a.agency_id = #{orgId} OR a.agency_pids LIKE CONCAT('%', #{orgId}, '%')) ) @@ -367,5 +394,53 @@ INNER JOIN ic_neighbor_hood nh ON (nh.ID = h.NEIGHBOR_HOOD_ID AND nh.DEL_FLAG = '0') WHERE h.ID = #{houseId} + + + + + + + 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 0f1cf1b84b..8d6e24b5f7 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 @@ -301,4 +301,15 @@ del_flag = '0' AND grid_id = #{gridId} + diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventAttachmentDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventAttachmentDTO.java new file mode 100644 index 0000000000..9d1abdb1b7 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventAttachmentDTO.java @@ -0,0 +1,110 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventCategoryDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventCategoryDTO.java new file mode 100644 index 0000000000..1d79e0e415 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventCategoryDTO.java @@ -0,0 +1,79 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + + /** + * 分类编码,分类编码+customer_id唯一 + */ + private String categoryCode; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java new file mode 100644 index 0000000000..fb86222967 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java @@ -0,0 +1,199 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,事件id + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件所属的网格Id + */ + private String gridId; + + /** + * 网格的所属组织 + */ + private String agencyId; + + /** + * 网格的所有组织Id + */ + private String gridPids; + + /** + * 报事的人【居民端/pc端居民Id】可为空 + */ + private String reportUserId; + + /** + * 报事人姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 反映渠道【字典表】 + */ + private String sourceType; + + /** + * 发生时间 + */ + private Date happenTime; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 地址 + */ + private String address; + + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + + /** + * 办结时间 + */ + private Date closeCaseTime; + + /** + * 0:已回复 1:已转项目 1:已转需求 + */ + private String operationType; + + /** + * 项目、需求ID + */ + private String operationId; + + /** + * 事件是否被阅读过;1已读;针对报事人待处理列表 + */ + private Integer readFlag; + + /** + * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/转需求/办结更新为1; + */ + private Integer redDot; + + /** + * 最近一次操作时间(回复、立项、转需求、办结更新此列) + */ + private Date latestOperatedTime; + + /** + * 是否解决:已解决 resolved,未解决 un_solved + */ + private String resolveStatus; + + /** + * 结案说明 + */ + private String closeRemark; + + /** + * 评论人 + */ + private String commentUserId; + + /** + * 评论内容 + */ + private String satisfaction; + + /** + * 评论时间 + */ + private Date commentTime; + + /** + * 事件审核状态[涉及附件审核需要加的状态](审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 展示红点:visible;隐藏:invisible;人大回复、工作人员回复/立项更新为visible; 插入数据默认不展示 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventOperationLogDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventOperationLogDTO.java new file mode 100644 index 0000000000..a70e211c41 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventOperationLogDTO.java @@ -0,0 +1,111 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventOperationLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 事件id + */ + private String icEventId; + + /** + * 操作用户Id + */ + private String userId; + + /** + * 操作用户类型【居民端用户:resi_user;工作人员:staff;】 + */ + private String userIdentity; + + /** + * 1、发布事件:add + * 2、复:reply; + * 3、立项:shift_project; + * 4、转需求:shift_demand + * 5、办结:close_case; + * 6、需求办结:close_demand + */ + private String actionCode; + + /** + * 1、发布事件:publish; + * 2、撤回事件:recall; + * 3、复:reply; + * 4、立项:shift_project; + * 5、转需求: shift_demand; + * 6、办结:close_case; + * 7、需求办结:close_demand; + * 8、选择是否已解决:choose_resolve; + * 9、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中; + */ + private String actionDesc; + + /** + * 操作时间 + */ + private Date operateTime; + + /** + * 服务方【事件被转需求,需求在办结时的服务方名称】 + */ + private String serviceParty; + /** + * 实际服务时间【事件被转需求,需求在办结时填写的实际服务时间 xx至xx】 + */ + private String actualServiceTime; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventReplyDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventReplyDTO.java new file mode 100644 index 0000000000..9830330fc6 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventReplyDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 事件回复表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventReplyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 回复人用户Id[工作人员ID] + */ + private String fromUserId; + + /** + * 内容 + */ + private String content; + + /** + * 报事人:组织-人名 + */ + private String userShowName; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventScanTaskDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventScanTaskDTO.java new file mode 100644 index 0000000000..d8433ce7a4 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventScanTaskDTO.java @@ -0,0 +1,87 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventScanTaskDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 事件附件表主键,对应dataId + */ + private String icEventAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice 文件 - doc) + */ + private String attachmentType; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 操作人,API审核结果,存储为SCAN_USER或者APP_USER + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AddEventFromResiFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AddEventFromResiFormDTO.java new file mode 100644 index 0000000000..28f5296c5b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AddEventFromResiFormDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/19 11:14 + * @DESC + */ +@Data +public class AddEventFromResiFormDTO implements Serializable { + + private static final long serialVersionUID = -2238068041964629750L; + + public interface AddEventFromResiForm{} + + private String content; + private String address; + + @NotBlank(message = "gridId不能为空",groups = AddEventFromResiForm.class) + private String gridId; + + + /** + * 图片附件列表 + */ + private List attachmentList; + + + /** + * 语音附件列表 + */ + private List voiceList; + + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + private String customerId; + + private String userId; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AutoEvaluationFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AutoEvaluationFormDTO.java new file mode 100644 index 0000000000..d6a5420fd0 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AutoEvaluationFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/5/18 16:33 + * @DESC + */ +@Data +public class AutoEvaluationFormDTO implements Serializable { + + private static final long serialVersionUID = -8871508029242477452L; + + private String customerId; + private String dateId; + private String startDate; + private String endDate; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java new file mode 100644 index 0000000000..19e7d38344 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 需求完成/项目结案时 修改事件数据 + */ +@Data +public class ColseProjectOrDemandFormDTO implements Serializable { + private static final long serialVersionUID = -590440160577071133L; + //事件管理Id + private String icEventId; + //类型 需求:demand 项目:project + private String type; + //服务方【事件被转需求,需求在办结时的服务方名称】 + private String serviceParty; + //实际服务时间【事件被转需求,需求在办结时填写的实际服务时间 xx至xx】 + private String actualServiceTime; + + private String customerId; + private String userId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventProcessAnalysisCommonFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventProcessAnalysisCommonFormDTO.java new file mode 100644 index 0000000000..4a8ffb9f3b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventProcessAnalysisCommonFormDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 事件处理分析通用 + */ +@Data +public class EventProcessAnalysisCommonFormDTO { + + /** + * 处理状态比例查询 + */ + public interface ProcessStatusRatioQuery {} + + /** + * 月度新增 + */ + public interface MonthlyIncrementAnalysis {} + + /** + * 同类事件列表 + */ + public interface SameCategoryEvents {} + + /** + * 要查询的组织ID + */ + @NotBlank(message = "组织ID为必填项", groups = { ProcessStatusRatioQuery.class, MonthlyIncrementAnalysis.class, SameCategoryEvents.class }) + private String orgId; + + /** + * 组织类型。grid,agency + */ + @NotBlank(message = "组织类型为必填项", groups = { ProcessStatusRatioQuery.class, MonthlyIncrementAnalysis.class, SameCategoryEvents.class }) + private String orgType; + + /** + * 查询起始时间 yyyy-MM-dd + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项", groups = { ProcessStatusRatioQuery.class, MonthlyIncrementAnalysis.class }) + private Date queryStartTime; + + /** + * 查询截止时间 yyyy-MM-dd + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项", groups = { ProcessStatusRatioQuery.class, MonthlyIncrementAnalysis.class }) + private Date queryEndTime; + + @NotBlank(message = "分类Id不能为空", groups = { SameCategoryEvents.class }) + private String categoryPids; + + private Integer pageNo = 1; + + private Integer pageSize = 20; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java index 560ebfe2d8..39e4f6f06e 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java @@ -94,4 +94,19 @@ public class EventToProjectFormDTO implements Serializable { private String app; private String client; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; + + /** + * 网格ID + */ + private String gridId; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java new file mode 100644 index 0000000000..0e2bc16a97 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java @@ -0,0 +1,174 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民端-上报需求,或者修改需求 + */ +@Data +public class IcDemandFormDTO implements Serializable { + + private static final long serialVersionUID = 1589287946950749226L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + public interface UpdateInternalGroup { + } + + @NotBlank(message = "事件id不能为空",groups = AddUserInternalGroup.class) + private String icEventId; + + @NotBlank(message = "需求id不能为空",groups = UpdateInternalGroup.class) + private String demandRecId; + + private String customerId; + private String currentUserId; + + + /** + * 网格id + */ + @NotBlank(message = "所属网格不能为空",groups = AddUserShowGroup.class) + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 网格的所有上级id + */ + private String gridPids; + + + + + /** + * 二级需求分类编码 + */ + @NotBlank(message = "需求类别不能为空",groups = AddUserShowGroup.class) + private String categoryCode; + + /** + * 父级需求分类编码 + */ + @NotBlank(message = "需求类别不能为空",groups = AddUserShowGroup.class) + private String parentCode; + + /** + * 需求内容1000字 + */ + @NotBlank(message = "需求内容不能为空",groups = AddUserShowGroup.class) + @Length(max = 1000,message = "需求内容至多输入1000字",groups = AddUserShowGroup.class) + private String content; + + /** + * 社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + */ + @NotBlank(message = "上报类型不能为空",groups = AddUserShowGroup.class) + private String reportType; + + /** + * 上报人姓名 + */ + @NotBlank(message = "上报人不能为空",groups = AddUserShowGroup.class) + private String reportUserName; + + /** + * 上报人联系方式。自身上报时存储注册居民的手机号 + */ + @NotBlank(message = "上报人联系方式不能为空",groups = AddUserShowGroup.class) + private String reportUserMobile; + + /** + * 上报时间 + */ + @NotNull(message = "上报时间不能为空",groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date reportTime; + + /** + * 需求人:user.id或者ic_resi_user.id + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserId; + + /** + * 需求人姓名 + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserName; + + /** + * 需求人联系电话 + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserMobile; + + /** + * 希望服务时间 + */ + @NotNull(message = "服务时间不能为空",groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date wantServiceTime; + + /** + * 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择 + */ + private String serviceLocation; + + /** + * 门牌号详细地址 + */ + private String locationDetail; + + /** + * 经度,需求人是ic的居民时,取所住楼栋的中心点位 + */ + private String longitude; + + /** + * 纬度,需求人是ic的居民时,取所住楼栋的中心点位 + */ + private String latitude; + + /** + * 来源[需求录入:demand 事件管理:ic_event] + */ + private String origin; + /** + * 来源Id[目前只有来源事件管理的有值] + */ + private String originId; + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + /** + * 志愿者:居民端爱心互助的志愿者userId; + */ + private String serverId; + /** + * 服务方名称 + */ + private String serverName; + /** + * 二级分类Id + */ + @NotBlank(message = "分类id不能为空",groups = AddUserInternalGroup.class) + private String categoryId; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java new file mode 100644 index 0000000000..6774329890 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java @@ -0,0 +1,116 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Description 事件管理新增 + * @Author sun + */ +@Data +public class IcEventAddEditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格ID + */ + @NotBlank(message = "网格ID不能为空", groups = {AddGroup.class}) + private String gridId; + /** + * 报事人Id + */ + private String reportUserId; + /** + * 报事人姓名 + */ + @NotBlank(message = "报事人不能为空", groups = {AddGroup.class}) + private String name; + /** + * 手机号 + */ + @Length(max = 11, message = "手机号位数不能超过11位", groups = AddGroup.class) + private String mobile; + /** + * 身份证号 + */ + // @NotBlank(message = "身份证号不能为空", groups = {AddGroup.class}) + @Length(max = 18, message = "身份证号位数不正确", groups = AddGroup.class) + private String idCard; + /** + * 反映渠道 + */ + @NotBlank(message = "反映渠道不能为空", groups = {AddGroup.class}) + private String sourceType; + /** + * 发生时间 + */ + @NotNull(message = "发生时间不能为空", groups = {AddGroup.class}) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date happenTime; + /** + * 事件内容 + */ + @NotBlank(message = "事件内容不能为空", groups = {AddGroup.class}) + private String eventContent; + /** + * 图片集合 + */ + private List imageList; + /** + * 二类分类Id + */ + private List categoryList; + /** + * 事件地址 + */ + //@NotBlank(message = "事件地址不能为空", groups = {AddGroup.class}) + private String address; + /** + * 经度 + */ + private String latitude; + /** + * 维度 + */ + private String longitude; + /** + * 处理方式[0:已回复 1:已转项目 2:已转需求] + */ + private String operationType; + /** + * 项目、需求ID + */ + private String operationId; + /** + * 回复内容 + */ + private String content; + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + /** + * 立项接口入参对象 + */ + private IcEventToProjectFormDTO project; + /** + * 转需求接口入参对象 + */ + private IcDemandFormDTO demand; + + + private String customerId; + private String userId; + private String app; + private String client; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventCategoryAnalysisFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventCategoryAnalysisFormDTO.java new file mode 100644 index 0000000000..e2dc625e6d --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventCategoryAnalysisFormDTO.java @@ -0,0 +1,75 @@ +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 社区治理可视化分析 + * 事件分类分析-饼1入参 + */ +@Data +public class IcEventCategoryAnalysisFormDTO { + + /** + * 处理状态比例查询 + */ + public interface TotalPie { + } + + public interface OrgTotalPie { + } + /** + * 要查询的组织ID + */ + @NotBlank(message = "组织ID为必填项", groups = {TotalPie.class,OrgTotalPie.class}) + private String orgId; + + /** + * 组织类型。grid,agency + */ + @NotBlank(message = "组织类型为必填项", groups = {TotalPie.class,OrgTotalPie.class}) + private String orgType; + + /** + * 查询起始时间 yyyy-MM-dd + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项", groups = {TotalPie.class,OrgTotalPie.class}) + private Date queryStartTime; + + /** + * 查询截止时间 yyyy-MM-dd + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项", groups = {TotalPie.class,OrgTotalPie.class}) + private Date queryEndTime; + + + private String categoryCode; + + /** + * 一级分类 code长度 + */ + private Integer categoryOneLength; + + private String gridPids; + + //以下参数从token中获取 + /** + * 当前登录用户 + */ + private String staffId; + + /** + * 当前客户id + */ + private String customerId; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java new file mode 100644 index 0000000000..ad88c1ce36 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java @@ -0,0 +1,76 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 【迁入管理】列表--接口入参 + * @Author sun + */ +@Data +public class IcEventListFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + public interface Detail extends CustomerClientShowGroup { + } + + /** + * 事件ID + */ + @NotBlank(message = "事件ID不能为空", groups = Detail.class) + private String icEventId; + /** + * 所属组织 + */ + private String agencyId; + /** + * 所属网格 + */ + private String gridId; + /** + * 上报渠道 + */ + private String sourceType; + /** + * 事件内容 + */ + private String eventContent; + /** + * 报事人 + */ + private String name; + /** + * 手机号 + */ + private String mobile; + /** + * 起始上报时间yyyy-MM-dd HH:mm:ss + */ + private String startTime; + /** + * 终止上报时间yyyy-MM-dd HH:mm:ss + */ + private String endTime; + /** + * 状态【处理中:processing;已办结:closed_case】】 + */ + private String status; + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + + private Boolean isPage = true; + + private String customerId; + private String staffId; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventReplyFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventReplyFormDTO.java new file mode 100644 index 0000000000..6c9bacafa8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventReplyFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 事件管理_回复 + * @Author sun + */ +@Data +public class IcEventReplyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface Comment extends CustomerClientShowGroup { + } + public interface Process extends CustomerClientShowGroup { + } + + /** + * 事件ID + */ + @NotBlank(message = "事件ID不能为空", groups = {UpdateGroup.class, Comment.class, Process.class}) + private String icEventId; + /** + * 二类分类Id + */ + private String categoryId; + /** + * 回复内容 + */ + @NotBlank(message = "回复内容不能为空", groups = {UpdateGroup.class}) + private String content; + /** + * 处理方式[0:已回复 1:已转项目 1:已转需求] + */ + @NotBlank(message = "处理方式不能为空", groups = {UpdateGroup.class}) + private String operationType; + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + + /** + * 满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + @NotBlank(message = "满意度不能为空", groups = {Comment.class}) + private String satisfaction; + + private String customerId; + private String userId; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java new file mode 100644 index 0000000000..7c5bf3fc6c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java @@ -0,0 +1,110 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 事件管理-立项 + * + * @author sun + */ +@Data +public class IcEventToProjectFormDTO implements Serializable { + private static final long serialVersionUID = 3392008990676159012L; + + public interface AddUserInternalGroup { + } + + public interface ApprovalCategory extends CustomerClientShowGroup { + } + + /** + * 事件id + */ + @NotBlank(message = "事件id不能为空", groups = AddUserInternalGroup.class) + private String icEventId; + /** + * 项目方案 1000 + */ + @Length(min = 1, max = 1000, message = "项目方案1000字", groups = {ApprovalCategory.class}) + private String publicReply; + /** + * 内部备注 1000 + * 21.08.09 直接立项的内部备注是必填的,然后议题转项目和我要直报转项目的都是非必填的 + */ + //@Length(min = 1, max = 1000, message = "内部备注1000字", groups = {ApprovalCategory.class}) + private String internalRemark; + + /** + * 吹哨勾选的工作人员信息集合,不可为空 + */ + @Valid + private List staffList; + /** + * 项目所选分类集合,不可为空 + */ + @Valid + private List categoryList; + /** + * 项目所选标签集合 + */ + private List tagList; + + @Length(min = 1, max = 20, message = "项目标题不能超过20位", groups = {ApprovalCategory.class}) + private String title; + + /** + * 公开答复对应文件集合 + */ + private List publicFile; + /** + * 内部备注对应文件集合 + */ + private List internalFile; + + //定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置] + private String locateAddress; + //定位经度 + private String locateLongitude; + //定位纬度 + private String locateDimension; + + + + //以下参数从token中获取 + /** + * 当前用户id + */ + @NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class) + private String userId; + + /** + * 当前客户id + */ + @NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; + + private String app; + private String client; + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空", groups = AddUserInternalGroup.class) + private String gridId; + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportIcEvFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportIcEvFormDTO.java new file mode 100644 index 0000000000..f313f6b406 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportIcEvFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 居民端小程序,我上报的事件 列表入参 + */ +@Data +public class MyReportIcEvFormDTO extends PageFormDTO implements Serializable { + //以下参数前端传入 + // @NotBlank(message = "处理中:processing;已办结:closed_case", groups = PageFormDTO.AddUserInternalGroup.class) + private String status; + /** + * 暂时两端不打通,先不要求传身份证了 + */ + // private String idCard; + + //以下参数从token中获取 + @NotBlank(message = "customerId不能为空", groups = PageFormDTO.AddUserInternalGroup.class) + private String customerId; + @NotBlank(message = "userId不能为空", groups = PageFormDTO.AddUserInternalGroup.class) + private String userId; + + public interface ReplyListGroup { + } + public interface RemoveRedGroup { + } + public interface DetailGroup { + } + @NotBlank(message = "事件id不能为空", groups = {ReplyListGroup.class,RemoveRedGroup.class,DetailGroup.class}) + private String icEventId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProcessAnalysisEventListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProcessAnalysisEventListFormDTO.java new file mode 100644 index 0000000000..5a4b1800ef --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProcessAnalysisEventListFormDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +@Data +public class ProcessAnalysisEventListFormDTO { + + /** + * 组织id + */ + @NotBlank(message = "组织ID为必填项") + private String orgId; + /** + * 组织类型grid,agency + */ + @NotBlank(message = "组织类型为必填项") + private String orgType; + /** + * 查询起始时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项") + private Date queryStartTime; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项") + private Date queryEndTime; + + /** + * 处理状态processing, closed_case + */ + private String processStatus; + /** + * 事件分类code + */ + private String categoryCode; + private Integer pageNo; + private Integer pageSize; + + /** + * 业务: + * 1.eventProcessAnalysis 事件处理分析 + * 2.eventCategoryAnalysis 事件分类分析 + */ + private String biz; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java index 0ce775f1ad..3b2fe63a12 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java @@ -75,5 +75,15 @@ public class ProjectApprovalFormDTO implements Serializable { */ @NotBlank(message = "网格ID不能为空",groups = {AddGroup.class}) private String gridId; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java index 75cf13e64e..0bcd5405fb 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java @@ -55,4 +55,16 @@ public class ProjectClosedFromDTO implements Serializable { * 内部备注对应文件集合 */ private List internalFile; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; + + private String customerId; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java new file mode 100644 index 0000000000..54d327354c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/5/17 14:14 + * @DESC + */ +@Data +public class ProjectManageListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -3317804468566708838L; + + /** + * 标题 + */ + private String title; + + /** + * 转项目开始日期,eg:20220505 + */ + private String startDate; + + /** + * 转项目结束日期,eg:20220505 + */ + private String endDate; + + /** + * null就是全部,closed:已关闭,pending:待处理 + */ + private String status; + + private String userId; + + private String customerId; + + private String agencyId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java index 3f7f2a1c13..1562997afa 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java @@ -55,4 +55,14 @@ public class ProjectResponseFormDTO implements Serializable { */ private List internalFile; + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiReplyIcEventFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiReplyIcEventFormDTO.java new file mode 100644 index 0000000000..0e4b423f0c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiReplyIcEventFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 居民端我上报的事件回复 + * ic_event + */ +@Data +public class ResiReplyIcEventFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "事件id不能为空", groups = {AddUserInternalGroup.class}) + private String icEventId; + + @NotBlank(message = "内容不能为空", groups = AddUserShowGroup.class) + @Length(max = 200, message = "内容最多输入200字", groups = AddUserShowGroup.class) + private String content; + + + //以下参数从token中获取 + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/SatisfactionEvaluationListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/SatisfactionEvaluationListFormDTO.java new file mode 100644 index 0000000000..3309a89426 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/SatisfactionEvaluationListFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/5/18 09:57 + * @DESC + */ +@Data +public class SatisfactionEvaluationListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 1790517675681175478L; + + public interface SatisfactionEvaluationListForm{} + + @NotBlank(message = "projectId不能为空",groups = SatisfactionEvaluationListForm.class) + private String projectId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java index 4b9718122c..da8e7b8f3d 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java @@ -40,5 +40,15 @@ public class TransferFormDTO implements Serializable { * 内部备注对应文件集合 */ private List internalFile; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java index 4ade8603df..15359f851d 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java @@ -8,4 +8,6 @@ import java.io.Serializable; public class HouseUserDTO implements Serializable { private String icResiUserId; private String icUserName; + private String agencyId; + private String gridId; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventAnalysisOrgResDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventAnalysisOrgResDTO.java new file mode 100644 index 0000000000..cc6d31f72c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventAnalysisOrgResDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + + +@Data +public class IcEventAnalysisOrgResDTO implements Serializable { + private String orgId; + private String orgType; + private String orgName; + private Integer total = 0; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventCategoryAnalysisResDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventCategoryAnalysisResDTO.java new file mode 100644 index 0000000000..62609af451 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventCategoryAnalysisResDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 社区治理可视化分析 + * 事件分类分析-饼1 + */ +@Data +public class IcEventCategoryAnalysisResDTO implements Serializable { + //一级分类Code + private String categoryCode; + //一级分类名称 + private String categoryName; + //一级分类颜色 + private String color = ""; + //分类下项目总数 + private Integer total = 0; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java new file mode 100644 index 0000000000..19bb9b55df --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java @@ -0,0 +1,215 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * @Description 【迁入管理】列表--接口返参 + * @Author sun + */ +@Data +public class IcEventListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 事件Id + */ + private String icEventId; + /** + * 网格ID + */ + private String gridId; + /** + * 所属网格 + */ + private String gridName; + /** + * 网格的所属组织 + */ + private String agencyId; + /** + * 报事的人【居民端/pc端居民Id】可为空 + */ + private String reportUserId; + /** + * 图片[url集合] + */ + private List imageList; + /** + * 音频[url集合] + */ + private List voiceList; + /** + * 上报渠道 + */ + private String sourceTypeName; + /** + * 纬度 + */ + private String latitude; + /** + * 经度 + */ + private String longitude; + /** + * 地址 + */ + private String address; + /** + * 报事人 + */ + private String name; + /** + * 手机号 + */ + private String mobile; + /** + * 身份证号 + */ + private String idCard; + /** + * 上报渠道[字典表] + */ + private String sourceType; + /** + * 发生时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date happenTime; + /** + * 事件内容 + */ + private String eventContent; + /** + * 群众满意度[满意度 - 不满意:bad、基本满意:good、非常满意:perfect] + */ + private String satisfaction; + /** + * 群众满意度[满意度 - 不满意:bad、基本满意:good、非常满意:perfect] + */ + private String satisfactionName; + /** + * 上报时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; + /** + * 状态【处理中:processing;已办结:closed_case】】 + */ + private String status; + /** + * 状态【处理中:processing;已办结:closed_case】】 + */ + private String statusName; + /** + * 事件创建人 + */ + private String createdUserId; + /** + * 办结时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date closeCaseTime; + /** + * 0:已回复 1:已转项目 1:已转需求 + */ + private String operationType; + /** + * 0:已回复 1:已转项目 1:已转需求 + */ + private String operationTypeName; + /** + * 项目、需求ID + */ + private String operationId; + /** + * 事件是否被阅读过;1已读;针对报事人待处理列表 + */ + private Integer readFlag; + /** + * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/转需求/办结更新为1; + */ + private Integer redDot; + /** + * 最近一次操作时间(回复、立项、转需求、办结更新此列) + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date latestOperatedTime; + /** + * 是否解决:已解决 resolved,未解决 un_solved + */ + private String resolveStatus; + /** + * 结案说明 + */ + private String closeRemark; + /** + * 评论人 + */ + private String commentUserId; + /** + * 评论时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date commentTime; + /** + * 上级分类ID 顶级此列存储0 + */ + private String parentCategoryId; + /** + * 分类Id + */ + private String categoryId; + /** + * 上级分类编码 + */ + private String parentCategoryCode; + + /** + * 分类编码 + */ + private String categoryCode; + /** + * 上级分类名称 + */ + private String parentCategoryName; + /** + * 分类名称 + */ + private String categoryName; + /** + * 第一章图片url + */ + private String imageUrl; + + /** + * 事件附件 + */ + @JsonIgnore + private List attachmentList; + @Data + public static class Attachment { + /** + * url + */ + private String url; + + /** + * 附件类型 + */ + private String type; + + /** + * 附件类型 + */ + private Integer duration; + } + + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyCountResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyCountResultDTO.java new file mode 100644 index 0000000000..724a39a79b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyCountResultDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result; + +import jdk.nashorn.internal.ir.debug.PrintVisitor; +import lombok.Data; + +import java.util.Date; + +@Data +public class IcEventMonthlyCountResultDTO { + + private String monthName; + + private Integer eventCount; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyIncrementResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyIncrementResultDTO.java new file mode 100644 index 0000000000..18cebe0622 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyIncrementResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 事件阅读增量dto + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class IcEventMonthlyIncrementResultDTO { + private String monthName; + private Integer increment; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java new file mode 100644 index 0000000000..65d28e6501 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/21 下午3:31 + */ +@Data +public class IcEventProcessListResultDTO implements Serializable { + + private static final long serialVersionUID = 5762152044573235897L; + + /** + * 进展Id + */ + private String processId; + + /** + * 处理进展名称 + */ + private String processName; + + /** + * 处理进展时间 + */ + private Long processTime; + + /** + * 处理部门 + */ + private String departmentName; + /** + * 公开答复 + */ + private String publicReply; + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + @JsonIgnore + private String assistanceUnitType; + /** + * 协办单位ID + */ + private String assistanceUnitId; + /** + * 协办单位名字 + */ + private String assistanceUnitName; + /** + * 回复event 项目project 需求demand + */ + private String type; + /** + * 服务方【事件被转需求,需求在办结时的服务方名称】 + */ + private String serviceParty; + /** + * 服务时间 + */ + private String serviceTime; + /** + * 实际服务时间【事件被转需求,需求在办结时填写的实际服务时间 xx至xx】 + */ + private String actualServiceTime; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java new file mode 100644 index 0000000000..0408211603 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class IcEventResultDTO { + private String eventId; + private String eventContent; + private String gridId; + private String gridName; + private String sourceType; + private String sourceTypeName; + private String processStatus; + private String processStatusName; + private String reportUserId; + private String reportUserName; + private String mobile; + private String address; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventYpAnalysisResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventYpAnalysisResultDTO.java new file mode 100644 index 0000000000..934833d09c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventYpAnalysisResultDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 研判分析 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class IcEventYpAnalysisResultDTO { + + /** + * 家属 + */ + private List dependents; + /** + * 上报人居民端小程序id + */ + //private String reportorUserId; + /** + * 上报人居民信息id + */ + private String reportorResiId; + /** + * 上报人姓名 + */ + private String reportorName; + /** + * 上报人手机号 + */ + private String reportorMobile; + /** + * 上报人身份证号 + */ + private String reportorIdCard; + + private String reportorAgencyId; + + private String reportorGridId; + /** + * 上报渠道名称 + */ + private String sourceTypeName; + /** + * 事件分类名称(目前是一级) + */ + private String categoryName; + /** + * 事件分类编码(目前是一级) + */ + private String categoryCode; + + /** + * 事件分类ID path + */ + private String categoryPids; + + /** + * 居民上报的事件的总和 + */ + private Integer resiReportEventCount; + /** + * 家属 + */ + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class Dependent { + private String id; + private String name; + private String agencyId; + private String gridId; + } + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportIcEvResDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportIcEvResDTO.java new file mode 100644 index 0000000000..d2652ce3a3 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportIcEvResDTO.java @@ -0,0 +1,109 @@ +package com.epmet.dto.result; + +import com.epmet.dto.IcEventAttachmentDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 居民端我上报的事件列表+详情 + */ +@Data +public class MyReportIcEvResDTO implements Serializable { + /** + * 事件Id + */ + private String icEventId; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 发生时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date happenTime; + + /** + * 图片[url集合] + */ + private List imageList; + /** + * 音频[url集合] + */ + private List voiceList; + + /** + * 地址 + */ + private String address; + + /** + * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/转需求/办结更新为1; + */ + private Boolean redDot; + + /** + * true:可以回复 + * false:不可以回复 + * todo + */ + private Boolean replyFlag; + + /** + * 状态【处理中:processing;已办结:closed_case】】 + */ + private String status; + /** + * 状态【处理中:processing;已办结:closed_case】】 + */ + private String statusName; + /** + * 0:已回复 1:已转项目 1:已转需求 + */ + private String operationType; + /** + * 项目、需求ID + */ + private String operationId; + + /** + * 最近一次操作时间(回复、立项、转需求、办结更新此列) + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date latestOperatedTime; + + /** + * 群众满意度[满意度 - 不满意:bad、基本满意:good、非常满意:perfect] + */ + private String satisfaction; + /** + * 群众满意度[满意度 - 不满意:bad、基本满意:good、非常满意:perfect] + */ + private String satisfactionName; + + /** + * 分类Id + */ + // @JsonIgnore + private String categoryId; + + /** + * 分类名称 + */ + private String categoryName; + + + /** + * 事件附件 + */ + @JsonIgnore + private List attachmentList; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java index cea1ce6288..25d9dcebf7 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -53,6 +54,23 @@ public class ProcessListV2ResultDTO implements Serializable { * 内部备注 */ private String internalRemark; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + @JsonIgnore + private String assistanceUnitType; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位名字 + */ + private String assistanceUnitName; + /** * 子节点 */ @@ -76,6 +94,8 @@ public class ProcessListV2ResultDTO implements Serializable { this.departmentName = ""; this.publicReply = ""; this.internalRemark = ""; + this.assistanceUnitName = ""; + this.assistanceUnitId = ""; this.publicFile = new ArrayList<>(); this.internalFile = new ArrayList<>(); this.subProcess = new ArrayList<>(); diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessStatusRatioResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessStatusRatioResultDTO.java new file mode 100644 index 0000000000..2028c30671 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessStatusRatioResultDTO.java @@ -0,0 +1,11 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class ProcessStatusRatioResultDTO { + private Long processingCount = 0l; + private Long closedCount = 0l; + private Double processingRatio = 0d; + private Double closedRatio = 0d; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java new file mode 100644 index 0000000000..7c9bb481e8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java @@ -0,0 +1,90 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/17 14:27 + * @DESC + */ +@Data +public class ProjectManageListResultDTO implements Serializable { + + private static final long serialVersionUID = 2374701362057175388L; + + /** + * 所顺网格 + */ + private String gridName; + private String gridId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目标题 + */ + private String title; + + /** + * 转项目时间 + */ + private String shiftProjectTime; + + /** + * 项目方案 + */ + private String projectScheme; + + /** + * 内部备注 + */ + private String internalRemark; + + /** + * 滞留天数 + */ + private String detentionDays; + + /** + * 状态 + */ + private String status; + private String statusValue; + + /** + * 处理部门 + */ + private List departmentNameList; + + @JsonIgnore + private Date updatedTime; + + @JsonIgnore + private String isHandle; + + private Boolean processable; + + private Boolean returnable; + + public ProjectManageListResultDTO() { + this.gridName = ""; + this.title = ""; + this.shiftProjectTime = ""; + this.projectScheme = ""; + this.internalRemark = ""; + this.detentionDays = NumConstant.ZERO_STR; + this.status = ""; + this.departmentNameList = new ArrayList<>(); + this.projectId = ""; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/SatisfactionEvaluationListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/SatisfactionEvaluationListResultDTO.java new file mode 100644 index 0000000000..613449a6cf --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/SatisfactionEvaluationListResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/5/18 09:58 + * @DESC + */ +@Data +public class SatisfactionEvaluationListResultDTO implements Serializable { + + private static final long serialVersionUID = 4086193179665858119L; + + /** + * 评价人 + */ + private String evaluationUser; + + @JsonIgnore + private String userId; + + /** + * 评价时间 + */ + private String time; + + /** + * 评价内容 + */ + private String content; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/enums/EcEventProcessStatusEnum.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/enums/EcEventProcessStatusEnum.java new file mode 100644 index 0000000000..b0878ded9c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/enums/EcEventProcessStatusEnum.java @@ -0,0 +1,40 @@ +package com.epmet.enums; + +/** + * ic事件状态枚举 + */ +public enum EcEventProcessStatusEnum { + + PROCESSING("processing", "处理中"), + CLOSED_CASE("closed_case", "已完成"); + + private String processStatus; + private String processStatusName; + + EcEventProcessStatusEnum(String processStatus, String processStatusName) { + this.processStatus = processStatus; + this.processStatusName = processStatusName; + } + + /** + * 根据sourceType查询对应的枚举对象 + * @param processStatus + * @return + */ + public static EcEventProcessStatusEnum getObjectBySourceType(String processStatus) { + for (EcEventProcessStatusEnum e : EcEventProcessStatusEnum.values()) { + if (e.getProcessStatus().equals(processStatus)) { + return e; + } + } + return null; + } + + public String getProcessStatus() { + return processStatus; + } + + public String getProcessStatusName() { + return processStatusName; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index 70abf989e9..1242d3064b 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -158,4 +158,22 @@ public interface GovProjectOpenFeignClient { */ @PostMapping("gov/project/project/audit-reset") Result eventAuditReset(@RequestParam("gridId")String gridId); + + /** + * Desc: 定时任务自动评价 + * @param formDTO + * @author zxc + * @date 2022/5/18 16:35 + */ + @PostMapping("gov/project/icEvent/auto-evaluation") + Result autoEvaluation(@RequestBody AutoEvaluationFormDTO formDTO); + + /** + * Desc: 需求完成/项目结案时 修改事件数据 + * @author sun + */ + @PostMapping("gov/project/icEvent/closeprojectordemand") + Result closeProjectOrDemand(@RequestBody ColseProjectOrDemandFormDTO formDTO); + + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index 8136ac1432..49a969f91e 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -159,4 +159,14 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result eventAuditReset(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "eventAuditReset",gridId); } + + @Override + public Result autoEvaluation(AutoEvaluationFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "autoEvaluation",formDTO); + } + + @Override + public Result closeProjectOrDemand(ColseProjectOrDemandFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "closeProjectOrDemand",formDTO); + } } diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 968e3c75bf..ac3b6f7dc2 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -24,6 +24,11 @@ epmet-third-client 2.0.0 + + com.epmet + epmet-heart-client + 2.0.0 + com.epmet epmet-commons-tools @@ -132,6 +137,11 @@ 2.0.0 compile + + com.epmet + epmet-admin-client + 2.0.0 + diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java new file mode 100644 index 0000000000..8e65d4273d --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java @@ -0,0 +1,452 @@ +package com.epmet.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; +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.dto.form.PageFormDTO; +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.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +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.IcEventDTO; +import com.epmet.dto.IcEventReplyDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.excel.IcEventExcel; +import com.epmet.service.IcEventReplyService; +import com.epmet.service.IcEventService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@RestController +@RequestMapping("icEvent") +@Slf4j +public class IcEventController { + + @Autowired + private IcEventService icEventService; + @Autowired + private IcEventReplyService icEventReplyService; + + @RequestMapping("list") + public Result> list(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icEventService.list(formDTO)); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcEventDTO data = icEventService.get(id); + return new Result().ok(data); + } + + @PostMapping("add") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcEventAddEditFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setApp(tokenDto.getApp()); + formDTO.setClient(tokenDto.getClient()); + icEventService.save(formDTO); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcEventDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icEventService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icEventService.delete(ids); + return new Result(); + } + + /** + * 事件处理分析-处理状态比例查询 + * @param formDTO + * @return + */ + @PostMapping("processAnalysis/processStatusRatio") + public Result getProcessStatusRatio(@RequestBody EventProcessAnalysisCommonFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EventProcessAnalysisCommonFormDTO.ProcessStatusRatioQuery.class); + + String orgId = formDTO.getOrgId(); + String orgType = formDTO.getOrgType(); + Date queryStartTime = formDTO.getQueryStartTime(); + Date queryEndTime = formDTO.getQueryEndTime(); + + ProcessStatusRatioResultDTO r = icEventService.getProcessStatusRatio(orgId, orgType, queryStartTime, queryEndTime); + return new Result().ok(r); + } + + /** + * 事件处理分析-事件列表 + * @param input + * @return + */ + @PostMapping("processAnalysis/eventList") + public Result> listProcessAnalysisEvents(@RequestBody ProcessAnalysisEventListFormDTO input) { + ValidatorUtils.validateEntity(input); + PageData page = icEventService.listProcessAnalysisEvents( + input.getOrgId(), + input.getOrgType(), + input.getCategoryCode(), + input.getProcessStatus(), + input.getQueryStartTime(), + input.getQueryEndTime(), + input.getPageNo(), + input.getPageSize(), + input.getBiz()); + return new Result>().ok(page); + } + + /** + * 时间处理分析-阅读增量查询 + * @param input + * @return + */ + @PostMapping("processAnalysis/monthlyIncrement") + public Result> listMonthlyIncrement(@RequestBody EventProcessAnalysisCommonFormDTO input) { + ValidatorUtils.validateEntity(input, EventProcessAnalysisCommonFormDTO.MonthlyIncrementAnalysis.class); + String orgId = input.getOrgId(); + String orgType = input.getOrgType(); + Date queryStartTime = input.getQueryStartTime(); + Date queryEndTime = input.getQueryEndTime(); + + if (queryStartTime.after(queryEndTime)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "日期范围错误", "日期范围错误"); + } + + List page = icEventService.listMonthlyIncrement(orgType, orgId, queryStartTime, queryEndTime); + return new Result>().ok(page); + } + + /** + * 研判分析查询 + * @param eventId + * @return + */ + @PostMapping("processAnalysis/analysis/{event-id}") + public Result getYpAnalysis(@PathVariable("event-id") String eventId) { + IcEventYpAnalysisResultDTO r = icEventService.getYpAnalysis(eventId); + return new Result().ok(r); + } + + /** + * 组织下,分类下的事件列表 + * @param input + * @return + */ + @PostMapping("processAnalysis/categoryEventList") + public Result> getSameCategoryEvents(@RequestBody EventProcessAnalysisCommonFormDTO input) { + ValidatorUtils.validateEntity(input, EventProcessAnalysisCommonFormDTO.SameCategoryEvents.class); + String categroyPid = input.getCategoryPids(); + String orgId = input.getOrgId(); + String orgType = input.getOrgType(); + Integer pageNo = input.getPageNo(); + Integer pageSize = input.getPageSize(); + PageData page = icEventService.getSameCategoryEvents(orgId, orgType, categroyPid, pageNo, pageSize); + return new Result>().ok(page); + } + /** + * @Author sun + * @Description 事件管理-回复 + **/ + @PostMapping("reply") + public Result reply(@LoginUser TokenDto tokenDto, @RequestBody IcEventReplyFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icEventService.reply(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 事件管理-立项 + **/ + @PostMapping("icEventToProject") + public Result icEventToProject(@LoginUser TokenDto tokenDto, @RequestBody IcEventToProjectFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setApp(tokenDto.getApp()); + formDTO.setClient(tokenDto.getClient()); + ValidatorUtils.validateEntity(formDTO,IcEventToProjectFormDTO.ApprovalCategory.class,IcEventToProjectFormDTO.AddUserInternalGroup.class); + icEventService.icEventToProject(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 事件管理-转需求 + **/ + @PostMapping("icEventToDemand") + public Result icEventToDemand(@LoginUser TokenDto tokenDto, @RequestBody IcDemandFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setDemandUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcDemandFormDTO.AddUserShowGroup.class, IcDemandFormDTO.AddUserInternalGroup.class); + icEventService.icEventToDemand(formDTO); + return new Result(); + } + + /** + * 事件分类分析-一级分类下事件数量 + * + * @param formDTO + * @return + */ + @PostMapping("category-analysis/total") + public Result> categoryAnalysisTotal(@LoginUser TokenDto tokenDto, @RequestBody IcEventCategoryAnalysisFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,IcEventCategoryAnalysisFormDTO.TotalPie.class); + List list = icEventService.categoryAnalysisTotal(formDTO); + return new Result>().ok(list); + } + + /** + * @Author sun + * @Description 事件管理-评价 + **/ + @PostMapping("comment") + public Result comment(@LoginUser TokenDto tokenDto, @RequestBody IcEventReplyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcEventReplyFormDTO.Comment.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icEventService.comment(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 事件管理-详情 + **/ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.Detail.class); + return new Result().ok(icEventService.detail(formDTO)); + } + + /** + * 事件分类分析- 饼图2,直属下级 事件数量 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("category-analysis/org-total") + public Result> analysisOrgTotal(@LoginUser TokenDto tokenDto, @RequestBody IcEventCategoryAnalysisFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcEventCategoryAnalysisFormDTO.OrgTotalPie.class); + List list = icEventService.analysisOrgTotal(formDTO); + return new Result>().ok(list); + } + + /** + * @Author sun + * @Description 事件管理-处理进展 + **/ + @PostMapping("process") + public Result> process(@RequestBody IcEventReplyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcEventReplyFormDTO.Process.class); + return new Result>().ok(icEventService.process(formDTO)); + } + + /** + * Desc: 定时任务自动评价 + * @param formDTO + * @author zxc + * @date 2022/5/18 16:35 + */ + @PostMapping("auto-evaluation") + public Result autoEvaluation(@RequestBody AutoEvaluationFormDTO formDTO){ + icEventService.autoEvaluation(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 需求完成/项目结案时 修改事件数据 + **/ + @PostMapping("closeprojectordemand") + public Result closeProjectOrDemand(@RequestBody ColseProjectOrDemandFormDTO formDTO) { + icEventService.closeProjectOrDemand(formDTO); + return new Result(); + } + + /** + * Desc: 新增【随手拍、讲】 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/5/19 13:38 + */ + @PostMapping("add-event-resi") + public Result addEventFromResi(@LoginUser TokenDto tokenDto,@RequestBody AddEventFromResiFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AddEventFromResiFormDTO.AddEventFromResiForm.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icEventService.addEventFromResi(formDTO); + return new Result(); + } + + /** + * 居民端小程序我上报的事件-列表+详情 + * yapi: http://yapi.elinkservice.cn/project/102/interface/api/7781 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("myreport") + public Result> myReport(@LoginUser TokenDto tokenDto, @RequestBody MyReportIcEvFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icEventService.myReport(formDTO).getList()); + } + + /** + * 居民端我上报的事件, 消息列表跳转详情 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("myreport-detail") + public Result myReportDetail(@LoginUser TokenDto tokenDto, @RequestBody MyReportIcEvFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, MyReportIcEvFormDTO.DetailGroup.class); + return new Result().ok(icEventService.myReportDetail(formDTO)); + } + + /** + * 居民端小程序我上报的事件详情页面-回复列表 + * http://yapi.elinkservice.cn/project/102/interface/api/7783 + * @param formDTO + * @return + */ + @PostMapping("reply-list") + public Result> replyList(@LoginUser TokenDto tokenDto,@RequestBody MyReportIcEvFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, MyReportIcEvFormDTO.ReplyListGroup.class); + return new Result>().ok(icEventReplyService.replyList(formDTO.getIcEventId(),formDTO.getUserId())); + } + + /** + * 居民端小程序我上报的事件-处理中 + * 点击事件进入详情页时调用此接口,消除红点 + * yapi:http://yapi.elinkservice.cn/project/102/interface/api/7790 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("remove-red") + public Result removeRed(@LoginUser TokenDto tokenDto, @RequestBody MyReportIcEvFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, MyReportIcEvFormDTO.RemoveRedGroup.class); + icEventService.removeRed(formDTO.getUserId(), formDTO.getIcEventId()); + return new Result(); + } + + /** + * 居民端我上报的事件-回复 + * http://yapi.elinkservice.cn/project/102/interface/api/7789 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("resi-reply") + public Result resiReply(@LoginUser TokenDto tokenDto, @RequestBody ResiReplyIcEventFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, ResiReplyIcEventFormDTO.AddUserShowGroup.class,ResiReplyIcEventFormDTO.AddUserInternalGroup.class); + icEventService.resiReply(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 数字平台-事件导出 + **/ + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "事件管理" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcEventExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = icEventService.list(formDTO); + data.getList().forEach(d->{ + if(!org.springframework.util.CollectionUtils.isEmpty(d.getImageList())){ + d.setImageUrl(d.getImageList().get(NumConstant.ZERO)); + } + }); + list = ConvertUtils.sourceToTarget(data.getList(), IcEventExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index 372ff5fb5c..03bb218bd1 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -336,4 +337,46 @@ public class ProjectController { public Result eventAuditReset(@RequestParam("gridId")String gridId){ return new Result().ok(projectService.eventAuditReset(gridId)); } + + /** + * Desc: 列表【项目管理】 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/5/17 14:19 + */ + @PostMapping("project-list") + public Result projectList(@LoginUser TokenDto tokenDto,@RequestBody ProjectManageListFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(projectService.projectList(formDTO)); + } + + /** + * Desc: 项目管理导出 + * @param response + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/5/24 15:22 + */ + @PostMapping("project-list-export") + public void projectListExport(HttpServletResponse response,@LoginUser TokenDto tokenDto,@RequestBody ProjectManageListFormDTO formDTO) throws IOException { + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setIsPage(false); + projectService.projectListExport(response,formDTO); + } + + /** + * Desc: 满意度评价列表 + * @param formDTO + * @author zxc + * @date 2022/5/18 10:03 + */ + @PostMapping("satisfaction-evaluation-list") + public Result satisfactionEvaluationList(@RequestBody SatisfactionEvaluationListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SatisfactionEvaluationListFormDTO.SatisfactionEvaluationListForm.class); + return new Result().ok(projectService.satisfactionEvaluationList(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventAttachmentDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventAttachmentDao.java new file mode 100644 index 0000000000..2da1ab32f9 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventAttachmentDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcEventAttachmentDTO; +import com.epmet.entity.IcEventAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventAttachmentDao extends BaseDao { + List selectByIcEventId(@Param("icEventId") String icEventId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java new file mode 100644 index 0000000000..e8829fda7a --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java @@ -0,0 +1,19 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcEventCategoryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 事件所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventCategoryDao extends BaseDao { + + IcEventCategoryEntity selectByEventId(@Param("icEventId") String icEventId); + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java new file mode 100644 index 0000000000..386225e922 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java @@ -0,0 +1,139 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcEventCategoryAnalysisFormDTO; +import com.epmet.dto.form.IcEventListFormDTO; +import com.epmet.dto.form.MyReportIcEvFormDTO; +import com.epmet.dto.result.*; +import com.epmet.entity.IcEventEntity; +import org.apache.ibatis.annotations.MapKey; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventDao extends BaseDao { + + List icEventList(IcEventListFormDTO formDTO); + + /** + * 查询事件处理状态比例 + * @param gridPids + * @param queryStartTime + * @param queryEndTime + * @return List[Map<状态key:事件数量>] + */ + @MapKey("status") + List> getProcessStatusRatio(@Param("customerId") String customerId, + @Param("orgType") String orgType, + @Param("orgId") String orgId, + @Param("gridPids") String gridPids, + @Param("queryStartTime") Date queryStartTime, + @Param("queryEndTime") Date queryEndTime); + + /** + * 事件处理分析-时间列表 + * @param customerId + * @param gridPids + * @param categoryCode + * @param processStatus + * @param queryStartTime 包含 + * @param queryEndTime 包含 + * @return + */ + List listProcessAnalysisEvents(@Param("customerId") String customerId, + @Param("orgType") String orgType, + @Param("orgId") String orgId, + @Param("gridPids") String gridPids, + @Param("categoryCode") String categoryCode, + @Param("processStatus") String processStatus, + @Param("queryStartTime") Date queryStartTime, + @Param("queryEndTime") Date queryEndTime, + @Param("biz") String biz); + + /** + * 月度事件数统计查询 + * @param orgType + * @param orgId + * @param gridPids + * @param queryStartTime + * @param queryEndTime + * @return + */ + List listMonthlyEventCount( + @Param("orgType") String orgType, + @Param("orgId") String orgId, + @Param("gridPids") String gridPids, + @Param("queryStartTime") Date queryStartTime, + @Param("queryEndTime") Date queryEndTime); + + /** + * 按父级分类查询组织下的事件列表 + * @param orgId + * @param orgType + * @param categoryPids + * @return + */ + List listEventsByPCategoryInOrg(@Param("orgId") String orgId, + @Param("gridPids") String gridPids, + @Param("orgType") String orgType, + @Param("categoryPids") String categoryPids); + + /** + * + * @param formDTO + * @return + */ + List selectFirstCategoryTotal(IcEventCategoryAnalysisFormDTO formDTO); + + /** + * Desc: 查询客户下可以自动评价事件的ID + * @param customerId + * @param no + * @param size + * @author zxc + * @date 2022/5/18 17:20 + */ + List getAutoEvaluationIds(@Param("customerId") String customerId,@Param("no")Integer no,@Param("size")Integer size); + + /** + * Desc: 更新评价,默认 perfect + * @param ids + * @author zxc + * @date 2022/5/18 17:26 + */ + void updateAutoEvaluation(@Param("ids")List ids); + + /** + * + * @param formDTO + * @return + */ + Integer selectOrgTotal(IcEventCategoryAnalysisFormDTO formDTO); + + /** + * 居民端小程序我上报的事件-列表+详情 + * + * @param formDTO + * @return + */ + List selectMyReport(MyReportIcEvFormDTO formDTO); + + int updateRedDot(@Param("userId") String userId, @Param("icEventId")String icEventId); + + /** + * 查询居民上报的时间数量 + * @param reportorIdCard 上报人的身份证号 + * @return + */ + Integer getResiReportEventCount(@Param("reportorIdCard") String reportorIdCard); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventOperationLogDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventOperationLogDao.java new file mode 100644 index 0000000000..50f87e388b --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventOperationLogDao.java @@ -0,0 +1,22 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IcEventProcessListResultDTO; +import com.epmet.entity.IcEventOperationLogEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.LinkedList; + +/** + * 事件操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventOperationLogDao extends BaseDao { + + LinkedList selectByEventId(@Param("icEventId") String icEventId); + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventReplyDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventReplyDao.java new file mode 100644 index 0000000000..efdc25830a --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventReplyDao.java @@ -0,0 +1,25 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcEventReplyDTO; +import com.epmet.dto.result.IcEventProcessListResultDTO; +import com.epmet.entity.IcEventReplyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.LinkedList; +import java.util.List; + +/** + * 事件回复表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventReplyDao extends BaseDao { + + LinkedList selectByEventId(@Param("icEventId") String icEventId); + + List selectReplyList(@Param("icEventId") String icEventId, @Param("userId")String userId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventScanTaskDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventScanTaskDao.java new file mode 100644 index 0000000000..0666a818a0 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventScanTaskDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcEventScanTaskEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventScanTaskDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index 5d1a7d578e..6c5e253e06 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.EventProjectInfoDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.ProjectStaffDTO; -import com.epmet.dto.form.LatestListFormDTO; -import com.epmet.dto.form.PatrolProjectFormDTO; -import com.epmet.dto.form.ProjectListFromDTO; -import com.epmet.dto.form.ShiftProjectsFromDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.ProjectEntity; import org.apache.ibatis.annotations.Mapper; @@ -300,4 +297,6 @@ public interface ProjectDao extends BaseDao { */ Integer selectEventStatus(@Param("gridId") String gridId); + List getProjectManageList(ProjectManageListFormDTO formDTO); + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionDetailDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionDetailDao.java index ca0c2a492e..a8f03be57e 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionDetailDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionDetailDao.java @@ -20,10 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.ProjectEvaluationListFormDTO; import com.epmet.dto.form.ProjectInitEvaluationFormDTO; -import com.epmet.dto.result.EvaluationListResultDTO; -import com.epmet.dto.result.ProjectEvaluateDetailResultDTO; -import com.epmet.dto.result.ProjectEvaluateInfoResultDTO; -import com.epmet.dto.result.ProjectEvaluationListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.ProjectSatisfactionDetailEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -69,4 +66,12 @@ public interface ProjectSatisfactionDetailDao extends BaseDao selectProjectEvaluateDetail(@Param("projectIds")List projectIds); + /** + * Desc: 满意度评价列表 + * @param projectId + * @author zxc + * @date 2022/5/18 10:03 + */ + List satisfactionEvaluationList(@Param("projectId")String projectId); + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventAttachmentEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventAttachmentEntity.java new file mode 100644 index 0000000000..a5efd1f853 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventAttachmentEntity.java @@ -0,0 +1,80 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event_attachment") +public class IcEventAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventCategoryEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventCategoryEntity.java new file mode 100644 index 0000000000..7e96695161 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventCategoryEntity.java @@ -0,0 +1,49 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event_category") +public class IcEventCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + + /** + * 分类编码,分类编码+customer_id唯一 + */ + private String categoryCode; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java new file mode 100644 index 0000000000..db3fc54536 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java @@ -0,0 +1,169 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event") +public class IcEventEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件所属的网格Id + */ + private String gridId; + + /** + * 网格的所属组织 + */ + private String agencyId; + + /** + * 网格的所有组织Id + */ + private String gridPids; + + /** + * 报事的人【居民端/pc端居民Id】可为空 + */ + private String reportUserId; + + /** + * 报事人姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 反映渠道【字典表】 + */ + private String sourceType; + + /** + * 发生时间 + */ + private Date happenTime; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 地址 + */ + private String address; + + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + + /** + * 办结时间 + */ + private Date closeCaseTime; + + /** + * 0:已回复 1:已转项目 2:已转需求 + */ + private String operationType; + + /** + * 项目、需求ID + */ + private String operationId; + + /** + * 事件是否被阅读过;1已读;针对报事人待处理列表 + */ + private Integer readFlag; + + /** + * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/转需求/办结更新为1; + */ + private Integer redDot; + + /** + * 最近一次操作时间(回复、立项、转需求、办结更新此列) + */ + private Date latestOperatedTime; + + /** + * 是否解决:已解决 resolved,未解决 un_solved + */ + private String resolveStatus; + + /** + * 结案说明 + */ + private String closeRemark; + + /** + * 评论人 + */ + private String commentUserId; + + /** + * 评论内容 + */ + private String satisfaction; + + /** + * 评论时间 + */ + private Date commentTime; + + /** + * 事件审核状态[涉及附件审核需要加的状态](审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java new file mode 100644 index 0000000000..209d70d4f3 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java @@ -0,0 +1,80 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event_operation_log") +public class IcEventOperationLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 事件id + */ + private String icEventId; + + /** + * 操作用户Id + */ + private String userId; + + /** + * 操作用户类型【居民端用户:resi_user;工作人员:staff;】 + */ + private String userIdentity; + + /** + * 1、发布事件:add + * 2、复:reply; + * 3、立项:shift_project; + * 4、转需求:shift_demand + * 5、办结:close_case; + * 6、需求办结:close_demand + */ + private String actionCode; + + /** + * 1、发布事件:publish; + * 2、撤回事件:recall; + * 3、复:reply; + * 4、立项:shift_project; + * 5、转需求: shift_demand; + * 6、办结:close_case; + * 7、需求办结:close_demand; + * 8、选择是否已解决:choose_resolve; + * 9、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中; + */ + private String actionDesc; + + /** + * 操作时间 + */ + private Date operateTime; + /** + * 服务方【事件被转需求,需求在办结时的服务方名称】 + */ + private String serviceParty; + /** + * 实际服务时间【事件被转需求,需求在办结时填写的实际服务时间 xx至xx】 + */ + private String actualServiceTime; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventReplyEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventReplyEntity.java new file mode 100644 index 0000000000..e477a9cb2a --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventReplyEntity.java @@ -0,0 +1,49 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件回复表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event_reply") +public class IcEventReplyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 回复人用户Id[工作人员ID] + */ + private String fromUserId; + + /** + * 内容 + */ + private String content; + + /** + * 报事人:组织-人名 + */ + private String userShowName; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventScanTaskEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventScanTaskEntity.java new file mode 100644 index 0000000000..bc51c9a0df --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventScanTaskEntity.java @@ -0,0 +1,57 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event_scan_task") +public class IcEventScanTaskEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 事件附件表主键,对应dataId + */ + private String icEventAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice 文件 - doc) + */ + private String attachmentType; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java index 64ea885f2c..b5199a8392 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java @@ -45,6 +45,8 @@ public class ProjectEntity extends BaseEpmetEntity { */ private String agencyId; + private String gridId; + /** * 来源:议题issue 项目立项:agency */ diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessEntity.java index a67f6b7eee..78599eb5bf 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessEntity.java @@ -112,4 +112,14 @@ public class ProjectProcessEntity extends BaseEpmetEntity { */ private Integer isSend; + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java new file mode 100644 index 0000000000..5bfc88d274 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java @@ -0,0 +1,65 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.format.DateTimeFormat; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.util.Date; + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventExcel { + + @ExcelProperty(value = "所属网格") + @ColumnWidth(20) + private String gridName; + + @ExcelProperty(value = "事件内容") + @ColumnWidth(25) + private String eventContent; + + @ExcelProperty(value = "图片") + @ColumnWidth(25) + private String imageUrl; + + @ExcelProperty(value = "上报渠道") + @ColumnWidth(20) + private String sourceTypeName; + + @ExcelProperty(value = "地址") + @ColumnWidth(25) + private String address; + + @ExcelProperty(value = "报事人") + @ColumnWidth(20) + private String name; + + @ExcelProperty(value = "手机号") + @ColumnWidth(20) + private String mobile; + + @ExcelProperty(value = "满意度") + @ColumnWidth(20) + private String commentContent; + + @ExcelProperty(value = "上报时间") + @ColumnWidth(20) + @DateTimeFormat("yyyy-MM-dd HH:mm:ss") + private Date createdTime; + + @ExcelProperty(value = "结点") + @ColumnWidth(20) + private String operationTypeName; + + @ExcelProperty(value = "状态") + @ColumnWidth(20) + private String statusName; + + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectListExportExcel.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectListExportExcel.java new file mode 100644 index 0000000000..5edd25b643 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectListExportExcel.java @@ -0,0 +1,40 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/24 15:24 + * @DESC + */ +@Data +public class ProjectListExportExcel extends ExcelVerifyInfo implements Serializable { + + @Excel(name = "所属网格",needMerge = true) + private String gridName = ""; + + @Excel(name = "项目标题",needMerge = true) + private String title = ""; + + @Excel(name = "转项目时间",needMerge = true) + private String shiftProjectTime; + + @Excel(name = "项目方案",needMerge = true) + private String projectScheme = ""; + + @Excel(name = "内部备注",needMerge = true) + private String internalRemark = ""; + + @Excel(name = "滞留工作日",needMerge = true) + private String detentionDays = ""; + + @ExcelCollection(name = "当前处理部门") + private List departmentNameList; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventAttachmentService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventAttachmentService.java new file mode 100644 index 0000000000..2827802377 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventAttachmentService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEventAttachmentDTO; +import com.epmet.entity.IcEventAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcEventAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEventAttachmentDTO + * @author generator + * @date 2022-05-17 + */ + IcEventAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcEventAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcEventAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java new file mode 100644 index 0000000000..90c9fd9524 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java @@ -0,0 +1,85 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEventCategoryDTO; +import com.epmet.entity.IcEventCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事件所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcEventCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEventCategoryDTO + * @author generator + * @date 2022-05-17 + */ + IcEventCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcEventCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcEventCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); + + /** + * 根据事件id查询事件对应的分类 + * @param eventId + * @return + */ + IcEventCategoryEntity getByEventId(String eventId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventOperationLogService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventOperationLogService.java new file mode 100644 index 0000000000..9b811b09cd --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventOperationLogService.java @@ -0,0 +1,82 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEventOperationLogDTO; +import com.epmet.dto.result.IcEventProcessListResultDTO; +import com.epmet.entity.IcEventOperationLogEntity; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * 事件操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcEventOperationLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEventOperationLogDTO + * @author generator + * @date 2022-05-17 + */ + IcEventOperationLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcEventOperationLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcEventOperationLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); + + LinkedList getByEventId(String icEventId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventReplyService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventReplyService.java new file mode 100644 index 0000000000..c2b3da8830 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventReplyService.java @@ -0,0 +1,90 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEventReplyDTO; +import com.epmet.dto.result.IcEventProcessListResultDTO; +import com.epmet.entity.IcEventReplyEntity; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * 事件回复表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcEventReplyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEventReplyDTO + * @author generator + * @date 2022-05-17 + */ + IcEventReplyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcEventReplyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcEventReplyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); + + LinkedList getByEventId(String icEventId); + + /** + * 居民端小程序我上报的事件详情页面-回复列表 + * + * @param icEventId + * @return + */ + List replyList(String icEventId,String userId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventScanTaskService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventScanTaskService.java new file mode 100644 index 0000000000..593e0b3438 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventScanTaskService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEventScanTaskDTO; +import com.epmet.entity.IcEventScanTaskEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcEventScanTaskService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEventScanTaskDTO + * @author generator + * @date 2022-05-17 + */ + IcEventScanTaskDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcEventScanTaskDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcEventScanTaskDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java new file mode 100644 index 0000000000..d7b548aca9 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java @@ -0,0 +1,218 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEventDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.IcEventEntity; + +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcEventService extends BaseService { + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + PageData list(IcEventListFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcEventDTO + * @author generator + * @date 2022-05-17 + */ + IcEventDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcEventAddEditFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcEventDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); + + ProcessStatusRatioResultDTO getProcessStatusRatio(String orgId, String orgType, Date queryStartTime, Date queryEndTime); + + /** + * 事件列表 + * @param orgId + * @param orgType + * @param categoryCode + * @param processStatus + * @param queryStartTime + * @param queryEndTime + * @param pageNo + * @param pageSize + * @return + */ + PageData listProcessAnalysisEvents(String orgId, String orgType, String categoryCode, String processStatus, Date queryStartTime, + Date queryEndTime, Integer pageNo, Integer pageSize, String biz); + + /** + * 月度增量查询 + * @param orgType + * @param orgId + * @param queryStartTime + * @param queryEndTime + * @return + */ + List listMonthlyIncrement(String orgType, String orgId, Date queryStartTime, Date queryEndTime); + + /** + * 研判分析查询 + * @param eventId + * @return + */ + IcEventYpAnalysisResultDTO getYpAnalysis(String eventId); + + /** + * 同类事件列表 + * @param categoryPids + * @param pageNo + * @param pageSize + * @return + */ + PageData getSameCategoryEvents(String orgId, String orgType, String categoryPids, Integer pageNo, Integer pageSize); + + /** + * @Author sun + * @Description 事件管理-回复 + **/ + void reply(IcEventReplyFormDTO formDTO); + + /** + * @Author sun + * @Description 事件管理-立项 + **/ + void icEventToProject(IcEventToProjectFormDTO formDTO); + + /** + * @Author sun + * @Description 事件管理-转需求 + **/ + void icEventToDemand(IcDemandFormDTO formDTO); + + /** + * 事件分类分析-一级分类下事件数量 + * @param formDTO + * @return + */ + List categoryAnalysisTotal(IcEventCategoryAnalysisFormDTO formDTO); + + /** + * @Author sun + * @Description 事件管理-评价 + **/ + void comment(IcEventReplyFormDTO formDTO); + + /** + * Desc: 定时任务自动评价 + * @param formDTO + * @author zxc + * @date 2022/5/18 16:35 + */ + void autoEvaluation(AutoEvaluationFormDTO formDTO); + + /** + * @Author sun + * @Description 事件管理-评价 + **/ + IcEventListResultDTO detail(IcEventListFormDTO formDTO); + + /** + * @Author sun + * @Description 事件管理-处理进展 + **/ + LinkedList process(IcEventReplyFormDTO formDTO); + /** + * 事件分类分析- 饼图2,直属下级 事件数量 + * @param formDTO + * @return + */ + List analysisOrgTotal(IcEventCategoryAnalysisFormDTO formDTO); + + /** + * @Author sun + * @Description 需求完成/项目结案时 修改事件数据 + **/ + void closeProjectOrDemand(ColseProjectOrDemandFormDTO formDTO); + + /** + * Desc: 新增【随手拍、讲】 + * @param formDTO + * @author zxc + * @date 2022/5/19 13:38 + */ + void addEventFromResi(AddEventFromResiFormDTO formDTO); + + /** + * 居民端小程序我上报的事件-列表+详情 + * yapi: http://yapi.elinkservice.cn/project/102/interface/api/7781 + * + * @param formDTO + * @param formDTO + * @return + */ + PageData myReport(MyReportIcEvFormDTO formDTO); + + /** + * 居民端小程序我上报的事件-处理中 + * 点击事件进入详情页时调用此接口,消除红点 + * + * @param userId + * @param icEventId + * @return + */ + void removeRed(String userId, String icEventId); + + /** + * 居民端我上报的事件-回复 + * @param formDTO + */ + void resiReply(ResiReplyIcEventFormDTO formDTO); + + /** + * 居民端我上报的事件, 消息列表跳转详情 + * @param formDTO + * @return + */ + MyReportIcEvResDTO myReportDetail(MyReportIcEvFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionDetailService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionDetailService.java index 2b138c7890..ba5b78ab6d 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionDetailService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionDetailService.java @@ -136,4 +136,10 @@ public interface ProjectSatisfactionDetailService extends BaseService - * 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.service; import com.epmet.commons.mybatis.service.BaseService; @@ -26,6 +9,8 @@ import com.epmet.dto.result.*; import com.epmet.entity.ProjectEntity; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -385,4 +370,29 @@ public interface ProjectService extends BaseService { */ ProjectAuditResetResultDTO eventAuditReset(String gridId); + /** + * Desc: 列表【项目管理】 + * @param formDTO + * @author zxc + * @date 2022/5/17 14:19 + */ + PageData projectList(ProjectManageListFormDTO formDTO); + + /** + * Desc: 满意度评价列表 + * @param formDTO + * @author zxc + * @date 2022/5/18 10:03 + */ + PageData satisfactionEvaluationList(SatisfactionEvaluationListFormDTO formDTO); + + /** + * Desc: 项目管理导出 + * @param response + * @param formDTO + * @author zxc + * @date 2022/5/24 15:22 + */ + void projectListExport(HttpServletResponse response,ProjectManageListFormDTO formDTO) throws IOException; + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java index 133711aea9..2b8d2a88e1 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java @@ -205,4 +205,10 @@ public interface ProjectTraceService { * @Date 2022/1/4 15:33 */ void approvaledListExport(HttpServletResponse response, ApprovaledListFromDTO formDTO); + + /** + * 事件管理-事件立项 + * @author sun + */ + EventToProjectResultDTO icEventToProject(IcEventToProjectFormDTO formDTO); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventAttachmentServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventAttachmentServiceImpl.java new file mode 100644 index 0000000000..1b2101cc28 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventAttachmentServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcEventAttachmentDao; +import com.epmet.dto.IcEventAttachmentDTO; +import com.epmet.entity.IcEventAttachmentEntity; +import com.epmet.service.IcEventAttachmentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Service +public class IcEventAttachmentServiceImpl extends BaseServiceImpl implements IcEventAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcEventAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcEventAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcEventAttachmentDTO get(String id) { + IcEventAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcEventAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcEventAttachmentDTO dto) { + IcEventAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcEventAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcEventAttachmentDTO dto) { + IcEventAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcEventAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java new file mode 100644 index 0000000000..c1d4d6fac9 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java @@ -0,0 +1,89 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcEventCategoryDao; +import com.epmet.dto.IcEventCategoryDTO; +import com.epmet.entity.IcEventCategoryEntity; +import com.epmet.service.IcEventCategoryService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 事件所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Service +public class IcEventCategoryServiceImpl extends BaseServiceImpl implements IcEventCategoryService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcEventCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcEventCategoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcEventCategoryDTO get(String id) { + IcEventCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcEventCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcEventCategoryDTO dto) { + IcEventCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IcEventCategoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcEventCategoryDTO dto) { + IcEventCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IcEventCategoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public IcEventCategoryEntity getByEventId(String icEventId) { + return baseDao.selectByEventId(icEventId); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventOperationLogServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventOperationLogServiceImpl.java new file mode 100644 index 0000000000..4ac89f9c94 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventOperationLogServiceImpl.java @@ -0,0 +1,90 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcEventOperationLogDao; +import com.epmet.dto.IcEventOperationLogDTO; +import com.epmet.dto.result.IcEventProcessListResultDTO; +import com.epmet.entity.IcEventOperationLogEntity; +import com.epmet.service.IcEventOperationLogService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * 事件操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Service +public class IcEventOperationLogServiceImpl extends BaseServiceImpl implements IcEventOperationLogService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcEventOperationLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcEventOperationLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcEventOperationLogDTO get(String id) { + IcEventOperationLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcEventOperationLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcEventOperationLogDTO dto) { + IcEventOperationLogEntity entity = ConvertUtils.sourceToTarget(dto, IcEventOperationLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcEventOperationLogDTO dto) { + IcEventOperationLogEntity entity = ConvertUtils.sourceToTarget(dto, IcEventOperationLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public LinkedList getByEventId(String icEventId) { + return baseDao.selectByEventId(icEventId); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventReplyServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventReplyServiceImpl.java new file mode 100644 index 0000000000..c3fe7d9106 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventReplyServiceImpl.java @@ -0,0 +1,102 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcEventReplyDao; +import com.epmet.dto.IcEventReplyDTO; +import com.epmet.dto.result.IcEventProcessListResultDTO; +import com.epmet.entity.IcEventReplyEntity; +import com.epmet.service.IcEventReplyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * 事件回复表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Service +public class IcEventReplyServiceImpl extends BaseServiceImpl implements IcEventReplyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcEventReplyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcEventReplyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcEventReplyDTO get(String id) { + IcEventReplyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcEventReplyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcEventReplyDTO dto) { + IcEventReplyEntity entity = ConvertUtils.sourceToTarget(dto, IcEventReplyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcEventReplyDTO dto) { + IcEventReplyEntity entity = ConvertUtils.sourceToTarget(dto, IcEventReplyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public LinkedList getByEventId(String icEventId) { + return baseDao.selectByEventId(icEventId); + } + + /** + * 居民端小程序我上报的事件详情页面-回复列表 + * + * @param icEventId + * @return + */ + @Override + public List replyList(String icEventId, String userId) { + List list = baseDao.selectReplyList(icEventId, userId); + return list; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventScanTaskServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventScanTaskServiceImpl.java new file mode 100644 index 0000000000..43a03b4865 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventScanTaskServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcEventScanTaskDao; +import com.epmet.dto.IcEventScanTaskDTO; +import com.epmet.entity.IcEventScanTaskEntity; +import com.epmet.service.IcEventScanTaskService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Service +public class IcEventScanTaskServiceImpl extends BaseServiceImpl implements IcEventScanTaskService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcEventScanTaskDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcEventScanTaskDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcEventScanTaskDTO get(String id) { + IcEventScanTaskEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcEventScanTaskDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcEventScanTaskDTO dto) { + IcEventScanTaskEntity entity = ConvertUtils.sourceToTarget(dto, IcEventScanTaskEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcEventScanTaskDTO dto) { + IcEventScanTaskEntity entity = ConvertUtils.sourceToTarget(dto, IcEventScanTaskEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java new file mode 100644 index 0000000000..5d1c2f9fbd --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -0,0 +1,1520 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.*; +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DictTypeEnum; +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.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; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.utils.*; +import com.epmet.constant.*; +import com.epmet.dao.IcEventDao; +import com.epmet.dto.*; +import com.epmet.dto.form.*; +import com.epmet.dto.form.demand.DemandRecId; +import com.epmet.dto.form.demand.IcEventCommentToDemandFromDTO; +import com.epmet.dto.result.*; +import com.epmet.entity.*; +import com.epmet.enums.EcEventProcessStatusEnum; +import com.epmet.feign.*; +import com.epmet.resi.group.constant.TopicConstant; +import com.epmet.service.*; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Slf4j +@Service + +public class IcEventServiceImpl extends BaseServiceImpl implements IcEventService, ResultDataResolver { + + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + @Autowired + private ProjectTraceService projectTraceService; + @Autowired + private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; + @Autowired + private GovIssueOpenFeignClient govIssueOpenFeignClient; + @Autowired + private IcEventAttachmentService icEventAttachmentService; + @Autowired + private IcEventCategoryService icEventCategoryService; + @Autowired + private IcEventReplyService icEventReplyService; + @Autowired + private IcEventOperationLogService icEventOperationLogService; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; + @Autowired + private OperCrmOpenFeignClient crmOpenFeignClient; + @Autowired + private ResiEventServiceImpl resiEventService; + @Autowired + private EpmetMessageOpenFeignClient messageOpenFeignClient; + @Autowired + private ProjectSatisfactionDetailService projectSatisfactionDetailService; + + public CustomerStaffInfoCacheResult getStaffInfo(String customerId,String staffId){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", staffId)); + } + return staffInfo; + } + + @Override + public PageData list(IcEventListFormDTO formDTO) { + //获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + + //分页查询当前组织下网格内事件数据 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.icEventList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + if (!CollectionUtils.isEmpty(list)) { + //查询网格名称(组织-网格) + List gridIds = list.stream().map(IcEventListResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); + Result> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2)); + + //事件管理字典表数据 + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + + //封装数据 + for (IcEventListResultDTO dto : list) { + if (gridInfoMap.containsKey(dto.getGridId())) { + dto.setGridName(gridInfoMap.get(dto.getGridId())); + } + if (StringUtils.isNotBlank(dto.getSourceType())) { + dto.setSourceTypeName(statusMap.get(dto.getSourceType())); + } + //每个事件对应的图片数据 + if(!CollectionUtils.isEmpty(dto.getAttachmentList())){ + List imageList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + for(IcEventListResultDTO.Attachment file: dto.getAttachmentList()){ + if ("image".equals(file.getType())) { + imageList.add(file.getUrl()); + } else if ("voice".equals(file.getType())) { + voiceList.add(file.getUrl()); + } + } + dto.setImageList(imageList); + dto.setVoiceList(voiceList); + } + + } + } + return new PageData<>(list, pageInfo.getTotal()); + } + + + @Override + public IcEventDTO get(String id) { + IcEventEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcEventDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcEventAddEditFormDTO formDTO) { + //获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + //获取网格缓存信息 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); + if (null == gridInfo) { + throw new EpmetException(String.format("未查询到网格{%s}信息", formDTO.getGridId())); + } + //1.参数校验,安全校验 + //1-1.判断是否勾选处理方式,勾选了则分类不能为空 + //勾选了立项或转需求或已完成时分类必须传 + if (((StringUtils.isNotBlank(formDTO.getOperationType()) && !"0".equals(formDTO.getOperationType())) + || (StringUtils.isNotBlank(formDTO.getStatus()) && "closed_case".equals(formDTO.getStatus()))) && CollectionUtils.isEmpty(formDTO.getCategoryList())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件分类不能为空"); + } + //1-2.判断勾选已完成则处理方式不能选择立项或转需求 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus()) + && StringUtils.isNotBlank(formDTO.getOperationType()) && (NumConstant.ONE_STR.equals(formDTO.getOperationType()) || NumConstant.TWO_STR.equals(formDTO.getOperationType()))) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件勾选已完成则不允许立项或转需求"); + } + //1-3.安全校验事件内容、图片内容 + //事件内容 + if (StringUtils.isNotBlank(formDTO.getEventContent())) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskDTO.setContent(formDTO.getEventContent()); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + //图片内容 + if (!CollectionUtils.isEmpty(formDTO.getImageList())) { + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + formDTO.getImageList().forEach(imgUrl -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(imgUrl); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg()); + } + } + } + + //事件Id + String icEventId = IdWorker.getIdStr(); + //事件表红点,回复、立项、转服务、办结展示红点【0不展示 1展示】 + int redDot = NumConstant.ZERO; + String operationType = ""; + //2.判断是否立项或转需求 + //2-1.项目立项 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.ONE_STR.equals(formDTO.getOperationType())) { + redDot = NumConstant.ONE; + operationType = NumConstant.ONE_STR; + IcEventToProjectFormDTO toProject = formDTO.getProject(); + toProject.setCustomerId(formDTO.getCustomerId()); + toProject.setUserId(formDTO.getUserId()); + toProject.setApp(formDTO.getApp()); + toProject.setClient(formDTO.getClient()); + toProject.setIcEventId(icEventId); + EventToProjectResultDTO project = projectTraceService.icEventToProject(toProject); + formDTO.setOperationId(project.getProjectId()); + } + //2-2.转需求 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.TWO_STR.equals(formDTO.getOperationType())) { + redDot = NumConstant.ONE; + operationType = NumConstant.TWO_STR; + IcDemandFormDTO dto = formDTO.getDemand(); + //需求人默认是当前用户id + dto.setDemandUserId(formDTO.getUserId()); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setOrigin("ic_event"); + dto.setOriginId(icEventId); + Result recIdResult = epmetHeartOpenFeignClient.icEventToDemand(dto); + if (!recIdResult.success() || recIdResult.getData() == null) { + throw new RenException(recIdResult.getCode(), recIdResult.getMsg()); + } + formDTO.setOperationId(recIdResult.getData().getDemandRecId()); + } + + //3.新增事件数据、附件数据、分类数据、回复数据、操作记录数据 + //3-1.事件数据保存 + IcEventEntity entity = ConvertUtils.sourceToTarget(formDTO, IcEventEntity.class); + entity.setId(icEventId); + entity.setAgencyId(gridInfo.getPid()); + entity.setGridPids(gridInfo.getPids()); + entity.setLatestOperatedTime(new Date()); + entity.setAuditStatus(TopicConstant.AUTO_PASSED); + if("closed_case".equals(formDTO.getStatus())){ + entity.setCloseCaseTime(new Date()); + } + //insert(entity); + //3-2.附件数据保存 + List imageEntityList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(formDTO.getImageList())) { + int sort = 0; + for (String url : formDTO.getImageList()) { + IcEventAttachmentEntity attachment = new IcEventAttachmentEntity(); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setAttachmentUrl(url); + attachment.setIcEventId(entity.getId()); + attachment.setCreatedBy(formDTO.getUserId()); + attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase()); + attachment.setSort(sort++); + attachment.setAttachmentType("image"); + attachment.setStatus(TopicConstant.AUTO_PASSED); + imageEntityList.add(attachment); + } + icEventAttachmentService.insertBatch(imageEntityList); + } + + //3-3.分类数据保存 + if (!CollectionUtils.isEmpty(formDTO.getCategoryList())) { + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), formDTO.getCategoryList()); + IcEventCategoryEntity categoryEntity = null; + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(formDTO.getCategoryList().get(NumConstant.ZERO))) { + categoryEntity = new IcEventCategoryEntity(); + categoryEntity.setCustomerId(formDTO.getCustomerId()); + categoryEntity.setIcEventId(entity.getId()); + categoryEntity.setCategoryId(ca.getId()); + categoryEntity.setCategoryPids(ca.getPids()); + categoryEntity.setCategoryCode(ca.getCategoryCode()); + } + } + if (categoryEntity != null) { + icEventCategoryService.insert(categoryEntity); + } + } + //3-4.操作记录数据保存 + List logList = new ArrayList<>(); + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), new Date(), "add", "publish")); + + Date date = new Date(); + //3-5.回复数据保存 + if (StringUtils.isNotBlank(formDTO.getContent())) { + if(StringUtils.isEmpty(operationType)){ + operationType = NumConstant.ZERO_STR; + } + redDot = NumConstant.ONE; + IcEventReplyEntity replyEntity = new IcEventReplyEntity(); + replyEntity.setCustomerId(formDTO.getCustomerId()); + replyEntity.setIcEventId(entity.getId()); + replyEntity.setFromUserId(formDTO.getUserId()); + replyEntity.setContent(formDTO.getContent()); + replyEntity.setUserShowName(staffInfo.getAgencyName() + "-" + staffInfo.getRealName()); + icEventReplyService.insert(replyEntity); + //回复对应的操作记录 + date.setTime(date.getTime() + 6000 * 1); + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "reply", "reply")); + } + //立项对应的操作记录 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.ONE_STR.equals(formDTO.getOperationType())) { + date.setTime(date.getTime() + 6000 * 1); + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "shift_project", "shift_project")); + } + //转需求对应的操作记录 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.TWO_STR.equals(formDTO.getOperationType())) { + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), formDTO.getDemand().getWantServiceTime(), "shift_demand", "shift_demand")); + } + //选择了已完成 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())) { + redDot = NumConstant.ONE; + date.setTime(date.getTime() + 6000 * 1); + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "close_case", "close_case")); + } + icEventOperationLogService.insertBatch(logList); + + entity.setRedDot(redDot); + entity.setOperationType(operationType); + insert(entity); + } + + /** + * 根据分类Id集合查询对应数据信息 + * + * @return + */ + private CategoryTagResultDTO queryCategory(String customerId, List categoryIdList) { + CategoryTagListFormDTO categoryTag = new CategoryTagListFormDTO(); + categoryTag.setCustomerId(customerId); + categoryTag.setCategoryIdList(categoryIdList); + Result resultDTOResult = govIssueOpenFeignClient.getCategoryTagList(categoryTag); + if (!resultDTOResult.success()) { + throw new RenException("项目立项,调用issue服务查询分类、标签基础信息失败"); + } + return resultDTOResult.getData(); + } + + /** + * 事件管理操作日志记录 + * + * @return + */ + private IcEventOperationLogEntity logEntity(String customerId, String icEventId, String userId, Date date, String actionCode, String actionDesc) { + IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity(); + logEntity.setCustomerId(customerId); + logEntity.setIcEventId(icEventId); + logEntity.setUserId(userId); + logEntity.setUserIdentity("staff"); + logEntity.setActionCode(actionCode); + logEntity.setActionDesc(actionDesc); + logEntity.setOperateTime(date); + return logEntity; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcEventDTO dto) { + IcEventEntity entity = ConvertUtils.sourceToTarget(dto, IcEventEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 查询时间的grid_pids + * + * @param agencyId + * @return + */ + public String getEventGridPids(String agencyId) { + String gridPids; + String errorMsg = "查询组织信息失败"; + CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(agencyId), + ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + errorMsg, + errorMsg); + if (agencyInfo == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组织信息未找到", "网格信息未找到"); + } + String purePids = agencyInfo.getPids(); + if ("0".equals(purePids) || StringUtils.isBlank(purePids)) { + gridPids = agencyInfo.getId(); + } else { + gridPids = purePids.concat(":").concat(agencyInfo.getId()); + } + + return gridPids; + } + + @Override + public ProcessStatusRatioResultDTO getProcessStatusRatio(String orgId, String orgType, Date queryStartTime, Date queryEndTime) { + + AgencyInfoFormDTO form = new AgencyInfoFormDTO(); + form.setOrgId(orgId); + form.setOrgType(orgType); + + String gridPids = null; + if ("agency".equals(orgType)) { + gridPids = getEventGridPids(orgId); + } + + List> m = baseDao.getProcessStatusRatio( + EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID), orgType, orgId, gridPids, queryStartTime, queryEndTime); + + ProcessStatusRatioResultDTO r = new ProcessStatusRatioResultDTO(); + + if (CollectionUtils.isEmpty(m)) { + return r; + } + + BigDecimal processingCount = new BigDecimal(0); + BigDecimal closedCount = new BigDecimal(0); + ; + BigDecimal processingRatio = null; + BigDecimal closedRatio = null; + + for (Map entry : m) { + if ("processing".equals(entry.get("status"))) { + processingCount = new BigDecimal(entry.get("eventCount")); + } else if ("closed_case".equals(entry.get("status"))) { + closedCount = new BigDecimal(entry.get("eventCount")); + } + } + + // 根据个数,计算比例 + BigDecimal total = processingCount.add(closedCount); + processingRatio = processingCount.divide(total, 2, BigDecimal.ROUND_HALF_UP); + closedRatio = new BigDecimal(1).subtract(processingRatio); + + r.setProcessingCount(processingCount.longValue()); + r.setClosedCount(closedCount.longValue()); + r.setProcessingRatio(processingRatio.doubleValue()); + r.setClosedRatio(closedRatio.doubleValue()); + + return r; + } + + @Override + public PageData listProcessAnalysisEvents(String orgId, String orgType, String categoryCode, String processStatus, + Date queryStartTime, Date queryEndTime, Integer pageNo, + Integer pageSize, String biz) { + + // 1.分类字典 + Map eventSourceTypeDict = getResultDataOrThrowsException(adminOpenFeignClient.dictMap("ic_event_source_type"), + ServiceConstant.EPMET_ADMIN_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【IC事件分析】查询上报渠道字典失败", + "【IC事件分析】查询上报渠道字典失败"); + + String gridPids = null; + if ("agency".equals(orgType)) { + gridPids = getEventGridPids(orgId); + } + + // 2.分页查询 + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.listProcessAnalysisEvents( + EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID), orgType, orgId, gridPids, categoryCode, processStatus, queryStartTime + , queryEndTime, biz); + + // 3.补充数据 + for (IcEventResultDTO event : list) { + // 网格信息 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(event.getGridId()); + if (gridInfo != null) { + event.setGridName(gridInfo.getGridName()); + } else { + logger.error("【IC事件分析】网格ID[{}]查询网格信息失败", event.getGridId()); + } + + // 上报渠道 + event.setSourceTypeName(eventSourceTypeDict.get(event.getSourceType())); + + // 状态 + EcEventProcessStatusEnum sourceTypeEnum = EcEventProcessStatusEnum.getObjectBySourceType(event.getProcessStatus()); + if (sourceTypeEnum != null) { + event.setProcessStatusName(sourceTypeEnum.getProcessStatusName()); + } + } + + PageInfo pageInfo = new PageInfo<>(list); + + return new PageData<>(list, pageInfo.getTotal()); + } + + @Override + public List listMonthlyIncrement(String orgType, String orgId, Date queryStartTime, Date queryEndTime) { + List resultList = new ArrayList<>(); + + String gridPids = null; + if ("agency".equals(orgType)) { + gridPids = getEventGridPids(orgId); + } + + // 从输入开始月份上一个月的开始查 + queryEndTime = DateUtils.addDateMonths(queryEndTime, 1); + + // 查询分组统计后的结果,此时月份数据不全,如果数量是0的月份不会在这里面 + List eventCountDataList = baseDao.listMonthlyEventCount(orgType, orgId, gridPids, queryStartTime, queryEndTime); + Map monthAndCount = eventCountDataList.stream().collect(Collectors.toMap((e) -> e.getMonthName(), (e) -> e.getEventCount())); + + Date tempMonth = DateUtils.integrate(queryStartTime, DateUtils.DATE_PATTERN_YYYY_MM); + Date endMonth = DateUtils.integrate(queryEndTime, DateUtils.DATE_PATTERN_YYYY_MM); + + // 按照开始和结束时间,对比数据库查出来的,没有数据的填0 + while (true) { + Integer increment = 0; + + if (tempMonth.equals(endMonth)) { + break; + } + + String tempMonthString = DateUtils.format(tempMonth, DateUtils.DATE_PATTERN_YYYY_MM); + Integer eventCountOfMonth = monthAndCount.get(tempMonthString); + if (eventCountOfMonth != null) { + increment = eventCountOfMonth; + } + + tempMonth = DateUtils.addDateMonths(tempMonth, 1); + + resultList.add(new IcEventMonthlyIncrementResultDTO(tempMonthString, increment)); + } + + + return resultList; + } + + @Override + public IcEventYpAnalysisResultDTO getYpAnalysis(String eventId) { + + // 事件上报渠道字典 + Map sourceTypeMap = getResultDataOrThrowsException( + adminOpenFeignClient.dictMap("ic_event_source_type"), + ServiceConstant.EPMET_ADMIN_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【事件研判分析】查询事件上报渠道字典失败", + "【事件研判分析】查询事件上报渠道字典失败"); + + // 事件信息 + IcEventEntity event = baseDao.selectById(eventId); + if (event == null) { + return null; + } + + // 上报人信息 + IcEventYpAnalysisResultDTO r = new IcEventYpAnalysisResultDTO(); + String idCard = event.getIdCard(); + List dependents = new ArrayList<>(); + if (StringUtils.isNotBlank(idCard)) { + IcResiUserDTO resiInfo = getResultDataOrThrowsException(userOpenFeignClient.getByResiIdCard(idCard), + ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【事件研判分析】根据身份证号查找居民信息失败", + "【事件研判分析】根据身份证号查找居民信息失败"); + if (resiInfo != null) { + r.setReportorResiId(resiInfo.getId()); + r.setReportorAgencyId(resiInfo.getAgencyId()); + r.setReportorGridId(resiInfo.getGridId()); + } + + dependents = getDependents(event.getIdCard()); + } + + // 该居民上报事件总数 + Integer resiReportEventCount = baseDao.getResiReportEventCount(event.getIdCard()); + + r.setReportorName(event.getName()); + r.setSourceTypeName(sourceTypeMap.get(event.getSourceType())); + r.setDependents(dependents); + r.setReportorMobile(event.getMobile()); + r.setReportorIdCard(idCard); + r.setResiReportEventCount(resiReportEventCount); + + // 事件分类 + IcEventCategoryEntity eventCategory = icEventCategoryService.getByEventId(eventId); + + // 有的事件刚创建,可能没有分类 + if (eventCategory != null) { + // 分类字典 + IssueProjectCategoryDictDTO categoryDictItem = getResultDataOrThrowsException(govIssueOpenFeignClient.getByCategoryCode(eventCategory.getCategoryCode()), + ServiceConstant.GOV_ISSUE_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【事件研判分析】查询分类字典失败", + "【事件研判分析】查询分类字典失败"); + + r.setCategoryCode(categoryDictItem.getParentCategoryCode()); + r.setCategoryPids(eventCategory.getCategoryPids()); + r.setCategoryName(categoryDictItem.getParentCategoryName()); + } + + return r; + } + + /** + * 查询家属 + * @param idCard + * @return + */ + private List getDependents(String idCard) { + IcResiUserBriefDTO familyInfo = getResultDataOrThrowsException(userOpenFeignClient.findFamilyMemByIdCard(idCard), + ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【事件研判分析】查找家属失败", + "【事件研判分析】查找家属失败"); + + List houseUserList = familyInfo.getHouseUserList(); + + ArrayList dependents = new ArrayList<>(); + if (CollectionUtils.isEmpty(houseUserList)) { + return dependents; + } + for (HouseUserDTO u : houseUserList) { + dependents.add(new IcEventYpAnalysisResultDTO.Dependent(u.getIcResiUserId(), u.getIcUserName(), u.getAgencyId(), u.getGridId())); + } + return dependents; + } + + @Override + public PageData getSameCategoryEvents(String orgId, String orgType, String categoryPids, Integer pageNo, Integer pageSize) { + String gridPids = null; + if ("agency".equals(orgType)) { + gridPids = getEventGridPids(orgId); + } + + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.listEventsByPCategoryInOrg(orgId, gridPids, orgType, categoryPids); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * @Author sun + * @Description 事件管理-回复 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void reply(IcEventReplyFormDTO formDTO) { + //1.查询事件数据 判断是否允许回复 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity || "1".equals(entity.getOperationType()) || "2".equals(entity.getOperationType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复"); + } + //2.修改事件数据 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && StringUtils.isNotBlank(formDTO.getStatus()) && "closed_case".equals(formDTO.getStatus())){ + entity.setStatus(formDTO.getStatus()); + entity.setCloseCaseTime(new Date()); + } + entity.setOperationType(NumConstant.ZERO_STR); + entity.setLatestOperatedTime(new Date()); + //工作端回复了,居民端那要展示红点。 + entity.setRedDot(NumConstant.ONE); + baseDao.updateById(entity); + + //3.新增回复数据 + //获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + IcEventReplyEntity replyEntity = new IcEventReplyEntity(); + replyEntity.setCustomerId(formDTO.getCustomerId()); + replyEntity.setIcEventId(formDTO.getIcEventId()); + replyEntity.setFromUserId(formDTO.getUserId()); + replyEntity.setContent(formDTO.getContent()); + replyEntity.setUserShowName(staffInfo.getAgencyName() + "-" + staffInfo.getRealName()); + icEventReplyService.insert(replyEntity); + + //4.判断新增或修改分类数据 + if (StringUtils.isNotBlank(formDTO.getCategoryId())) { + //查询分类信息 + List categoryList = new ArrayList<>(); + categoryList.add(formDTO.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + IcEventCategoryEntity categoryEntity = null; + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(formDTO.getCategoryId())) { + categoryEntity = new IcEventCategoryEntity(); + categoryEntity.setCustomerId(formDTO.getCustomerId()); + categoryEntity.setIcEventId(entity.getId()); + categoryEntity.setCategoryId(ca.getId()); + categoryEntity.setCategoryPids(ca.getPids()); + categoryEntity.setCategoryCode(ca.getCategoryCode()); + } + } + + IcEventCategoryEntity icEventCategory = icEventCategoryService.getByEventId(formDTO.getIcEventId()); + if (null == icEventCategory || StringUtils.isEmpty(icEventCategory.getId())) { + icEventCategoryService.insert(categoryEntity); + } else { + categoryEntity.setId(icEventCategory.getId()); + icEventCategoryService.updateById(categoryEntity); + } + } + //4.判断来源居民端的事件,回复、办结了给居民推送站内信 + List msgList = new ArrayList<>(); + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(formDTO.getCustomerId()); + messageFormDTO.setApp(ProjectConstant.RESI); + messageFormDTO.setGridId(entity.getGridId()); + messageFormDTO.setUserId(entity.getCreatedBy()); + messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); + messageFormDTO.setMessageContent(String.format("%s对您上报的事件进行了回复,请查看。", (staffInfo.getAgencyName() + "-" + staffInfo.getRealName()))); + messageFormDTO.setReadFlag(Constant.UNREAD); + messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); + messageFormDTO.setTargetId(entity.getId()); + msgList.add(messageFormDTO); + + //5.新增操作记录数据 + Date date = new Date(); + List logList = new ArrayList<>(); + logList.add(logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), date, ResiEventAction.REPLY.getCode(), ResiEventAction.REPLY.getCode())); + //回复时选择了已完成 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && ResiEventAction.CLOSE_CASE.getCode().equals(formDTO.getStatus())) { + date.setTime(date.getTime() + 6000 * 1); + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, ResiEventAction.CLOSE_CASE.getCode(), ResiEventAction.CLOSE_CASE.getCode())); + + UserMessageFormDTO close = ConvertUtils.sourceToTarget(messageFormDTO, UserMessageFormDTO.class); + close.setMessageContent(String.format("您上报的事件已完成,请查看。")); + msgList.add(close); + } + icEventOperationLogService.insertBatch(logList); + Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList); + if (!sendMessageRes.success()) { + log.warn(String.format("事件回复,给居民端用户发送站内信异常,事件Id->%s", entity.getId())); + } + + + } + + /** + * @Author sun + * @Description 事件管理-立项 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void icEventToProject(IcEventToProjectFormDTO formDTO) { + //1.查询事件数据 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity || "1".equals(entity.getOperationType()) || "2".equals(entity.getOperationType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许立项"); + } + //2.调用事件立项接口 + EventToProjectResultDTO project = projectTraceService.icEventToProject(formDTO); + + //3.更新事件数据 + entity.setOperationType(NumConstant.ONE_STR); + entity.setOperationId(project.getProjectId()); + entity.setLatestOperatedTime(new Date()); + //工作端回复了,居民端那要展示红点。 + entity.setRedDot(NumConstant.ONE); + baseDao.updateById(entity); + + //4.判断新增或修改分类数据 + if (!CollectionUtils.isEmpty(formDTO.getCategoryList())) { + String categoryId = formDTO.getCategoryList().get(NumConstant.ZERO).getId(); + //查询分类信息 + List categoryList = new ArrayList<>(); + categoryList.add(categoryId); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + IcEventCategoryEntity categoryEntity = null; + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(categoryId)) { + categoryEntity = new IcEventCategoryEntity(); + categoryEntity.setCustomerId(formDTO.getCustomerId()); + categoryEntity.setIcEventId(entity.getId()); + categoryEntity.setCategoryId(ca.getId()); + categoryEntity.setCategoryPids(ca.getPids()); + categoryEntity.setCategoryCode(ca.getCategoryCode()); + } + } + + IcEventCategoryEntity icEventCategory = icEventCategoryService.getByEventId(formDTO.getIcEventId()); + if (null == icEventCategory || StringUtils.isEmpty(icEventCategory.getId())) { + icEventCategoryService.insert(categoryEntity); + } else { + categoryEntity.setId(icEventCategory.getId()); + icEventCategoryService.updateById(categoryEntity); + } + } + + //5.新增操作记录 + IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), new Date(), "shift_project", "shift_project"); + icEventOperationLogService.insert(logEntity); + + //6.判断来源居民端的事件,转了项目给居民推送站内信 + if ("0".equals(entity.getSourceType())) { + //通知 + List msgList = new ArrayList<>(); + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(formDTO.getCustomerId()); + messageFormDTO.setApp(ProjectConstant.RESI); + messageFormDTO.setGridId(entity.getGridId()); + messageFormDTO.setUserId(entity.getCreatedBy()); + messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); + //获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + messageFormDTO.setMessageContent(String.format("%s将您上报的事件转为项目,请查看。", staffInfo.getAgencyName())); + messageFormDTO.setReadFlag(Constant.UNREAD); + messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); + messageFormDTO.setTargetId(entity.getId()); + msgList.add(messageFormDTO); + Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList); + if (!sendMessageRes.success()) { + log.warn(String.format("事件立项,给居民端用户发送站内信异常,事件Id->%s", entity.getId())); + } + } + } + + /** + * @Author sun + * @Description 事件管理-转需求 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void icEventToDemand(IcDemandFormDTO formDTO) { + //1.查询事件数据 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity || "1".equals(entity.getOperationType()) || "2".equals(entity.getOperationType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许转需求"); + } + //2.调用转需求接口 + formDTO.setOrigin("ic_event"); + formDTO.setOriginId(formDTO.getIcEventId()); + Result recIdResult = epmetHeartOpenFeignClient.icEventToDemand(formDTO); + if (!recIdResult.success() || recIdResult.getData() == null) { + throw new RenException(recIdResult.getCode(), recIdResult.getMsg()); + } + + //3.更新事件数据 + entity.setOperationType(NumConstant.TWO_STR); + entity.setOperationId(recIdResult.getData().getDemandRecId()); + entity.setLatestOperatedTime(new Date()); + //工作端回复了,居民端那要展示红点。 + entity.setRedDot(NumConstant.ONE); + baseDao.updateById(entity); + + //4.判断新增或修改分类数据 + if (StringUtils.isNotBlank(formDTO.getCategoryId())) { + //查询分类信息 + List categoryList = new ArrayList<>(); + categoryList.add(formDTO.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + IcEventCategoryEntity categoryEntity = null; + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(formDTO.getCategoryId())) { + categoryEntity = new IcEventCategoryEntity(); + categoryEntity.setCustomerId(formDTO.getCustomerId()); + categoryEntity.setIcEventId(entity.getId()); + categoryEntity.setCategoryId(ca.getId()); + categoryEntity.setCategoryPids(ca.getPids()); + categoryEntity.setCategoryCode(ca.getCategoryCode()); + } + } + + IcEventCategoryEntity icEventCategory = icEventCategoryService.getByEventId(formDTO.getIcEventId()); + if (null == icEventCategory || StringUtils.isEmpty(icEventCategory.getId())) { + icEventCategoryService.insert(categoryEntity); + } else { + categoryEntity.setId(icEventCategory.getId()); + icEventCategoryService.updateById(categoryEntity); + } + } + + //5.新增操作记录 + IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getDemandUserId(), new Date(), "shift_demand", "shift_demand"); + icEventOperationLogService.insert(logEntity); + + //6.判断来源居民端的事件,转了项目给居民推送站内信 + if ("0".equals(entity.getSourceType())) { + //通知 + List msgList = new ArrayList<>(); + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(formDTO.getCustomerId()); + messageFormDTO.setApp(ProjectConstant.RESI); + messageFormDTO.setGridId(entity.getGridId()); + messageFormDTO.setUserId(entity.getCreatedBy()); + messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getDemandUserId()); + messageFormDTO.setMessageContent(String.format("%s将您上报的事件转为服务,请查看。", staffInfo.getAgencyName())); + messageFormDTO.setReadFlag(Constant.UNREAD); + messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); + messageFormDTO.setTargetId(entity.getId()); + msgList.add(messageFormDTO); + Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList); + if (!sendMessageRes.success()) { + log.warn(String.format("事件转需求,给居民端用户发送站内信异常,事件Id->%s", entity.getId())); + } + } + + } + + /** + * 事件分类分析-一级分类下事件数量 + * + * @param formDTO + * @return + */ + @Override + public List categoryAnalysisTotal(IcEventCategoryAnalysisFormDTO formDTO) { + Result> res = govIssueOpenFeignClient.queryFirstCategory(formDTO.getCustomerId()); + if (!res.success() || CollectionUtils.isEmpty(res.getData())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前客户下未配置事件分类"); + } + int length = res.getData().get(NumConstant.ZERO).getCategoryCode().length(); + formDTO.setCategoryOneLength(length); + if ("agency".equals(formDTO.getOrgType())) { + formDTO.setGridPids(getEventGridPids(formDTO.getOrgId())); + } + + List resList = baseDao.selectFirstCategoryTotal(formDTO); + Map resMap = resList.stream().collect(Collectors.toMap(IcEventCategoryAnalysisResDTO::getCategoryCode, Function.identity())); + List result = new ArrayList<>(); + for (IssueProjectCategoryDictDTO dict : res.getData()) { + IcEventCategoryAnalysisResDTO resultDto = ConvertUtils.sourceToTarget(dict, IcEventCategoryAnalysisResDTO.class); + resultDto.setTotal(MapUtils.isNotEmpty(resMap) && resMap.containsKey(dict.getCategoryCode()) ? resMap.get(dict.getCategoryCode()).getTotal() : NumConstant.ZERO); + result.add(resultDto); + } + return result; + } + + /** + * @Author sun + * @Description 事件管理-评价 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void comment(IcEventReplyFormDTO formDTO) { + //1.查询事件是否存在 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity || !"closed_case".equals(entity.getStatus()) || StringUtils.isNotBlank(entity.getSatisfaction())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "不允许评价,事件不存在或还未办结"); + } + + //2.判断当前评价人是否是事件创建人 + if (!formDTO.getUserId().equals(entity.getCreatedBy())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "不允许评价,当前评价人不是事件创建人"); + } + + //3.修改事件数据 + entity.setCommentUserId(formDTO.getUserId()); + entity.setSatisfaction(formDTO.getSatisfaction()); + entity.setCommentTime(new Date()); + baseDao.updateById(entity); + + //4.判断已转项目或已转需求的对应的增加评价记录 + if (NumConstant.ONE_STR.equals(entity.getOperationType())) { + //立项 + projectSatisfactionDetailService.comment(entity.getCustomerId(), entity.getOperationId(), formDTO.getSatisfaction()); + } else if (NumConstant.TWO_STR.equals(entity.getOperationType())) { + //转需求 + IcEventCommentToDemandFromDTO dto = new IcEventCommentToDemandFromDTO(); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setDemandRecId(entity.getOperationId()); + dto.setSatisfaction(formDTO.getSatisfaction()); + dto.setStaffId(formDTO.getUserId()); + Result result = epmetHeartOpenFeignClient.icEventComment(dto); + if (!result.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "评价事件同步服务评价结果失败"); + } + } + + } + + /** + * @Author sun + * @Description 事件管理-评价 + **/ + @Override + public IcEventListResultDTO detail(IcEventListFormDTO formDTO) { + IcEventListResultDTO resultDTO = new IcEventListResultDTO(); + //1.获取事件基本信息 + List list = baseDao.icEventList(formDTO); + if (!CollectionUtils.isEmpty(list)) { + resultDTO = list.get(0); + //查询网格名称(组织-网格) + List gridIds = list.stream().map(IcEventListResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); + Result> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2)); + + //事件管理字典表数据 + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + + //封装数据 + if (gridInfoMap.containsKey(resultDTO.getGridId())) { + resultDTO.setGridName(gridInfoMap.get(resultDTO.getGridId())); + } + if (StringUtils.isNotBlank(resultDTO.getSourceType())) { + resultDTO.setSourceTypeName(statusMap.get(resultDTO.getSourceType())); + } + //每个事件对应的图片数据 + if(!CollectionUtils.isEmpty(resultDTO.getAttachmentList())){ + List imageList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + resultDTO.getAttachmentList().forEach(file -> { + if ("image".equals(file.getType())) { + imageList.add(file.getUrl()); + } else if ("voice".equals(file.getType())) { + voiceList.add(file.getUrl()); + } + }); + resultDTO.setImageList(imageList); + resultDTO.setVoiceList(voiceList); + } + + //分类信息 + if(StringUtils.isNotBlank(resultDTO.getCategoryId())){ + List categoryList = new ArrayList<>(); + categoryList.add(resultDTO.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(resultDTO.getCategoryId())) { + resultDTO.setParentCategoryId(ca.getPid()); + resultDTO.setCategoryId(ca.getId()); + resultDTO.setParentCategoryCode(ca.getParentCategoryCode()); + resultDTO.setCategoryCode(ca.getCategoryCode()); + resultDTO.setParentCategoryName(ca.getParentCategoryName()); + resultDTO.setCategoryName(ca.getCategoryName()); + } + } + } + } + + return resultDTO; + } + + /** + * 事件分类分析- 饼图2,直属下级 事件数量 + * + * @param formDTO + * @return + */ + @Override + public List analysisOrgTotal(IcEventCategoryAnalysisFormDTO formDTO) { + List list = new ArrayList<>(); + if ("grid".equals(formDTO.getOrgType())) { + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(formDTO.getOrgId()); + if (null == gridInfoCache) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常"); + } + IcEventAnalysisOrgResDTO grid = ConvertUtils.sourceToTarget(formDTO,IcEventAnalysisOrgResDTO.class); + grid.setOrgName(gridInfoCache.getGridName()); + grid.setTotal(baseDao.selectOrgTotal(formDTO)); + list.add(grid); + return list; + } + Result> subOrgListRes = govOrgOpenFeignClient.subOrgList(formDTO.getOrgId()); + if (!subOrgListRes.success() || CollectionUtils.isEmpty(subOrgListRes.getData())) { + return list; + } + for (SubOrgResDTO org : subOrgListRes.getData()) { + IcEventAnalysisOrgResDTO resultDto = ConvertUtils.sourceToTarget(org, IcEventAnalysisOrgResDTO.class); + formDTO.setOrgId(org.getOrgId()); + formDTO.setOrgType(org.getOrgType()); + if("agency".equals(org.getOrgType())){ + String purePids = org.getPids(); + if ("0".equals(purePids) || StringUtils.isBlank(purePids)) { + formDTO.setGridPids(org.getOrgId()); + } else { + formDTO.setGridPids(purePids.concat(":").concat(org.getOrgId())); + } + } + resultDto.setTotal(baseDao.selectOrgTotal(formDTO)); + list.add(resultDto); + } + return list; + } + + /** + * Desc: 定时任务自动评价 + * @param formDTO + * @author zxc + * @date 2022/5/18 16:35 + */ + @Override + public void autoEvaluation(AutoEvaluationFormDTO formDTO) { + List customerIds = new ArrayList<>(); + if (StringUtils.isBlank(formDTO.getCustomerId())){ + Result> allCustomerList = crmOpenFeignClient.getAllCustomerList(); + if (!allCustomerList.success()){ + throw new EpmetException("查询所有客户失败"); + } + List data = allCustomerList.getData(); + customerIds.addAll(data.stream().map(m -> m.getId()).collect(Collectors.toList())); + }else { + customerIds.add(formDTO.getCustomerId()); + } + customerIds.forEach(c -> { + autoEvaluationDispose(c); + }); + } + + /** + * Desc: 处理未评价的icEvent + * @param customerId + * @author zxc + * @date 2022/5/18 16:52 + */ + @Transactional(rollbackFor = Exception.class) + public void autoEvaluationDispose(String customerId){ + Integer no = NumConstant.ONE; + Integer size = NumConstant.ONE_HUNDRED; + List ids = new ArrayList<>(); + do { + int start = (no - NumConstant.ONE) * size; + ids = baseDao.getAutoEvaluationIds(customerId,start,size); + // 批量更新 + if (!CollectionUtils.isEmpty(ids)){ + baseDao.updateAutoEvaluation(ids); + } + no++; + }while (ids.size() == size); + } + + /** + * @Author sun + * @Description 事件管理-处理进展 + **/ + @Override + public LinkedList process(IcEventReplyFormDTO formDTO) { + LinkedList resultList = new LinkedList(); + //1.查询事件基础信息 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件不存在"); + } + + //2.查询事件回复信息 + LinkedList event = icEventReplyService.getByEventId(formDTO.getIcEventId()); + + //3.判断查询事件项目进展或需求进展信息 + //项目进展 + if ("1".equals(entity.getOperationType())) { + ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO(); + processListV2FormDTO.setProjectId(entity.getOperationId()); + List project = projectTraceService.processListV2(processListV2FormDTO); + List projectList = ConvertUtils.sourceToTarget(project, IcEventProcessListResultDTO.class); + projectList.forEach(p->p.setType("project")); + resultList.addAll(projectList); + } + //需求进展 + if ("2".equals(entity.getOperationType())) { + LinkedList demand = icEventOperationLogService.getByEventId(formDTO.getIcEventId()); + resultList.addAll(demand); + } + resultList.addAll(event); + + return resultList; + } + + /** + * @Author sun + * @Description 需求完成/项目结案时 修改事件数据 + **/ + @Override + public void closeProjectOrDemand(ColseProjectOrDemandFormDTO formDTO) { + //1.查询事件数据 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity || "closed_case".equals(entity.getStatus())) { + logger.error(String.format("事件不存在或已办结不允许修改,事件Id->%s", formDTO.getIcEventId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件不存在或已办结不允许修改"); + } + + //2.修改事件数据 + entity.setStatus("closed_case"); + entity.setCloseCaseTime(new Date()); + entity.setLatestOperatedTime(new Date()); + baseDao.updateById(entity); + + //3.判断新增操作记录 + if ("demand".equals(formDTO.getType())) { + IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity(); + logEntity.setIcEventId(formDTO.getIcEventId()); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setUserId(formDTO.getUserId()); + logEntity.setUserIdentity("staff"); + logEntity.setActionCode("close_demand"); + logEntity.setActionDesc("close_demand"); + logEntity.setOperateTime(new Date()); + logEntity.setServiceParty(formDTO.getServiceParty()); + logEntity.setActualServiceTime(formDTO.getActualServiceTime()); + icEventOperationLogService.insert(logEntity); + } + } + + /** + * Desc: 新增【随手拍、讲】 + * @param formDTO + * @author zxc + * @date 2022/5/19 13:38 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void addEventFromResi(AddEventFromResiFormDTO formDTO) { + // 判断是否注册居民 + Result isResiFlag = userOpenFeignClient.getIsResiFlag(formDTO.getUserId()); + if (!isResiFlag.success()){ + throw new EpmetException("查询是否注册居民失败..."); + } + if (!isResiFlag.getData()){ + throw new EpmetException(EpmetErrorCode.NOT_REGEIST_RESI.getCode()); + } + if(StringUtils.isBlank(formDTO.getContent()) && CollectionUtils.isEmpty(formDTO.getVoiceList())) { + //话题内容和语音不能同时为空 + log.error("事件内容和语音不能同时为空"); + throw new RenException(EpmetErrorCode.RESI_EVENT_SUBMIT.getCode(), EpmetErrorCode.RESI_EVENT_SUBMIT.getMsg()); + } + if (!CollectionUtils.isEmpty(formDTO.getVoiceList()) && StringUtils.isBlank(formDTO.getContent())) { + formDTO.setContent("语音事件"); + } + resiEventService.scanContent(formDTO.getContent(), formDTO.getAttachmentList()); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); + if (null == gridInfo){ + throw new EpmetException("未查询到此网格信息"+formDTO.getGridId()); + } + IcEventEntity entity = ConvertUtils.sourceToTarget(formDTO,IcEventEntity.class); + entity.setAgencyId(gridInfo.getPid()); + entity.setGridPids(gridInfo.getPids()); + Result> userResult = userOpenFeignClient.queryUserBaseInfo(Arrays.asList(formDTO.getUserId())); + if (!userResult.success() && CollectionUtils.isEmpty(userResult.getData())){ + throw new EpmetException("查询用户信息失败"+formDTO.getUserId()); + } + entity.setReportUserId(formDTO.getUserId()); + AtomicReference userShowName = new AtomicReference<>(""); + userResult.getData().forEach(u -> { + if (u.getUserId().equals(formDTO.getUserId())){ + entity.setName(u.getRealName()); + entity.setMobile(u.getMobile()); + entity.setIdCard(u.getIdNum()); + userShowName.set(u.getUserShowName()); + } + }); + // 0代表 随手拍和随时讲 + entity.setSourceType(NumConstant.ZERO_STR); + entity.setHappenTime(new Date()); + entity.setEventContent(formDTO.getContent()); + entity.setStatus("processing"); + entity.setReadFlag(0); + entity.setRedDot(0); + entity.setLatestOperatedTime(new Date()); + entity.setAuditStatus(TopicConstant.AUTO_PASSED); + baseDao.insert(entity); + //3-2.附件数据保存 + List attachmentEntityList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(formDTO.getAttachmentList())) { + disposeAttachment(formDTO.getAttachmentList(), attachmentEntityList,entity.getId(),formDTO.getCustomerId(),formDTO.getUserId()); + } + if (!CollectionUtils.isEmpty(formDTO.getVoiceList())) { + disposeAttachment(formDTO.getVoiceList(), attachmentEntityList,entity.getId(),formDTO.getCustomerId(),formDTO.getUserId()); + } + if (!CollectionUtils.isEmpty(attachmentEntityList)){ + icEventAttachmentService.insertBatch(attachmentEntityList); + } + // 站内信发送给社区每个工作人员 + disposeMessage(gridInfo.getPid(), formDTO.getCustomerId(), userShowName.get(), entity.getId()); + } + + /** + * Desc: 给工作人员发送站内信 + * @param agencyId + * @param customerId + * @param showName + * @param icEventId + * @author zxc + * @date 2022/5/20 10:22 + */ + public void disposeMessage(String agencyId,String customerId,String showName,String icEventId){ + // 查询组织下的所有工作人员 + AgencyIdFormDTO formDTO = new AgencyIdFormDTO(); + formDTO.setAgencyId(agencyId); + Result> agencyStaffsResult = govOrgOpenFeignClient.getAgencyStaffs(formDTO); + if (!agencyStaffsResult.success()){ + throw new EpmetException("查询组织下工作人员失败..."); + } + if (!CollectionUtils.isEmpty(agencyStaffsResult.getData())){ + List msgList = new ArrayList<>(); + agencyStaffsResult.getData().forEach(u -> { + UserMessageFormDTO msg = new UserMessageFormDTO(); + msg.setUserId(u); + msg.setCustomerId(customerId); + msg.setTargetId(icEventId); + msg.setGridId("*"); + msg.setApp(AppClientConstant.APP_GOV); + msg.setMessageType(UserMessageTypeConstant.IC_EVENT); + msg.setReadFlag(ReadFlagConstant.UN_READ); + msg.setTitle("您有一条事件消息"); + msg.setMessageContent(showName+"上报一条事件,请查看。"); + msgList.add(msg); + }); + messageOpenFeignClient.saveUserMessageList(msgList); + } + } + + /** + * Desc: 附件处理 + * @param list + * @param attachmentEntityList + * @param id + * @param customerId + * @param userId + * @author zxc + * @date 2022/5/20 09:50 + */ + public void disposeAttachment(List list,List attachmentEntityList,String id,String customerId,String userId){ + int sort = NumConstant.ZERO; + for (FileCommonDTO a : list) { + IcEventAttachmentEntity attachment = new IcEventAttachmentEntity(); + attachment.setCustomerId(customerId); + attachment.setIcEventId(id); + attachment.setCreatedBy(userId); + attachment.setAttachmentFormat(a.getFormat()); + attachment.setAttachmentType(a.getType()); + attachment.setAttachmentUrl(a.getUrl()); + attachment.setDuration(a.getDuration()); + attachment.setStatus(TopicConstant.AUTO_PASSED); + attachment.setSort(sort++); + attachmentEntityList.add(attachment); + } + } + + + /** + * 居民端小程序我上报的事件-列表+详情 + * yapi: http://yapi.elinkservice.cn/project/102/interface/api/7781 + * + * @param formDTO + * @return + */ + @Override + public PageData myReport(MyReportIcEvFormDTO formDTO) { + // 1.分页查询 + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectMyReport(formDTO)); + List list = pageInfo.getList(); + if (!CollectionUtils.isEmpty(list)) { + //封装数据 + for (MyReportIcEvResDTO dto : list) { + //每个事件对应的图片数据 + if (!CollectionUtils.isEmpty(dto.getAttachmentList())) { + List imageList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + for (IcEventAttachmentDTO file : dto.getAttachmentList()) { + if ("image".equals(file.getAttachmentType())) { + imageList.add(file.getAttachmentUrl()); + } else if ("voice".equals(file.getAttachmentType())) { + voiceList.add(file); + } + } + dto.setImageList(imageList); + dto.setVoiceList(voiceList); + } + + //分类信息 + if(StringUtils.isNotBlank(dto.getCategoryId())){ + List categoryList = new ArrayList<>(); + categoryList.add(dto.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(dto.getCategoryId())) { + if(StringUtils.isNotBlank(ca.getParentCategoryName())){ + //大类-子类 + dto.setCategoryName(ca.getParentCategoryName().concat(StrConstant.HYPHEN).concat(ca.getCategoryName())); + }else{ + dto.setCategoryName(ca.getCategoryName()); + } + } + } + } + + } + } + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 居民端小程序我上报的事件-处理中 + * 点击事件进入详情页时调用此接口,消除红点 + * + * @param userId + * @param icEventId + * @return + */ + @Override + public void removeRed(String userId, String icEventId) { + baseDao.updateRedDot(userId,icEventId); + } + + /** + * 居民端我上报的事件-回复 + * + * @param formDTO + */ + @Override + public void resiReply(ResiReplyIcEventFormDTO formDTO) { + //1.查询事件数据 判断是否允许回复 + IcEventEntity entity=checkReply(formDTO.getIcEventId()); + entity.setLatestOperatedTime(new Date()); + entity.setRedDot(NumConstant.ZERO); + baseDao.updateById(entity); + + //2.新增回复数据 + IcEventReplyEntity replyEntity = new IcEventReplyEntity(); + replyEntity.setCustomerId(formDTO.getCustomerId()); + replyEntity.setIcEventId(formDTO.getIcEventId()); + replyEntity.setFromUserId(formDTO.getUserId()); + replyEntity.setContent(formDTO.getContent()); + // 查询当前用户的显示昵称 应该是xxx街道-姓/女士or先生 如果没有街道和姓,显示的微信昵称 + List userIdList =new ArrayList<>(); + userIdList.add(formDTO.getUserId()); + Result> userResult=userOpenFeignClient.queryUserBaseInfo(userIdList); + if (!userResult.success() || CollectionUtils.isEmpty(userResult.getData())) { + throw new RenException("查询当前用户信息异常"); + } + replyEntity.setUserShowName(userResult.getData().get(NumConstant.ZERO).getUserShowName()); + icEventReplyService.insert(replyEntity); + + //3.新增操作记录数据 + IcEventOperationLogEntity logEntity =ConvertUtils.sourceToTarget(formDTO,IcEventOperationLogEntity.class); + logEntity.setUserIdentity(EventConstant.RESI_USER); + logEntity.setActionCode(ResiEventAction.REPLY.getCode()); + logEntity.setActionDesc(ResiEventAction.REPLY.getDesc()); + logEntity.setOperateTime(new Date()); + icEventOperationLogService.insert(logEntity); + } + + /** + * 居民端我上报的事件, 消息列表跳转详情 + * + * @param formDTO + * @return + */ + @Override + public MyReportIcEvResDTO myReportDetail(MyReportIcEvFormDTO formDTO) { + // 1.分页查询 + List list=baseDao.selectMyReport(formDTO); + if (!CollectionUtils.isEmpty(list)) { + //封装数据 + for (MyReportIcEvResDTO dto : list) { + //每个事件对应的图片数据 + if (!CollectionUtils.isEmpty(dto.getAttachmentList())) { + List imageList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + for (IcEventAttachmentDTO file : dto.getAttachmentList()) { + if ("image".equals(file.getAttachmentType())) { + imageList.add(file.getAttachmentUrl()); + } else if ("voice".equals(file.getAttachmentType())) { + voiceList.add(file); + } + } + dto.setImageList(imageList); + dto.setVoiceList(voiceList); + } + + //分类信息 + if(StringUtils.isNotBlank(dto.getCategoryId())){ + List categoryList = new ArrayList<>(); + categoryList.add(dto.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(dto.getCategoryId())) { + if(StringUtils.isNotBlank(ca.getParentCategoryName())){ + //大类-子类 + dto.setCategoryName(ca.getParentCategoryName().concat(StrConstant.HYPHEN).concat(ca.getCategoryName())); + }else{ + dto.setCategoryName(ca.getCategoryName()); + } + } + } + } + + } + } + return list.get(NumConstant.ZERO); + } + + private IcEventEntity checkReply(String icEventId) { + //:0:已回复 1:已转项目 1:已转需求 + IcEventEntity entity = baseDao.selectById(icEventId); + if (null == entity || NumConstant.ONE_STR.equals(entity.getOperationType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复", "事件已转项目"); + } + if (null == entity || NumConstant.TWO_STR.equals(entity.getOperationType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复", "事件已转需求"); + } + return entity; + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index 902fb92e6f..2b51ec32ce 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -646,6 +646,8 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl NumConstant.ZERO) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java index c1e07bf6bf..0df33e275a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java @@ -356,4 +356,29 @@ public class ProjectSatisfactionDetailServiceImpl extends BaseServiceImpl implements ProjectService { private Logger logger = LogManager.getLogger(ProjectServiceImpl.class); - @Autowired - private ProjectRedis projectRedis; + @Autowired private CustomerProjectParameterService parameterService; @Autowired @@ -149,6 +154,10 @@ public class ProjectServiceImpl extends BaseServiceImpl { if (issueDTO.getOrgId().equals(agency.getId())) { processEntity.setDepartmentName(agency.getOrganizationName()); @@ -2281,6 +2307,8 @@ public class ProjectServiceImpl extends BaseServiceImpl projectList(ProjectManageListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员信息"+formDTO.getUserId()); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageData result = new PageData<>(new ArrayList<>(),NumConstant.ZERO); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getProjectManageList(formDTO)); + List projectManageList = pageInfo.getList(); + if (CollectionUtils.isNotEmpty(projectManageList)){ + // 获取滞留天数 + Integer days = getDays(ConvertUtils.sourceToTarget(formDTO, ProjectListFromDTO.class)); + projectManageList.forEach(p -> { + // 所属网格赋值 + if (StringUtils.isNotBlank(p.getGridId())){ + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(p.getGridId()); + if (null == gridInfo){ + throw new EpmetException("未查询到网格信息"+p.getGridId()); + } + p.setGridName(gridInfo.getGridNamePath()); + } + // 获取当前处理部门 + List departmentNameList = new ArrayList<>(); + if (ProjectConstant.CLOSED.equals(p.getStatus())) { + p.setDepartmentNameList(departmentNameList); + p.setDetentionDays(NumConstant.ZERO_STR); + p.setProcessable(false); + p.setReturnable(false); + } else { + ProjectDTO projectDTO = ConvertUtils.sourceToTarget(p, ProjectDTO.class); + projectDTO.setId(p.getProjectId()); + if (p.getIsHandle().equals("unhandled")){ + String detentionDays = getDetentionDays(projectDTO); + if (!ONE_DAY.equals(detentionDays) && Integer.parseInt(detentionDays) > days) { + p.setDetentionDays(detentionDays); + } else { + p.setDetentionDays(detentionDays); + } + } + departmentNameList = baseDao.selectDepartmentNameList(projectDTO); + p.setDepartmentNameList(departmentNameList); + ProjectStaffDTO projectStaffDTO = new ProjectStaffDTO(); + projectStaffDTO.setProjectId(p.getProjectId()); + projectStaffDTO.setStaffId(formDTO.getUserId()); + List departmentList = projectStaffService.getDepartmentNameList(projectStaffDTO); + if (null != departmentList && departmentList.size() > NumConstant.ZERO) { + //TODO external_system值为1时,根据departmentList里的projectStaffId在project_sub_process表找最新的一条记录, + // 如果没有记录或者INTERNAL_STATUS是closed,processable的值为true + CustomerProjectParameterDTO customerProjectParameterDTO = new CustomerProjectParameterDTO(); + customerProjectParameterDTO.setCustomerId(formDTO.getCustomerId()); + customerProjectParameterDTO.setParameterKey(ProjectConstant.EXTERNAL_SYSTEM); + String parameterValue = parameterService.getParameterValueByKey(customerProjectParameterDTO); + if (StringUtils.isNotEmpty(parameterValue)){ + if (parameterValue.equals(NumConstant.ONE_STR)) { + List projectStaffIds = departmentList.stream().map(m -> m.getProjectStaffId()).distinct().collect(Collectors.toList()); + // 根据departmentList里的projectStaffId在project_sub_process表找最新的一条记录 + ProjectSubProcessDTO projectSubProcessDTO = projectSubProcessService.selectSubProcess(projectStaffIds); + if (null == projectSubProcessDTO || projectSubProcessDTO.getInternalStatus().equals(ProjectConstant.CLOSED)) { + p.setProcessable(true); + } else { + p.setProcessable(false); + } + } else { + p.setProcessable(true); + } + } else { + p.setProcessable(true); + } + } else { + p.setProcessable(false); + } + ReturnListFromDTO returnListFromDTO = new ReturnListFromDTO(); + returnListFromDTO.setProjectId(p.getProjectId()); + List returnableList = projectProcessService.getReturnableList(returnListFromDTO); + if (null != returnableList && returnableList.size() > NumConstant.ZERO) { + p.setReturnable(true); + } else { + p.setReturnable(false); + } + } + }); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + result.setList(projectManageList); + } + return result; + } + + /** + * Desc: 满意度评价列表 + * @param formDTO + * @author zxc + * @date 2022/5/18 10:03 + */ + @Override + public PageData satisfactionEvaluationList(SatisfactionEvaluationListFormDTO formDTO) { + PageData data = new PageData<>(new ArrayList<>(),NumConstant.ZERO); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> satisfactionDetailDao.satisfactionEvaluationList(formDTO.getProjectId())); + List result = pageInfo.getList(); + if (CollectionUtils.isNotEmpty(result)){ + Result> listResult = epmetUserOpenFeignClient.getStaffAndResi(result.stream().map(m -> m.getUserId()).distinct().collect(Collectors.toList())); + if (!listResult.success()){ + throw new EpmetException("查询user信息失败..."); + } + listResult.getData().forEach(u -> result.stream().filter(r -> r.getUserId().equals(u.getUserId())).forEach(r -> r.setEvaluationUser(u.getRealName()))); + data.setList(result); + data.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + } + return data; + } + + /** + * Desc: 项目管理导出 + * @param response + * @param formDTO + * @author zxc + * @date 2022/5/24 15:22 + */ + @Override + public void projectListExport(HttpServletResponse response, ProjectManageListFormDTO formDTO) throws IOException { + List list = this.projectList(formDTO).getList(); + List projectListExportExcels = ConvertUtils.sourceToTarget(list, ProjectListExportExcel.class); + TemplateExportParams templatePath = new TemplateExportParams("excel/project_list_export.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",projectListExportExcels); + ExcelPoiUtils.exportExcel(templatePath ,map,"项目管理导出表",response); + } + /** * @Description 区间项目分类数量处理 * 查询的是时间段内的分类项目数,查询的时间 是传入一个日期,拼上时间,在进行比较大小 diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java index 7bf5b6e4df..3007780212 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java @@ -111,6 +111,8 @@ public class ProjectTraceServiceImpl implements ProjectTraceS private BlockChainUploadService blockChainUploadService; @Autowired private YuShanSysApiService yuShanSysApiService; + @Autowired + private EpmetHeartOpenFeignClient heartOpenFeignClient; @Override @@ -156,6 +158,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS @Override public void closedV2(TokenDto tokenDto, ProjectClosedFromDTO fromDTO) { fromDTO.setUserId(tokenDto.getUserId()); + fromDTO.setCustomerId(tokenDto.getCustomerId()); projectService.closedV2(fromDTO); } @@ -240,6 +243,30 @@ public class ProjectTraceServiceImpl implements ProjectTraceS processList.forEach(p -> internalFiles.stream().filter(f -> p.getProcessId().equals(f.getProcessId())).forEach(f -> p.getInternalFile().add(f))); } } + // 协办单位名字赋值 协办单位类型,1社区自组织,2联建单位 + Map> groupByType = processList.stream().filter(p -> StringUtils.isNotBlank(p.getAssistanceUnitType())).collect(Collectors.groupingBy(ProcessListV2ResultDTO::getAssistanceUnitType)); + List oneType = groupByType.get(NumConstant.ONE_STR); + List twoType = groupByType.get(NumConstant.TWO_STR); + PartyUnitListFormDTO partyUnitListFormDTO = new PartyUnitListFormDTO(); + if (CollectionUtils.isNotEmpty(oneType)){ + partyUnitListFormDTO.setCommunitySelfIds(oneType.stream().map(m -> m.getAssistanceUnitId()).collect(Collectors.toList())); + } + if (CollectionUtils.isNotEmpty(twoType)){ + partyUnitListFormDTO.setPartyUnitIds(twoType.stream().map(m -> m.getAssistanceUnitId()).collect(Collectors.toList())); + } + Result> partyUnitListResult = heartOpenFeignClient.getPartyUnitList(partyUnitListFormDTO); + if (!partyUnitListResult.success()){ + throw new EpmetException("查询协办单位失败"); + } + if (CollectionUtils.isNotEmpty(partyUnitListResult.getData())){ + partyUnitListResult.getData().forEach(u -> { + processList.forEach(p -> { + if (u.getAssistanceUnitId().equals(p.getAssistanceUnitId())){ + p.setAssistanceUnitName(u.getAssistanceUnitName()); + } + }); + }); + } return processList; } @@ -382,6 +409,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setCustomerId(formDTO.getCustomerId()); projectEntity.setAgencyId(loginUser.getAgencyId()); + projectEntity.setGridId(formDTO.getGridId()); if (ProjectConstant.WORK_EVENT.equals(formDTO.getType())) { projectEntity.setOrigin(ProjectConstant.WORK_EVENT); projectEntity.setOriginId(formDTO.getGridId()); @@ -407,6 +435,8 @@ public class ProjectTraceServiceImpl implements ProjectTraceS processEntity.setOperationName(ProjectConstant.OPERATION_PROJECT_APPROVAL); processEntity.setPublicReply(formDTO.getPublicReply()); processEntity.setInternalRemark(formDTO.getInternalRemark()); + processEntity.setAssistanceUnitType(formDTO.getAssistanceUnitType()); + processEntity.setAssistanceUnitId(formDTO.getAssistanceUnitId()); agencyDeptGrid.getAgencyList().forEach(agency -> { if (loginUser.getAgencyId().equals(agency.getId())) { processEntity.setDepartmentName(agency.getOrganizationName()); @@ -675,6 +705,8 @@ public class ProjectTraceServiceImpl implements ProjectTraceS public EventToProjectResultDTO eventToProject(EventToProjectFormDTO formDTO) { //事件已经立项,不能重复操作 ResiEventEntity resiEventEntity=resiEventService.getById(formDTO.getEventId()); + //TODO 兼容新事件表 + String gridId = formDTO.getGridId(); if(null==resiEventEntity||resiEventEntity.getShiftProject()){ throw new RenException(EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getCode(),EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getMsg()); } @@ -719,6 +751,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS projectEntity.setOriginId(formDTO.getEventId()); projectEntity.setTitle(formDTO.getTitle()); projectEntity.setBackGround(formDTO.getPublicReply()); + projectEntity.setGridId(gridId); projectEntity.setStatus(ProjectConstant.PENDING); projectEntity.setOrgIdPath(loginUser.getOrgIdPath()); projectEntity.setLocateAddress(null == formDTO.getLocateAddress() ? "" : formDTO.getLocateAddress()); @@ -735,6 +768,8 @@ public class ProjectTraceServiceImpl implements ProjectTraceS processEntity.setOperationName(ProjectConstant.OPERATION_PROJECT_APPROVAL); processEntity.setPublicReply(formDTO.getPublicReply()); processEntity.setInternalRemark(formDTO.getInternalRemark()); + processEntity.setAssistanceUnitId(formDTO.getAssistanceUnitId()); + processEntity.setAssistanceUnitType(formDTO.getAssistanceUnitType()); agencyDeptGrid.getAgencyList().forEach(agency -> { if (loginUser.getAgencyId().equals(agency.getId())) { processEntity.setDepartmentName(agency.getOrganizationName()); @@ -1191,4 +1226,234 @@ public class ProjectTraceServiceImpl implements ProjectTraceS epmetMessageOpenFeignClient.saveUserMessage(userMessage); } + + /** + * 事件管理-事件立项【赶时间没空兼容】 + * @author sun + */ + @Override + public EventToProjectResultDTO icEventToProject(IcEventToProjectFormDTO formDTO) { + //判断是否存在已立项 + List projectEntityList = projectService.getByOriginId(formDTO.getIcEventId()); + if (!CollectionUtils.isEmpty(projectEntityList)) { + throw new RenException(EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getCode(), EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getMsg()); + } + List staffList = formDTO.getStaffList(); + //1.文字内容安全校验 + List list = new ArrayList<>(); + list.add(formDTO.getTitle()); + list.add(formDTO.getPublicReply()); + list.add(formDTO.getPublicReply()); + list.add(formDTO.getInternalRemark()); + safetyCheck(list); + //2.数据准备 + //2-1获取当前工作人员基本信息 + EventToProjectFormDTO eventToProjectFormDTO = ConvertUtils.sourceToTarget(formDTO, EventToProjectFormDTO.class); + LoginUserDetailsResultDTO loginUser = queryLoginUserInfo(eventToProjectFormDTO); + + //2-2.调用gov-org服务,获取所有勾选人员以及议题数据对应的组织信息、部门信息、网格信息用于对处理部门和ORG_ID_PATH字段的赋值使用 + AgencyDeptGridResultDTO agencyDeptGrid = getAgencyDeptGridRes(formDTO.getStaffList(), loginUser.getAgencyId()); + + //2-3.调用issue服务,查询分类、标签数据信息 + CategoryTagResultDTO categoryTagResultDTO = queryCategoryTagRes(eventToProjectFormDTO); + List categoryList = categoryTagResultDTO.getCategoryList(); + List tagList = categoryTagResultDTO.getTagList(); + + //2-4.批量查询被勾选工作人员基础信息 + List staffInfoList = queryStaffListRes(formDTO.getStaffList(), formDTO.getUserId()); + + //3.封装保存业务数据 + //3-1.项目主表新增数据 + ProjectEntity projectEntity = new ProjectEntity(); + projectEntity.setCustomerId(formDTO.getCustomerId()); + //立项人的所属组织id + projectEntity.setAgencyId(loginUser.getAgencyId()); + projectEntity.setOrigin("ic_event"); + projectEntity.setOriginId(formDTO.getIcEventId()); + projectEntity.setTitle(formDTO.getTitle()); + projectEntity.setBackGround(formDTO.getPublicReply()); + projectEntity.setGridId(formDTO.getGridId()); + projectEntity.setStatus(ProjectConstant.PENDING); + projectEntity.setOrgIdPath(loginUser.getOrgIdPath()); + projectEntity.setLocateAddress(null == formDTO.getLocateAddress() ? "" : formDTO.getLocateAddress()); + projectEntity.setLocateLongitude(null == formDTO.getLocateLongitude() ? "" : formDTO.getLocateLongitude()); + projectEntity.setLocateDimension(null == formDTO.getLocateDimension() ? "" : formDTO.getLocateDimension()); + projectService.insert(projectEntity); + + //3-2.项目进展表新增第一个节点数据 + ProjectProcessEntity processEntity = new ProjectProcessEntity(); + processEntity.setProjectId(projectEntity.getId()); + processEntity.setCustomerId(formDTO.getCustomerId()); + processEntity.setStaffId(formDTO.getUserId()); + processEntity.setOperation(ProjectConstant.OPERATION_CREATED); + processEntity.setOperationName(ProjectConstant.OPERATION_PROJECT_APPROVAL); + processEntity.setPublicReply(formDTO.getPublicReply()); + processEntity.setInternalRemark(formDTO.getInternalRemark()); + processEntity.setAssistanceUnitId(formDTO.getAssistanceUnitId()); + processEntity.setAssistanceUnitType(formDTO.getAssistanceUnitType()); + agencyDeptGrid.getAgencyList().forEach(agency -> { + if (loginUser.getAgencyId().equals(agency.getId())) { + processEntity.setDepartmentName(agency.getOrganizationName()); + processEntity.setAgencyId(agency.getId()); + if (org.apache.commons.lang3.StringUtils.isBlank(agency.getPids()) || org.apache.commons.lang3.StringUtils.equals(NumConstant.ZERO_STR, agency.getPids().trim()) || "".equals(agency.getPids().trim())) { + processEntity.setOrgIdPath(agency.getId()); + } else { + processEntity.setOrgIdPath(agency.getPids().concat(":").concat(agency.getId())); + } + } + }); + projectProcessService.insert(processEntity); + + //3-3.项目人员表批量新增数据 + List entityList = new ArrayList<>(); + staffList.forEach(ts -> { + ProjectStaffEntity entity = ConvertUtils.sourceToTarget(ts, ProjectStaffEntity.class); + entity.setOrgId(ts.getAgencyId()); + entity.setProjectId(projectEntity.getId()); + entity.setProcessId(processEntity.getId()); + entity.setIsHandle(ProjectConstant.UNHANDLED); + agencyDeptGrid.getAgencyList().forEach(agency -> { + if (ts.getAgencyId().equals(agency.getId())) { + entity.setCustomerId(agency.getCustomerId()); + entity.setOrgIdPath(("".equals(agency.getPids()) ? "" : agency.getPids() + ":") + agency.getId()); + entity.setDepartmentName(agency.getOrganizationName()); + } + }); + if (org.apache.commons.lang3.StringUtils.isNotBlank(ts.getDepartmentId())) { + agencyDeptGrid.getDeptList().forEach(dept -> { + if (ts.getDepartmentId().equals(dept.getId())) { + entity.setDepartmentName(entity.getDepartmentName() + "-" + dept.getDepartmentName()); + } + }); + } + if (org.apache.commons.lang3.StringUtils.isNotBlank(ts.getGridId())) { + agencyDeptGrid.getGridList().forEach(grid -> { + if (ts.getGridId().equals(grid.getId())) { + entity.setDepartmentName(entity.getDepartmentName() + "-" + grid.getGridName()); + } + }); + } + entityList.add(entity); + }); + projectStaffService.insertBatch(entityList); + + //3-4.项目附件表新增数据 + if ((null != formDTO.getPublicFile() && formDTO.getPublicFile().size() > NumConstant.ZERO) + || (null != formDTO.getInternalFile() && formDTO.getInternalFile().size() > NumConstant.ZERO)) { + projectService.saveFile(formDTO.getPublicFile(), formDTO.getInternalFile(), formDTO.getCustomerId(), projectEntity.getId(), processEntity.getId()); + } + + //3-5.项目分类表新增数据 + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getCategoryList())) { + List categoryEntityList = new ArrayList<>(); + formDTO.getCategoryList().forEach(item -> { + categoryList.forEach(ca -> { + if (item.getId().equals(ca.getId())) { + ProjectCategoryEntity entity = new ProjectCategoryEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setProjectId(projectEntity.getId()); + entity.setCategoryId(item.getId()); + entity.setCategoryPids(ca.getPids()); + entity.setCategoryCode(ca.getCategoryCode()); + entity.setGridId(formDTO.getGridId()); + categoryEntityList.add(entity); + } + }); + }); + projectCategoryService.insertBatch(categoryEntityList); + } + + //3-6.项目标签表新增数据 + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getTagList())) { + List tagEntityList = new ArrayList<>(); + formDTO.getTagList().forEach(item -> { + tagList.forEach(ta -> { + if (item.getId().equals(ta.getId())) { + ProjectTagsEntity entity = new ProjectTagsEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setProjectId(projectEntity.getId()); + entity.setTagId(item.getId()); + entity.setTagName(ta.getTagName()); + tagEntityList.add(entity); + } + }); + }); + projectTagsService.insertBatch(tagEntityList); + } + + //3-7:初始化机关-项目时间关联数据 + Date current = new Date(); + List projectStaffIds = entityList.stream().map(ProjectStaffEntity::getId).distinct().collect(Collectors.toList()); + if (!org.apache.commons.collections4.CollectionUtils.isEmpty(projectStaffIds)) { + List container = new LinkedList<>(); + projectStaffIds.forEach(o -> { + ProjectOrgRelationEntity period = new ProjectOrgRelationEntity(); + period.setProjectStaffId(o); + period.setInformedDate(current); + period.setSourceOperation(ProjectConstant.OPERATION_CREATED); + period.setCreatedBy(formDTO.getUserId()); + container.add(period); + }); + relationDao.insertBatch(container); + } + + //4.推送站内信、微信、短信消息 + //4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息 + if (!shiftProjectMessage(formDTO.getStaffList(), formDTO.getCustomerId(), formDTO.getTitle(), projectEntity.getId()).success()) { + throw new RenException("事件转为项目,推送站内信失败"); + } + + //4-2.以及政府端调用epmet-message服务,给工作端工作人员推送微信订阅消息 + if (!wxmpShiftProjectMessage(formDTO.getStaffList(), formDTO.getCustomerId(), formDTO.getTitle()).success()) { + logger.error("事件转为项目,推送微信订阅消息失败!"); + } + + //4-3.吹哨短信消息 + List smsList = new ArrayList<>(); + staffList.forEach(staff -> { + staffInfoList.forEach(st -> { + if (staff.getStaffId().equals(st.getStaffId())) { + ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); + sms.setCustomerId(st.getCustomerId()); + sms.setMobile(st.getMobile()); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER); + sms.setParameterKey("send_msg"); + smsList.add(sms); + } + }); + }); + Result result = epmetMessageOpenFeignClient.projectSendMsg(smsList); + if (!result.success()) { + logger.error("项目吹哨,发送手机短信失败" + JSON.toJSONString(result)); + } + + //5.项目实时统计消息 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String mqMsgBrief = String.format("创建了\"%s\"的项目", formDTO.getTitle()); + ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_CREATED, + projectEntity.getId(), + formDTO.getUserId(), + new Date(), + mqMsgBrief, + IpUtils.getIpAddr(request), + loginUserUtil.getLoginUserApp(), + loginUserUtil.getLoginUserClient()); + boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(mqMsg); + if (!msgResult) { + log.error("项目实时统计消息发送失败"); + } + // 数据上链 + try { + blockChainUploadService.send2BlockChain(projectEntity, processEntity, entityList, null); + } catch (Exception e) { + String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); + log.error("【项目流转】上链失败,错误信息:{}", errorMsg); + } + + EventToProjectResultDTO resultDTO = new EventToProjectResultDTO(); + resultDTO.setProjectId(projectEntity.getId()); + return resultDTO; + } + + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java index 3c5b66a824..eb336fe63e 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java @@ -484,7 +484,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl attachmentList) { + public void scanContent(String eventContent, List attachmentList) { //事件内容 if (StringUtils.isNotBlank(eventContent)) { TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); @@ -502,9 +502,11 @@ public class ResiEventServiceImpl extends BaseServiceImpl imgList=new ArrayList<>(); - for(FileCommonDTO fileCommonDTO:attachmentList){ - if("image".equals(fileCommonDTO.getType())){ - imgList.add(fileCommonDTO.getUrl()); + if(!CollectionUtils.isEmpty(attachmentList)){ + for(FileCommonDTO fileCommonDTO:attachmentList){ + if("image".equals(fileCommonDTO.getType())){ + imgList.add(fileCommonDTO.getUrl()); + } } } //事件图片 diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.22__add_project_and_process.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.22__add_project_and_process.sql new file mode 100644 index 0000000000..aa58e9f0ae --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.22__add_project_and_process.sql @@ -0,0 +1,6 @@ + + +ALTER TABLE `project_process` ADD COLUMN `ASSISTANCE_UNIT_ID` VARCHAR(32) COMMENT '协办单位ID' AFTER `staff_id`; +ALTER TABLE `project_process` ADD COLUMN `ASSISTANCE_UNIT_TYPE` VARCHAR(1) COMMENT '协办单位类型,1社区自组织,2联建单位' AFTER `ASSISTANCE_UNIT_ID`; +ALTER TABLE `project` ADD COLUMN `GRID_ID` VARCHAR(32) DEFAULT'' COMMENT '网格ID' AFTER `AGENCY_ID`; + diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.23__add_ic_event.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.23__add_ic_event.sql new file mode 100644 index 0000000000..6ccf4c6343 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.23__add_ic_event.sql @@ -0,0 +1,153 @@ + +CREATE TABLE `ic_event` ( + `ID` varchar(64) NOT NULL COMMENT '主键,事件id', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '事件所属的网格Id。不包含网格的id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '网格的所属组织', + `GRID_PIDS` varchar(255) NOT NULL COMMENT '网格的所有组织Id', + `REPORT_USER_ID` varchar(64) NOT NULL COMMENT '报事的人【居民端/pc端居民Id】可为空', + `NAME` varchar(64) DEFAULT NULL COMMENT '报事人姓名', + `MOBILE` varchar(11) NOT NULL COMMENT '手机号', + `ID_CARD` varchar(18) DEFAULT NULL COMMENT '身份证号', + `SOURCE_TYPE` char(1) DEFAULT NULL COMMENT '反映渠道【字典表】', + `HAPPEN_TIME` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '发生时间', + `EVENT_CONTENT` varchar(1024) NOT NULL COMMENT '事件内容', + `LATITUDE` varchar(32) DEFAULT NULL COMMENT '纬度', + `LONGITUDE` varchar(32) DEFAULT NULL COMMENT '经度', + `ADDRESS` varchar(255) NOT NULL COMMENT '地址', + `STATUS` varchar(32) NOT NULL DEFAULT 'processing' COMMENT '处理中:processing;已办结:closed_case', + `CLOSE_CASE_TIME` datetime DEFAULT NULL COMMENT '办结时间', + `OPERATION_TYPE` char(1) DEFAULT NULL COMMENT '0:已回复 1:已转项目 2:已转需求', + `OPERATION_ID` varchar(32) DEFAULT NULL COMMENT '项目、需求ID', + `READ_FLAG` tinyint(1) NOT NULL DEFAULT '0' COMMENT '事件是否被阅读过;1已读;针对报事人待处理列表', + `RED_DOT` tinyint(1) NOT NULL DEFAULT '0' COMMENT '报事人的红点:展示1;不展示:0;【工作人员回复/立项/转需求/办结更新为1】', + `LATEST_OPERATED_TIME` datetime NOT NULL COMMENT '最近一次操作时间(回复、立项、转需求、办结更新此列)', + `RESOLVE_STATUS` varchar(32) DEFAULT 'resolved' COMMENT '是否解决:已解决 resolved,未解决 un_solved', + `CLOSE_REMARK` varchar(255) DEFAULT NULL COMMENT '结案说明', + `COMMENT_USER_ID` varchar(32) DEFAULT NULL COMMENT '评价人', + `SATISFACTION` varchar(300) DEFAULT NULL COMMENT '满意度 - 不满意:bad、基本满意:good、非常满意:perfect', + `COMMENT_TIME` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '满意度评价时间', + `AUDIT_STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '事件审核状态[涉及附件审核需要加的状态](审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)', + `AUDIT_REASON` varchar(128) DEFAULT NULL COMMENT '审核理由', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '展示红点:visible;隐藏:invisible;人大回复、工作人员回复/立项更新为visible; 插入数据默认不展示', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_gid` (`GRID_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件管理表'; + +-- ---------------------------- +-- Table structure for ic_event_attachment +-- ---------------------------- + +CREATE TABLE `ic_event_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '附件状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态', + `REASON` varchar(255) DEFAULT NULL COMMENT '失败原因', + `DURATION` int(11) DEFAULT NULL COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_eid` (`IC_EVENT_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件附件表'; + +-- ---------------------------- +-- Table structure for ic_event_category +-- ---------------------------- + +CREATE TABLE `ic_event_category` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id', + `CATEGORY_ID` varchar(64) NOT NULL COMMENT '分类id', + `CATEGORY_PIDS` varchar(512) NOT NULL COMMENT '分类对应的所有上级,英文逗号隔开', + `CATEGORY_CODE` varchar(50) CHARACTER SET utf8 NOT NULL COMMENT '分类编码,分类编码+customer_id唯一', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_pid` (`IC_EVENT_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件所属分类表'; + +-- ---------------------------- +-- Table structure for ic_event_operation_log +-- ---------------------------- + +CREATE TABLE `ic_event_operation_log` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id', + `USER_ID` varchar(64) NOT NULL COMMENT '操作用户Id', + `USER_IDENTITY` varchar(32) NOT NULL COMMENT ' 操作用户类型【居民端用户:resi_user;工作人员:staff;】', + `ACTION_CODE` varchar(32) NOT NULL COMMENT '1、发布事件:add\r\n2、复:reply;\r\n3、立项:shift_project;\r\n4、转需求:shift_demand\r\n5、办结:close_case;\r\n6、需求办结:close_demand\r\n\r\n', + `ACTION_DESC` varchar(32) NOT NULL COMMENT '1、发布事件:publish;\r\n2、撤回事件:recall;\r\n3、复:reply;\r\n4、立项:shift_project;\r\n5、转需求: shift_demand;\r\n6、办结:close_case;\r\n7、需求办结:close_demand;\r\n8、选择是否已解决:choose_resolve;\r\n9、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中;', + `OPERATE_TIME` datetime NOT NULL COMMENT '操作时间', + `SERVICE_PARTY` varchar(64) DEFAULT NULL COMMENT '服务方【事件被转需求,需求在办结时的服务方名称】', + `ACTUAL_SERVICE_TIME` varchar(64) DEFAULT NULL COMMENT '实际服务时间【事件被转需求,需求在办结时填写的实际服务时间 xx至xx】', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件操作日志表'; + +-- ---------------------------- +-- Table structure for ic_event_reply +-- ---------------------------- + +CREATE TABLE `ic_event_reply` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id', + `FROM_USER_ID` varchar(64) NOT NULL COMMENT '回复人用户Id[工作人员ID]', + `CONTENT` varchar(1024) NOT NULL COMMENT '内容', + `USER_SHOW_NAME` varchar(64) NOT NULL COMMENT '报事人:组织-人名', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_eid` (`IC_EVENT_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件回复表'; + +-- ---------------------------- +-- Table structure for ic_event_scan_task +-- ---------------------------- + +CREATE TABLE `ic_event_scan_task` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id', + `IC_EVENT_ATTACHMENT_ID` varchar(64) NOT NULL COMMENT '事件附件表主键,对应dataId', + `TASK_ID` varchar(64) NOT NULL COMMENT '阿里云审核任务Id', + `STATUS` varchar(32) NOT NULL COMMENT '审核状态【auditing: 审核中;\r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;】', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型(视频 - video、 语音 - voice 文件 - doc)', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '操作人,API审核结果,存储为SCAN_USER或者APP_USER', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='事件附件安全校验任务表'; diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/excel/project_list_export.xlsx b/epmet-module/gov-project/gov-project-server/src/main/resources/excel/project_list_export.xlsx new file mode 100644 index 0000000000..2844847108 Binary files /dev/null and b/epmet-module/gov-project/gov-project-server/src/main/resources/excel/project_list_export.xlsx differ diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventAttachmentDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventAttachmentDao.xml new file mode 100644 index 0000000000..42b0c0dd12 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventAttachmentDao.xml @@ -0,0 +1,17 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml new file mode 100644 index 0000000000..afb3965750 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml new file mode 100644 index 0000000000..d2035f274a --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml @@ -0,0 +1,376 @@ + + + + + + + + UPDATE ic_event + SET SATISFACTION = 'perfect', + COMMENT_USER_ID = 'APP_USER', + COMMENT_TIME = NOW(), + LATEST_OPERATED_TIME = NOW(), + UPDATED_TIME = NOW() + WHERE ID IN ( + + #{id} + + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE ic_event + SET UPDATED_BY = #{userId}, + UPDATED_TIME = NOW(), + RED_DOT = '0' + WHERE + id = #{icEventId} + AND DEL_FLAG = '0' + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventOperationLogDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventOperationLogDao.xml new file mode 100644 index 0000000000..76994c7fc8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventOperationLogDao.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventReplyDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventReplyDao.xml new file mode 100644 index 0000000000..60dadc46aa --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventReplyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventScanTaskDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventScanTaskDao.xml new file mode 100644 index 0000000000..8e73ee8fee --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventScanTaskDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index bef089e81f..493f8bbf72 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -564,4 +564,60 @@ AND p.status = 'pending' ORDER BY psp.created_time, p.created_time ASC + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml index 0e2a2e5b3d..8a774f3c21 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml @@ -95,7 +95,9 @@ DEPARTMENT_NAME, PUBLIC_REPLY, INTERNAL_REMARK, - IS_SEND + IS_SEND, + ASSISTANCE_UNIT_TYPE, + ASSISTANCE_UNIT_ID FROM project_process WHERE DEL_FLAG = '0' AND PROJECT_ID = #{projectId} diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionDetailDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionDetailDao.xml index 595060968d..7bfae0a648 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionDetailDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionDetailDao.xml @@ -75,4 +75,16 @@ ) + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaLoudongDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaLoudongDTO.java new file mode 100644 index 0000000000..09d3628f2a --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaLoudongDTO.java @@ -0,0 +1,235 @@ +package com.epmet.opendata.dto.ca; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 楼栋基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +public class CaLoudongDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 楼栋ID + */ + private Long buildingId; + + /** + * 楼宇类型 + */ + private String buildingType; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 楼宇名称 + */ + private String buildingName; + + /** + * 用途分类 + */ + private String buildingUse; + + /** + * 楼宇状态 + */ + private String buildingStatus; + + /** + * 楼宇结构 + */ + private String buildingStructure; + + /** + * 使用现状 + */ + private String buildingUseage; + + /** + * 建筑时间 + */ + private Date constructionTime; + + /** + * 所处位置 + */ + private String buildingAddr; + + /** + * 小区(单位)名称 + */ + private String communityName; + + /** + * 楼栋长 + */ + private String buildingLeader; + + /** + * 楼层数 + */ + private Integer layerCount; + + /** + * 地下楼层数 + */ + private Integer basementLayerCount; + + /** + * 住宅开始层数 + */ + private Integer houseBeginLayer; + + /** + * 单元数 + */ + private Integer unitCount; + + /** + * 每层每单元户数 + */ + private Integer layerRoomCount; + + /** + * 总房屋数 + */ + private Integer roomCount; + + /** + * 电梯数量 + */ + private String elevatorCount; + + /** + * 建筑面积 + */ + private String buildingArea; + + /** + * 物业公司 + */ + private String buildingPmc; + + /** + * 介绍 + */ + private String buildingDesc; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 数据来源 + */ + private String platCode; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 最后修改人 + */ + private Long updateBy; + + /** + * 最后修改时间 + */ + private Date updateDate; + + /** + * 删除状态 + */ + private String deleteFlag; + + /** + * 乐观锁 + */ + private Integer versions; + + /** + * 扩展字段1 + */ + private String attribute1; + + /** + * 扩展字段2 + */ + private String attribute2; + + /** + * 扩展字段3 + */ + private String attribute3; + + /** + * 扩展字段4 + */ + private String attribute4; + + /** + * 扩展字段5 + */ + private String attribute5; + + /** + * 小区主键 + */ + private Long attribute6; + + /** + * 扩展字段7 + */ + private Long attribute7; + + /** + * 扩展字段8 + */ + private Long attribute8; + + /** + * 扩展字段9 + */ + private Date attribute9; + + /** + * 扩展字段10 + */ + private Date attribute10; + + /** + * 小区主键 + */ + private String communityId; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaPingfangDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaPingfangDTO.java new file mode 100644 index 0000000000..39456014b9 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaPingfangDTO.java @@ -0,0 +1,235 @@ +package com.epmet.opendata.dto.ca; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +public class CaPingfangDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 楼栋ID + */ + private Long buildingId; + + /** + * 楼宇类型 + */ + private String buildingType; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 楼宇名称 + */ + private String buildingName; + + /** + * 用途分类 + */ + private String buildingUse; + + /** + * 楼宇状态 + */ + private String buildingStatus; + + /** + * 楼宇结构 + */ + private String buildingStructure; + + /** + * 使用现状 + */ + private String buildingUseage; + + /** + * 建筑时间 + */ + private Date constructionTime; + + /** + * 所处位置 + */ + private String buildingAddr; + + /** + * 小区(单位)名称 + */ + private String communityName; + + /** + * 楼栋长 + */ + private String buildingLeader; + + /** + * 楼层数 + */ + private Integer layerCount; + + /** + * 地下楼层数 + */ + private Integer basementLayerCount; + + /** + * 住宅开始层数 + */ + private Integer houseBeginLayer; + + /** + * 单元数 + */ + private Integer unitCount; + + /** + * 每层每单元户数 + */ + private Integer layerRoomCount; + + /** + * 总房屋数 + */ + private Integer roomCount; + + /** + * 电梯数量 + */ + private String elevatorCount; + + /** + * 建筑面积 + */ + private String buildingArea; + + /** + * 物业公司 + */ + private String buildingPmc; + + /** + * 介绍 + */ + private String buildingDesc; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 数据来源 + */ + private String platCode; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 最后修改人 + */ + private Long updateBy; + + /** + * 最后修改时间 + */ + private Date updateDate; + + /** + * 删除状态 + */ + private String deleteFlag; + + /** + * 乐观锁 + */ + private Integer versions; + + /** + * 扩展字段1 + */ + private String attribute1; + + /** + * 扩展字段2 + */ + private String attribute2; + + /** + * 扩展字段3 + */ + private String attribute3; + + /** + * 扩展字段4 + */ + private String attribute4; + + /** + * 扩展字段5 + */ + private String attribute5; + + /** + * 小区主键 + */ + private Long attribute6; + + /** + * 扩展字段7 + */ + private Long attribute7; + + /** + * 扩展字段8 + */ + private Long attribute8; + + /** + * 扩展字段9 + */ + private Date attribute9; + + /** + * 扩展字段10 + */ + private Date attribute10; + + /** + * 小区主键 + */ + private String communityId; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaRentalDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaRentalDTO.java new file mode 100644 index 0000000000..597b46c5ae --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaRentalDTO.java @@ -0,0 +1,215 @@ +package com.epmet.opendata.dto.ca; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 出租房信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +public class CaRentalDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 出租房ID + */ + private Long rentalId; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 房屋ID + */ + private Long houseId; + + /** + * 房屋编号 + */ + private String houseName; + + /** + * 房屋地址 + */ + private String houseAddress; + + /** + * 建筑用途 + */ + private String houseUse; + + /** + * 建筑面积(平方米) + */ + private BigDecimal houseArea; + + /** + * 证件代码 + */ + private String idType; + + /** + * 证件号码 + */ + private String idCard; + + /** + * 房主姓名 + */ + private String residentName; + + /** + * 房主联系方式 + */ + private String telephone; + + /** + * 房主现居详址 + */ + private String curliveAddress; + + /** + * 出租用途 + */ + private String rentUse; + + /** + * 隐患类型 + */ + private String troubleType; + + /** + * 承租人ID + */ + private Long renterId; + + /** + * 承租人公民身份证号码 + */ + private String renterCardNumber; + + /** + * 承租人证件类型 + */ + private Long renterCardType; + + /** + * 承租人姓名 + */ + private String renterName; + + /** + * 承租人联系方式 + */ + private String renterPhone; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 数据来源 + */ + private String platCode; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 最后修改人 + */ + private Long updateBy; + + /** + * 最后修改时间 + */ + private Date updateDate; + + /** + * 删除状态 + */ + private String deleteFlag; + + /** + * 乐观锁 + */ + private Integer versions; + + /** + * 承租单位 + */ + private String attribute1; + + /** + * 承租日期 + */ + private String attribute2; + + /** + * 承租期限 + */ + private String attribute3; + + /** + * 扩展字段4 + */ + private String attribute4; + + /** + * 扩展字段5 + */ + private String attribute5; + + /** + * 扩展字段6 + */ + private Long attribute6; + + /** + * 扩展字段7 + */ + private Long attribute7; + + /** + * 扩展字段8 + */ + private Long attribute8; + + /** + * 扩展字段9 + */ + private Date attribute9; + + /** + * 扩展字段10 + */ + private Date attribute10; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaResidentDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaResidentDTO.java new file mode 100644 index 0000000000..6b2e8c4c86 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaResidentDTO.java @@ -0,0 +1,284 @@ +package com.epmet.opendata.dto.ca; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 人口基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +public class CaResidentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 人口ID + */ + private Long residentId; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 人口性质 + */ + private String residentProperty; + + /** + * 居民分类 + */ + private String residentType; + + /** + * 证件类型 + */ + private String idType; + + /** + * 证件号码(公民身份证号) + */ + private String idCard; + + /** + * 姓名 + */ + private String residentName; + + /** + * 性别 + */ + private String sex; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 民族 + */ + private String nation; + + /** + * 联系方式 + */ + private String telephone; + + /** + * 户籍省 + */ + private String householdProv; + + /** + * 户籍市 + */ + private String householdCity; + + /** + * 户籍县(区) + */ + private String householdCounty; + + /** + * 户籍镇街 + */ + private String householdTown; + + /** + * 户籍社区/村 + */ + private String householdVillage; + + /** + * 户籍详址 + */ + private String householdAddressDetail; + + /** + * 现住省 + */ + private String curliveProv; + + /** + * 现住市 + */ + private String curliveCity; + + /** + * 现住县(区) + */ + private String curliveCounty; + + /** + * 现住镇街 + */ + private String curliveTown; + + /** + * 现住社区/村 + */ + private String curliveVillage; + + /** + * 现住详址 + */ + private String curliveAddressDetail; + + /** + * 籍贯省 + */ + private String nativeAddressProv; + + /** + * 籍贯市 + */ + private String nativeAddressCity; + + /** + * 籍贯县(区) + */ + private String nativeAddressCounty; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 学历 + */ + private String education; + + /** + * 职业 + */ + private String occupation; + + /** + * 职业类别 + */ + private String occupationType; + + /** + * 服务处所 + */ + private String serviceAddress; + + /** + * 婚姻状况 + */ + private String marriageStatus; + + /** + * 政治面貌 + */ + private String party; + + /** + * 宗教信仰 + */ + private String religious; + + /** + * 有无皈依(已受洗) + */ + private String conversionState; + + /** + * 国籍 + */ + private String nationality; + + /** + * 数据来源 + */ + private String platCode; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 最后修改人 + */ + private Long updateBy; + + /** + * 最后修改时间 + */ + private Date updateDate; + + /** + * 删除状态 + */ + private String deleteFlag; + + /** + * 乐观锁 + */ + private Integer versions; + + /** + * 扩展字段1 + */ + private String attribute1; + + /** + * 扩展字段2 + */ + private String attribute2; + + /** + * 扩展字段3 + */ + private String attribute3; + + /** + * 扩展字段4 + */ + private String attribute4; + + /** + * 扩展字段5 + */ + private String attribute5; + + /** + * 扩展字段6 + */ + private Long attribute6; + + /** + * 扩展字段7 + */ + private Long attribute7; + + /** + * 扩展字段8 + */ + private Long attribute8; + + /** + * 扩展字段9 + */ + private Date attribute9; + + /** + * 扩展字段10 + */ + private Date attribute10; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaRotatorsDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaRotatorsDTO.java new file mode 100644 index 0000000000..9bd29a4dea --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaRotatorsDTO.java @@ -0,0 +1,299 @@ +package com.epmet.opendata.dto.ca; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 流动人口表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +public class CaRotatorsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long rotatorsId; + + /** + * 公民身份证号 + */ + private String idCard; + + /** + * 证件类型 + */ + private String idType; + + /** + * 姓名 + */ + private String rotatorsName; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 性别 + */ + private String sex; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 民族 + */ + private String nation; + + /** + * 籍贯省 + */ + private String nativeAddressProv; + + /** + * 籍贯市 + */ + private String nativeAddressCity; + + /** + * 籍贯县(区) + */ + private String nativeAddressCountry; + + /** + * 婚姻状况 + */ + private String marriageStatus; + + /** + * 政治面貌 + */ + private String party; + + /** + * 学历 + */ + private String education; + + /** + * 宗教信仰 + */ + private String religious; + + /** + * 职业类别 + */ + private String occupationType; + + /** + * 职业 + */ + private String occupation; + + /** + * 服务处所 + */ + private String serviceAddress; + + /** + * 联系方式 + */ + private String telephone; + + /** + * 户籍地省 + */ + private String householdAddressProv; + + /** + * 户籍地市 + */ + private String householdAddressCity; + + /** + * 户籍地县(区) + */ + private String householdAddressCountry; + + /** + * 户籍地镇街 + */ + private String householdAddressTown; + + /** + * 户籍地社区/村 + */ + private String householdAddressVillage; + + /** + * 户籍门(楼)详址 + */ + private String householdAddressDetail; + + /** + * 现住地省 + */ + private String curliveAddressProv; + + /** + * 现住地市 + */ + private String curliveAddressCity; + + /** + * 现住地县(区) + */ + private String curliveAddressCountry; + + /** + * 现住地镇街 + */ + private String curliveAddressTown; + + /** + * 现住地社区/村 + */ + private String curliveAddressVillage; + + /** + * 现住门(楼)详址 + */ + private String curliveAddressDetail; + + /** + * 流入原因 + */ + private String inflowReason; + + /** + * 办证类型 + */ + private String certificateType; + + /** + * 证件号码 + */ + private String certificateNumber; + + /** + * 登记日期 + */ + private Date signDate; + + /** + * 证件到期日期 + */ + private Date endDate; + + /** + * 住所类型 + */ + private String residenceType; + + /** + * 是否重点关注人员 + */ + private String isFocusPerson; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 最后修改人 + */ + private Long updateBy; + + /** + * 最后修改时间 + */ + private Date updateDate; + + /** + * 删除标识(正常的数据存:normal,逻辑删除的标识为:delete) + */ + private String deleteFlag; + + /** + * 数据来源编码 + */ + private String platcode; + + /** + * 网格id + */ + private Long gridId; + + /** + * 乐观锁 + */ + private Integer versions; + + /** + * 是否注销 + */ + private String attribute1; + + /** + * 注销原因 + */ + private String attribute2; + + /** + * + */ + private String attribute3; + + /** + * + */ + private String attribute4; + + /** + * + */ + private String attribute5; + + /** + * + */ + private Long attribute6; + + /** + * + */ + private Long attribute7; + + /** + * + */ + private Long attribute8; + + /** + * + */ + private Date attribute9; + + /** + * + */ + private Date attribute10; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/CaWghDataConstant.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/CaWghDataConstant.java new file mode 100644 index 0000000000..624c9ac5b4 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/CaWghDataConstant.java @@ -0,0 +1,26 @@ +package com.epmet.opendata.dto.constant; + +/*** + * 综治及网格化常量 + * @author work@yujt.net.cn + * @date 2022/6/8/0008 10:00 + */ +public interface CaWghDataConstant { + + + String AESKEY = "hriajrutnbghajsd"; + + String TABLESCHEMA_UNICOM = "unicom"; + + String UNICOM_PINGFANG = "ca_pingfang"; + + + String UNICOM_LOUDONG = "ca_loudong"; + String UNICOM_RESIDENT = "ca_resident"; + String UNICOM_ROTATORS = "ca_rotators"; + String UNICOM_RENTAL = "ca_rental"; + + String DATA_URL_UNICON = "http://120.221.72.83:9090/bridge/unicom/page"; + + String UNICOM_CONDITION = "unicomCondition"; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaLoudongDetailsFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaLoudongDetailsFormDTO.java new file mode 100644 index 0000000000..eab041919e --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaLoudongDetailsFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; + +@Data +public class CaLoudongDetailsFormDTO implements Serializable { + + private static final long serialVersionUID = -496629781476101758L; + + /** + * 楼栋id + */ + private BigInteger buildingId; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaLoudongFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaLoudongFormDTO.java new file mode 100644 index 0000000000..0822a5fcf1 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaLoudongFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.opendata.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CaLoudongFormDTO implements Serializable { + + private static final long serialVersionUID = -5277855973512833181L; + + /** + * 小区名称 + */ + private String communityName; + + /** + * 楼宇名字 + */ + private String buildingName; + + private Integer page; + private Integer limit; + + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaPingFangDetailsFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaPingFangDetailsFormDTO.java new file mode 100644 index 0000000000..ccff047834 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaPingFangDetailsFormDTO.java @@ -0,0 +1,14 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CaPingFangDetailsFormDTO implements Serializable { + + private static final long serialVersionUID = -357459764293119751L; + + + private String buildingId; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaPingfangFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaPingfangFormDTO.java new file mode 100644 index 0000000000..f6388581f1 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaPingfangFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CaPingfangFormDTO implements Serializable { + + private static final long serialVersionUID = 7714897295294884648L; + + /** + * 楼栋名称 + */ + private String buildingName; + + /** + * 小区名称 + */ + private String communityName; + + private Integer page; + + private Integer limit; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRentalDetailsFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRentalDetailsFormDTO.java new file mode 100644 index 0000000000..f949721e55 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRentalDetailsFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CaRentalDetailsFormDTO implements Serializable { + + private static final long serialVersionUID = 5574325462597735500L; + + /** + * 出租房id + */ + private String rentalId; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRentalFormtDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRentalFormtDTO.java new file mode 100644 index 0000000000..e268304026 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRentalFormtDTO.java @@ -0,0 +1,30 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CaRentalFormtDTO implements Serializable { + + private static final long serialVersionUID = -6052280300032032361L; + + /** + * 房主姓名 + */ + private String residentName; + + /** + * 房屋编号 + */ + private String houseName; + + /** + * 承租人姓名 + */ + private String renterName; + + private Integer page; + + private Integer limit; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaResidentDetailsFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaResidentDetailsFormDTO.java new file mode 100644 index 0000000000..b8a88b5cd5 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaResidentDetailsFormDTO.java @@ -0,0 +1,13 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CaResidentDetailsFormDTO implements Serializable { + + private static final long serialVersionUID = 1936067831073936603L; + + private String idCard; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaResidentFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaResidentFormDTO.java new file mode 100644 index 0000000000..dc7972f46c --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaResidentFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CaResidentFormDTO implements Serializable { + + private static final long serialVersionUID = 7243033732302561487L; + + private Integer page; + + private Integer limit; + + /** + * 姓名 + */ + private String residentName; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 联系方式 + */ + private String telephone; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRotatorsDetailsFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRotatorsDetailsFormDTO.java new file mode 100644 index 0000000000..4861ef6627 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRotatorsDetailsFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CaRotatorsDetailsFormDTO implements Serializable { + + private static final long serialVersionUID = -536489426327498665L; + + /** + * 身份证号 + */ + private String idCard; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRotatorsFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRotatorsFormDTO.java new file mode 100644 index 0000000000..322c9783b3 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaRotatorsFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.net.Inet4Address; + +@Data +public class CaRotatorsFormDTO implements Serializable { + + private static final long serialVersionUID = 3356808153818385932L; + + /** + * 姓名 + */ + private String rotatorsName; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 联系方式 + */ + private String telephone; + + private Integer page; + private Integer limit; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/PreserVationFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/PreserVationFormDTO.java new file mode 100644 index 0000000000..e2cb679bf7 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/PreserVationFormDTO.java @@ -0,0 +1,41 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class PreserVationFormDTO implements Serializable { + + private static final long serialVersionUID = 3489407841261413891L; + + /** + * 表名 + */ + private String tableSchema; + + /** + * 表名 + */ + private String tableName; + + /** + * 页码 + */ + private Integer pageNo; + + /** + * 每页条数 + */ + private Integer pageSize; + + /** + * 查询条件 + */ + private String whereCase; + + /** + *排序字段 + */ + private String orderBy; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaLoudongDetailsResultDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaLoudongDetailsResultDTO.java new file mode 100644 index 0000000000..d79b6884c4 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaLoudongDetailsResultDTO.java @@ -0,0 +1,143 @@ +package com.epmet.opendata.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class CaLoudongDetailsResultDTO implements Serializable { + + private static final long serialVersionUID = -8076699273641714744L; + + /** + * 楼栋ID + */ + private Long buildingId; + + /** + * 楼宇类型 + */ + private String buildingType; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 楼宇名称 + */ + private String buildingName; + + /** + * 用途分类 + */ + private String buildingUse; + + /** + * 楼宇状态 + */ + private String buildingStatus; + + /** + * 楼宇结构 + */ + private String buildingStructure; + + /** + * 使用现状 + */ + private String buildingUseage; + + /** + * 建筑时间 + */ + private Date constructionTime; + + /** + * 所处位置 + */ + private String buildingAddr; + + /** + * 小区(单位)名称 + */ + private String communityName; + + /** + * 楼栋长 + */ + private String buildingLeader; + + /** + * 楼层数 + */ + private Integer layerCount; + + /** + * 地下楼层数 + */ + private Integer basementLayerCount; + + /** + * 住宅开始层数 + */ + private Integer houseBeginLayer; + + /** + * 单元数 + */ + private Integer unitCount; + + /** + * 每层每单元户数 + */ + private Integer layerRoomCount; + + /** + * 总房屋数 + */ + private Integer roomCount; + + /** + * 电梯数量 + */ + private String elevatorCount; + + /** + * 建筑面积 + */ + private String buildingArea; + + /** + * 物业公司 + */ + private String buildingPmc; + + /** + * 介绍 + */ + private String buildingDesc; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 小区主键 + */ + private String communityId; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaLoudongResultDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaLoudongResultDTO.java new file mode 100644 index 0000000000..71f91a0aee --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaLoudongResultDTO.java @@ -0,0 +1,144 @@ +package com.epmet.opendata.dto.result; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class CaLoudongResultDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 2835612060476537433L; + + /** + * 楼栋ID + */ + private Long buildingId; + + /** + * 楼宇类型 + */ + private String buildingType; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 楼宇名称 + */ + private String buildingName; + + /** + * 用途分类 + */ + private String buildingUse; + + /** + * 楼宇状态 + */ + private String buildingStatus; + + /** + * 楼宇结构 + */ + private String buildingStructure; + + /** + * 使用现状 + */ + private String buildingUseage; + + /** + * 建筑时间 + */ + private Date constructionTime; + + /** + * 所处位置 + */ + private String buildingAddr; + + /** + * 小区(单位)名称 + */ + private String communityName; + + /** + * 楼栋长 + */ + private String buildingLeader; + + /** + * 楼层数 + */ + private Integer layerCount; + + /** + * 地下楼层数 + */ + private Integer basementLayerCount; + + /** + * 住宅开始层数 + */ + private Integer houseBeginLayer; + + /** + * 单元数 + */ + private Integer unitCount; + + /** + * 每层每单元户数 + */ + private Integer layerRoomCount; + + /** + * 总房屋数 + */ + private Integer roomCount; + + /** + * 电梯数量 + */ + private String elevatorCount; + + /** + * 建筑面积 + */ + private String buildingArea; + + /** + * 物业公司 + */ + private String buildingPmc; + + /** + * 介绍 + */ + private String buildingDesc; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 小区主键 + */ + private String communityId; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaPingFangDetailsResultDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaPingFangDetailsResultDTO.java new file mode 100644 index 0000000000..dcf821a3c0 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaPingFangDetailsResultDTO.java @@ -0,0 +1,149 @@ +package com.epmet.opendata.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class CaPingFangDetailsResultDTO implements Serializable { + + private static final long serialVersionUID = -6967441851106789821L; + + /** + * 楼栋ID + */ + private Long buildingId; + + /** + * 楼宇类型 + */ + private String buildingType; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 楼宇名称 + */ + private String buildingName; + + /** + * 用途分类 + */ + private String buildingUse; + + /** + * 楼宇状态 + */ + private String buildingStatus; + + /** + * 楼宇结构 + */ + private String buildingStructure; + + /** + * 使用现状 + */ + private String buildingUseage; + + /** + * 建筑时间 + */ + private Date constructionTime; + + /** + * 所处位置 + */ + private String buildingAddr; + + /** + * 小区(单位)名称 + */ + private String communityName; + + /** + * 楼栋长 + */ + private String buildingLeader; + + /** + * 楼层数 + */ + private Integer layerCount; + + /** + * 地下楼层数 + */ + private Integer basementLayerCount; + + /** + * 住宅开始层数 + */ + private Integer houseBeginLayer; + + /** + * 单元数 + */ + private Integer unitCount; + + /** + * 每层每单元户数 + */ + private Integer layerRoomCount; + + /** + * 总房屋数 + */ + private Integer roomCount; + + /** + * 电梯数量 + */ + private String elevatorCount; + + /** + * 建筑面积 + */ + private String buildingArea; + + /** + * 物业公司 + */ + private String buildingPmc; + + /** + * 介绍 + */ + private String buildingDesc; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 数据来源 + */ + private String platCode; + + /** + * 小区主键 + */ + private String communityId; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaPingfangResultDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaPingfangResultDTO.java new file mode 100644 index 0000000000..21500d78d6 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaPingfangResultDTO.java @@ -0,0 +1,149 @@ +package com.epmet.opendata.dto.result; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class CaPingfangResultDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 3689421598802326474L; + + /** + * 楼栋ID + */ + private Long buildingId; + + /** + * 楼宇类型 + */ + private String buildingType; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 楼宇名称 + */ + private String buildingName; + + /** + * 用途分类 + */ + private String buildingUse; + + /** + * 楼宇状态 + */ + private String buildingStatus; + + /** + * 楼宇结构 + */ + private String buildingStructure; + + /** + * 使用现状 + */ + private String buildingUseage; + + /** + * 建筑时间 + */ + private Date constructionTime; + + /** + * 所处位置 + */ + private String buildingAddr; + + /** + * 小区(单位)名称 + */ + private String communityName; + + /** + * 楼栋长 + */ + private String buildingLeader; + + /** + * 楼层数 + */ + private Integer layerCount; + + /** + * 地下楼层数 + */ + private Integer basementLayerCount; + + /** + * 住宅开始层数 + */ + private Integer houseBeginLayer; + + /** + * 单元数 + */ + private Integer unitCount; + + /** + * 每层每单元户数 + */ + private Integer layerRoomCount; + + /** + * 总房屋数 + */ + private Integer roomCount; + + /** + * 电梯数量 + */ + private String elevatorCount; + + /** + * 建筑面积 + */ + private String buildingArea; + + /** + * 物业公司 + */ + private String buildingPmc; + + /** + * 介绍 + */ + private String buildingDesc; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 数据来源 + */ + private String platCode; + + /** + * 小区主键 + */ + private String communityId; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRentalDetailsResultDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRentalDetailsResultDTO.java new file mode 100644 index 0000000000..8bd5acca1c --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRentalDetailsResultDTO.java @@ -0,0 +1,128 @@ +package com.epmet.opendata.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +public class CaRentalDetailsResultDTO implements Serializable { + + private static final long serialVersionUID = 163050940482300773L; + + /** + * 出租房ID + */ + private Long rentalId; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 房屋ID + */ + private Long houseId; + + /** + * 房屋编号 + */ + private String houseName; + + /** + * 房屋地址 + */ + private String houseAddress; + + /** + * 建筑用途 + */ + private String houseUse; + + /** + * 建筑面积(平方米) + */ + private BigDecimal houseArea; + + /** + * 证件代码 + */ + private String idType; + + /** + * 证件号码 + */ + private String idCard; + + /** + * 房主姓名 + */ + private String residentName; + + /** + * 房主联系方式 + */ + private String telephone; + + /** + * 房主现居详址 + */ + private String curliveAddress; + + /** + * 出租用途 + */ + private String rentUse; + + /** + * 隐患类型 + */ + private String troubleType; + + /** + * 承租人ID + */ + private Long renterId; + + /** + * 承租人公民身份证号码 + */ + private String renterCardNumber; + + /** + * 承租人证件类型 + */ + private Long renterCardType; + + /** + * 承租人姓名 + */ + private String renterName; + + /** + * 承租人联系方式 + */ + private String renterPhone; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 数据来源 + */ + private String platCode; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRentalResultDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRentalResultDTO.java new file mode 100644 index 0000000000..9264d24aac --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRentalResultDTO.java @@ -0,0 +1,128 @@ +package com.epmet.opendata.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +public class CaRentalResultDTO implements Serializable { + + private static final long serialVersionUID = -1721373620271590333L; + + /** + * 出租房ID + */ + private Long rentalId; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 房屋ID + */ + private Long houseId; + + /** + * 房屋编号 + */ + private String houseName; + + /** + * 房屋地址 + */ + private String houseAddress; + + /** + * 建筑用途 + */ + private String houseUse; + + /** + * 建筑面积(平方米) + */ + private BigDecimal houseArea; + + /** + * 证件代码 + */ + private String idType; + + /** + * 证件号码 + */ + private String idCard; + + /** + * 房主姓名 + */ + private String residentName; + + /** + * 房主联系方式 + */ + private String telephone; + + /** + * 房主现居详址 + */ + private String curliveAddress; + + /** + * 出租用途 + */ + private String rentUse; + + /** + * 隐患类型 + */ + private String troubleType; + + /** + * 承租人ID + */ + private Long renterId; + + /** + * 承租人公民身份证号码 + */ + private String renterCardNumber; + + /** + * 承租人证件类型 + */ + private Long renterCardType; + + /** + * 承租人姓名 + */ + private String renterName; + + /** + * 承租人联系方式 + */ + private String renterPhone; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 数据来源 + */ + private String platCode; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaResidentDetailsResultDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaResidentDetailsResultDTO.java new file mode 100644 index 0000000000..20f5c86f93 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaResidentDetailsResultDTO.java @@ -0,0 +1,198 @@ +package com.epmet.opendata.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class CaResidentDetailsResultDTO implements Serializable { + + private static final long serialVersionUID = -7745222285619853846L; + + /** + * 人口ID + */ + private Long residentId; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 人口性质 + */ + private String residentProperty; + + /** + * 居民分类 + */ + private String residentType; + + /** + * 证件类型 + */ + private String idType; + + /** + * 证件号码(公民身份证号) + */ + private String idCard; + + /** + * 姓名 + */ + private String residentName; + + /** + * 性别 + */ + private String sex; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 民族 + */ + private String nation; + + /** + * 联系方式 + */ + private String telephone; + + /** + * 户籍省 + */ + private String householdProv; + + /** + * 户籍市 + */ + private String householdCity; + + /** + * 户籍县(区) + */ + private String householdCounty; + + /** + * 户籍镇街 + */ + private String householdTown; + + /** + * 户籍社区/村 + */ + private String householdVillage; + + /** + * 户籍详址 + */ + private String householdAddressDetail; + + /** + * 现住省 + */ + private String curliveProv; + + /** + * 现住市 + */ + private String curliveCity; + + /** + * 现住县(区) + */ + private String curliveCounty; + + /** + * 现住镇街 + */ + private String curliveTown; + + /** + * 现住社区/村 + */ + private String curliveVillage; + + /** + * 现住详址 + */ + private String curliveAddressDetail; + + /** + * 籍贯省 + */ + private String nativeAddressProv; + + /** + * 籍贯市 + */ + private String nativeAddressCity; + + /** + * 籍贯县(区) + */ + private String nativeAddressCounty; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 学历 + */ + private String education; + + /** + * 职业 + */ + private String occupation; + + /** + * 职业类别 + */ + private String occupationType; + + /** + * 服务处所 + */ + private String serviceAddress; + + /** + * 婚姻状况 + */ + private String marriageStatus; + + /** + * 政治面貌 + */ + private String party; + + /** + * 宗教信仰 + */ + private String religious; + + /** + * 有无皈依(已受洗) + */ + private String conversionState; + + /** + * 国籍 + */ + private String nationality; + + /** + * 数据来源 + */ + private String platCode; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaResidentResultDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaResidentResultDTO.java new file mode 100644 index 0000000000..8fac0b7cba --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaResidentResultDTO.java @@ -0,0 +1,197 @@ +package com.epmet.opendata.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class CaResidentResultDTO implements Serializable { + + private static final long serialVersionUID = 3876909002181822355L; + + /** + * 人口ID + */ + private Long residentId; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 人口性质 + */ + private String residentProperty; + + /** + * 居民分类 + */ + private String residentType; + + /** + * 证件类型 + */ + private String idType; + + /** + * 证件号码(公民身份证号) + */ + private String idCard; + + /** + * 姓名 + */ + private String residentName; + + /** + * 性别 + */ + private String sex; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 民族 + */ + private String nation; + + /** + * 联系方式 + */ + private String telephone; + + /** + * 户籍省 + */ + private String householdProv; + + /** + * 户籍市 + */ + private String householdCity; + + /** + * 户籍县(区) + */ + private String householdCounty; + + /** + * 户籍镇街 + */ + private String householdTown; + + /** + * 户籍社区/村 + */ + private String householdVillage; + + /** + * 户籍详址 + */ + private String householdAddressDetail; + + /** + * 现住省 + */ + private String curliveProv; + + /** + * 现住市 + */ + private String curliveCity; + + /** + * 现住县(区) + */ + private String curliveCounty; + + /** + * 现住镇街 + */ + private String curliveTown; + + /** + * 现住社区/村 + */ + private String curliveVillage; + + /** + * 现住详址 + */ + private String curliveAddressDetail; + + /** + * 籍贯省 + */ + private String nativeAddressProv; + + /** + * 籍贯市 + */ + private String nativeAddressCity; + + /** + * 籍贯县(区) + */ + private String nativeAddressCounty; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 学历 + */ + private String education; + + /** + * 职业 + */ + private String occupation; + + /** + * 职业类别 + */ + private String occupationType; + + /** + * 服务处所 + */ + private String serviceAddress; + + /** + * 婚姻状况 + */ + private String marriageStatus; + + /** + * 政治面貌 + */ + private String party; + + /** + * 宗教信仰 + */ + private String religious; + + /** + * 有无皈依(已受洗) + */ + private String conversionState; + + /** + * 国籍 + */ + private String nationality; + + /** + * 数据来源 + */ + private String platCode; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRotatorsDetailsResultDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRotatorsDetailsResultDTO.java new file mode 100644 index 0000000000..7d91a14322 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRotatorsDetailsResultDTO.java @@ -0,0 +1,213 @@ +package com.epmet.opendata.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class CaRotatorsDetailsResultDTO implements Serializable { + + private static final long serialVersionUID = 6450956000162367591L; + + /** + * 主键id + */ + private Long rotatorsId; + + /** + * 公民身份证号 + */ + private String idCard; + + /** + * 证件类型 + */ + private String idType; + + /** + * 姓名 + */ + private String rotatorsName; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 性别 + */ + private String sex; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 民族 + */ + private String nation; + + /** + * 籍贯省 + */ + private String nativeAddressProv; + + /** + * 籍贯市 + */ + private String nativeAddressCity; + + /** + * 籍贯县(区) + */ + private String nativeAddressCountry; + + /** + * 婚姻状况 + */ + private String marriageStatus; + + /** + * 政治面貌 + */ + private String party; + + /** + * 学历 + */ + private String education; + + /** + * 宗教信仰 + */ + private String religious; + + /** + * 职业类别 + */ + private String occupationType; + + /** + * 职业 + */ + private String occupation; + + /** + * 服务处所 + */ + private String serviceAddress; + + /** + * 联系方式 + */ + private String telephone; + + /** + * 户籍地省 + */ + private String householdAddressProv; + + /** + * 户籍地市 + */ + private String householdAddressCity; + + /** + * 户籍地县(区) + */ + private String householdAddressCountry; + + /** + * 户籍地镇街 + */ + private String householdAddressTown; + + /** + * 户籍地社区/村 + */ + private String householdAddressVillage; + + /** + * 户籍门(楼)详址 + */ + private String householdAddressDetail; + + /** + * 现住地省 + */ + private String curliveAddressProv; + + /** + * 现住地市 + */ + private String curliveAddressCity; + + /** + * 现住地县(区) + */ + private String curliveAddressCountry; + + /** + * 现住地镇街 + */ + private String curliveAddressTown; + + /** + * 现住地社区/村 + */ + private String curliveAddressVillage; + + /** + * 现住门(楼)详址 + */ + private String curliveAddressDetail; + + /** + * 流入原因 + */ + private String inflowReason; + + /** + * 办证类型 + */ + private String certificateType; + + /** + * 证件号码 + */ + private String certificateNumber; + + /** + * 登记日期 + */ + private Date signDate; + + /** + * 证件到期日期 + */ + private Date endDate; + + /** + * 住所类型 + */ + private String residenceType; + + /** + * 是否重点关注人员 + */ + private String isFocusPerson; + + /** + * 数据来源编码 + */ + private String platcode; + + /** + * 网格id + */ + private Long gridId; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRotatorsResultDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRotatorsResultDTO.java new file mode 100644 index 0000000000..7736d81e41 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaRotatorsResultDTO.java @@ -0,0 +1,202 @@ +package com.epmet.opendata.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class CaRotatorsResultDTO implements Serializable { + + private static final long serialVersionUID = -5388784241677803257L; + + /** + * 主键id + */ + private Long rotatorsId; + + /** + * 公民身份证号 + */ + private String idCard; + + /** + * 证件类型 + */ + private String idType; + + /** + * 姓名 + */ + private String rotatorsName; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 性别 + */ + private String sex; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 民族 + */ + private String nation; + + /** + * 籍贯省 + */ + private String nativeAddressProv; + + /** + * 籍贯市 + */ + private String nativeAddressCity; + + /** + * 籍贯县(区) + */ + private String nativeAddressCountry; + + /** + * 婚姻状况 + */ + private String marriageStatus; + + /** + * 政治面貌 + */ + private String party; + + /** + * 学历 + */ + private String education; + + /** + * 宗教信仰 + */ + private String religious; + + /** + * 职业类别 + */ + private String occupationType; + + /** + * 职业 + */ + private String occupation; + + /** + * 服务处所 + */ + private String serviceAddress; + + /** + * 联系方式 + */ + private String telephone; + + /** + * 户籍地省 + */ + private String householdAddressProv; + + /** + * 户籍地市 + */ + private String householdAddressCity; + + /** + * 户籍地县(区) + */ + private String householdAddressCountry; + + /** + * 户籍地镇街 + */ + private String householdAddressTown; + + /** + * 户籍地社区/村 + */ + private String householdAddressVillage; + + /** + * 户籍门(楼)详址 + */ + private String householdAddressDetail; + + /** + * 现住地省 + */ + private String curliveAddressProv; + + /** + * 现住地市 + */ + private String curliveAddressCity; + + /** + * 现住地县(区) + */ + private String curliveAddressCountry; + + /** + * 现住地镇街 + */ + private String curliveAddressTown; + + /** + * 现住地社区/村 + */ + private String curliveAddressVillage; + + /** + * 现住门(楼)详址 + */ + private String curliveAddressDetail; + + /** + * 流入原因 + */ + private String inflowReason; + + /** + * 办证类型 + */ + private String certificateType; + + /** + * 证件号码 + */ + private String certificateNumber; + + /** + * 登记日期 + */ + private Date signDate; + + /** + * 证件到期日期 + */ + private Date endDate; + + /** + * 住所类型 + */ + private String residenceType; + + /** + * 是否重点关注人员 + */ + private String isFocusPerson; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/GuardarDatosFeignClient.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/GuardarDatosFeignClient.java new file mode 100644 index 0000000000..62aa02fd0c --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/GuardarDatosFeignClient.java @@ -0,0 +1,14 @@ +package com.epmet.opendata.feign; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.feign.impl.GuardarDatosFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; + +@FeignClient(name = "open-data-worker-server", fallback = GuardarDatosFeignClientFallBack.class) +public interface GuardarDatosFeignClient { + + @PostMapping("/opendata/caTask/guardarDatosTask") + Result guardarDatosTask(PreserVationFormDTO dto); +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/impl/GuardarDatosFeignClientFallBack.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/impl/GuardarDatosFeignClientFallBack.java new file mode 100644 index 0000000000..4a688e5ae5 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/impl/GuardarDatosFeignClientFallBack.java @@ -0,0 +1,17 @@ +package com.epmet.opendata.feign.impl; + +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.feign.GuardarDatosFeignClient; +import org.springframework.stereotype.Component; + +@Component +public class GuardarDatosFeignClientFallBack implements GuardarDatosFeignClient { + + @Override + public Result guardarDatosTask(PreserVationFormDTO dto) { + return ModuleUtils.feignConError("open-data-worker", "guardarDatosTask", dto); + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaLoudongController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaLoudongController.java new file mode 100644 index 0000000000..c349b17ae0 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaLoudongController.java @@ -0,0 +1,131 @@ +package com.epmet.opendata.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +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.opendata.dto.ca.CaLoudongDTO; +import com.epmet.opendata.dto.form.CaLoudongDetailsFormDTO; +import com.epmet.opendata.dto.form.CaLoudongFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaLoudongDetailsResultDTO; +import com.epmet.opendata.dto.result.CaLoudongResultDTO; +import com.epmet.opendata.excel.CaLoudongExcel; +import com.epmet.opendata.service.CaLoudongService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 楼栋基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@RestController +@RequestMapping("caLoudong") +public class CaLoudongController { + + @Autowired + private CaLoudongService caLoudongService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = caLoudongService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { + CaLoudongDTO data = caLoudongService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody CaLoudongDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + caLoudongService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody CaLoudongDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + caLoudongService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + caLoudongService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = caLoudongService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CaLoudongExcel.class); + } + + /** + * 楼栋基本信息分页 + * + * @param dto + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author LZN + * @date 2022/5/31 18:57 + */ + @PostMapping("getPage") + public Result> getPage(@RequestBody CaLoudongFormDTO dto, @LoginUser TokenDto tokenDto) { + PageData data = caLoudongService.getPage(dto); + return new Result>().ok(data); + } + + /** + * 楼栋基本信息详情 + * + * @param dto + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/1 9:37 + */ + @PostMapping("getLouDongDetails") + public Result getLouDongDetails(@RequestBody CaLoudongDetailsFormDTO dto, @LoginUser TokenDto tokenDto) { + CaLoudongDetailsResultDTO result = caLoudongService.getLouDongDetails(dto); + return new Result().ok(result); + } + + /** + * 楼栋调用ruoyi接口存储数据 + * + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/2 10:02 + */ + @PostMapping("/preserLouDongVation") + public Result getPreserLouDongVation(@RequestBody PreserVationFormDTO dto) { + caLoudongService.preserLouDongVation(dto); + return new Result(); + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaPingfangController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaPingfangController.java new file mode 100644 index 0000000000..3ef18ebada --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaPingfangController.java @@ -0,0 +1,129 @@ +package com.epmet.opendata.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +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.opendata.dto.ca.CaPingfangDTO; +import com.epmet.opendata.dto.form.CaPingFangDetailsFormDTO; +import com.epmet.opendata.dto.form.CaPingfangFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaPingFangDetailsResultDTO; +import com.epmet.opendata.excel.CaPingfangExcel; +import com.epmet.opendata.service.CaPingfangService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@RestController +@RequestMapping("caPingfang") +public class CaPingfangController { + + @Autowired + private CaPingfangService caPingfangService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = caPingfangService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { + CaPingfangDTO data = caPingfangService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody CaPingfangDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + caPingfangService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody CaPingfangDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + caPingfangService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + caPingfangService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = caPingfangService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CaPingfangExcel.class); + } + + /** + * 平房基础信息分页 + * + * @param dto + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/5/31 18:58 + */ + @PostMapping("getPage") + public Result getPage(@RequestBody CaPingfangFormDTO dto, @LoginUser TokenDto tokenDto) { + PageData data = caPingfangService.getPage(dto); + return new Result().ok(data); + } + + /** + * 平房详情 + * + * @param dto + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/2 14:04 + */ + @PostMapping("getPingFangDetails") + public Result getPingFangDetails(@RequestBody CaPingFangDetailsFormDTO dto, @LoginUser TokenDto tokenDto) { + CaPingFangDetailsResultDTO result = caPingfangService.getPingFangDetails(dto); + return new Result().ok(result); + } + + /** + * 平房调用ruoyi接口存储数据 + * + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/2 10:20 + */ + @PostMapping("/preserPingFangVation") + public Result getPreserPingFangVation(@RequestBody PreserVationFormDTO dto) { + caPingfangService.preserPingFangVation(dto); + return new Result(); + } + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaRentalController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaRentalController.java new file mode 100644 index 0000000000..ac31858960 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaRentalController.java @@ -0,0 +1,131 @@ +package com.epmet.opendata.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +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.opendata.dto.ca.CaRentalDTO; +import com.epmet.opendata.dto.form.CaRentalDetailsFormDTO; +import com.epmet.opendata.dto.form.CaRentalFormtDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaRentalDetailsResultDTO; +import com.epmet.opendata.dto.result.CaRentalResultDTO; +import com.epmet.opendata.excel.CaRentalExcel; +import com.epmet.opendata.service.CaRentalService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 出租房信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@RestController +@RequestMapping("caRental") +public class CaRentalController { + + @Autowired + private CaRentalService caRentalService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = caRentalService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { + CaRentalDTO data = caRentalService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody CaRentalDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + caRentalService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody CaRentalDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + caRentalService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + caRentalService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = caRentalService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CaRentalExcel.class); + } + + /** + * 出租房信息分页 + * + * @param dto + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author LZN + * @date 2022/5/31 18:38 + */ + @PostMapping("getPage") + public Result> getPage(@RequestBody CaRentalFormtDTO dto, @LoginUser TokenDto tokenDto) { + PageData data = caRentalService.getPage(dto); + return new Result>().ok(data); + } + + /** + * 出租房详情 + * + * @param dto + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/2 14:53 + */ + @PostMapping("getRentalDetails") + public Result getRentalDetails(@RequestBody CaRentalDetailsFormDTO dto, @LoginUser TokenDto tokenDto) { + CaRentalDetailsResultDTO result = caRentalService.getRentalDetails(dto); + return new Result().ok(result); + } + + /** + * 出租房调用ruoyi接口存储数据 + * + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/2 10:31 + */ + @PostMapping("/preserRentalVation") + public Result getPreserRentalVation(@RequestBody PreserVationFormDTO dto) { + caRentalService.preserRentalVation(dto); + return new Result(); + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentController.java new file mode 100644 index 0000000000..ac27374d80 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentController.java @@ -0,0 +1,130 @@ +package com.epmet.opendata.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +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.opendata.dto.ca.CaResidentDTO; +import com.epmet.opendata.dto.form.CaResidentDetailsFormDTO; +import com.epmet.opendata.dto.form.CaResidentFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaResidentDetailsResultDTO; +import com.epmet.opendata.dto.result.CaResidentResultDTO; +import com.epmet.opendata.excel.CaResidentExcel; +import com.epmet.opendata.service.CaResidentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 人口基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@RestController +@RequestMapping("caResident") +public class CaResidentController { + + @Autowired + private CaResidentService caResidentService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = caResidentService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { + CaResidentDTO data = caResidentService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody CaResidentDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + caResidentService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody CaResidentDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + caResidentService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + caResidentService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = caResidentService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CaResidentExcel.class); + } + + /** + * 人口基本信息分页 + * + * @param dto + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author LZN + * @date 2022/5/31 18:59 + */ + @PostMapping("getPage") + public Result> getPage(@RequestBody CaResidentFormDTO dto, @LoginUser TokenDto tokenDto) { + PageData data = caResidentService.getPage(dto); + return new Result>().ok(data); + } + + /** + * 人口基本信息详情 + * + * @param dto + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/2 15:17 + */ + @PostMapping("getResidentDetails") + public Result getResidentDetails(@RequestBody CaResidentDetailsFormDTO dto, @LoginUser TokenDto tokenDto) { + CaResidentDetailsResultDTO result = caResidentService.getResidentDetails(dto); + return new Result().ok(result); + } + + /** + * 人口基本信息调用ruoyi接口存储数据 + * + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/2 10:47 + */ + @PostMapping("/preserResidentVation") + public Result getPreserResidentVation(@RequestBody PreserVationFormDTO dto) { + caResidentService.preserResidentVation(dto); + return new Result(); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaRotatorsController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaRotatorsController.java new file mode 100644 index 0000000000..8072b7fbb5 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaRotatorsController.java @@ -0,0 +1,132 @@ +package com.epmet.opendata.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +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.opendata.dto.ca.CaRotatorsDTO; +import com.epmet.opendata.dto.form.CaRotatorsDetailsFormDTO; +import com.epmet.opendata.dto.form.CaRotatorsFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaRotatorsDetailsResultDTO; +import com.epmet.opendata.dto.result.CaRotatorsResultDTO; +import com.epmet.opendata.excel.CaRotatorsExcel; +import com.epmet.opendata.service.CaRotatorsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 流动人口表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@RestController +@RequestMapping("caRotators") +public class CaRotatorsController { + + @Autowired + private CaRotatorsService caRotatorsService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = caRotatorsService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { + CaRotatorsDTO data = caRotatorsService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody CaRotatorsDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + caRotatorsService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody CaRotatorsDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + caRotatorsService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + caRotatorsService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = caRotatorsService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CaRotatorsExcel.class); + } + + /** + * 流动人口分页 + * + * @param dto + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author LZN + * @date 2022/5/31 19:00 + */ + @PostMapping("getPage") + public Result> getPage(@RequestBody CaRotatorsFormDTO dto, @LoginUser TokenDto tokenDto) { + PageData data = caRotatorsService.getPage(dto); + return new Result>().ok(data); + } + + /** + * 流动人口详情 + * + * @param dto + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/2 15:33 + */ + @PostMapping("getRotatorsDetails") + public Result getRotatorsDetails(@RequestBody CaRotatorsDetailsFormDTO dto, @LoginUser TokenDto tokenDto) { + CaRotatorsDetailsResultDTO result = caRotatorsService.getRotatorsDetails(dto); + return new Result().ok(result); + } + + /** + * 流动人口调用ruoyi接口存储数据 + * + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/2 11:00 + */ + @PostMapping("/preserRotatorsVation") + public Result getPreserRotatorsVation(@RequestBody PreserVationFormDTO dto) { + caRotatorsService.preserRotatorsVation(dto); + return new Result(); + } + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaTaskController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaTaskController.java new file mode 100644 index 0000000000..97c77cd539 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaTaskController.java @@ -0,0 +1,33 @@ +package com.epmet.opendata.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.service.GuardarDatosTaskService; +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; + +/** + * 定时任务 + * + * @param + * @author LZN + * @return + * @date 2022/6/7 15:54 + */ +@RestController +@RequestMapping("caTask") +public class CaTaskController { + + @Autowired + private GuardarDatosTaskService taskService; + + @PostMapping("guardarDatosTask") + public Result guardarDatosTask(@RequestBody PreserVationFormDTO dto) { + taskService.guardarDatosTask(dto); + return new Result(); + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaLoudongDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaLoudongDao.java new file mode 100644 index 0000000000..6d3682d52f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaLoudongDao.java @@ -0,0 +1,46 @@ +package com.epmet.opendata.dao; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.dto.ca.CaLoudongDTO; +import com.epmet.opendata.dto.result.CaLoudongDetailsResultDTO; +import com.epmet.opendata.dto.result.CaLoudongResultDTO; +import com.epmet.opendata.entity.CaLoudongEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.List; + +/** + * 楼栋基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Mapper +public interface CaLoudongDao extends BaseDao { + + List getList(); + + /** + * 楼栋基本信息分页 + * + * @param communityName + * @return java.util.List + * @author LZN + * @date 2022/5/31 18:57 + */ + List getPage(@Param("communityName") String communityName, + @Param("buildingName") String buildingName); + + /** + * 楼栋基本信息详情 + * + * @param buildingId + * @return + */ + CaLoudongDetailsResultDTO getLouDongDetails(@Param("buildingId") BigInteger buildingId); + + void deleteAll(); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaPingfangDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaPingfangDao.java new file mode 100644 index 0000000000..4aa4f98439 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaPingfangDao.java @@ -0,0 +1,37 @@ +package com.epmet.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.dto.result.CaPingFangDetailsResultDTO; +import com.epmet.opendata.dto.result.CaPingfangResultDTO; +import com.epmet.opendata.entity.CaPingfangEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Mapper +public interface CaPingfangDao extends BaseDao { + + /** + * 平房基础信息分页 + * + * @param buildingName + * @return + */ + List getPage(@Param("buildingName") String buildingName, + @Param("communityName") String communityName); + + void deleteAll(); + + /** + * 平房详情 + * + * @param buildingId + * @return + */ + CaPingFangDetailsResultDTO getPingFangDetails(@Param("buildingId") String buildingId); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaRentalDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaRentalDao.java new file mode 100644 index 0000000000..36490a9bf0 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaRentalDao.java @@ -0,0 +1,42 @@ +package com.epmet.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; + +import com.epmet.opendata.dto.result.CaLoudongResultDTO; +import com.epmet.opendata.dto.result.CaRentalDetailsResultDTO; +import com.epmet.opendata.dto.result.CaRentalResultDTO; +import com.epmet.opendata.entity.CaRentalEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 出租房信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Mapper +public interface CaRentalDao extends BaseDao { + + /** + * 出租房信息分页 + * + * @param residentName + * @return + */ + List getPage(@Param("residentName") String residentName, + @Param("houseName") String houseName, + @Param("renterName") String renterName); + + void deleteAll(); + + /** + * 出租房详情 + * + * @param rentalId + * @return + */ + CaRentalDetailsResultDTO getRentalDetails(@Param("rentalId") String rentalId); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentDao.java new file mode 100644 index 0000000000..8838273b8f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentDao.java @@ -0,0 +1,41 @@ +package com.epmet.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; + +import com.epmet.opendata.dto.result.CaResidentDetailsResultDTO; +import com.epmet.opendata.dto.result.CaResidentResultDTO; +import com.epmet.opendata.entity.CaResidentEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 人口基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Mapper +public interface CaResidentDao extends BaseDao { + + /** + * 人口基本信息分页 + * + * @param residentName + * @return + */ + List getPage(@Param("residentName") String residentName, + @Param("idCard") String idCard, + @Param("telephone") String telephone); + + void deleteAll(); + + /** + * 人口基本信息详情 + * + * @param idCard + * @return + */ + CaResidentDetailsResultDTO getResidentDetails(@Param("idCard") String idCard); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaRotatorsDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaRotatorsDao.java new file mode 100644 index 0000000000..8cc71a30cc --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaRotatorsDao.java @@ -0,0 +1,42 @@ +package com.epmet.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; + +import com.epmet.opendata.dto.result.CaRotatorsDetailsResultDTO; +import com.epmet.opendata.dto.result.CaRotatorsResultDTO; +import com.epmet.opendata.entity.CaRotatorsEntity; +import com.sun.tracing.dtrace.ProviderAttributes; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 流动人口表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Mapper +public interface CaRotatorsDao extends BaseDao { + + /** + * 流动人口表 + * + * @param rotatorsName + * @return + */ + List getPage(@Param("rotatorsName") String rotatorsName, + @Param("idCard") String idCard, + @Param("telephone") String telephone); + + void deleteAll(); + + /** + * 流动人口详情 + * + * @param idCard + * @return + */ + CaRotatorsDetailsResultDTO getRotatorsDetails(@Param("idCard") String idCard); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaLoudongEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaLoudongEntity.java new file mode 100644 index 0000000000..820a670b38 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaLoudongEntity.java @@ -0,0 +1,240 @@ +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 楼栋基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ca_loudong") +public class CaLoudongEntity { + + private static final long serialVersionUID = 1L; + + /** + * 楼栋ID + */ + private Long buildingId; + + /** + * 楼宇类型 + */ + private String buildingType; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 楼宇名称 + */ + private String buildingName; + + /** + * 用途分类 + */ + private String buildingUse; + + /** + * 楼宇状态 + */ + private String buildingStatus; + + /** + * 楼宇结构 + */ + private String buildingStructure; + + /** + * 使用现状 + */ + private String buildingUseage; + + /** + * 建筑时间 + */ + private Date constructionTime; + + /** + * 所处位置 + */ + private String buildingAddr; + + /** + * 小区(单位)名称 + */ + private String communityName; + + /** + * 楼栋长 + */ + private String buildingLeader; + + /** + * 楼层数 + */ + private Integer layerCount; + + /** + * 地下楼层数 + */ + private Integer basementLayerCount; + + /** + * 住宅开始层数 + */ + private Integer houseBeginLayer; + + /** + * 单元数 + */ + private Integer unitCount; + + /** + * 每层每单元户数 + */ + private Integer layerRoomCount; + + /** + * 总房屋数 + */ + private Integer roomCount; + + /** + * 电梯数量 + */ + private String elevatorCount; + + /** + * 建筑面积 + */ + private String buildingArea; + + /** + * 物业公司 + */ + private String buildingPmc; + + /** + * 介绍 + */ + private String buildingDesc; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 数据来源 + */ + private String platCode; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 最后修改人 + */ + private Long updateBy; + + /** + * 最后修改时间 + */ + private Date updateDate; + + /** + * 删除状态 + */ + private String deleteFlag; + + /** + * 乐观锁 + */ + private Integer versions; + + /** + * 扩展字段1 + */ + private String attribute1; + + /** + * 扩展字段2 + */ + private String attribute2; + + /** + * 扩展字段3 + */ + private String attribute3; + + /** + * 扩展字段4 + */ + private String attribute4; + + /** + * 扩展字段5 + */ + private String attribute5; + + /** + * 小区主键 + */ + private Long attribute6; + + /** + * 扩展字段7 + */ + private Long attribute7; + + /** + * 扩展字段8 + */ + private Long attribute8; + + /** + * 扩展字段9 + */ + private Date attribute9; + + /** + * 扩展字段10 + */ + private Date attribute10; + + /** + * 小区主键 + */ + private String communityId; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaPingfangEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaPingfangEntity.java new file mode 100644 index 0000000000..ae008d7585 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaPingfangEntity.java @@ -0,0 +1,240 @@ +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ca_pingfang") +public class CaPingfangEntity { + + private static final long serialVersionUID = 1L; + + /** + * 楼栋ID + */ + private Long buildingId; + + /** + * 楼宇类型 + */ + private String buildingType; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 楼宇名称 + */ + private String buildingName; + + /** + * 用途分类 + */ + private String buildingUse; + + /** + * 楼宇状态 + */ + private String buildingStatus; + + /** + * 楼宇结构 + */ + private String buildingStructure; + + /** + * 使用现状 + */ + private String buildingUseage; + + /** + * 建筑时间 + */ + private Date constructionTime; + + /** + * 所处位置 + */ + private String buildingAddr; + + /** + * 小区(单位)名称 + */ + private String communityName; + + /** + * 楼栋长 + */ + private String buildingLeader; + + /** + * 楼层数 + */ + private Integer layerCount; + + /** + * 地下楼层数 + */ + private Integer basementLayerCount; + + /** + * 住宅开始层数 + */ + private Integer houseBeginLayer; + + /** + * 单元数 + */ + private Integer unitCount; + + /** + * 每层每单元户数 + */ + private Integer layerRoomCount; + + /** + * 总房屋数 + */ + private Integer roomCount; + + /** + * 电梯数量 + */ + private String elevatorCount; + + /** + * 建筑面积 + */ + private String buildingArea; + + /** + * 物业公司 + */ + private String buildingPmc; + + /** + * 介绍 + */ + private String buildingDesc; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 数据来源 + */ + private String platCode; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 最后修改人 + */ + private Long updateBy; + + /** + * 最后修改时间 + */ + private Date updateDate; + + /** + * 删除状态 + */ + private String deleteFlag; + + /** + * 乐观锁 + */ + private Integer versions; + + /** + * 扩展字段1 + */ + private String attribute1; + + /** + * 扩展字段2 + */ + private String attribute2; + + /** + * 扩展字段3 + */ + private String attribute3; + + /** + * 扩展字段4 + */ + private String attribute4; + + /** + * 扩展字段5 + */ + private String attribute5; + + /** + * 小区主键 + */ + private Long attribute6; + + /** + * 扩展字段7 + */ + private Long attribute7; + + /** + * 扩展字段8 + */ + private Long attribute8; + + /** + * 扩展字段9 + */ + private Date attribute9; + + /** + * 扩展字段10 + */ + private Date attribute10; + + /** + * 小区主键 + */ + private String communityId; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaRentalEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaRentalEntity.java new file mode 100644 index 0000000000..d3a22ce419 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaRentalEntity.java @@ -0,0 +1,220 @@ +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 出租房信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ca_rental") +public class CaRentalEntity { + + private static final long serialVersionUID = 1L; + + /** + * 出租房ID + */ + private Long rentalId; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 房屋ID + */ + private Long houseId; + + /** + * 房屋编号 + */ + private String houseName; + + /** + * 房屋地址 + */ + private String houseAddress; + + /** + * 建筑用途 + */ + private String houseUse; + + /** + * 建筑面积(平方米) + */ + private BigDecimal houseArea; + + /** + * 证件代码 + */ + private String idType; + + /** + * 证件号码 + */ + private String idCard; + + /** + * 房主姓名 + */ + private String residentName; + + /** + * 房主联系方式 + */ + private String telephone; + + /** + * 房主现居详址 + */ + private String curliveAddress; + + /** + * 出租用途 + */ + private String rentUse; + + /** + * 隐患类型 + */ + private String troubleType; + + /** + * 承租人ID + */ + private Long renterId; + + /** + * 承租人公民身份证号码 + */ + private String renterCardNumber; + + /** + * 承租人证件类型 + */ + private Long renterCardType; + + /** + * 承租人姓名 + */ + private String renterName; + + /** + * 承租人联系方式 + */ + private String renterPhone; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 纬度 + */ + private BigDecimal latitude; + + /** + * 标绘状态 + */ + private String pointStatus; + + /** + * 数据来源 + */ + private String platCode; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 最后修改人 + */ + private Long updateBy; + + /** + * 最后修改时间 + */ + private Date updateDate; + + /** + * 删除状态 + */ + private String deleteFlag; + + /** + * 乐观锁 + */ + private Integer versions; + + /** + * 承租单位 + */ + private String attribute1; + + /** + * 承租日期 + */ + private String attribute2; + + /** + * 承租期限 + */ + private String attribute3; + + /** + * 扩展字段4 + */ + private String attribute4; + + /** + * 扩展字段5 + */ + private String attribute5; + + /** + * 扩展字段6 + */ + private Long attribute6; + + /** + * 扩展字段7 + */ + private Long attribute7; + + /** + * 扩展字段8 + */ + private Long attribute8; + + /** + * 扩展字段9 + */ + private Date attribute9; + + /** + * 扩展字段10 + */ + private Date attribute10; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentEntity.java new file mode 100644 index 0000000000..a65dcc6574 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentEntity.java @@ -0,0 +1,299 @@ +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 人口基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ca_resident") +public class CaResidentEntity { + + private static final long serialVersionUID = 1L; + + /** + * 人口ID + */ + private Long residentId; + + /** + * homeId + */ + private String homeId; + + /** + * 对应的ic_resi_user主表Id + */ + private String icResiUser; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 人口性质 + */ + private String residentProperty; + + /** + * 居民分类 + */ + private String residentType; + + /** + * 证件类型 + */ + private String idType; + + /** + * 证件号码(公民身份证号) + */ + private String idCard; + + /** + * 姓名 + */ + private String residentName; + + /** + * 性别 + */ + private String sex; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 民族 + */ + private String nation; + + /** + * 联系方式 + */ + private String telephone; + + /** + * 户籍省 + */ + private String householdProv; + + /** + * 户籍市 + */ + private String householdCity; + + /** + * 户籍县(区) + */ + private String householdCounty; + + /** + * 户籍镇街 + */ + private String householdTown; + + /** + * 户籍社区/村 + */ + private String householdVillage; + + /** + * 户籍详址 + */ + private String householdAddressDetail; + + /** + * 现住省 + */ + private String curliveProv; + + /** + * 现住市 + */ + private String curliveCity; + + /** + * 现住县(区) + */ + private String curliveCounty; + + /** + * 现住镇街 + */ + private String curliveTown; + + /** + * 现住社区/村 + */ + private String curliveVillage; + + /** + * 现住详址 + */ + private String curliveAddressDetail; + + /** + * 籍贯省 + */ + private String nativeAddressProv; + + /** + * 籍贯市 + */ + private String nativeAddressCity; + + /** + * 籍贯县(区) + */ + private String nativeAddressCounty; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 学历 + */ + private String education; + + /** + * 职业 + */ + private String occupation; + + /** + * 职业类别 + */ + private String occupationType; + + /** + * 服务处所 + */ + private String serviceAddress; + + /** + * 婚姻状况 + */ + private String marriageStatus; + + /** + * 政治面貌 + */ + private String party; + + /** + * 宗教信仰 + */ + private String religious; + + /** + * 有无皈依(已受洗) + */ + private String conversionState; + + /** + * 国籍 + */ + private String nationality; + + /** + * 数据来源 + */ + private String platCode; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 最后修改人 + */ + private Long updateBy; + + /** + * 最后修改时间 + */ + private Date updateDate; + + /** + * 删除状态 + */ + private String deleteFlag; + + /** + * 乐观锁 + */ + private Integer versions; + + /** + * 扩展字段1 + */ + private String attribute1; + + /** + * 扩展字段2 + */ + private String attribute2; + + /** + * 扩展字段3 + */ + private String attribute3; + + /** + * 扩展字段4 + */ + private String attribute4; + + /** + * 扩展字段5 + */ + private String attribute5; + + /** + * 扩展字段6 + */ + private Long attribute6; + + /** + * 扩展字段7 + */ + private Long attribute7; + + /** + * 扩展字段8 + */ + private Long attribute8; + + /** + * 扩展字段9 + */ + private Date attribute9; + + /** + * 扩展字段10 + */ + private Date attribute10; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaRotatorsEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaRotatorsEntity.java new file mode 100644 index 0000000000..77e27c75fd --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaRotatorsEntity.java @@ -0,0 +1,314 @@ +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 流动人口表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ca_rotators") +public class CaRotatorsEntity { + + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long rotatorsId; + + /** + * homeId + */ + private String homeId; + + /** + * 对应的ic_resi_user主表Id + */ + private String icResiUser; + + /** + * 公民身份证号 + */ + private String idCard; + + /** + * 证件类型 + */ + private String idType; + + /** + * 姓名 + */ + private String rotatorsName; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 性别 + */ + private String sex; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 民族 + */ + private String nation; + + /** + * 籍贯省 + */ + private String nativeAddressProv; + + /** + * 籍贯市 + */ + private String nativeAddressCity; + + /** + * 籍贯县(区) + */ + private String nativeAddressCountry; + + /** + * 婚姻状况 + */ + private String marriageStatus; + + /** + * 政治面貌 + */ + private String party; + + /** + * 学历 + */ + private String education; + + /** + * 宗教信仰 + */ + private String religious; + + /** + * 职业类别 + */ + private String occupationType; + + /** + * 职业 + */ + private String occupation; + + /** + * 服务处所 + */ + private String serviceAddress; + + /** + * 联系方式 + */ + private String telephone; + + /** + * 户籍地省 + */ + private String householdAddressProv; + + /** + * 户籍地市 + */ + private String householdAddressCity; + + /** + * 户籍地县(区) + */ + private String householdAddressCountry; + + /** + * 户籍地镇街 + */ + private String householdAddressTown; + + /** + * 户籍地社区/村 + */ + private String householdAddressVillage; + + /** + * 户籍门(楼)详址 + */ + private String householdAddressDetail; + + /** + * 现住地省 + */ + private String curliveAddressProv; + + /** + * 现住地市 + */ + private String curliveAddressCity; + + /** + * 现住地县(区) + */ + private String curliveAddressCountry; + + /** + * 现住地镇街 + */ + private String curliveAddressTown; + + /** + * 现住地社区/村 + */ + private String curliveAddressVillage; + + /** + * 现住门(楼)详址 + */ + private String curliveAddressDetail; + + /** + * 流入原因 + */ + private String inflowReason; + + /** + * 办证类型 + */ + private String certificateType; + + /** + * 证件号码 + */ + private String certificateNumber; + + /** + * 登记日期 + */ + private Date signDate; + + /** + * 证件到期日期 + */ + private Date endDate; + + /** + * 住所类型 + */ + private String residenceType; + + /** + * 是否重点关注人员 + */ + private String isFocusPerson; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 最后修改人 + */ + private Long updateBy; + + /** + * 最后修改时间 + */ + private Date updateDate; + + /** + * 删除标识(正常的数据存:normal,逻辑删除的标识为:delete) + */ + private String deleteFlag; + + /** + * 数据来源编码 + */ + private String platcode; + + /** + * 网格id + */ + private Long gridId; + + /** + * 乐观锁 + */ + private Integer versions; + + /** + * 是否注销 + */ + private String attribute1; + + /** + * 注销原因 + */ + private String attribute2; + + /** + * + */ + private String attribute3; + + /** + * + */ + private String attribute4; + + /** + * + */ + private String attribute5; + + /** + * + */ + private Long attribute6; + + /** + * + */ + private Long attribute7; + + /** + * + */ + private Long attribute8; + + /** + * + */ + private Date attribute9; + + /** + * + */ + private Date attribute10; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaLoudongExcel.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaLoudongExcel.java new file mode 100644 index 0000000000..fce722fd43 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaLoudongExcel.java @@ -0,0 +1,148 @@ +package com.epmet.opendata.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 楼栋基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +public class CaLoudongExcel { + + @Excel(name = "楼栋ID") + private Long buildingId; + + @Excel(name = "楼宇类型") + private String buildingType; + + @Excel(name = "网格ID") + private Long gridId; + + @Excel(name = "楼宇名称") + private String buildingName; + + @Excel(name = "用途分类") + private String buildingUse; + + @Excel(name = "楼宇状态") + private String buildingStatus; + + @Excel(name = "楼宇结构") + private String buildingStructure; + + @Excel(name = "使用现状") + private String buildingUseage; + + @Excel(name = "建筑时间") + private Date constructionTime; + + @Excel(name = "所处位置") + private String buildingAddr; + + @Excel(name = "小区(单位)名称") + private String communityName; + + @Excel(name = "楼栋长") + private String buildingLeader; + + @Excel(name = "楼层数") + private Integer layerCount; + + @Excel(name = "地下楼层数") + private Integer basementLayerCount; + + @Excel(name = "住宅开始层数") + private Integer houseBeginLayer; + + @Excel(name = "单元数") + private Integer unitCount; + + @Excel(name = "每层每单元户数") + private Integer layerRoomCount; + + @Excel(name = "总房屋数") + private Integer roomCount; + + @Excel(name = "电梯数量") + private String elevatorCount; + + @Excel(name = "建筑面积") + private String buildingArea; + + @Excel(name = "物业公司") + private String buildingPmc; + + @Excel(name = "介绍") + private String buildingDesc; + + @Excel(name = "标绘状态") + private String pointStatus; + + @Excel(name = "经度") + private BigDecimal longitude; + + @Excel(name = "纬度") + private BigDecimal latitude; + + @Excel(name = "数据来源") + private String platCode; + + @Excel(name = "创建人") + private Long createBy; + + @Excel(name = "创建时间") + private Date createDate; + + @Excel(name = "最后修改人") + private Long updateBy; + + @Excel(name = "最后修改时间") + private Date updateDate; + + @Excel(name = "删除状态") + private String deleteFlag; + + @Excel(name = "乐观锁") + private Integer versions; + + @Excel(name = "扩展字段1") + private String attribute1; + + @Excel(name = "扩展字段2") + private String attribute2; + + @Excel(name = "扩展字段3") + private String attribute3; + + @Excel(name = "扩展字段4") + private String attribute4; + + @Excel(name = "扩展字段5") + private String attribute5; + + @Excel(name = "小区主键") + private Long attribute6; + + @Excel(name = "扩展字段7") + private Long attribute7; + + @Excel(name = "扩展字段8") + private Long attribute8; + + @Excel(name = "扩展字段9") + private Date attribute9; + + @Excel(name = "扩展字段10") + private Date attribute10; + + @Excel(name = "小区主键") + private String communityId; + + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaPingfangExcel.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaPingfangExcel.java new file mode 100644 index 0000000000..4eadd5f8b3 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaPingfangExcel.java @@ -0,0 +1,148 @@ +package com.epmet.opendata.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +public class CaPingfangExcel { + + @Excel(name = "楼栋ID") + private Long buildingId; + + @Excel(name = "楼宇类型") + private String buildingType; + + @Excel(name = "网格ID") + private Long gridId; + + @Excel(name = "楼宇名称") + private String buildingName; + + @Excel(name = "用途分类") + private String buildingUse; + + @Excel(name = "楼宇状态") + private String buildingStatus; + + @Excel(name = "楼宇结构") + private String buildingStructure; + + @Excel(name = "使用现状") + private String buildingUseage; + + @Excel(name = "建筑时间") + private Date constructionTime; + + @Excel(name = "所处位置") + private String buildingAddr; + + @Excel(name = "小区(单位)名称") + private String communityName; + + @Excel(name = "楼栋长") + private String buildingLeader; + + @Excel(name = "楼层数") + private Integer layerCount; + + @Excel(name = "地下楼层数") + private Integer basementLayerCount; + + @Excel(name = "住宅开始层数") + private Integer houseBeginLayer; + + @Excel(name = "单元数") + private Integer unitCount; + + @Excel(name = "每层每单元户数") + private Integer layerRoomCount; + + @Excel(name = "总房屋数") + private Integer roomCount; + + @Excel(name = "电梯数量") + private String elevatorCount; + + @Excel(name = "建筑面积") + private String buildingArea; + + @Excel(name = "物业公司") + private String buildingPmc; + + @Excel(name = "介绍") + private String buildingDesc; + + @Excel(name = "标绘状态") + private String pointStatus; + + @Excel(name = "经度") + private BigDecimal longitude; + + @Excel(name = "纬度") + private BigDecimal latitude; + + @Excel(name = "数据来源") + private String platCode; + + @Excel(name = "创建人") + private Long createBy; + + @Excel(name = "创建时间") + private Date createDate; + + @Excel(name = "最后修改人") + private Long updateBy; + + @Excel(name = "最后修改时间") + private Date updateDate; + + @Excel(name = "删除状态") + private String deleteFlag; + + @Excel(name = "乐观锁") + private Integer versions; + + @Excel(name = "扩展字段1") + private String attribute1; + + @Excel(name = "扩展字段2") + private String attribute2; + + @Excel(name = "扩展字段3") + private String attribute3; + + @Excel(name = "扩展字段4") + private String attribute4; + + @Excel(name = "扩展字段5") + private String attribute5; + + @Excel(name = "小区主键") + private Long attribute6; + + @Excel(name = "扩展字段7") + private Long attribute7; + + @Excel(name = "扩展字段8") + private Long attribute8; + + @Excel(name = "扩展字段9") + private Date attribute9; + + @Excel(name = "扩展字段10") + private Date attribute10; + + @Excel(name = "小区主键") + private String communityId; + + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaRentalExcel.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaRentalExcel.java new file mode 100644 index 0000000000..f4ccf8ee38 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaRentalExcel.java @@ -0,0 +1,136 @@ +package com.epmet.opendata.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 出租房信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +public class CaRentalExcel { + + @Excel(name = "出租房ID") + private Long rentalId; + + @Excel(name = "网格ID") + private Long gridId; + + @Excel(name = "房屋ID") + private Long houseId; + + @Excel(name = "房屋编号") + private String houseName; + + @Excel(name = "房屋地址") + private String houseAddress; + + @Excel(name = "建筑用途") + private String houseUse; + + @Excel(name = "建筑面积(平方米)") + private BigDecimal houseArea; + + @Excel(name = "证件代码") + private String idType; + + @Excel(name = "证件号码") + private String idCard; + + @Excel(name = "房主姓名") + private String residentName; + + @Excel(name = "房主联系方式") + private String telephone; + + @Excel(name = "房主现居详址") + private String curliveAddress; + + @Excel(name = "出租用途") + private String rentUse; + + @Excel(name = "隐患类型") + private String troubleType; + + @Excel(name = "承租人ID") + private Long renterId; + + @Excel(name = "承租人公民身份证号码") + private String renterCardNumber; + + @Excel(name = "承租人证件类型") + private Long renterCardType; + + @Excel(name = "承租人姓名") + private String renterName; + + @Excel(name = "承租人联系方式") + private String renterPhone; + + @Excel(name = "经度") + private BigDecimal longitude; + + @Excel(name = "纬度") + private BigDecimal latitude; + + @Excel(name = "标绘状态") + private String pointStatus; + + @Excel(name = "数据来源") + private String platCode; + + @Excel(name = "创建人") + private Long createBy; + + @Excel(name = "创建时间") + private Date createDate; + + @Excel(name = "最后修改人") + private Long updateBy; + + @Excel(name = "最后修改时间") + private Date updateDate; + + @Excel(name = "删除状态") + private String deleteFlag; + + @Excel(name = "乐观锁") + private Integer versions; + + @Excel(name = "承租单位") + private String attribute1; + + @Excel(name = "承租日期") + private String attribute2; + + @Excel(name = "承租期限") + private String attribute3; + + @Excel(name = "扩展字段4") + private String attribute4; + + @Excel(name = "扩展字段5") + private String attribute5; + + @Excel(name = "扩展字段6") + private Long attribute6; + + @Excel(name = "扩展字段7") + private Long attribute7; + + @Excel(name = "扩展字段8") + private Long attribute8; + + @Excel(name = "扩展字段9") + private Date attribute9; + + @Excel(name = "扩展字段10") + private Date attribute10; + + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaResidentExcel.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaResidentExcel.java new file mode 100644 index 0000000000..5d3007c8e9 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaResidentExcel.java @@ -0,0 +1,177 @@ +package com.epmet.opendata.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 人口基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +public class CaResidentExcel { + + @Excel(name = "人口ID") + private Long residentId; + + @Excel(name = "网格ID") + private Long gridId; + + @Excel(name = "人口性质") + private String residentProperty; + + @Excel(name = "居民分类") + private String residentType; + + @Excel(name = "证件类型") + private String idType; + + @Excel(name = "证件号码(公民身份证号)") + private String idCard; + + @Excel(name = "姓名") + private String residentName; + + @Excel(name = "性别") + private String sex; + + @Excel(name = "出生日期") + private Date birthday; + + @Excel(name = "民族") + private String nation; + + @Excel(name = "联系方式") + private String telephone; + + @Excel(name = "户籍省") + private String householdProv; + + @Excel(name = "户籍市") + private String householdCity; + + @Excel(name = "户籍县(区)") + private String householdCounty; + + @Excel(name = "户籍镇街") + private String householdTown; + + @Excel(name = "户籍社区/村") + private String householdVillage; + + @Excel(name = "户籍详址") + private String householdAddressDetail; + + @Excel(name = "现住省") + private String curliveProv; + + @Excel(name = "现住市") + private String curliveCity; + + @Excel(name = "现住县(区)") + private String curliveCounty; + + @Excel(name = "现住镇街") + private String curliveTown; + + @Excel(name = "现住社区/村") + private String curliveVillage; + + @Excel(name = "现住详址") + private String curliveAddressDetail; + + @Excel(name = "籍贯省") + private String nativeAddressProv; + + @Excel(name = "籍贯市") + private String nativeAddressCity; + + @Excel(name = "籍贯县(区)") + private String nativeAddressCounty; + + @Excel(name = "曾用名") + private String formerName; + + @Excel(name = "学历") + private String education; + + @Excel(name = "职业") + private String occupation; + + @Excel(name = "职业类别") + private String occupationType; + + @Excel(name = "服务处所") + private String serviceAddress; + + @Excel(name = "婚姻状况") + private String marriageStatus; + + @Excel(name = "政治面貌") + private String party; + + @Excel(name = "宗教信仰") + private String religious; + + @Excel(name = "有无皈依(已受洗)") + private String conversionState; + + @Excel(name = "国籍") + private String nationality; + + @Excel(name = "数据来源") + private String platCode; + + @Excel(name = "创建人") + private Long createBy; + + @Excel(name = "创建时间") + private Date createDate; + + @Excel(name = "最后修改人") + private Long updateBy; + + @Excel(name = "最后修改时间") + private Date updateDate; + + @Excel(name = "删除状态") + private String deleteFlag; + + @Excel(name = "乐观锁") + private Integer versions; + + @Excel(name = "扩展字段1") + private String attribute1; + + @Excel(name = "扩展字段2") + private String attribute2; + + @Excel(name = "扩展字段3") + private String attribute3; + + @Excel(name = "扩展字段4") + private String attribute4; + + @Excel(name = "扩展字段5") + private String attribute5; + + @Excel(name = "扩展字段6") + private Long attribute6; + + @Excel(name = "扩展字段7") + private Long attribute7; + + @Excel(name = "扩展字段8") + private Long attribute8; + + @Excel(name = "扩展字段9") + private Date attribute9; + + @Excel(name = "扩展字段10") + private Date attribute10; + + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaRotatorsExcel.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaRotatorsExcel.java new file mode 100644 index 0000000000..a528ae4d29 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaRotatorsExcel.java @@ -0,0 +1,186 @@ +package com.epmet.opendata.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 流动人口表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Data +public class CaRotatorsExcel { + + @Excel(name = "主键id") + private Long rotatorsId; + + @Excel(name = "公民身份证号") + private String idCard; + + @Excel(name = "证件类型") + private String idType; + + @Excel(name = "姓名") + private String rotatorsName; + + @Excel(name = "曾用名") + private String formerName; + + @Excel(name = "性别") + private String sex; + + @Excel(name = "出生日期") + private Date birthday; + + @Excel(name = "民族") + private String nation; + + @Excel(name = "籍贯省") + private String nativeAddressProv; + + @Excel(name = "籍贯市") + private String nativeAddressCity; + + @Excel(name = "籍贯县(区)") + private String nativeAddressCountry; + + @Excel(name = "婚姻状况") + private String marriageStatus; + + @Excel(name = "政治面貌") + private String party; + + @Excel(name = "学历") + private String education; + + @Excel(name = "宗教信仰") + private String religious; + + @Excel(name = "职业类别") + private String occupationType; + + @Excel(name = "职业") + private String occupation; + + @Excel(name = "服务处所") + private String serviceAddress; + + @Excel(name = "联系方式") + private String telephone; + + @Excel(name = "户籍地省") + private String householdAddressProv; + + @Excel(name = "户籍地市") + private String householdAddressCity; + + @Excel(name = "户籍地县(区)") + private String householdAddressCountry; + + @Excel(name = "户籍地镇街") + private String householdAddressTown; + + @Excel(name = "户籍地社区/村") + private String householdAddressVillage; + + @Excel(name = "户籍门(楼)详址") + private String householdAddressDetail; + + @Excel(name = "现住地省") + private String curliveAddressProv; + + @Excel(name = "现住地市") + private String curliveAddressCity; + + @Excel(name = "现住地县(区)") + private String curliveAddressCountry; + + @Excel(name = "现住地镇街") + private String curliveAddressTown; + + @Excel(name = "现住地社区/村") + private String curliveAddressVillage; + + @Excel(name = "现住门(楼)详址") + private String curliveAddressDetail; + + @Excel(name = "流入原因") + private String inflowReason; + + @Excel(name = "办证类型") + private String certificateType; + + @Excel(name = "证件号码") + private String certificateNumber; + + @Excel(name = "登记日期") + private Date signDate; + + @Excel(name = "证件到期日期") + private Date endDate; + + @Excel(name = "住所类型") + private String residenceType; + + @Excel(name = "是否重点关注人员") + private String isFocusPerson; + + @Excel(name = "创建人") + private Long createBy; + + @Excel(name = "创建时间") + private Date createDate; + + @Excel(name = "最后修改人") + private Long updateBy; + + @Excel(name = "最后修改时间") + private Date updateDate; + + @Excel(name = "删除标识(正常的数据存:normal,逻辑删除的标识为:delete)") + private String deleteFlag; + + @Excel(name = "数据来源编码") + private String platcode; + + @Excel(name = "网格id") + private Long gridId; + + @Excel(name = "乐观锁") + private Integer versions; + + @Excel(name = "是否注销") + private String attribute1; + + @Excel(name = "注销原因") + private String attribute2; + + @Excel(name = "") + private String attribute3; + + @Excel(name = "") + private String attribute4; + + @Excel(name = "") + private String attribute5; + + @Excel(name = "") + private Long attribute6; + + @Excel(name = "") + private Long attribute7; + + @Excel(name = "") + private Long attribute8; + + @Excel(name = "") + private Date attribute9; + + @Excel(name = "") + private Date attribute10; + + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaLoudongRedis.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaLoudongRedis.java new file mode 100644 index 0000000000..f6e9dce887 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaLoudongRedis.java @@ -0,0 +1,30 @@ +package com.epmet.opendata.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 楼栋基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Component +public class CaLoudongRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaPingfangRedis.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaPingfangRedis.java new file mode 100644 index 0000000000..8a992d6f15 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaPingfangRedis.java @@ -0,0 +1,30 @@ +package com.epmet.opendata.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Component +public class CaPingfangRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaRentalRedis.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaRentalRedis.java new file mode 100644 index 0000000000..54e13c1d97 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaRentalRedis.java @@ -0,0 +1,30 @@ +package com.epmet.opendata.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 出租房信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Component +public class CaRentalRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaResidentRedis.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaResidentRedis.java new file mode 100644 index 0000000000..d16105e371 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaResidentRedis.java @@ -0,0 +1,30 @@ +package com.epmet.opendata.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 人口基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Component +public class CaResidentRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaRotatorsRedis.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaRotatorsRedis.java new file mode 100644 index 0000000000..2f1552f8ba --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaRotatorsRedis.java @@ -0,0 +1,30 @@ +package com.epmet.opendata.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 流动人口表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Component +public class CaRotatorsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaLoudongService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaLoudongService.java new file mode 100644 index 0000000000..19a067ebe6 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaLoudongService.java @@ -0,0 +1,110 @@ +package com.epmet.opendata.service; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.opendata.dto.ca.CaLoudongDTO; +import com.epmet.opendata.dto.form.CaLoudongDetailsFormDTO; +import com.epmet.opendata.dto.form.CaLoudongFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaLoudongDetailsResultDTO; +import com.epmet.opendata.dto.result.CaLoudongResultDTO; +import com.epmet.opendata.entity.CaLoudongEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 楼栋基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +public interface CaLoudongService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-31 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-31 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CaLoudongDTO + * @author generator + * @date 2022-05-31 + */ + CaLoudongDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-31 + */ + void save(CaLoudongDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-31 + */ + void update(CaLoudongDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-31 + */ + void delete(String[] ids); + + /** + * 楼栋基本信息分页 + * + * @param dto + * @return com.epmet.commons.tools.page.PageData + * @author LZN + * @date 2022/5/31 18:57 + */ + PageData getPage(CaLoudongFormDTO dto); + + /** + * 楼栋基本信息详情 + * + * @param dto + * @return + */ + CaLoudongDetailsResultDTO getLouDongDetails(CaLoudongDetailsFormDTO dto); + + /** + * 楼栋调用ruoyi接口存储数据 + * + * @param dto + */ + void preserLouDongVation(PreserVationFormDTO dto); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaPingfangService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaPingfangService.java new file mode 100644 index 0000000000..26f6501df3 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaPingfangService.java @@ -0,0 +1,105 @@ +package com.epmet.opendata.service; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.opendata.dto.ca.CaPingfangDTO; +import com.epmet.opendata.dto.form.CaPingFangDetailsFormDTO; +import com.epmet.opendata.dto.form.CaPingfangFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaPingFangDetailsResultDTO; +import com.epmet.opendata.entity.CaPingfangEntity; + + +import java.util.List; +import java.util.Map; + +/** + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +public interface CaPingfangService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-31 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-31 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CaPingfangDTO + * @author generator + * @date 2022-05-31 + */ + CaPingfangDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-31 + */ + void save(CaPingfangDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-31 + */ + void update(CaPingfangDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-31 + */ + void delete(String[] ids); + + /** + * 平房基础信息分页 + * + * @param dto + * @return + */ + PageData getPage(CaPingfangFormDTO dto); + + /** + * 平房调用ruoyi接口存储数据 + * + * @param dto + */ + void preserPingFangVation(PreserVationFormDTO dto); + + /** + * 平房详情 + * + * @param dto + * @return + */ + CaPingFangDetailsResultDTO getPingFangDetails(CaPingFangDetailsFormDTO dto); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaRentalService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaRentalService.java new file mode 100644 index 0000000000..ae1f631b54 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaRentalService.java @@ -0,0 +1,107 @@ +package com.epmet.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.opendata.dto.ca.CaRentalDTO; +import com.epmet.opendata.dto.form.CaRentalDetailsFormDTO; +import com.epmet.opendata.dto.form.CaRentalFormtDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaRentalDetailsResultDTO; +import com.epmet.opendata.dto.result.CaRentalResultDTO; +import com.epmet.opendata.entity.CaRentalEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 出租房信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +public interface CaRentalService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-31 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-31 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CaRentalDTO + * @author generator + * @date 2022-05-31 + */ + CaRentalDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-31 + */ + void save(CaRentalDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-31 + */ + void update(CaRentalDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-31 + */ + void delete(String[] ids); + + /** + * 出租房信息分页 + * + * @param dto + * @return + */ + PageData getPage(CaRentalFormtDTO dto); + + /** + * 出租房调用ruoyi接口存储数据 + * + * @param dto + */ + void preserRentalVation(PreserVationFormDTO dto); + + /** + * 出租房详情 + * + * @param dto + * @return + */ + CaRentalDetailsResultDTO getRentalDetails(CaRentalDetailsFormDTO dto); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentService.java new file mode 100644 index 0000000000..0f1406b524 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentService.java @@ -0,0 +1,107 @@ +package com.epmet.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.opendata.dto.ca.CaResidentDTO; +import com.epmet.opendata.dto.form.CaResidentDetailsFormDTO; +import com.epmet.opendata.dto.form.CaResidentFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaResidentDetailsResultDTO; +import com.epmet.opendata.dto.result.CaResidentResultDTO; +import com.epmet.opendata.entity.CaResidentEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 人口基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +public interface CaResidentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-31 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-31 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CaResidentDTO + * @author generator + * @date 2022-05-31 + */ + CaResidentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-31 + */ + void save(CaResidentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-31 + */ + void update(CaResidentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-31 + */ + void delete(String[] ids); + + /** + * 人口基本信息分页 + * + * @param dto + * @return + */ + PageData getPage(CaResidentFormDTO dto); + + /** + * 人口基本信息调用ruoyi接口存储数据 + * + * @param dto + */ + void preserResidentVation(PreserVationFormDTO dto); + + /** + * 人口基本信息详情 + * + * @param dto + * @return + */ + CaResidentDetailsResultDTO getResidentDetails(CaResidentDetailsFormDTO dto); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaRotatorsService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaRotatorsService.java new file mode 100644 index 0000000000..f114134bf7 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaRotatorsService.java @@ -0,0 +1,106 @@ +package com.epmet.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.opendata.dto.ca.CaRotatorsDTO; +import com.epmet.opendata.dto.form.CaRotatorsDetailsFormDTO; +import com.epmet.opendata.dto.form.CaRotatorsFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaRotatorsDetailsResultDTO; +import com.epmet.opendata.dto.result.CaRotatorsResultDTO; +import com.epmet.opendata.entity.CaRotatorsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 流动人口表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +public interface CaRotatorsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-31 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-31 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CaRotatorsDTO + * @author generator + * @date 2022-05-31 + */ + CaRotatorsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-31 + */ + void save(CaRotatorsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-31 + */ + void update(CaRotatorsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-31 + */ + void delete(String[] ids); + + /** + * 流动人口表 + * + * @param dto + * @return + */ + PageData getPage(CaRotatorsFormDTO dto); + + /** + * 流动人口调用ruoyi接口存储数据 + * + * @param dto + */ + void preserRotatorsVation(PreserVationFormDTO dto); + + /** + * 流动人口详情 + * + * @param dto + * @return + */ + CaRotatorsDetailsResultDTO getRotatorsDetails(CaRotatorsDetailsFormDTO dto); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GuardarDatosTaskService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GuardarDatosTaskService.java new file mode 100644 index 0000000000..fbd89caa2f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GuardarDatosTaskService.java @@ -0,0 +1,16 @@ +package com.epmet.opendata.service; + +import com.epmet.opendata.dto.form.PreserVationFormDTO; + +/** + * 定时任务 + * + * @param + * @author LZN + * @return + * @date 2022/6/7 15:54 + */ +public interface GuardarDatosTaskService { + + void guardarDatosTask(PreserVationFormDTO dto); +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaLoudongServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaLoudongServiceImpl.java new file mode 100644 index 0000000000..bd2f41b004 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaLoudongServiceImpl.java @@ -0,0 +1,202 @@ +package com.epmet.opendata.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.opendata.dao.CaLoudongDao; +import com.epmet.opendata.dto.ca.CaLoudongDTO; +import com.epmet.opendata.dto.constant.CaWghDataConstant; +import com.epmet.opendata.dto.form.CaLoudongDetailsFormDTO; +import com.epmet.opendata.dto.form.CaLoudongFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaLoudongDetailsResultDTO; +import com.epmet.opendata.dto.result.CaLoudongResultDTO; +import com.epmet.opendata.entity.CaLoudongEntity; +import com.epmet.opendata.redis.CaLoudongRedis; +import com.epmet.opendata.service.CaLoudongService; +import com.epmet.opendata.util.AesUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 楼栋基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Service +public class CaLoudongServiceImpl extends BaseServiceImpl implements CaLoudongService { + + @Autowired + private CaLoudongRedis caLoudongRedis; + +// @Override +// public PageData page(Map params) { +// IPage page = baseDao.selectPage( +// getPage(params, FieldConstant.CREATED_TIME, false), +// getWrapper(params) +// ); +// return getPageData(page, CaLoudongDTO.class); +// } + + @Override + public PageData page(Map params) { + PageHelper.startPage((int) (params.get("limit")), (int) (params.get("pageSize"))); + List list = baseDao.getList(); + PageInfo info = new PageInfo<>(list); + return new PageData<>(list, info.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CaLoudongDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CaLoudongDTO get(String id) { + CaLoudongEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CaLoudongDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CaLoudongDTO dto) { + CaLoudongEntity entity = ConvertUtils.sourceToTarget(dto, CaLoudongEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CaLoudongDTO dto) { + CaLoudongEntity entity = ConvertUtils.sourceToTarget(dto, CaLoudongEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public PageData getPage(CaLoudongFormDTO dto) { + PageHelper.startPage(dto.getPage(), dto.getLimit()); + List result = baseDao.getPage(dto.getCommunityName(), dto.getBuildingName()); + PageInfo info = new PageInfo<>(result); + return new PageData<>(result, info.getTotal()); + } + + /** + * 楼栋基本信息详情 + * + * @param dto + * @return com.epmet.opendata.dto.result.CaLoudongDetailsResultDTO + * @author LZN + * @date 2022/6/2 13:40 + */ + @Override + public CaLoudongDetailsResultDTO getLouDongDetails(CaLoudongDetailsFormDTO dto) { + CaLoudongDetailsResultDTO result = baseDao.getLouDongDetails(dto.getBuildingId()); + return result; + } + + /** + * 楼栋调用ruoyi接口存储数据 + * + * @param dto + * @return void + * @author LZN + * @date 2022/6/2 10:03 + */ + @Override + public void preserLouDongVation(PreserVationFormDTO dto) { + baseDao.deleteAll(); + dto.setPageNo(NumConstant.ONE); + dto.setPageSize(NumConstant.FIFTY); + dto.setTableSchema(CaWghDataConstant.TABLESCHEMA_UNICOM); + dto.setTableName(CaWghDataConstant.UNICOM_LOUDONG); + + dto.setWhereCase("delete_flag = 'normal'"); + dto.setOrderBy("grid_id,update_date desc"); + + int pageNo = 1; + + int total = 0; + + do { + try { + total = listLouDong(dto); + pageNo++; + dto.setPageNo(pageNo); + } catch (Exception e) { + e.printStackTrace(); + } + } while (total > (pageNo * NumConstant.FIFTY)); + } + + + private int listLouDong(PreserVationFormDTO dto) throws Exception { + String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), CaWghDataConstant.AESKEY); + JSONObject obj = new JSONObject(); + obj.put(CaWghDataConstant.UNICOM_CONDITION, aes); + String data = HttpClientManager.getInstance().sendPostByJSON(CaWghDataConstant.DATA_URL_UNICON, obj.toJSONString()).getData(); + JSONObject toResult = JSON.parseObject(data); + Result result = ConvertUtils.mapToEntity(toResult, Result.class); + if (!result.success()) { + return dto.getPageNo() + 1; + } + + ReturnDate returnDate = JSONObject.parseObject(JSONObject.toJSONString(result.getData()), ReturnDate.class); + this.insertBatch(returnDate.getList()); + return returnDate.getTotal(); + } + + static class ReturnDate { + + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaPingfangServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaPingfangServiceImpl.java new file mode 100644 index 0000000000..541726c478 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaPingfangServiceImpl.java @@ -0,0 +1,188 @@ +package com.epmet.opendata.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.opendata.dao.CaPingfangDao; +import com.epmet.opendata.dto.ca.CaPingfangDTO; +import com.epmet.opendata.dto.constant.CaWghDataConstant; +import com.epmet.opendata.dto.form.CaPingFangDetailsFormDTO; +import com.epmet.opendata.dto.form.CaPingfangFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaPingFangDetailsResultDTO; +import com.epmet.opendata.dto.result.CaPingfangResultDTO; +import com.epmet.opendata.entity.CaPingfangEntity; +import com.epmet.opendata.redis.CaPingfangRedis; +import com.epmet.opendata.service.CaPingfangService; +import com.epmet.opendata.util.AesUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Service +public class CaPingfangServiceImpl extends BaseServiceImpl implements CaPingfangService { + + @Autowired + private CaPingfangRedis caPingfangRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CaPingfangDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CaPingfangDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CaPingfangDTO get(String id) { + CaPingfangEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CaPingfangDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CaPingfangDTO dto) { + CaPingfangEntity entity = ConvertUtils.sourceToTarget(dto, CaPingfangEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CaPingfangDTO dto) { + CaPingfangEntity entity = ConvertUtils.sourceToTarget(dto, CaPingfangEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public PageData getPage(CaPingfangFormDTO dto) { + PageHelper.startPage(dto.getPage(), dto.getLimit()); + List result = baseDao.getPage(dto.getBuildingName(), dto.getCommunityName()); + PageInfo info = new PageInfo<>(result); + return new PageData<>(result, info.getTotal()); + } + + /** + * 平房调用ruoyi接口存储数据 + * + * @param dto + * @return void + * @author LZN + * @date 2022/6/2 10:21 + */ + @Override + public void preserPingFangVation(PreserVationFormDTO dto) { + baseDao.deleteAll(); + + dto.setPageNo(NumConstant.ONE); + dto.setPageSize(NumConstant.FIFTY); + dto.setTableSchema(CaWghDataConstant.TABLESCHEMA_UNICOM); + dto.setTableName(CaWghDataConstant.UNICOM_PINGFANG); + + dto.setWhereCase("delete_flag = 'normal'"); + dto.setOrderBy("grid_id,update_date desc"); + + int pageNo = 1; + + int total = 0; + + do { + try { + total = listPingFang(dto); + pageNo++; + dto.setPageNo(pageNo); + } catch (Exception e) { + e.printStackTrace(); + } + } while (total > (pageNo * NumConstant.FIFTY)); + } + + + @Override + public CaPingFangDetailsResultDTO getPingFangDetails(CaPingFangDetailsFormDTO dto) { + CaPingFangDetailsResultDTO result = baseDao.getPingFangDetails(dto.getBuildingId()); + return result; + } + + private int listPingFang(PreserVationFormDTO dto) throws Exception { + String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), CaWghDataConstant.AESKEY); + JSONObject obj = new JSONObject(); + obj.put(CaWghDataConstant.UNICOM_CONDITION,aes); + String data = HttpClientManager.getInstance().sendPostByJSON(CaWghDataConstant.DATA_URL_UNICON, obj.toJSONString()).getData(); + JSONObject toResult = JSON.parseObject(data); + Result result = ConvertUtils.mapToEntity(toResult, Result.class); + if (!result.success()) { + return dto.getPageNo() + 1; + } + + ReturnDate returnDate = JSONObject.parseObject(JSONObject.toJSONString(result.getData()), ReturnDate.class); + this.insertBatch(returnDate.getList()); + return returnDate.getTotal(); + } + + static class ReturnDate { + + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaRentalServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaRentalServiceImpl.java new file mode 100644 index 0000000000..6cb0e53410 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaRentalServiceImpl.java @@ -0,0 +1,194 @@ +package com.epmet.opendata.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; + +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.opendata.dao.CaRentalDao; +import com.epmet.opendata.dto.ca.CaRentalDTO; +import com.epmet.opendata.dto.constant.CaWghDataConstant; +import com.epmet.opendata.dto.form.CaRentalDetailsFormDTO; +import com.epmet.opendata.dto.form.CaRentalFormtDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaRentalDetailsResultDTO; +import com.epmet.opendata.dto.result.CaRentalResultDTO; +import com.epmet.opendata.entity.CaRentalEntity; +import com.epmet.opendata.redis.CaRentalRedis; +import com.epmet.opendata.service.CaRentalService; +import com.epmet.opendata.util.AesUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 出租房信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Service +public class CaRentalServiceImpl extends BaseServiceImpl implements CaRentalService { + + @Autowired + private CaRentalRedis caRentalRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CaRentalDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CaRentalDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CaRentalDTO get(String id) { + CaRentalEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CaRentalDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CaRentalDTO dto) { + CaRentalEntity entity = ConvertUtils.sourceToTarget(dto, CaRentalEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CaRentalDTO dto) { + CaRentalEntity entity = ConvertUtils.sourceToTarget(dto, CaRentalEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public PageData getPage(CaRentalFormtDTO dto) { + PageHelper.startPage(dto.getPage(), dto.getLimit()); + List result = baseDao.getPage(dto.getResidentName(), + dto.getHouseName(), + dto.getRenterName()); + PageInfo info = new PageInfo<>(result); + return new PageData<>(result, info.getTotal()); + } + + /** + * 出租房调用ruoyi接口存储数据 + * + * @param dto + * @return void + * @author LZN + * @date 2022/6/2 10:31 + */ + @Override + public void preserRentalVation(PreserVationFormDTO dto) { + baseDao.deleteAll(); + + dto.setPageNo(NumConstant.ONE); + dto.setPageSize(NumConstant.FIFTY); + dto.setTableSchema(CaWghDataConstant.TABLESCHEMA_UNICOM); + dto.setTableName(CaWghDataConstant.UNICOM_RENTAL); + + dto.setWhereCase("delete_flag = 'normal'"); + dto.setOrderBy("grid_id,update_date desc"); + + int pageNo = 1; + + int total = 0; + + do { + try { + total = listRental(dto); + pageNo++; + dto.setPageNo(pageNo); + } catch (Exception e) { + e.printStackTrace(); + } + } while (total > (pageNo * NumConstant.FIFTY)); + + } + + @Override + public CaRentalDetailsResultDTO getRentalDetails(CaRentalDetailsFormDTO dto) { + CaRentalDetailsResultDTO result = baseDao.getRentalDetails(dto.getRentalId()); + return result; + } + + private int listRental(PreserVationFormDTO dto) throws Exception { + String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), CaWghDataConstant.AESKEY); + JSONObject obj = new JSONObject(); + obj.put(CaWghDataConstant.UNICOM_CONDITION, aes); + String data = HttpClientManager.getInstance().sendPostByJSON(CaWghDataConstant.DATA_URL_UNICON, obj.toJSONString()).getData(); + JSONObject toResult = JSON.parseObject(data); + Result result = ConvertUtils.mapToEntity(toResult, Result.class); + if (!result.success()) { + return dto.getPageNo() + 1; + } + + ReturnDate returnDate = JSONObject.parseObject(JSONObject.toJSONString(result.getData()), ReturnDate.class); + this.insertBatch(returnDate.getList()); + return returnDate.getTotal(); + } + + static class ReturnDate { + + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + } + + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaResidentServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaResidentServiceImpl.java new file mode 100644 index 0000000000..e66d249fa9 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaResidentServiceImpl.java @@ -0,0 +1,206 @@ +package com.epmet.opendata.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.opendata.dao.CaResidentDao; +import com.epmet.opendata.dto.ca.CaResidentDTO; +import com.epmet.opendata.dto.constant.CaWghDataConstant; +import com.epmet.opendata.dto.form.CaResidentDetailsFormDTO; +import com.epmet.opendata.dto.form.CaResidentFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaResidentDetailsResultDTO; +import com.epmet.opendata.dto.result.CaResidentResultDTO; +import com.epmet.opendata.entity.CaResidentEntity; +import com.epmet.opendata.redis.CaResidentRedis; +import com.epmet.opendata.service.CaResidentService; +import com.epmet.opendata.util.AesUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 人口基本信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Service +public class CaResidentServiceImpl extends BaseServiceImpl implements CaResidentService { + + @Autowired + private CaResidentRedis caResidentRedis; + + @Autowired + private EpmetUserOpenFeignClient openFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CaResidentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CaResidentDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CaResidentDTO get(String id) { + CaResidentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CaResidentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CaResidentDTO dto) { + CaResidentEntity entity = ConvertUtils.sourceToTarget(dto, CaResidentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CaResidentDTO dto) { + CaResidentEntity entity = ConvertUtils.sourceToTarget(dto, CaResidentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public PageData getPage(CaResidentFormDTO dto) { + PageHelper.startPage(dto.getPage(), dto.getLimit()); + List result = baseDao.getPage(dto.getResidentName(), + dto.getIdCard(), + dto.getTelephone()); + PageInfo info = new PageInfo<>(result); + return new PageData<>(result, info.getTotal()); + } + + /** + * 人口基本信息调用ruoyi接口存储数据 + * + * @param dto + * @return void + * @author LZN + * @date 2022/6/2 10:47 + */ + @Override + public void preserResidentVation(PreserVationFormDTO dto) { + baseDao.deleteAll(); + + dto.setPageNo(NumConstant.ONE); + dto.setPageSize(NumConstant.FIFTY); + dto.setTableSchema(CaWghDataConstant.TABLESCHEMA_UNICOM); + dto.setTableName(CaWghDataConstant.UNICOM_RESIDENT); + + dto.setWhereCase("delete_flag = 'normal'"); + dto.setOrderBy("grid_id,update_date desc"); + + int pageNo = 1; + + int total = 0; + + do { + try { + total = listResident(dto); + pageNo++; + dto.setPageNo(pageNo); + } catch (Exception e) { + e.printStackTrace(); + } + } while (total > (pageNo * NumConstant.FIFTY)); + } + + @Override + public CaResidentDetailsResultDTO getResidentDetails(CaResidentDetailsFormDTO dto) { + CaResidentDetailsResultDTO result = baseDao.getResidentDetails(dto.getIdCard()); + return result; + } + + + private int listResident(PreserVationFormDTO dto) throws Exception { + String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), CaWghDataConstant.AESKEY); + JSONObject obj = new JSONObject(); + obj.put(CaWghDataConstant.UNICOM_CONDITION,aes); + String data = HttpClientManager.getInstance().sendPostByJSON(CaWghDataConstant.DATA_URL_UNICON, obj.toJSONString()).getData(); + JSONObject toResult = JSON.parseObject(data); + Result result = ConvertUtils.mapToEntity(toResult, Result.class); + if (!result.success()) { + return dto.getPageNo() + 1; + } + + ReturnDate returnDate = JSONObject.parseObject(JSONObject.toJSONString(result.getData()), ReturnDate.class); + +// returnDate.getList().forEach(item -> { +// if (StringUtils.isNotBlank(item.getIdCard())) { +// Result client = openFeignClient.getByResiIdCard(item.getIdCard()); +// IcResiUserDTO clientData = client.getData(); +// item.setIcResiUser(clientData.getId()); +// item.setHomeId(clientData.getHomeId()); +// } +// }); + + this.insertBatch(returnDate.getList()); + return returnDate.getTotal(); + } + + static class ReturnDate { + + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaRotatorsServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaRotatorsServiceImpl.java new file mode 100644 index 0000000000..71ebb9a3da --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaRotatorsServiceImpl.java @@ -0,0 +1,220 @@ +package com.epmet.opendata.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.opendata.dao.CaRotatorsDao; +import com.epmet.opendata.dto.ca.CaRotatorsDTO; +import com.epmet.opendata.dto.constant.CaWghDataConstant; +import com.epmet.opendata.dto.form.CaRotatorsDetailsFormDTO; +import com.epmet.opendata.dto.form.CaRotatorsFormDTO; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.result.CaRotatorsDetailsResultDTO; +import com.epmet.opendata.dto.result.CaRotatorsResultDTO; +import com.epmet.opendata.entity.CaRotatorsEntity; +import com.epmet.opendata.redis.CaRotatorsRedis; +import com.epmet.opendata.service.CaRotatorsService; +import com.epmet.opendata.util.AesUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 流动人口表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-31 + */ +@Service +public class CaRotatorsServiceImpl extends BaseServiceImpl implements CaRotatorsService { + + @Autowired + private CaRotatorsRedis caRotatorsRedis; + + @Autowired + private EpmetUserOpenFeignClient openFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CaRotatorsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CaRotatorsDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CaRotatorsDTO get(String id) { + CaRotatorsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CaRotatorsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CaRotatorsDTO dto) { + CaRotatorsEntity entity = ConvertUtils.sourceToTarget(dto, CaRotatorsEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CaRotatorsDTO dto) { + CaRotatorsEntity entity = ConvertUtils.sourceToTarget(dto, CaRotatorsEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public PageData getPage(CaRotatorsFormDTO dto) { + PageHelper.startPage(dto.getPage(), dto.getLimit()); + List result = baseDao.getPage(dto.getRotatorsName(), + dto.getIdCard(), + dto.getTelephone()); + PageInfo info = new PageInfo<>(result); + return new PageData<>(result, info.getTotal()); + } + + /** + * 流动人口调用ruoyi接口存储数据 + * + * @param dto + * @return void + * @author LZN + * @date 2022/6/2 11:01 + */ + @Override + public void preserRotatorsVation(PreserVationFormDTO dto) { + baseDao.deleteAll(); + dto.setPageNo(NumConstant.ONE); + dto.setPageSize(NumConstant.FIFTY); + dto.setTableSchema(CaWghDataConstant.TABLESCHEMA_UNICOM); + dto.setTableName(CaWghDataConstant.UNICOM_ROTATORS); + + dto.setWhereCase("delete_flag = 'normal'"); + dto.setOrderBy("grid_id,update_date desc"); + + int pageNo = 1; + + int total = 0; + + do { + try { + total = listRotators(dto); + pageNo++; + dto.setPageNo(pageNo); + } catch (Exception e) { + e.printStackTrace(); + } + } while (total > (pageNo * NumConstant.FIFTY)); + } + + @Override + public CaRotatorsDetailsResultDTO getRotatorsDetails(CaRotatorsDetailsFormDTO dto) { + CaRotatorsDetailsResultDTO result = baseDao.getRotatorsDetails(dto.getIdCard()); + return result; + } + + enum rotatorsEnum { + + LDRK("unicom", "ca_rotators"), + AES("key", "hriajrutnbghajsd"); + + private String name; + private String code; + + + rotatorsEnum(String name, String code) { + this.name = name; + this.code = code; + } + + } + + private int listRotators(PreserVationFormDTO dto) throws Exception { + String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), CaWghDataConstant.AESKEY); + JSONObject obj = new JSONObject(); + obj.put(CaWghDataConstant.UNICOM_CONDITION, aes); + String data = HttpClientManager.getInstance().sendPostByJSON(CaWghDataConstant.DATA_URL_UNICON, obj.toJSONString()).getData(); + JSONObject toResult = JSON.parseObject(data); + Result result = ConvertUtils.mapToEntity(toResult, Result.class); + if (!result.success()) { + return dto.getPageNo() + 1; + } + + ReturnDate returnDate = JSONObject.parseObject(JSONObject.toJSONString(result.getData()), ReturnDate.class); + +// returnDate.getList().forEach(item -> { +// if (StringUtils.isNotBlank(item.getIdCard())) { +// Result client = openFeignClient.getByResiIdCard(item.getIdCard()); +// IcResiUserDTO clientData = client.getData(); +// item.setIcResiUser(clientData.getId()); +// item.setHomeId(clientData.getHomeId()); +// } +// }); + + this.insertBatch(returnDate.getList()); + return returnDate.getTotal(); + } + + static class ReturnDate { + + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GuardarDatosTaskServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GuardarDatosTaskServiceImpl.java new file mode 100644 index 0000000000..b8e1f0b669 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GuardarDatosTaskServiceImpl.java @@ -0,0 +1,56 @@ +package com.epmet.opendata.service.impl; + +import com.epmet.opendata.dto.constant.CaWghDataConstant; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.service.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class GuardarDatosTaskServiceImpl implements GuardarDatosTaskService { + + @Autowired + private CaLoudongService caLoudongService; + + @Autowired + private CaPingfangService pingfangService; + + @Autowired + private CaRentalService rentalService; + + @Autowired + private CaResidentService residentService; + + @Autowired + private CaRotatorsService rotatorsService; + + @Override + public void guardarDatosTask(PreserVationFormDTO dto) { + if (StringUtils.isBlank(dto.getTableName())) { + caLoudongService.preserLouDongVation(dto); + pingfangService.preserPingFangVation(dto); + rentalService.preserRentalVation(dto); + residentService.preserResidentVation(dto); + rotatorsService.preserRotatorsVation(dto); + } + + switch (dto.getTableName()) { + case CaWghDataConstant.UNICOM_LOUDONG: + caLoudongService.preserLouDongVation(dto); + break; + case CaWghDataConstant.UNICOM_PINGFANG: + pingfangService.preserPingFangVation(dto); + break; + case CaWghDataConstant.UNICOM_RESIDENT: + residentService.preserResidentVation(dto); + break; + case CaWghDataConstant.UNICOM_RENTAL: + rentalService.preserRentalVation(dto); + break; + case CaWghDataConstant.UNICOM_ROTATORS: + rotatorsService.preserRotatorsVation(dto); + break; + } + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/util/AesUtils.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/util/AesUtils.java new file mode 100644 index 0000000000..131bbfec83 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/util/AesUtils.java @@ -0,0 +1,78 @@ +package com.epmet.opendata.util; + +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; + +/*** + * Aes加解密工具类 + * @author www + * @date 2022/6/6/0006 11:07 + */ +public class AesUtils { + + + public static String encryptByAES(String input, String key) throws Exception { + // 算法 + String algorithm = "AES"; + String transformation = "AES"; + // Cipher:密码,获取加密对象 + // transformation:参数表示使用什么类型加密 + Cipher cipher = Cipher.getInstance(transformation); + // 指定秘钥规则 + // 第一个参数表示:密钥,key的字节数组 长度必须是16位 + // 第二个参数表示:算法 + SecretKeySpec sks = new SecretKeySpec(key.getBytes(), algorithm); + // 对加密进行初始化 + // 第一个参数:表示模式,有加密模式和解密模式 + // 第二个参数:表示秘钥规则 + cipher.init(Cipher.ENCRYPT_MODE, sks); + // 进行加密 + byte[] bytes = cipher.doFinal(input.getBytes()); + return bytesToHexString(bytes); + } + + public static String decryptByAES(String input, String key) throws Exception { + // 算法 + String algorithm = "AES"; + String transformation = "AES"; + // Cipher:密码,获取加密对象 + // transformation:参数表示使用什么类型加密 + Cipher cipher = Cipher.getInstance(transformation); + // 指定秘钥规则 + // 第一个参数表示:密钥,key的字节数组 长度必须是16位 + // 第二个参数表示:算法 + SecretKeySpec sks = new SecretKeySpec(key.getBytes(), algorithm); + // 对加密进行初始化 + // 第一个参数:表示模式,有加密模式和解密模式 + // 第二个参数:表示秘钥规则 + cipher.init(Cipher.DECRYPT_MODE, sks); + // 进行解密 + byte[] inputBytes = hexStringToBytes(input); + byte[] bytes = cipher.doFinal(inputBytes); + return new String(bytes); + } + + private static byte[] hexStringToBytes(String hexString) { + if (hexString.length() % 2 != 0) throw new IllegalArgumentException("hexString length not valid"); + int length = hexString.length() / 2; + byte[] resultBytes = new byte[length]; + for (int index = 0; index < length; index++) { + String result = hexString.substring(index * 2, index * 2 + 2); + resultBytes[index] = Integer.valueOf(Integer.parseInt(result, 16)).byteValue(); + } + return resultBytes; + } + + private static String bytesToHexString(byte[] sources) { + if (sources == null) return null; + StringBuilder stringBuffer = new StringBuilder(); + for (byte source : sources) { + String result = Integer.toHexString(source & 0xff); + if (result.length() < 2) { + result = "0" + result; + } + stringBuffer.append(result); + } + return stringBuffer.toString(); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.2__create_resident_rotators_tables.sql b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.2__create_resident_rotators_tables.sql new file mode 100644 index 0000000000..e56a702e99 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.2__create_resident_rotators_tables.sql @@ -0,0 +1,135 @@ +CREATE TABLE `ca_resident` ( + `resident_id` bigint(20) DEFAULT NULL COMMENT '人口ID', + `grid_id` bigint(20) DEFAULT NULL COMMENT '网格ID', + `resident_property` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '人口性质', + `resident_type` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '居民分类', + `id_type` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '证件类型', + `id_card` varchar(18) COLLATE utf8_bin DEFAULT NULL COMMENT '证件号码(公民身份证号)', + `resident_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '姓名', + `sex` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '性别', + `birthday` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '出生日期', + `nation` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '民族', + `telephone` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '联系方式', + `household_prov` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍省', + `household_city` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍市', + `household_county` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍县(区)', + `household_town` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍镇街', + `household_village` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍社区/村', + `household_address_detail` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍详址', + `curlive_prov` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '现住省', + `curlive_city` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '现住市', + `curlive_county` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '现住县(区)', + `curlive_town` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '现住镇街', + `curlive_village` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '现住社区/村', + `curlive_address_detail` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '现住详址', + `native_address_prov` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '籍贯省', + `native_address_city` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '籍贯市', + `native_address_county` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '籍贯县(区)', + `former_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '曾用名', + `education` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '学历', + `occupation` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '职业', + `occupation_type` varchar(50) COLLATE utf8_bin DEFAULT '' COMMENT '职业类别', + `service_address` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '服务处所', + `marriage_status` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '婚姻状况', + `party` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '政治面貌', + `religious` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '宗教信仰', + `conversion_state` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '有无皈依(已受洗)', + `nationality` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '国籍', + `plat_code` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '数据来源', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '最后修改人', + `update_date` datetime DEFAULT NULL COMMENT '最后修改时间', + `delete_flag` varchar(50) COLLATE utf8_bin DEFAULT 'normal' COMMENT '删除状态', + `versions` int(11) DEFAULT '1' COMMENT '乐观锁', + `attribute1` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段1', + `attribute2` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段2', + `attribute3` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段3', + `attribute4` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段4', + `attribute5` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段5', + `attribute6` bigint(20) DEFAULT NULL COMMENT '扩展字段6', + `attribute7` bigint(20) DEFAULT NULL COMMENT '扩展字段7', + `attribute8` bigint(20) DEFAULT NULL COMMENT '扩展字段8', + `attribute9` datetime DEFAULT NULL COMMENT '扩展字段9', + `attribute10` datetime DEFAULT NULL COMMENT '扩展字段10', + `home_id` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT 'homeId', + `ic_resi_user` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '对应的ic_resi_user主表Id', + KEY `IDX_ID_CARD` (`id_card`) USING BTREE, + KEY `IDX_RESIDENT_ID` (`resident_id`) USING BTREE, + KEY `IDX_GRID_ID` (`grid_id`) USING BTREE, + KEY `IDX_DELETE_FLAG` (`delete_flag`) USING BTREE, + KEY `IDX_RESIDENT_NAME` (`resident_name`) USING BTREE, + KEY `IDX_BIRTHDAY` (`grid_id`,`birthday`) USING BTREE, + KEY `inx_gridDelete` (`grid_id`,`delete_flag`) USING BTREE, + KEY `IDX_UPDATE_DATE` (`update_date`,`create_date`) USING BTREE, + KEY `idx_resident_property` (`resident_property`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='人口基本信息表'; + +CREATE TABLE `ca_rotators` ( + `rotators_id` bigint(20) DEFAULT NULL COMMENT '主键id', + `id_card` varchar(18) COLLATE utf8_bin DEFAULT NULL COMMENT '公民身份证号', + `id_type` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '证件类型', + `rotators_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '姓名', + `former_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '曾用名', + `sex` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '性别', + `birthday` datetime DEFAULT NULL COMMENT '出生日期', + `nation` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '民族', + `native_address_prov` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '籍贯省', + `native_address_city` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '籍贯市', + `native_address_country` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '籍贯县(区)', + `marriage_status` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '婚姻状况', + `party` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '政治面貌', + `education` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '学历', + `religious` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '宗教信仰', + `occupation_type` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '职业类别', + `occupation` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '职业', + `service_address` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '服务处所', + `telephone` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '联系方式', + `household_address_prov` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍地省', + `household_address_city` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍地市', + `household_address_country` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍地县(区)', + `household_address_town` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍地镇街', + `household_address_village` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍地社区/村', + `household_address_detail` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '户籍门(楼)详址', + `curlive_address_prov` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '现住地省', + `curlive_address_city` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '现住地市', + `curlive_address_country` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '现住地县(区)', + `curlive_address_town` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '现住地镇街', + `curlive_address_village` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '现住地社区/村', + `curlive_address_detail` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '现住门(楼)详址', + `inflow_reason` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '流入原因', + `certificate_type` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '办证类型', + `certificate_number` varchar(30) COLLATE utf8_bin DEFAULT NULL COMMENT '证件号码', + `sign_date` datetime DEFAULT NULL COMMENT '登记日期', + `end_date` datetime DEFAULT NULL COMMENT '证件到期日期', + `residence_type` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '住所类型', + `is_focus_person` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '是否重点关注人员', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '最后修改人', + `update_date` datetime DEFAULT NULL COMMENT '最后修改时间', + `delete_flag` varchar(10) COLLATE utf8_bin DEFAULT 'normal' COMMENT '删除标识(正常的数据存:normal,逻辑删除的标识为:delete)', + `platcode` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '数据来源编码', + `grid_id` bigint(20) DEFAULT NULL COMMENT '网格id', + `versions` int(11) DEFAULT '1' COMMENT '乐观锁', + `attribute1` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '是否注销', + `attribute2` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '注销原因', + `attribute3` varchar(240) COLLATE utf8_bin DEFAULT NULL, + `attribute4` varchar(240) COLLATE utf8_bin DEFAULT NULL, + `attribute5` varchar(240) COLLATE utf8_bin DEFAULT '', + `attribute6` bigint(20) DEFAULT NULL, + `attribute7` bigint(20) DEFAULT NULL, + `attribute8` bigint(20) DEFAULT NULL, + `attribute9` datetime DEFAULT NULL, + `attribute10` datetime DEFAULT NULL, + `home_id` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT 'homeId', + `ic_resi_user` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '对应的ic_resi_user主表Id', + KEY `idx_rotators_id` (`rotators_id`) USING BTREE, + KEY `idx_id_card` (`id_card`) USING BTREE, + KEY `idx_rotators_name` (`rotators_name`) USING BTREE, + KEY `idx_telephone` (`telephone`) USING BTREE, + KEY `IDX_UPDATE_DATE` (`update_date`) USING BTREE, + KEY `idx_rotators_create_date` (`create_date`) USING BTREE, + KEY `idx_data` (`update_date`,`create_date`) USING BTREE, + KEY `idx_platcode` (`platcode`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='流动人口表'; diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.3__create_table.sql b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.3__create_table.sql new file mode 100644 index 0000000000..7093472799 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.3__create_table.sql @@ -0,0 +1,141 @@ +CREATE TABLE `ca_loudong` ( + `building_id` bigint(20) DEFAULT NULL COMMENT '楼栋ID', + `building_type` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '楼宇类型', + `grid_id` bigint(50) DEFAULT NULL COMMENT '网格ID', + `building_name` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '楼宇名称', + `building_use` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '用途分类', + `building_status` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '楼宇状态', + `building_structure` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '楼宇结构', + `building_useage` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '使用现状', + `construction_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '建筑时间', + `building_addr` varchar(256) COLLATE utf8_bin DEFAULT NULL COMMENT '所处位置', + `community_name` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '小区(单位)名称', + `building_leader` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '楼栋长', + `layer_count` int(11) DEFAULT NULL COMMENT '楼层数', + `basement_layer_count` int(11) DEFAULT NULL COMMENT '地下楼层数', + `house_begin_layer` int(11) DEFAULT NULL COMMENT '住宅开始层数', + `unit_count` int(11) DEFAULT NULL COMMENT '单元数', + `layer_room_count` int(11) DEFAULT NULL COMMENT '每层每单元户数', + `room_count` int(11) DEFAULT NULL COMMENT '总房屋数', + `elevator_count` varchar(11) COLLATE utf8_bin DEFAULT NULL COMMENT '电梯数量', + `building_area` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '建筑面积', + `building_pmc` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '物业公司', + `building_desc` varchar(1000) COLLATE utf8_bin DEFAULT NULL COMMENT '介绍', + `point_status` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '标绘状态', + `longitude` decimal(10,7) DEFAULT NULL COMMENT '经度', + `latitude` decimal(10,7) DEFAULT NULL COMMENT '纬度', + `plat_code` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '数据来源', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '最后修改人', + `update_date` datetime DEFAULT NULL COMMENT '最后修改时间', + `delete_flag` varchar(10) COLLATE utf8_bin DEFAULT 'normal' COMMENT '删除状态', + `versions` int(11) DEFAULT '1' COMMENT '乐观锁', + `attribute1` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段1', + `attribute2` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段2', + `attribute3` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段3', + `attribute4` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段4', + `attribute5` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段5', + `attribute6` bigint(20) DEFAULT NULL COMMENT '小区主键', + `attribute7` bigint(20) DEFAULT NULL COMMENT '扩展字段7', + `attribute8` bigint(20) DEFAULT NULL COMMENT '扩展字段8', + `attribute9` datetime DEFAULT NULL COMMENT '扩展字段9', + `attribute10` datetime DEFAULT NULL COMMENT '扩展字段10', + `community_id` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '小区主键', + KEY `IDX_BUILDING_ID` (`building_id`) USING BTREE, + KEY `idx_building_grid_type` (`building_id`,`building_use`,`delete_flag`) USING BTREE, + KEY `sel_buildingname` (`building_name`) USING BTREE, + KEY `idx_buiding_type` (`building_type`) USING BTREE, + KEY `idx_building_id_flag` (`grid_id`,`delete_flag`,`building_use`) USING BTREE, + KEY `u_createdate` (`update_date`,`create_date`) USING BTREE, + KEY `idx_grid_id` (`grid_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='楼栋基本信息表'; + +CREATE TABLE `ca_pingfang` ( + `building_id` bigint(20) DEFAULT NULL COMMENT '楼栋ID', + `building_type` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '楼宇类型', + `grid_id` bigint(50) DEFAULT NULL COMMENT '网格ID', + `building_name` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '楼宇名称', + `building_use` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '用途分类', + `building_status` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '楼宇状态', + `building_structure` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '楼宇结构', + `building_useage` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '使用现状', + `construction_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '建筑时间', + `building_addr` varchar(256) COLLATE utf8_bin DEFAULT NULL COMMENT '所处位置', + `community_name` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '小区(单位)名称', + `building_leader` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '楼栋长', + `layer_count` int(11) DEFAULT NULL COMMENT '楼层数', + `basement_layer_count` int(11) DEFAULT NULL COMMENT '地下楼层数', + `house_begin_layer` int(11) DEFAULT NULL COMMENT '住宅开始层数', + `unit_count` int(11) DEFAULT NULL COMMENT '单元数', + `layer_room_count` int(11) DEFAULT NULL COMMENT '每层每单元户数', + `room_count` int(11) DEFAULT NULL COMMENT '总房屋数', + `elevator_count` varchar(11) COLLATE utf8_bin DEFAULT NULL COMMENT '电梯数量', + `building_area` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '建筑面积', + `building_pmc` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '物业公司', + `building_desc` varchar(1000) COLLATE utf8_bin DEFAULT NULL COMMENT '介绍', + `point_status` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '标绘状态', + `longitude` decimal(10,7) DEFAULT NULL COMMENT '经度', + `latitude` decimal(10,7) DEFAULT NULL COMMENT '纬度', + `plat_code` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '数据来源', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '最后修改人', + `update_date` datetime DEFAULT NULL COMMENT '最后修改时间', + `delete_flag` varchar(10) COLLATE utf8_bin DEFAULT 'normal' COMMENT '删除状态', + `versions` int(11) DEFAULT '1' COMMENT '乐观锁', + `attribute1` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段1', + `attribute2` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段2', + `attribute3` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段3', + `attribute4` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段4', + `attribute5` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段5', + `attribute6` bigint(20) DEFAULT NULL COMMENT '小区主键', + `attribute7` bigint(20) DEFAULT NULL COMMENT '扩展字段7', + `attribute8` bigint(20) DEFAULT NULL COMMENT '扩展字段8', + `attribute9` datetime DEFAULT NULL COMMENT '扩展字段9', + `attribute10` datetime DEFAULT NULL COMMENT '扩展字段10', + `community_id` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '小区主键' +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +CREATE TABLE `ca_rental` ( + `rental_id` bigint(20) DEFAULT NULL COMMENT '出租房ID', + `grid_id` bigint(20) DEFAULT NULL COMMENT '网格ID', + `house_id` bigint(20) DEFAULT NULL COMMENT '房屋ID', + `house_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '房屋编号', + `house_address` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '房屋地址', + `house_use` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '建筑用途', + `house_area` decimal(20,2) DEFAULT NULL COMMENT '建筑面积(平方米)', + `id_type` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '证件代码', + `id_card` varchar(30) COLLATE utf8_bin DEFAULT NULL COMMENT '证件号码', + `resident_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '房主姓名', + `telephone` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '房主联系方式', + `curlive_address` varchar(160) COLLATE utf8_bin DEFAULT NULL COMMENT '房主现居详址', + `rent_use` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '出租用途', + `trouble_type` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '隐患类型', + `renter_id` bigint(20) DEFAULT NULL COMMENT '承租人ID', + `renter_card_number` varchar(18) COLLATE utf8_bin DEFAULT NULL COMMENT '承租人公民身份证号码', + `renter_card_type` bigint(20) DEFAULT NULL COMMENT '承租人证件类型', + `renter_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '承租人姓名', + `renter_phone` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '承租人联系方式', + `longitude` decimal(10,7) DEFAULT NULL COMMENT '经度', + `latitude` decimal(10,7) DEFAULT NULL COMMENT '纬度', + `point_status` varchar(10) COLLATE utf8_bin DEFAULT '0' COMMENT '标绘状态', + `plat_code` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '数据来源', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '最后修改人', + `update_date` datetime DEFAULT NULL COMMENT '最后修改时间', + `delete_flag` varchar(10) COLLATE utf8_bin DEFAULT 'normal' COMMENT '删除状态', + `versions` int(11) unsigned zerofill DEFAULT '00000000001' COMMENT '乐观锁', + `attribute1` varchar(240) COLLATE utf8_bin DEFAULT '' COMMENT '承租单位', + `attribute2` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '承租日期', + `attribute3` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '承租期限', + `attribute4` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段4', + `attribute5` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段5', + `attribute6` bigint(20) DEFAULT NULL COMMENT '扩展字段6', + `attribute7` bigint(20) DEFAULT NULL COMMENT '扩展字段7', + `attribute8` bigint(20) DEFAULT NULL COMMENT '扩展字段8', + `attribute9` datetime DEFAULT NULL COMMENT '扩展字段9', + `attribute10` datetime DEFAULT NULL COMMENT '扩展字段10' +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='出租房信息表'; + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml index f985020aa1..9b1c2efa20 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml @@ -145,12 +145,36 @@ --> + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + + + + @@ -164,6 +188,10 @@ + + + + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaLoudongDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaLoudongDao.xml new file mode 100644 index 0000000000..613665cd44 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaLoudongDao.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from ca_loudong + + + + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaPingfangDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaPingfangDao.xml new file mode 100644 index 0000000000..9bf92f78ab --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaPingfangDao.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from ca_pingfang + + + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRentalDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRentalDao.xml new file mode 100644 index 0000000000..c7dda007dc --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRentalDao.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from ca_rental + + + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentDao.xml new file mode 100644 index 0000000000..33041e3a96 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentDao.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from ca_resident + + + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRotatorsDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRotatorsDao.xml new file mode 100644 index 0000000000..d54fe39738 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRotatorsDao.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from ca_rotators + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index ce708be3b2..e93d9badaa 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -170,4 +171,12 @@ public interface OperCustomizeOpenFeignClient { @PostMapping("/oper/customize/icExportTemplate/getExcelHeaderAndSqlColumnForExport") Result getExcelHeaderAndSqlColumnForExport(@RequestBody IcExportTemplateQueryFormDTO param); + /** + * 使用item相关条件查询关联的options + * @param input + * @return + */ + @PostMapping("/oper/customize/icformitemoptions/getItemConditions") + Result> getOptionsMap(@RequestBody IcFormOptionsQueryFormDTO input); + } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index 555dac052c..e59af2b818 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -12,6 +12,7 @@ import com.epmet.dto.result.*; import com.epmet.feign.OperCustomizeOpenFeignClient; import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -130,4 +131,15 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getExcelHeaderAndSqlColumnForExport", param); } + /** + * 使用item相关条件查询关联的options + * + * @param input + * @return + */ + @Override + public Result> getOptionsMap(IcFormOptionsQueryFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getOptionsMap", input); + } + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java index 9f6f68e3a5..9a8f76e302 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java @@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** @@ -120,5 +121,19 @@ public class IcFormItemOptionsController { return new Result>().ok(r); } + @PostMapping("getItemConditions") + public Result> getOptionsMap(@RequestBody IcFormOptionsQueryFormDTO input) { + ValidatorUtils.validateEntity(input, IcFormOptionsQueryFormDTO.QueryByLabelAndCustomerIdForForm.class); + String customerId = input.getCustomerId(); + String formCode = input.getFormCode(); + String columnName = input.getColumnName(); + Integer columnNum = input.getColumnNum(); + List list = icFormItemOptionsService.getOptionsByItemConditions(customerId, formCode, columnName, columnNum); + Map map = list.stream() + .collect(Collectors.toMap(IcFormItemOptionsDTO::getOptionValue, IcFormItemOptionsDTO::getOptionLabel, (o1, o2) -> o1)); + return new Result>().ok(map); + } + + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.26__hide_old_event_footbar.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.26__hide_old_event_footbar.sql new file mode 100644 index 0000000000..5bb2273861 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.26__hide_old_event_footbar.sql @@ -0,0 +1,4 @@ +-- 隐藏旧的事件footbar +update customer_foot_bar +set DISPLAY='0' +where BAR_NAME = '事件' \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.27__modify_zhianxunluoyuan.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.27__modify_zhianxunluoyuan.sql new file mode 100644 index 0000000000..33a8111fb3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.27__modify_zhianxunluoyuan.sql @@ -0,0 +1,5 @@ + +update ic_form_item_options set OPTION_LABEL='治安巡逻员' +where DEL_FLAG='0' +and OPTION_LABEL like '%治安巡逻%' +and ITEM_ID like '%1074'; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.28__update_ic_form_item.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.28__update_ic_form_item.sql new file mode 100644 index 0000000000..c023b712a7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.28__update_ic_form_item.sql @@ -0,0 +1,3 @@ +update ic_form_item set OPTION_SOURCE_VALUE='/resi/partymember/icPartyOrg/branchlist',ITEM_TYPE='cascader' +where DEL_FLAG='0' +and LABEL='所属支部'; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml index d809abcfd7..594456d25f 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml @@ -108,6 +108,25 @@ DENY + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + @@ -144,6 +163,10 @@ + + + + @@ -157,6 +180,10 @@ + + + + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml index a496703051..3eb3b4432f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml @@ -138,6 +138,26 @@ + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + @@ -147,6 +167,10 @@ + + + + @@ -164,6 +188,10 @@ + + + + diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyResiUserInfoResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyResiUserInfoResultDTO.java index 5ffe04836b..56e8dfae95 100644 --- a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyResiUserInfoResultDTO.java +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyResiUserInfoResultDTO.java @@ -56,4 +56,14 @@ public class MyResiUserInfoResultDTO implements Serializable { * 是否录入身份证号,true ,false * */ private Boolean completeIdNum; + + /** + * 是否是志愿者:0否1是 + */ + private String volunteerFlag; + + /** + * 类别【字典表】 + */ + private String volunteerCategory; } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java index a508fffe31..5c4788f7b7 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java @@ -28,11 +28,14 @@ public class PersonalCenterServiceImpl implements PersonalCenterService { @Override public InitInfoResultDTO initInfo(TokenDto tokenDto) { + InitInfoResultDTO resultDTO = new InitInfoResultDTO(); Result baseInfoResult = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto); - if (!baseInfoResult.success() || null == baseInfoResult.getData()) { + if (!baseInfoResult.success()) { throw new RenException(baseInfoResult.getCode(), baseInfoResult.getMsg()); } - InitInfoResultDTO resultDTO = new InitInfoResultDTO(); + if (null == baseInfoResult.getData()) { + return resultDTO; + } resultDTO.setHeadImgUrl(baseInfoResult.getData().getHeadImgUrl()); resultDTO.setSurname(baseInfoResult.getData().getSurname()); resultDTO.setName(baseInfoResult.getData().getName()); diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java new file mode 100644 index 0000000000..b5d26e1ee6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java @@ -0,0 +1,127 @@ +package com.epmet.resi.partymember.dto.partyOrg; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyOrgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 党组织的上级ID,没有上级时为0 + */ + @NotNull(message = "上级组织不能为空") + private String orgPid; + + /** + * 党组织的所有上级ID,没有上级时为0 + */ + private String orgPids; + + /** + * 行政组织 机关ID + */ + + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部 + */ + @NotNull(message = "组织类型不能为空") + private String partyOrgType; + + /** + * 组织名称 + */ + @NotNull(message = "组织名称不能为空") + private String partyOrgName; + + /** + * 组织编码 + */ + private String partyOrgCode; + + /** + * 经度 + */ + @NotNull(message = "经度不能为空") + private String longitude; + + /** + * 纬度 + */ + @NotNull(message = "纬度不能为空") + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 党组织介绍 + */ + private String introduction; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 用户id + */ + private String staffId; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/PartyOrgTreeListDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/PartyOrgTreeListDTO.java new file mode 100644 index 0000000000..862d5e6c58 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/PartyOrgTreeListDTO.java @@ -0,0 +1,32 @@ +package com.epmet.resi.partymember.dto.partyOrg.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-05-20 14:04 + **/ +@Data +public class PartyOrgTreeListDTO implements Serializable { + + /** + * 行政组织 机关ID + */ + + private String agencyId; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 党组织pid + */ + + private String orgPid; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchlistTreeDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchlistTreeDTO.java new file mode 100644 index 0000000000..d4e48da213 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchlistTreeDTO.java @@ -0,0 +1,23 @@ +package com.epmet.resi.partymember.dto.partyOrg.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-05-30 10:11 + **/ +@Data +public class BranchlistTreeDTO implements Serializable { + + private String label; + + private String value; + + private List children = new ArrayList<>(); +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchlistTreeSubDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchlistTreeSubDTO.java new file mode 100644 index 0000000000..2bd1b45953 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchlistTreeSubDTO.java @@ -0,0 +1,22 @@ +package com.epmet.resi.partymember.dto.partyOrg.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-05-30 10:11 + **/ +@Data +public class BranchlistTreeSubDTO implements Serializable { + + private String label; + + private String value; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/IcPartyOrgTreeDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/IcPartyOrgTreeDTO.java new file mode 100644 index 0000000000..cb5bf1b927 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/IcPartyOrgTreeDTO.java @@ -0,0 +1,59 @@ +package com.epmet.resi.partymember.dto.partyOrg.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyOrgTreeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 党组织的上级ID,没有上级时为0(前端展示用) + */ + private String pid; + + /** + * 党组织的所有上级ID,没有上级时为0 + */ + private String orgPids; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部 + */ + private String partyOrgType; + + /** + * 组织名称 + */ + private String partyOrgName; + + private List children = new ArrayList<>(); + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java new file mode 100644 index 0000000000..9832a35e5e --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java @@ -0,0 +1,188 @@ +package com.epmet.resi.partymember.dto.partymember; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 数字平台党员信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyMemberDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + @NotBlank(message = "当前网格id不能为空",groups ={UpdateGroup.class}) + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 党组织的所有上级ID,没有上级时为0 + */ + private String orgPids; + private String orgName; + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 对应的ic_resi_user主表Id + */ + private String icResiUser; + + /** + * 姓名 + */ + @NotBlank(message = "当前网格id不能为空",groups ={AddGroup.class, UpdateGroup.class}) + private String name; + + /** + * 手机号 + */ + @NotBlank(message = "当前网格id不能为空",groups ={AddGroup.class, UpdateGroup.class}) + private String mobile; + + /** + * 身份证号 + */ + @NotBlank(message = "当前网格id不能为空",groups ={AddGroup.class, UpdateGroup.class}) + private String idCard; + + /** + * 地址 + */ + private String address; + + /** + * 入党时间 + */ + private String rdsj; + + /** + * 所属支部 + */ + private String sszb; + + /** + * 是否流动党员 + */ + private String isLd; + + /** + * 流动党员活动证号 + */ + private String ldzh; + + /** + * 职务 + */ + private String partyZw; + private String postName; + /** + * 是否退休 + */ + private String isTx; + + /** + * 是否党员中心户 + */ + private String isDyzxh; + + /** + * 是否免学习0否,1是 + */ + private String isMxx; + + /** + * 文化程度【字典表】 + */ + private String culture; + private String cultureName; + /** + * 志愿者类型,逗号隔开 + */ + private String volunteerCategory; + private List volunteerCategoryName; + /** + * 备注 + */ + private String remark; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPayRecordDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPayRecordDTO.java new file mode 100644 index 0000000000..82ae32717d --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPayRecordDTO.java @@ -0,0 +1,92 @@ +package com.epmet.resi.partymember.dto.partymember; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.math.BigDecimal; + +/** + * 党员缴费记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyMemberPayRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id (customer.id) + */ + @NotBlank(message = "客户Id不能为空") + private String customerId; + + /** + * 党员ID + */ + @NotBlank(message = "党员ID不能为空") + private String partyMemberId; + + /** + * 缴费日期 + */ + @NotBlank(message = "缴费日期不能为空") + private String payDate; + + /** + * 缴费金额 + */ + @NotBlank(message = "缴费金额不能为空") + private BigDecimal money; + + /** + * 缴费开始时间 + */ + @NotBlank(message = "缴费开始时间不能为空") + private String startDate; + + /** + * 缴费结束时间 + */ + @NotBlank(message = "缴费结束时间不能为空") + private String endDate; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPayRecordDetailDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPayRecordDetailDTO.java new file mode 100644 index 0000000000..e0537443ce --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPayRecordDetailDTO.java @@ -0,0 +1,99 @@ +package com.epmet.resi.partymember.dto.partymember; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 党员缴费记录明细表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyMemberPayRecordDetailDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 党员ID + */ + private String partyMemberId; + + /** + * 党员缴费记录表ID + */ + private String recordId; + + /** + * 缴费年度 + */ + private String year; + + /** + * 缴费月份 + */ + private String month; + + /** + * 缴费金额 + */ + private BigDecimal money; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + // 姓名 + private String name; + // 手机号 + private String mobile; + // 身份证号 + private String idCard; + // 所属党组织名称 + private String orgName; + // 缴费次数 + private String times; + // 备注 + private String remark; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java new file mode 100644 index 0000000000..90879a74f4 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java @@ -0,0 +1,119 @@ +package com.epmet.resi.partymember.dto.partymember; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党员量化积分表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyMemberPointDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 党员ID + */ + private String partyMemberId; + + /** + * 年 + */ + private String year; + + /** + * 季度 + */ + private String quarter; + + /** + * 基础积分分值 + */ + private Integer basePoint; + + /** + * 基础积分选项 英文逗号隔开 + */ + private String baseOptions; + + /** + * 民主评议积分分值 + */ + private Integer reviewPoint; + + /** + * 民主评议积分选项 + */ + private String reviewOptions; + + /** + * 激励积分分值 + */ + private Integer inspirePoint; + + /** + * 激励积分选项 + */ + private String inspireOptions; + + /** + * 警示扣分分值 + */ + private Integer warnPoint; + + /** + * 警示扣分选项 + */ + private String warnOptions; + + /** + * 总分 + */ + private Integer totalScore = 0; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartyMemberPointListCountDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartyMemberPointListCountDTO.java new file mode 100644 index 0000000000..e3c44992a6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartyMemberPointListCountDTO.java @@ -0,0 +1,35 @@ +package com.epmet.resi.partymember.dto.partymember; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyMemberPointListCountDTO implements Serializable { + + private static final long serialVersionUID = -8960345656247021278L; + + /** + * 基础积分分值次数 + */ + private Integer basePointCount; + + /** + * 民主评议积分分值次数 + */ + private Integer reviewPointCount; + + /** + * 激励积分分值次数 + */ + private Integer inspirePointCount; + + /** + * 警示扣分分值次数 + */ + private Integer warnPointCount; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java new file mode 100644 index 0000000000..42da9bdf94 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java @@ -0,0 +1,84 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/18 16:03 + */ +@NoArgsConstructor +@Data +public class IcPartyMemberFromDTO extends PageFormDTO implements Serializable { + private static final long serialVersionUID = -5751720367897462952L; + private String customerId; + /** + * 所属党组织 + */ + private String partyOrgId; + /** + * 姓名 + */ + private String name; + /** + * 手机 + */ + private String mobile; + /** + * 身份证号 + */ + private String idCard; + /** + * 地址 + */ + private String address; + /** + * 流动党员 + */ + private String isLd; + /** + * 流动党员证号 + */ + private String ldzh; + /** + * 职务 + */ + private String partyZw; + /** + * 是否党员中心户 + */ + private String isDyzxh; + /** + * 是否免学习 + */ + private String isMxx; + /** + * 文化程度 + */ + private String culture; + /** + * 是否缴费 + */ + private String isPay; + /** + * 入党时间开始 + */ + private String rdsjStartDate; + /** + * 入党时间结束 + */ + private String rdsjEndDate; + /** + * 最后一次缴费时间开始 + */ + private String payStatrDate; + /** + * 最后一次缴费时间结束 + */ + private String payEndDate; + private String year; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberPayRecordDetailFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberPayRecordDetailFormDTO.java new file mode 100644 index 0000000000..322fce31c8 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberPayRecordDetailFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @Author wgf + * @Date 2022/05/17 19:49 + */ +@NoArgsConstructor +@Data +public class IcPartyMemberPayRecordDetailFormDTO implements Serializable { + private static final long serialVersionUID = 4743261460276449408L; + + private String orgId; + private String name; + private String mobile; + private String idCard; + private String year; + private String month; + + private Integer pageNo; + private Integer pageSize; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberExportFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberExportFormDTO.java new file mode 100644 index 0000000000..42d465463e --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberExportFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyMemberExportFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -1193821690622467766L; + + /** + * 客户id + */ + private String customerId; + + /** + * 所属党组织id + */ + private String orgId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 评分年度 + */ + private String year; + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointEchoFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointEchoFormDTO.java new file mode 100644 index 0000000000..ba52678e75 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointEchoFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class PartyMemberPointEchoFormDTO implements Serializable { + + private static final long serialVersionUID = 6999955563137801002L; + + /** + * 年份 + */ + @NotBlank(message = "年份不能为空") + private String year; + + /** + * 季度 + */ + @NotBlank(message = "季度不能为空") + private String quarter; + + /** + * 党员id + */ + @NotBlank(message = "党员id不能为空") + private String partyMemberId; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java new file mode 100644 index 0000000000..5055126aec --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyMemberPointListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 5659445492756209830L; + + /** + * 所属党组织id + */ + private String orgId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 评分年度 + */ + private String year; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/IcPartyMemberResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/IcPartyMemberResultDTO.java new file mode 100644 index 0000000000..bf4408f5a6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/IcPartyMemberResultDTO.java @@ -0,0 +1,82 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/18 16:33 + */ +@NoArgsConstructor +@Data +public class IcPartyMemberResultDTO implements Serializable { + + private static final long serialVersionUID = -4964061462850271428L; + /** + * 主键 + */ + private String id; + /** + * 姓名 + */ + private String name; + /** + * 身份证号 + */ + private String idCard; + /** + * 手机号 + */ + private String mobile; + /** + * 入党时间 + */ + private String rdsj; + /** + * 所属党组织 + */ + private String sszb; + /** + * 流动党员 + */ + private String isLd; + /** + * 流动党员证号 + */ + private String ldzh; + /** + * 职务 + */ + private String partyZw; + /** + * 地址 + */ + private String address; + /** + * 是否缴费 + */ + private String isPay; + /** + * 最近一次缴纳党费时间 + */ + private String payDate; + /** + * 文化程度 + */ + private String culture; + /** + * 量化积分 + */ + private String point; + /** + * 志愿者类别 + */ + private String volunteerCategory; + /** + * 备注 + */ + private String remark; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointEchoResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointEchoResultDTO.java new file mode 100644 index 0000000000..42b93cd711 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointEchoResultDTO.java @@ -0,0 +1,57 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyMemberPointEchoResultDTO implements Serializable { + + private static final long serialVersionUID = 195601506560614702L; + + /** + * 基础积分分值 + */ + private Integer basePoint; + + /** + * 基础积分选项 英文逗号隔开 + */ + private String baseOptions; + + /** + * 民主评议积分分值 + */ + private Integer reviewPoint; + + /** + * 民主评议积分选项 + */ + private String reviewOptions; + + /** + * 激励积分分值 + */ + private Integer inspirePoint; + + /** + * 激励积分选项 + */ + private String inspireOptions; + + /** + * 警示扣分分值 + */ + private Integer warnPoint; + + /** + * 警示扣分选项 + */ + private String warnOptions; + + private String id; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointExportResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointExportResultDTO.java new file mode 100644 index 0000000000..a6f1cbd054 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointExportResultDTO.java @@ -0,0 +1,72 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class PartyMemberPointExportResultDTO implements Serializable { + + private static final long serialVersionUID = -3692594790475696502L; + + + /** + * 党员id + */ + private String partyMemberId; + + /** + * 年 + */ + private String year; + + /** + * 季度 + */ + private String quarter; + + /** + * 基础积分分值 + */ + private Integer basePoint; + + /** + * 基础积分选项 + */ + private String baseOptions; + + /** + * 民主评议积分分值 + */ + private Integer reviewPoint; + + /** + * 民主评议积分选项 + */ + private String reviewOptions; + + /** + * 激励积分分值 + */ + private Integer inspirePoint; + + /** + * 激励积分选项 + */ + private String inspireOptions; + + /** + * 警示扣分分值 + */ + private Integer warnPoint; + + /** + * 警示扣分选项 + */ + private String warnOptions; + + /** + * 总分 + */ + private Integer totalScore; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointListResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointListResultDTO.java new file mode 100644 index 0000000000..2670024446 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointListResultDTO.java @@ -0,0 +1,102 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyMemberPointListResultDTO implements Serializable { + + private static final long serialVersionUID = 5867583472212661940L; + + /** + * 所属党组织 + */ + private String partyOrg; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 总分 + */ + private Integer totalScore; + + /** + *基础积分分值 + */ + private Integer basePoint; + + /** + * 基础选项 + */ + private String baseOptions; + + /** + * 民主评议积分分值 + */ + private Integer reviewPoint; + + /** + * 民主评议选项 + */ + private String reviewOptions; + + /** + * 激励积分分值 + */ + private Integer inspirePoint; + + /** + * 激励积分选项 + */ + private String inspireOptions; + + /** + * 警示扣分分值 + */ + private Integer warnPoint; + + /** + * 警示扣分选项 + */ + private String warnOptions; + + /** + * 备注 + */ + private String Remark; + + /** + * 年度 + */ + private String year; + + /** + * 季度 + */ + private Integer quarter; + + + /** + * id + */ + private String partyMemberId; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java index 63c2674043..de18151595 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java @@ -1,7 +1,12 @@ package com.epmet.resi.partymember.feign; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; @@ -114,4 +119,16 @@ public interface ResiPartyMemberOpenFeignClient { @PostMapping("/resi/partymember/partymemberconfirmmanual/audit-reset") Result partyMemberAuditReset(@RequestParam("gridId")String gridId); + /** + * @Description 同步党员信息 + * @Param dto + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/18 10:41 + */ + @PostMapping("/resi/partymember/icPartyMember/icPartyMemberSync") + Result icPartyMemberSync(@RequestBody IcPartyMemberDTO dto); + + @PostMapping("/resi/partymember/icPartyOrg/branchlist") + public Result> branchlist(); } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java index 2cb889e348..69215d5380 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java @@ -1,8 +1,12 @@ package com.epmet.resi.partymember.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; @@ -74,4 +78,22 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp public Result partyMemberAuditReset(String gridId) { return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "partyMemberAuditReset", gridId); } + + /** + * @param dto + * @Description 同步党员信息 + * @Param dto + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/18 10:41 + */ + @Override + public Result icPartyMemberSync(IcPartyMemberDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "icPartyMemberSync", dto); + } + + @Override + public Result> branchlist() { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "branchlist", null); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index dfd61d4d3e..7e5dd0187d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -106,7 +106,13 @@ com.epmet - epmet-user-client + epmet-admin-client + 2.0.0 + compile + + + com.epmet + oper-customize-client 2.0.0 compile diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java new file mode 100644 index 0000000000..c0b0af1144 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java @@ -0,0 +1,113 @@ +package com.epmet.modules.partyOrg.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +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.modules.partyOrg.excel.IcPartyOrgExcel; +import com.epmet.modules.partyOrg.service.IcPartyOrgService; +import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@RestController +@RequestMapping("icPartyOrg") +public class IcPartyOrgController { + + @Autowired + private IcPartyOrgService icPartyOrgService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPartyOrgService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcPartyOrgDTO data = icPartyOrgService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyOrgDTO dto){ + dto.setCustomerId(tokenDto.getCustomerId()); + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return icPartyOrgService.save(dto); + } + + @NoRepeatSubmit + @PutMapping + public Result update(@RequestBody IcPartyOrgDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPartyOrgService.update(dto); + return new Result(); + } + + @DeleteMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPartyOrgService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icPartyOrgService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcPartyOrgExcel.class); + } + + + /** + * @describe: 获取党组织下拉树 + * @author wangtong + * @date 2022/5/17 17:13 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + @GetMapping("getTreelist") + public Result> getTreelist(@LoginUser TokenDto tokenDto,PartyOrgTreeListDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + return icPartyOrgService.getTreelist(formDTO); + } + + /** + * @describe: 当前登录用户所属行政组织,及下级的党组织(只限支部) + * @author wangtong + * @date 2022/5/25 15:24 + * @params [tokenDto] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("branchlist") + public Result> branchlist(@LoginUser TokenDto tokenDto){ + return icPartyOrgService.branchlist(tokenDto); + } + + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java new file mode 100644 index 0000000000..3413e87649 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java @@ -0,0 +1,78 @@ +package com.epmet.modules.partyOrg.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; +import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcPartyOrgDao extends BaseDao { + + /** + * @describe: 获取组织列表 + * @author wangtong + * @date 2022/5/17 19:00 + * @params [] + * @return java.util.List + */ + List getTreelist(PartyOrgTreeListDTO formDTO); + + /** + * @describe: 查询跟id相关的所有组织id + * @author wangtong + * @date 2022/5/19 16:14 + * @params [id] + * @return java.util.List + */ + List selectAllByOrgId(@Param("id") String id); + + /** + * @describe: 通过名称或者编码查询 + * @author wangtong + * @date 2022/5/20 10:35 + * @params [partyOrgName, partyOrgCode] + * @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity + */ + IcPartyOrgEntity selectByCuIdAndNameOrCode(@Param("partyOrgName") String partyOrgName, + @Param("partyOrgCode") String partyOrgCode, + @Param("customerId") String customerId); + + /** + * @describe: 通过行政组织id和类型(不等于)筛选 + * @author wangtong + * @date 2022/5/20 10:40 + * @params [agencyId, partyOrgType] + * @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity + */ + IcPartyOrgEntity selectByAgencyId(@Param("agencyId") String agencyId,@Param("partyOrgType") String partyOrgType); + + /** + * @describe: 查询当前客户下的一级组织 + * @author wangtong + * @date 2022/5/25 10:47 + * @params [customerId] + * @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity + */ + IcPartyOrgEntity selectLevelOneOrgByCustomerId(@Param("customerId") String customerId); + + /** + * @describe: 查询行政组织下的所有支部党组织 + * @author wangtong + * @date 2022/5/25 15:30 + * @params [agencyId, customerId] + * @return java.util.List + */ + List selectAllBranchByAgencyId(@Param("agencyId") String agencyId, @Param("customerId") String customerId); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java new file mode 100644 index 0000000000..e9ea2f210c --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java @@ -0,0 +1,81 @@ +package com.epmet.modules.partyOrg.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_org") +public class IcPartyOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 党组织的上级ID,没有上级时为0 + */ + private String orgPid; + + /** + * 党组织的所有上级ID,没有上级时为0 + */ + private String orgPids; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部 + */ + private String partyOrgType; + + /** + * 组织名称 + */ + private String partyOrgName; + + /** + * 组织编码 + */ + private String partyOrgCode; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 党组织介绍 + */ + private String introduction; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/excel/IcPartyOrgExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/excel/IcPartyOrgExcel.java new file mode 100644 index 0000000000..f57f8cb7c5 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/excel/IcPartyOrgExcel.java @@ -0,0 +1,75 @@ +package com.epmet.modules.partyOrg.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyOrgExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id (customer.id)") + private String customerId; + + @Excel(name = "党组织的上级ID,没有上级时为0") + private String orgPid; + + @Excel(name = "党组织的所有上级ID,没有上级时为0") + private String orgPids; + + @Excel(name = "行政组织 机关ID") + private String agencyId; + + @Excel(name = "行政组织 机关ID") + private String agencyPids; + + @Excel(name = "党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部") + private String partyOrgType; + + @Excel(name = "组织名称") + private String partyOrgName; + + @Excel(name = "组织编码") + private String partyOrgCode; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "地址") + private String address; + + @Excel(name = "党组织介绍") + private String introduction; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer 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; + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/redis/IcPartyOrgRedis.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/redis/IcPartyOrgRedis.java new file mode 100644 index 0000000000..158dc60fcc --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/redis/IcPartyOrgRedis.java @@ -0,0 +1,30 @@ +package com.epmet.modules.partyOrg.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Component +public class IcPartyOrgRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java new file mode 100644 index 0000000000..5405a5b531 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java @@ -0,0 +1,101 @@ +package com.epmet.modules.partyOrg.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; +import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; + +import java.util.List; +import java.util.Map; + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcPartyOrgService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPartyOrgDTO + * @author generator + * @date 2022-05-17 + */ + IcPartyOrgDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + Result save(IcPartyOrgDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcPartyOrgDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); + + /** + * @describe: 获取党组织下拉树 + * @author wangtong + * @date 2022/5/17 17:20 + * @params [formDTO] + * @return com.epmet.commons.tools.page.PageData + */ + Result> getTreelist(PartyOrgTreeListDTO formDTO); + + /** + * @describe: 当前登录用户所属行政组织,及下级的党组织(只限支部) + * @author wangtong + * @date 2022/5/25 15:25 + * @params [tokenDto] + * @return com.epmet.commons.tools.utils.Result + */ + Result> branchlist(TokenDto tokenDto); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java new file mode 100644 index 0000000000..789d94bbca --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java @@ -0,0 +1,259 @@ +package com.epmet.modules.partyOrg.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.PartyOrgTypeEnum; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.enums.OrgLevelEnums; +import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; +import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; +import com.epmet.modules.partyOrg.service.IcPartyOrgService; +import com.epmet.modules.partymember.dao.IcPartyMemberDao; +import com.epmet.modules.partymember.entity.IcPartyMemberEntity; +import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Service +public class IcPartyOrgServiceImpl extends BaseServiceImpl implements IcPartyOrgService { + + @Autowired + private IcPartyMemberDao icPartyMemberDao; + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPartyOrgDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPartyOrgDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyOrgDTO get(String id) { + IcPartyOrgEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPartyOrgDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(IcPartyOrgDTO dto) { + //同一个客户下,名称和编码不可重复 + IcPartyOrgEntity repeatName = baseDao.selectByCuIdAndNameOrCode(dto.getPartyOrgName(),null,dto.getCustomerId()); + if(null != repeatName){ + throw new EpmetException("行政组织名称不可重复!"); + } + if(StringUtils.isNotBlank(dto.getPartyOrgCode())){ + IcPartyOrgEntity repeatCode = baseDao.selectByCuIdAndNameOrCode(null,dto.getPartyOrgCode(),dto.getCustomerId()); + if(null != repeatCode){ + throw new EpmetException("行政组织编码不可重复!"); + } + } + IcPartyOrgEntity parentOrg = baseDao.selectById(dto.getOrgPid()); + //判断当前党组织的类型是否是所选上级党组织类型的直接下级 + if("0".equals(dto.getOrgPid())){ + if(PartyOrgTypeEnum.BRANCH.getCode().equals(dto.getPartyOrgType())){ + throw new EpmetException("支部不可设为一级组织!"); + } + //一个客户下只能有一个一级组织 + IcPartyOrgEntity levelOneOrg = baseDao.selectLevelOneOrgByCustomerId(dto.getCustomerId()); + if(null != levelOneOrg){ + throw new EpmetException("当前客户下已存在一级组织,不可重复添加!"); + } + }else{ + checkOrgType(parentOrg.getPartyOrgType(),dto.getPartyOrgType()); + } + //如果不是支部,需要判断行政组织是否重复 + if(!PartyOrgTypeEnum.BRANCH.getCode().equals(dto.getPartyOrgType())){ + IcPartyOrgEntity isAgency = baseDao.selectByAgencyId(dto.getAgencyId(),PartyOrgTypeEnum.BRANCH.getCode()); + if(null != isAgency){ + throw new EpmetException("该行政组织已被关联!"); + } + AgencyInfoCache agency = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId()); + //判断该所选的行政组织类型是否与当前党组织的类型一致 + checnAgencyLevel(agency.getLevel(),dto.getPartyOrgType()); + dto.setAgencyPids(agency.getPids()); + }else{ + //类型为支部时,行政组织信息与上级党组织一致 + dto.setAgencyId(parentOrg.getAgencyId()); + dto.setAgencyPids(parentOrg.getAgencyPids()); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId()); + if (null == agencyInfo){ + throw new EpmetException("组织信息获取失败"); + } + IcPartyOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyOrgEntity.class); + insert(entity); + return new Result(); + } + + /** + * @describe: 判断当前党组织的类型是否是所选上级党组织类型的直接下级 + * @author wangtong + * @date 2022/5/25 10:09 + * @params [parentOrg, partyOrgType] + * @return void + */ + private void checkOrgType(String parentOrgType, String partyOrgType) { + if(PartyOrgTypeEnum.BRANCH.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.PARTY.getCode().equals(parentOrgType)){ + throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择党委作为上级组织!"); + }else if(PartyOrgTypeEnum.PARTY.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.WORKING.getCode().equals(parentOrgType)){ + throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择党工委作为上级组织!"); + }else if(PartyOrgTypeEnum.WORKING.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.DISTRICT.getCode().equals(parentOrgType)){ + throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择区委作为上级组织!"); + }else if(PartyOrgTypeEnum.DISTRICT.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.MUNICIPAL.getCode().equals(parentOrgType)){ + throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择市委作为上级组织!"); + }else if(PartyOrgTypeEnum.MUNICIPAL.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.PROVINCIAL.getCode().equals(parentOrgType)){ + throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择省委作为上级组织!"); + } + } + + /** + * @describe: 判断该所选的行政组织类型是否与当前党组织的类型一致 + * @author wangtong + * @date 2022/5/25 9:45 + * @params [agencyLevel, partyOrgType] + * @return void + */ + private void checnAgencyLevel(String agencyLevel, String partyOrgType) { + if(PartyOrgTypeEnum.PROVINCIAL.getCode().equals(partyOrgType) && !OrgLevelEnums.PROVINCE.getLevel().equals(agencyLevel)){ + throw new EpmetException("请保持党组织类型与行政组织类型一致,选择省级的行政组织!"); + }else if(PartyOrgTypeEnum.MUNICIPAL.getCode().equals(partyOrgType) && !OrgLevelEnums.CITY.getLevel().equals(agencyLevel)){ + throw new EpmetException("请保持党组织类型与行政组织类型一致,选择市级的行政组织!"); + }else if(PartyOrgTypeEnum.DISTRICT.getCode().equals(partyOrgType) && !OrgLevelEnums.DISTRICT.getLevel().equals(agencyLevel)){ + throw new EpmetException("请保持党组织类型与行政组织类型一致,选择区级的行政组织!"); + }else if(PartyOrgTypeEnum.WORKING.getCode().equals(partyOrgType) && !OrgLevelEnums.STREET.getLevel().equals(agencyLevel)){ + throw new EpmetException("请保持党组织类型与行政组织类型一致,选择街道级的行政组织!"); + }else if(PartyOrgTypeEnum.PARTY.getCode().equals(partyOrgType) && !OrgLevelEnums.COMMUNITY.getLevel().equals(agencyLevel)){ + throw new EpmetException("请保持党组织类型与行政组织类型一致,选择社区级的行政组织!"); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPartyOrgDTO dto) { +// IcPartyOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyOrgEntity.class); + IcPartyOrgEntity entity = baseDao.selectById(dto.getId()); + entity.setPartyOrgName(dto.getPartyOrgName()); + entity.setPartyOrgCode(dto.getPartyOrgCode()); + entity.setIntroduction(dto.getIntroduction()); + entity.setLatitude(dto.getLatitude()); + entity.setLongitude(dto.getLongitude()); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) +// baseDao.deleteBatchIds(Arrays.asList(ids)); + for(String id : ids){ + //判断该组织是否有下级党组织 + List orgList = baseDao.selectAllByOrgId(id); + if(!CollectionUtils.isEmpty(orgList)){ + throw new EpmetException("请先删除下级党组织!"); + } + //判断该组织下是否有党员 + List memberList = icPartyMemberDao.selectAllByOrgId(id); + if(!CollectionUtils.isEmpty(memberList)){ + throw new EpmetException("该组织下有党员信息暂时不可删除!"); + } + baseDao.deleteById(id); + } + } + + @Override + public Result> getTreelist(PartyOrgTreeListDTO formDTO) { + List list = baseDao.getTreelist(formDTO); + return new Result>().ok(build(list)); + } + + @Override + public Result> branchlist(TokenDto tokenDto) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); + List resultList = new ArrayList<>(); + BranchlistTreeDTO result = new BranchlistTreeDTO(); + result.setValue(staffInfo.getAgencyId()); +// result.setOrgPids(staffInfo.getAgencyPIds()); + result.setLabel(staffInfo.getAgencyName()); + //该行政组织下的所有类型为支部的党组织 + List orgList = baseDao.selectAllBranchByAgencyId(staffInfo.getAgencyId(),tokenDto.getCustomerId()); + if(CollectionUtils.isEmpty(orgList)){ + return new Result>().ok(resultList); + } + result.setChildren(orgList); + resultList.add(result); + return new Result>().ok(resultList); + } + + /** + * 构建树节点 + */ + public static List build(List treeNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(treeNodes.size()); + for(IcPartyOrgTreeDTO treeNode : treeNodes){ + nodeMap.put(treeNode.getId(), treeNode); + } + + for(IcPartyOrgTreeDTO node : nodeMap.values()) { + IcPartyOrgTreeDTO parent = nodeMap.get(node.getPid()); + if(parent != null && !(node.getId().equals(parent.getId()))){ + parent.getChildren().add(node); + continue; + } + + result.add(node); + } + + return result; + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java new file mode 100644 index 0000000000..3390d45acc --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java @@ -0,0 +1,311 @@ +package com.epmet.modules.partymember.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +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.constants.ImportTaskConstants; +import com.epmet.dto.form.IcPartyMemberFormDTO; +import com.epmet.dto.form.IcPartyMemberListFormDTO; +import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.PartyMemberAgeResultDTO; +import com.epmet.dto.result.PartyMemberEducationResultDTO; +import com.epmet.modules.partymember.excel.IcPartyMemberExcel; +import com.epmet.modules.partymember.service.IcPartyMemberService; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; +import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; +import com.epmet.utils.ImportTaskUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.net.URLEncoder; +import java.nio.file.Path; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; + + +/** + * 数字平台党员信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Slf4j +@RestController +@RequestMapping("icPartyMember") +public class IcPartyMemberController implements ResultDataResolver { + + @Autowired + private IcPartyMemberService icPartyMemberService; + + @RequestMapping("page") + @MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) + public Result> page(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFromDTO formDTO){ + PageData page = icPartyMemberService.page(tokenDto, formDTO); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@LoginUser TokenDto tokenDto, @PathVariable("id") String id){ + IcPartyMemberDTO data = icPartyMemberService.get(tokenDto, id); + return new Result().ok(data); + } + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcPartyMemberDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + String id = icPartyMemberService.save(dto); + return new Result().ok(id); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcPartyMemberDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPartyMemberService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPartyMemberService.delete(ids); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFromDTO formDTO, HttpServletResponse response) throws Exception { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setIsPage(false); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + + ExcelWriter excelWriter = null; + AtomicInteger i = new AtomicInteger(1); + try { + String fileName = "党员管理.xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPartyMemberExcel.class).build(); + PageData page = null; + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + do { + page = icPartyMemberService.page(tokenDto, formDTO); + List list = ConvertUtils.sourceToTarget(page.getList(), IcPartyMemberExcel.class); + list.forEach(item -> { + item.setIndex(i.getAndIncrement()); + }); + excelWriter.write(list, writeSheet); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + } while (CollectionUtils.isNotEmpty(page.getList()) && page.getList().size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + @PostMapping("icPartyMemberSync") + public Result icPartyMemberSync(@RequestBody IcPartyMemberDTO dto) { + icPartyMemberService.icPartyMemberSync(dto); + return new Result(); + } + + /** + * excel导入 + * @Param file + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/23 16:05 + */ + @PostMapping("import") + public Result importExcel(MultipartFile file) { + String userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); + + // 1.暂存文件 + String originalFilename = file.getOriginalFilename(); + String extName = originalFilename.substring(originalFilename.lastIndexOf(".")); + + Path fileSavePath; + try { + Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_party_member", "import"); + fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName)); + } catch (IOException e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【党员管理导入】创建临时存储文件失败:{}", errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败"); + } + + InputStream is = null; + FileOutputStream os = null; + + try { + is = file.getInputStream(); + os = new FileOutputStream(fileSavePath.toString()); + IOUtils.copy(is, os); + } catch (Exception e) { + log.error("method exception", e); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(is); + org.apache.poi.util.IOUtils.closeQuietly(os); + } + + // 2.生成导入任务记录 + ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException( + ImportTaskUtils.createImportTask(originalFilename, ImportTaskConstants.BIZ_TYPE_IC_PARTY_MEMBER), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "excel导入党员信息错误", + "导入党员信息失败"); + + // 3.执行导入 + icPartyMemberService.execAsyncExcelImport(fileSavePath, rstData.getTaskId()); + + return new Result(); + } + + /** + * @describe: 统计分析-党员学历统计 + * @author wangtong + * @date 2022/5/23 10:06 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("partymembereducationstatistics") + public Result> partyMemberEducationStatistics(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getAgencyId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + return new Result>().ok(icPartyMemberService.partyMemberEducationStatistics(formDTO)); + } + + /** + * @describe: 统计分析-党员年龄列表 + * @author wangtong + * @date 2022/5/23 10:20 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("partymemberagelist") + @MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) + public Result> partyMemberAgelist(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberListFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getAgencyId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + return new Result>().ok(icPartyMemberService.getPartyMemberAgeList(formDTO)); + } + + /** + * @describe: 统计分析-党员学历列表 + * @author wangtong + * @date 2022/5/23 10:19 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("partymembereducationlist") + @MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) + public Result> partyMemberEducationlist(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberListFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getAgencyId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + return new Result>().ok(icPartyMemberService.getPartyMemberEducationList(formDTO)); + } + + /** + * @describe: 统计分析-党员年龄范围统计 + * @author wangtong + * @date 2022/5/23 10:19 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("partymemberagestatistics") + public Result> partyMemberAgeStatistics(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getAgencyId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + return new Result>().ok(icPartyMemberService.partyMemberAgeStatistics(formDTO)); + } + + + @RequestMapping(value = "downloadTemplate", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("党员信息导入模板", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/ic_party_member.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordController.java new file mode 100644 index 0000000000..f3b91d27dd --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordController.java @@ -0,0 +1,85 @@ +package com.epmet.modules.partymember.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.modules.partymember.excel.IcPartyMemberPayRecordExcel; +import com.epmet.modules.partymember.service.IcPartyMemberPayRecordService; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 党员缴费记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@RestController +@RequestMapping("icPartyMemberPayRecord") +public class IcPartyMemberPayRecordController { + + @Autowired + private IcPartyMemberPayRecordService icPartyMemberPayRecordService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ +// PageData page = icPartyMemberPayRecordService.page(params); + PageData page = icPartyMemberPayRecordService.getPhrasePage(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcPartyMemberPayRecordDTO data = icPartyMemberPayRecordService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberPayRecordDTO dto){ + dto.setCustomerId(tokenDto.getCustomerId()); + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return icPartyMemberPayRecordService.save(dto); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberPayRecordDTO dto){ + dto.setCustomerId(tokenDto.getCustomerId()); + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return icPartyMemberPayRecordService.update(dto); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPartyMemberPayRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icPartyMemberPayRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcPartyMemberPayRecordExcel.class); + } + + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordDetailController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordDetailController.java new file mode 100644 index 0000000000..4c095ac243 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordDetailController.java @@ -0,0 +1,137 @@ +package com.epmet.modules.partymember.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; +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.ConvertUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +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.modules.partymember.excel.IcPartyMemberPayRecordDetailExcel; +import com.epmet.modules.partymember.service.IcPartyMemberPayRecordDetailService; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDetailDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + + +/** + * 党员缴费记录明细表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Slf4j +@RestController +@RequestMapping("icPartyMemberPayRecordDetail") +public class IcPartyMemberPayRecordDetailController { + + @Autowired + private IcPartyMemberPayRecordDetailService icPartyMemberPayRecordDetailService; + + @RequestMapping("page") + public Result> page(@LoginUser TokenDto tokenDto, @RequestParam Map params){ + params.put("customerId",tokenDto.getCustomerId()); +// PageData page = icPartyMemberPayRecordDetailService.page(params); + PageData page = icPartyMemberPayRecordDetailService.getPhrasePage(params); + return new Result>().ok(page); + } + + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcPartyMemberPayRecordDetailDTO data = icPartyMemberPayRecordDetailService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcPartyMemberPayRecordDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartyMemberPayRecordDetailService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcPartyMemberPayRecordDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPartyMemberPayRecordDetailService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPartyMemberPayRecordDetailService.delete(ids); + return new Result(); + } + + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody Map params, HttpServletResponse response) throws Exception { +// List list = icPartyMemberPayRecordDetailService.list(params); +// ExcelUtils.exportExcelToTarget(response, null, list, IcPartyMemberPayRecordDetailExcel.class); + + params.put("customerId",tokenDto.getCustomerId()); + params.put("isPage",false); + params.put("pageSize",NumConstant.TEN_THOUSAND); + + ExcelWriter excelWriter = null; + AtomicInteger i = new AtomicInteger(1); + try { + String fileName = "缴费记录.xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPartyMemberPayRecordDetailExcel.class).build(); + PageData page = null; + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + do { + page = icPartyMemberPayRecordDetailService.getPhrasePage(params); + List list = ConvertUtils.sourceToTarget(page.getList(), IcPartyMemberPayRecordDetailExcel.class); + list.forEach(item -> { + item.setIndex(i.getAndIncrement()); + }); + excelWriter.write(list, writeSheet); +// formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + } while (CollectionUtils.isNotEmpty(page.getList()) && page.getList().size() == NumConstant.TEN_THOUSAND); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java new file mode 100644 index 0000000000..07af853ce1 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java @@ -0,0 +1,186 @@ +package com.epmet.modules.partymember.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; +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.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +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.IcFollowUpRecordDTO; +import com.epmet.dto.result.IcMoveInListResultDTO; +import com.epmet.dto.result.IcVaccineListResultDTO; +import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; +import com.epmet.modules.partymember.excel.IcPartyMemberExcel; +import com.epmet.modules.partymember.excel.IcPartyMemberPointExcel; +import com.epmet.modules.partymember.service.IcPartyMemberPointService; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; +import com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberExportFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointEchoFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointListFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointExportResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO; +import jdk.nashorn.internal.parser.Token; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + + +/** + * 党员量化积分表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@RestController +@RequestMapping("icPartyMemberPoint") +@Slf4j +public class IcPartyMemberPointController { + + @Autowired + private IcPartyMemberPointService icPartyMemberPointService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = icPartyMemberPointService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { + IcPartyMemberPointDTO data = icPartyMemberPointService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcPartyMemberPointDTO dto, @LoginUser TokenDto tokenDto) { + dto.setCustomerId(tokenDto.getCustomerId()); + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartyMemberPointService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcPartyMemberPointDTO dto, @LoginUser TokenDto tokenDto) { + dto.setCustomerId(tokenDto.getCustomerId()); + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPartyMemberPointService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPartyMemberPointService.delete(ids); + return new Result(); + } + + /** + * 量化积分统计导出 + * + * @param formDto + * @param response + * @return void + * @author LZN + * @date 2022/5/24 14:26 + */ + @PostMapping("export") + public void export(@RequestBody PartyMemberPointListFormDTO formDto, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception { + + formDto.setIsPage(false); + formDto.setPageSize(NumConstant.TEN_THOUSAND); + + ExcelWriter excelWriter = null; + AtomicInteger i = new AtomicInteger(1); + + try { + String fileName = "lhjf.xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPartyMemberPointExcel.class).build(); + PageData page = null; + WriteSheet writeSheet = EasyExcel.writerSheet("量化积分").registerWriteHandler(new FreezeAndFilter()).build(); + do { + page = icPartyMemberPointService.getExport(formDto, tokenDto); + List list = ConvertUtils.sourceToTarget(page.getList(), IcPartyMemberPointExcel.class); + list.forEach(item -> { + item.setIndex(i.getAndIncrement()); + }); + excelWriter.write(list, writeSheet); + formDto.setPageNo(formDto.getPageNo() + NumConstant.ONE); + } while (CollectionUtils.isNotEmpty(page.getList()) && page.getList().size() == formDto.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + /** + * 量化积分统计 + * + * @param form + * @return com.epmet.commons.tools.utils.Result> + * @author LZN + * @date 2022/5/17 17:19 + */ + @PostMapping("getList") + public Result> getList(@RequestBody PartyMemberPointListFormDTO form, @LoginUser TokenDto tokenDto) { + PageData dto = icPartyMemberPointService.getList(form, tokenDto); + return new Result>().ok(dto); + } + + /** + * 量化积分统计回显 + * + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/5/18 18:18 + */ + @PostMapping("echoPartyMemberPoint") + public Result getEchoPartyMemberPoint(@RequestBody PartyMemberPointEchoFormDTO form, @LoginUser TokenDto tokenDto) { + ValidatorUtils.validateEntity(form); + List dto = icPartyMemberPointService.getEchoPartyMemberPoint(form, tokenDto.getCustomerId()); + return new Result().ok(dto); + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java new file mode 100644 index 0000000000..00ea198d81 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java @@ -0,0 +1,77 @@ +package com.epmet.modules.partymember.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.dto.result.PartyMemberAgeResultDTO; +import com.epmet.dto.result.PartyMemberEducationResultDTO; +import com.epmet.modules.partymember.entity.IcPartyMemberEntity; +import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 数字平台党员信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcPartyMemberDao extends BaseDao { + /** + * 党员列表 + * + * @Param formDTO + * @Return {@link List< IcPartyMemberResultDTO>} + * @Author zhaoqifeng + * @Date 2022/5/18 17:01 + */ + List selectList(IcPartyMemberFromDTO formDTO); + + /** + * @describe: 查询该组织下的党员信息 + * @author wangtong + * @date 2022/5/19 16:20 + * @params [orgId] + * @return java.util.List + */ + List selectAllByOrgId(@Param("orgId") String orgId); + + /** + * @describe: 统计分析-党员学历统计 + * @author wangtong + * @date 2022/5/23 10:32 + * @params [orgId] + * @return java.util.List + */ + List getPartyMemberEducationStatistics(@Param("agencyId") String agencyId, @Param("orgId") String orgId); + + /** + * @describe: 党员年龄列表 + * @author wangtong + * @date 2022/5/23 11:06 + * @params [orgId, code] + * @return java.util.List + */ + List getPartyMemberAgeList(@Param("agencyId") String agencyId,@Param("orgId") String orgId,@Param("code") String code); + + /** + * @describe: 党员学历列表 + * @author wangtong + * @date 2022/5/23 13:40 + * @params [orgId, code] + * @return java.util.List + */ + List getPartyMemberEducationList(@Param("agencyId") String agencyId,@Param("orgId") String orgId,@Param("code") String code); + + /** + * @describe: 党员年龄范围统计 + * @author wangtong + * @date 2022/5/23 13:42 + * @params [orgId] + * @return java.util.List + */ + List getPartyMemberAgeStatistics(@Param("agencyId") String agencyId,@Param("orgId") String orgId); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPayRecordDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPayRecordDao.java new file mode 100644 index 0000000000..4e1ab1d607 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPayRecordDao.java @@ -0,0 +1,22 @@ +package com.epmet.modules.partymember.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.partymember.entity.IcPartyMemberPayRecordEntity; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 党员缴费记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcPartyMemberPayRecordDao extends BaseDao { + + List selectListInfo(Map params); + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPayRecordDetailDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPayRecordDetailDao.java new file mode 100644 index 0000000000..3922fc9718 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPayRecordDetailDao.java @@ -0,0 +1,30 @@ +package com.epmet.modules.partymember.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.partymember.entity.IcPartyMemberPayRecordDetailEntity; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDetailDTO; +import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberPayRecordDetailFormDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 党员缴费记录明细表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcPartyMemberPayRecordDetailDao extends BaseDao { + + List selectListInfo(Map params); + + List getpayedList(@Param("monthList") List monthList, + @Param("partyMemberId") String partyMemberId, + @Param("recordId") String recordId); + + void deletePayDetailByRecordId(@Param("recordId") String recordId); + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java new file mode 100644 index 0000000000..9e44e7d2b6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java @@ -0,0 +1,50 @@ +package com.epmet.modules.partymember.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; +import com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberExportFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointExportResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 党员量化积分表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcPartyMemberPointDao extends BaseDao { + + List getList(@Param("idCard") String idCard, + @Param("mobile") String mobile, + @Param("name") String name, + @Param("orgId") String orgId, + @Param("year") String year, + @Param("customerId") String customerId); + + List getListCount(@Param("year") String year, + @Param("customerId") String customerId); + + List getEchoPartyMemberPoint(@Param("partyMemberId") String partyMemberId, + @Param("quarter") String quarter, + @Param("year") String year, + @Param("customerId") String customerId); + + List getExport(@Param("form") PartyMemberExportFormDTO form, + @Param("customerId") String customerId); + + void updateMember(@Param("partyMemberId") String partyMemberId, @Param("totalScore") Integer totalScore); + + int getPoint(@Param("year") String year, + @Param("quarter") String quarter, + @Param("customerId") String customerId, + @Param("partyMemberId") String partyMemberId); +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java new file mode 100644 index 0000000000..1f6a367d80 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java @@ -0,0 +1,146 @@ +package com.epmet.modules.partymember.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 数字平台党员信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_member") +public class IcPartyMemberEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 党组织的所有上级ID,没有上级时为0 + */ + private String orgPids; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 对应的ic_resi_user主表Id + */ + private String icResiUser; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 地址 + */ + private String address; + + /** + * 入党时间 + */ + private String rdsj; + + /** + * 所属支部 + */ + private String sszb; + + /** + * 是否流动党员 + */ + private String isLd; + + /** + * 流动党员活动证号 + */ + private String ldzh; + + /** + * 职务 + */ + private String partyZw; + + /** + * 是否退休 + */ + private String isTx; + + /** + * 是否党员中心户 + */ + private String isDyzxh; + + /** + * 是否免学习0否,1是 + */ + private String isMxx; + + /** + * 文化程度【字典表】 + */ + private String culture; + + /** + * 志愿者类型,逗号隔开 + */ + private String volunteerCategory; + + /** + * 备注 + */ + private String remark; + + /** + * 预留字段1 + */ + private Integer totalScore; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberPayRecordDetailEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberPayRecordDetailEntity.java new file mode 100644 index 0000000000..62830675bd --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberPayRecordDetailEntity.java @@ -0,0 +1,55 @@ +package com.epmet.modules.partymember.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 党员缴费记录明细表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_member_pay_record_detail") +public class IcPartyMemberPayRecordDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 党员ID + */ + private String partyMemberId; + + /** + * 党员缴费记录表ID + */ + private String recordId; + + /** + * 缴费年度 + */ + private String year; + + /** + * 缴费月份 + */ + private String month; + + /** + * 缴费金额 + */ + private BigDecimal money; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberPayRecordEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberPayRecordEntity.java new file mode 100644 index 0000000000..714fba69f6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberPayRecordEntity.java @@ -0,0 +1,55 @@ +package com.epmet.modules.partymember.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 党员缴费记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_member_pay_record") +public class IcPartyMemberPayRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 党员ID + */ + private String partyMemberId; + + /** + * 缴费日期 + */ + private String payDate; + + /** + * 缴费金额 + */ + private BigDecimal money; + + /** + * 缴费开始时间 + */ + private String startDate; + + /** + * 缴费结束时间 + */ + private String endDate; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberPointEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberPointEntity.java new file mode 100644 index 0000000000..15890c9101 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberPointEntity.java @@ -0,0 +1,104 @@ +package com.epmet.modules.partymember.entity; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 党员量化积分表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_member_point") +public class IcPartyMemberPointEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id (customer.id) + */ + @ExcelIgnore + private String customerId; + + /** + * 党员ID + */ + @ExcelIgnore + private String partyMemberId; + + /** + * 年 + */ + @ExcelProperty(index = 1,value = "年份") + private String year; + + /** + * 季度 + */ + @ExcelProperty(index = 2,value = "季度") + private String quarter; + + /** + * 基础积分分值 + */ + @ExcelProperty(index = 3,value = "基础积分分值") + private Integer basePoint; + + /** + * 基础积分选项 英文逗号隔开 + */ + @ExcelIgnore + private String baseOptions; + + /** + * 民主评议积分分值 + */ + @ExcelProperty(index = 4,value = "民主评议积分分值") + private Integer reviewPoint; + + /** + * 民主评议积分选项 + */ + @ExcelIgnore + private String reviewOptions; + + /** + * 激励积分分值 + */ + @ExcelProperty(index = 5,value = "激励积分分值") + private Integer inspirePoint; + + /** + * 激励积分选项 + */ + @ExcelIgnore + private String inspireOptions; + + /** + * 警示扣分分值 + */ + @ExcelProperty(index = 6,value = "警示扣分分值") + private Integer warnPoint; + + /** + * 警示扣分选项 + */ + @ExcelIgnore + private String warnOptions; + + /** + * 总分 + */ + @ExcelProperty(index = 7,value = "总分") + private Integer totalScore; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberExcel.java new file mode 100644 index 0000000000..98b1ab122e --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberExcel.java @@ -0,0 +1,84 @@ +package com.epmet.modules.partymember.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.HeadStyle; +import com.alibaba.excel.enums.poi.FillPatternTypeEnum; +import lombok.Data; + +/** + * 数字平台党员信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) +@Data +public class IcPartyMemberExcel { + + @ColumnWidth(10) + @ExcelProperty(value = "序号",order = 1) + private Integer index; + + @ColumnWidth(20) + @ExcelProperty(value = "姓名",order = 2) + private String name; + + @ColumnWidth(20) + @ExcelProperty(value = "身份证号",order = 3) + private String idCard; + + @ColumnWidth(20) + @ExcelProperty(value = "手机号",order = 4) + private String mobile; + + @ColumnWidth(20) + @ExcelProperty(value = "入党时间",order = 5) + private String rdsj; + + @ColumnWidth(20) + @ExcelProperty(value = "所属党组织",order = 6) + private String sszb; + + @ColumnWidth(20) + @ExcelProperty(value = "流动党员",order = 7) + private String isLd; + + @ColumnWidth(20) + @ExcelProperty(value = "流动党员证号",order = 8) + private String ldzh; + + @ColumnWidth(20) + @ExcelProperty(value = "职务",order = 9) + private String partyZw; + + @ColumnWidth(20) + @ExcelProperty(value = "地址",order = 10) + private String address; + + @ColumnWidth(20) + @ExcelProperty(value = "是否缴费",order = 11) + private String isPay; + + @ColumnWidth(20) + @ExcelProperty(value = "最近一次缴纳党费时间",order = 12) + private String payDate; + + @ColumnWidth(20) + @ExcelProperty(value = "文化程度",order = 13) + private String culture; + + @ColumnWidth(20) + @ExcelProperty(value = "量化积分",order = 14) + private String point; + + @ColumnWidth(20) + @ExcelProperty(value = "志愿者类别",order = 15) + private String volunteerCategory; + + @ColumnWidth(20) + @ExcelProperty(value = "备注",order = 16) + private String remark; + + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberImportExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberImportExcel.java new file mode 100644 index 0000000000..ac937ae045 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberImportExcel.java @@ -0,0 +1,81 @@ +package com.epmet.modules.partymember.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; + +/** + * 核酸检测信息导入excel数据 + * @author Administrator + */ +@Data +public class IcPartyMemberImportExcel { + + @NotBlank(message = "所属党组织为必填项") + @ExcelProperty("所属党组织") + private String sszb; + + @NotBlank(message = "姓名为必填项") + @ExcelProperty("姓名") + private String name; + + @NotBlank(message = "手机号为必填项") + @ExcelProperty("手机号") + @Length(max = 15, message = "手机号长度不正确,应小于15位") + private String mobile; + + @NotBlank(message = "身份证号为必填项") + @ExcelProperty("身份证号") + @Length(max = 18, message = "身份证号长度不正确,应小于18位") + private String idCard; + + @ExcelProperty("地址") + private String address; + + @ExcelProperty("入党时间") + private String rdsj; + + @ExcelProperty("流动党员") + private String isLd; + + @ExcelProperty("流动党员证号") + private String ldzh; + + @ExcelProperty("党员中心户") + private String isDyzxh; + + @ExcelProperty("免学习") + private String isMxx; + + @ExcelProperty("职务") + private String partyZw; + + @ExcelProperty("文化程度") + private String culture; + + @ExcelProperty("备注") + private String remark; + + @Data + public static class RowRemarkMessage { + + @ExcelProperty("姓名") + @ColumnWidth(20) + private String name; + + @ExcelProperty("手机号") + @ColumnWidth(20) + private String mobile; + + @ColumnWidth(20) + @ExcelProperty("身份证号") + private String idCard; + + @ColumnWidth(60) + @ExcelProperty("错误信息") + private String errorInfo; + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPayRecordDetailExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPayRecordDetailExcel.java new file mode 100644 index 0000000000..f4ae8dc8c5 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPayRecordDetailExcel.java @@ -0,0 +1,84 @@ +package com.epmet.modules.partymember.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 党员缴费记录明细表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyMemberPayRecordDetailExcel { + + @ColumnWidth(10) + @ExcelProperty(value = "序号",order = 1) + private Integer index; + + @ColumnWidth(20) + @ExcelProperty(value = "所属党组织",order = 2) + private String orgName; + + @ColumnWidth(20) + @ExcelProperty(value = "姓名",order = 3) + private String name; + + @ColumnWidth(20) + @ExcelProperty(value = "身份证号",order = 4) + private String idCard; + + @ColumnWidth(20) + @ExcelProperty(value = "手机号",order = 5) + private String mobile; + + @ColumnWidth(20) + @ExcelProperty(value = "缴费次数",order = 6) + private String times; + + @ColumnWidth(20) + @ExcelProperty(value = "缴费金额",order = 7) + private BigDecimal money; + + @ColumnWidth(20) + @ExcelProperty(value = "备注",order = 8) + private String remark; + +// @Excel(name = "客户Id (customer.id)") +// private String customerId; +// +// @Excel(name = "党员ID") +// private String partyMemberId; +// +// @Excel(name = "党员缴费记录表ID") +// private String recordId; +// +// @Excel(name = "缴费年度") +// private String year; +// +// @Excel(name = "缴费季度") +// private String quarter; + +// @Excel(name = "删除标识:0.未删除 1.已删除") +// private Integer 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; + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPayRecordExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPayRecordExcel.java new file mode 100644 index 0000000000..134cd13384 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPayRecordExcel.java @@ -0,0 +1,58 @@ +package com.epmet.modules.partymember.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 党员缴费记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyMemberPayRecordExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id (customer.id)") + private String customerId; + + @Excel(name = "党员ID") + private String partyMemberId; + + @Excel(name = "缴费日期") + private String payDate; + + @Excel(name = "缴费金额") + private BigDecimal money; + + @Excel(name = "缴费开始时间") + private String startDate; + + @Excel(name = "缴费结束时间") + private String endDate; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer 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; + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPointExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPointExcel.java new file mode 100644 index 0000000000..f042565a97 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPointExcel.java @@ -0,0 +1,124 @@ +package com.epmet.modules.partymember.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import kotlin.ExperimentalUnsignedTypes; +import lombok.Data; + +import javax.validation.Valid; +import java.util.Date; + +/** + * 党员量化积分表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyMemberPointExcel { + + @ColumnWidth(10) + @ExcelProperty(value = "序号",order = 1) + private Integer index; + + @ExcelIgnore + private String id; + + @ExcelIgnore + private String customerId; + + @ColumnWidth(20) + @ExcelProperty(value = "党员ID",order = 2) + private String partyMemberId; + + /** + * 所属党组织 + */ + @ColumnWidth(20) + @ExcelProperty(value = "所属党组织",order = 3) + private String partyOrg; + + /** + * 姓名 + */ + @ColumnWidth(20) + @ExcelProperty(value = "姓名",order = 4) + private String name; + + /** + * 手机号 + */ + @ColumnWidth(20) + @ExcelProperty(value = "手机号",order = 5) + private String mobile; + + /** + * 身份证号 + */ + @ColumnWidth(20) + @ExcelProperty(value = "身份证号",order = 6) + private String idCard; + + @ColumnWidth(20) + @ExcelProperty(value = "年份",order = 7) + private String year; + + @ExcelIgnore + private String quarter; + + @ColumnWidth(20) + @ExcelProperty(value = "基础积分分值",order = 8) + private Integer basePoint; + + @ExcelIgnore + private String baseOptions; + + @ColumnWidth(20) + @ExcelProperty(value = "民主评议积分分值",order = 9) + private Integer reviewPoint; + + @ExcelIgnore + private String reviewOptions; + + @ColumnWidth(20) + @ExcelProperty(value = "激励积分分值",order = 10) + private Integer inspirePoint; + + @ExcelIgnore + private String inspireOptions; + + @ColumnWidth(20) + @ExcelProperty(value = "警示扣分分值",order = 11) + private Integer warnPoint; + + @ExcelIgnore + private String warnOptions; + + @ColumnWidth(20) + @ExcelProperty(value = "总分" ,order = 12) + private Integer totalScore; + + + + @ExcelIgnore + private Integer delFlag; + + @ExcelIgnore + private Integer revision; + + @ExcelIgnore + private String createdBy; + + @ExcelIgnore + private Date createdTime; + + @ExcelIgnore + private String updatedBy; + + @ExcelIgnore + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/handler/IcPartyMemberImportListener.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/handler/IcPartyMemberImportListener.java new file mode 100644 index 0000000000..108b42a8ab --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/handler/IcPartyMemberImportListener.java @@ -0,0 +1,130 @@ +package com.epmet.modules.partymember.excel.handler; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.modules.partymember.entity.IcPartyMemberEntity; +import com.epmet.modules.partymember.excel.IcPartyMemberImportExcel; +import com.epmet.modules.partymember.service.impl.IcPartyMemberServiceImpl; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 党员excel导入监听器 + * @author Administrator + */ +@Data +@Slf4j +public class IcPartyMemberImportListener implements ReadListener { + + /** + * 最大条数阈值 + */ + public static final int MAX_THRESHOLD = 200; + + private String currentUserId; + /** + * 当前组织ID + */ + private String currentAgencyId; + + private String currentAgencyPids; + + /** + * 数据 + */ + private List datas = new ArrayList<>(); + + /** + * 错误项列表 + */ + private List errorRows = new ArrayList<>(); + /** + * 其他被标记出来的列表列表 + */ + private List otherRows = new ArrayList<>(); + + private IcPartyMemberServiceImpl icPartyMemberService; + + public IcPartyMemberImportListener(String currentUserId, IcPartyMemberServiceImpl icPartyMemberService) { + this.currentUserId = currentUserId; + this.icPartyMemberService = icPartyMemberService; + } + + @Override + public void invoke(IcPartyMemberImportExcel data, AnalysisContext context) { + + try { + // 先校验数据 + ValidatorUtils.validateEntity(data); + if (StringUtils.isNotBlank(data.getSszb())) { + data.setSszb(data.getSszb().trim()); + } + if (StringUtils.isNotBlank(data.getName())) { + data.setName(data.getName().trim()); + } + if (StringUtils.isNotBlank(data.getMobile())) { + data.setMobile(data.getMobile().trim()); + } + if (StringUtils.isNotBlank(data.getIdCard())) { + data.setIdCard(data.getIdCard().trim()); + } + + IcPartyMemberEntity icPartyMemberEntity = ConvertUtils.sourceToTarget(data, IcPartyMemberEntity.class); + datas.add(icPartyMemberEntity); + + if (datas.size() == MAX_THRESHOLD) { + execPersist(); + } + } catch (Exception e) { + String errorMsg = null; + if (e instanceof ValidateException) { + errorMsg = ((ValidateException) e).getMsg(); + } else { + errorMsg = "未知错误"; + log.error("【党员信息导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + IcPartyMemberImportExcel.RowRemarkMessage errorRow = new IcPartyMemberImportExcel.RowRemarkMessage(); + errorRow.setName(data.getName()); + errorRow.setMobile(data.getMobile()); + errorRow.setIdCard(data.getIdCard()); + errorRow.setErrorInfo(errorMsg); + errorRows.add(errorRow); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 最后几条达不到阈值,这里必须再调用一次 + execPersist(); + } + + /** + * 执行持久化 + */ + private void execPersist() { + try { + if (datas != null && datas.size() > 0) { + icPartyMemberService.batchPersist(datas, this); + } + } finally { + datas.clear(); + } + } + + /** + * 获取错误行 + * @return + */ + public List getErrorRows() { + return errorRows; + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/IcPartyMemberPayRecordDetailRedis.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/IcPartyMemberPayRecordDetailRedis.java new file mode 100644 index 0000000000..fb7511bcf5 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/IcPartyMemberPayRecordDetailRedis.java @@ -0,0 +1,30 @@ +package com.epmet.modules.partymember.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 党员缴费记录明细表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Component +public class IcPartyMemberPayRecordDetailRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/IcPartyMemberPayRecordRedis.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/IcPartyMemberPayRecordRedis.java new file mode 100644 index 0000000000..46a4a5c1e3 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/IcPartyMemberPayRecordRedis.java @@ -0,0 +1,30 @@ +package com.epmet.modules.partymember.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 党员缴费记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Component +public class IcPartyMemberPayRecordRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/IcPartyMemberPointRedis.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/IcPartyMemberPointRedis.java new file mode 100644 index 0000000000..18f699d28f --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/IcPartyMemberPointRedis.java @@ -0,0 +1,30 @@ +package com.epmet.modules.partymember.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 党员量化积分表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Component +public class IcPartyMemberPointRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPayRecordDetailService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPayRecordDetailService.java new file mode 100644 index 0000000000..afd86a9c5a --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPayRecordDetailService.java @@ -0,0 +1,89 @@ +package com.epmet.modules.partymember.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.partymember.entity.IcPartyMemberPayRecordDetailEntity; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDetailDTO; +import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; +import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberPayRecordDetailFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; + +import java.util.List; +import java.util.Map; + +/** + * 党员缴费记录明细表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcPartyMemberPayRecordDetailService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 分页条件查询 + * @param params + * @return + */ + PageData getPhrasePage(Map params); + + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPartyMemberPayRecordDetailDTO + * @author generator + * @date 2022-05-17 + */ + IcPartyMemberPayRecordDetailDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcPartyMemberPayRecordDetailDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcPartyMemberPayRecordDetailDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPayRecordService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPayRecordService.java new file mode 100644 index 0000000000..b5ec5fa0f0 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPayRecordService.java @@ -0,0 +1,87 @@ +package com.epmet.modules.partymember.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.modules.partymember.entity.IcPartyMemberPayRecordEntity; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDTO; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDetailDTO; + +import java.util.List; +import java.util.Map; + +/** + * 党员缴费记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcPartyMemberPayRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 分页条件查询 + * @param params + * @return + */ + PageData getPhrasePage(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPartyMemberPayRecordDTO + * @author generator + * @date 2022-05-17 + */ + IcPartyMemberPayRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + Result save(IcPartyMemberPayRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + Result update(IcPartyMemberPayRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java new file mode 100644 index 0000000000..701ce482aa --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java @@ -0,0 +1,117 @@ +package com.epmet.modules.partymember.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; +import com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberExportFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointEchoFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointListFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointExportResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO; + + +import java.util.List; +import java.util.Map; + +/** + * 党员量化积分表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcPartyMemberPointService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPartyMemberPointDTO + * @author generator + * @date 2022-05-17 + */ + IcPartyMemberPointDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcPartyMemberPointDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcPartyMemberPointDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); + + /** + * 量化积分统计 + * + * @param form + * @return java.util.List + * @author LZN + * @date 2022/5/17 17:19 + */ + PageData getList(PartyMemberPointListFormDTO form, TokenDto tokenDto); + + /** + * 量化积分统计回显 + * + * @param form + * @return java.util.List + * @author LZN + * @date 2022/5/18 18:18 + */ + List getEchoPartyMemberPoint(PartyMemberPointEchoFormDTO form, String customerId); + + /** + * 量化积分统计导出 + * + * @param form + * @return com.epmet.commons.tools.page.PageData + * @author LZN + * @date 2022/5/24 14:26 + */ + PageData getExport(PartyMemberPointListFormDTO form, TokenDto tokenDto); +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java new file mode 100644 index 0000000000..0d84d90723 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java @@ -0,0 +1,140 @@ +package com.epmet.modules.partymember.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.IcPartyMemberFormDTO; +import com.epmet.dto.form.IcPartyMemberListFormDTO; +import com.epmet.dto.result.PartyMemberAgeResultDTO; +import com.epmet.dto.result.PartyMemberEducationResultDTO; +import com.epmet.modules.partymember.entity.IcPartyMemberEntity; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; +import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; + +import java.nio.file.Path; +import java.util.List; +import java.util.Map; + +/** + * 数字平台党员信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcPartyMemberService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(TokenDto tokenDto, IcPartyMemberFromDTO formDTO); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPartyMemberDTO + * @author generator + * @date 2022-05-17 + */ + IcPartyMemberDTO get(TokenDto tokenDto, String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + String save(IcPartyMemberDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcPartyMemberDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); + + /** + * 党员信息同步 + * + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/5/18 10:16 + */ + void icPartyMemberSync(IcPartyMemberDTO dto); + + /** + * @describe: 统计分析-党员学历统计 + * @author wangtong + * @date 2022/5/23 10:06 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + List partyMemberEducationStatistics(IcPartyMemberFormDTO formDTO); + + /** + * @describe: 统计分析-党员年龄列表 + * @author wangtong + * @date 2022/5/23 10:20 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + PageData getPartyMemberAgeList(IcPartyMemberListFormDTO formDTO); + + /** + * @describe: 统计分析-党员学历列表 + * @author wangtong + * @date 2022/5/23 10:19 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + PageData getPartyMemberEducationList(IcPartyMemberListFormDTO formDTO); + + /** + * @describe: 统计分析-党员年龄范围统计 + * @author wangtong + * @date 2022/5/23 10:19 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + List partyMemberAgeStatistics(IcPartyMemberFormDTO formDTO); + + + /** + * 执行Excel导入 + * @param filePath + */ + void execAsyncExcelImport(Path filePath, String importTaskId); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordDetailServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordDetailServiceImpl.java new file mode 100644 index 0000000000..fb1d15b57e --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordDetailServiceImpl.java @@ -0,0 +1,111 @@ +package com.epmet.modules.partymember.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.StrConstant; +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.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.modules.partymember.dao.IcPartyMemberPayRecordDetailDao; +import com.epmet.modules.partymember.entity.IcPartyMemberPayRecordDetailEntity; +import com.epmet.modules.partymember.entity.IcPartymemberStyleCategoryDictEntity; +import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity; +import com.epmet.modules.partymember.redis.IcPartyMemberPayRecordDetailRedis; +import com.epmet.modules.partymember.service.IcPartyMemberPayRecordDetailService; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDetailDTO; +import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; +import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberPayRecordDetailFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 党员缴费记录明细表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Service +public class IcPartyMemberPayRecordDetailServiceImpl extends BaseServiceImpl implements IcPartyMemberPayRecordDetailService { + + @Autowired + private IcPartyMemberPayRecordDetailRedis icPartyMemberPayRecordDetailRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPartyMemberPayRecordDetailDTO.class); + } + + /** + * 条件查询 + * @param params + * @return + */ + @Override + public PageData getPhrasePage(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListInfo(params); + return new PageData<>(list, page.getTotal()); + } + + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPartyMemberPayRecordDetailDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyMemberPayRecordDetailDTO get(String id) { + IcPartyMemberPayRecordDetailEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPartyMemberPayRecordDetailDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPartyMemberPayRecordDetailDTO dto) { + IcPartyMemberPayRecordDetailEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberPayRecordDetailEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPartyMemberPayRecordDetailDTO dto) { + IcPartyMemberPayRecordDetailEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberPayRecordDetailEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordServiceImpl.java new file mode 100644 index 0000000000..bbff39f124 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordServiceImpl.java @@ -0,0 +1,212 @@ +package com.epmet.modules.partymember.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.modules.partymember.dao.IcPartyMemberPayRecordDao; +import com.epmet.modules.partymember.dao.IcPartyMemberPayRecordDetailDao; +import com.epmet.modules.partymember.entity.IcPartyMemberPayRecordDetailEntity; +import com.epmet.modules.partymember.entity.IcPartyMemberPayRecordEntity; +import com.epmet.modules.partymember.redis.IcPartyMemberPayRecordRedis; +import com.epmet.modules.partymember.service.IcPartyMemberPayRecordDetailService; +import com.epmet.modules.partymember.service.IcPartyMemberPayRecordService; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDTO; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDetailDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * 党员缴费记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Service +public class IcPartyMemberPayRecordServiceImpl extends BaseServiceImpl implements IcPartyMemberPayRecordService { + + @Autowired + private IcPartyMemberPayRecordRedis icPartyMemberPayRecordRedis; + + @Autowired + private IcPartyMemberPayRecordDetailService icPartyMemberPayRecordDetailService; + + @Autowired + private IcPartyMemberPayRecordDetailDao icPartyMemberPayRecordDetailDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPartyMemberPayRecordDTO.class); + } + + /** + * 条件查询 + * @param params + * @return + */ + @Override + public PageData getPhrasePage(Map params) { + String partyMemberId = params.get("partyMemberId") == null ? "" : params.get("partyMemberId").toString(); + if(StringUtils.isBlank(partyMemberId)){ + throw new RenException("党员ID不能为空"); + } + IPage page = getPage(params); + List list = baseDao.selectListInfo(params); + return new PageData<>(list, page.getTotal()); + } + + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPartyMemberPayRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyMemberPayRecordDTO get(String id) { + IcPartyMemberPayRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPartyMemberPayRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(IcPartyMemberPayRecordDTO dto) { + // 根据起始时间转月份列表 + List monthList = getMonthList(dto.getStartDate(),dto.getEndDate()); + + // 校验是否有月份已缴费 + List payedList = icPartyMemberPayRecordDetailDao.getpayedList(monthList,dto.getPartyMemberId(),""); + if(payedList.size() > 0){ + return new Result().error("存在已缴费月份,请重新录入"); + } + + // 保存党员缴费记录表信息 + IcPartyMemberPayRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberPayRecordEntity.class); + insert(entity); + + // 保存党员缴费记录明细 + saveDetailInfo(monthList,entity); + + return new Result(); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result update(IcPartyMemberPayRecordDTO dto) { + // 根据起始时间转月份列表 + List monthList = getMonthList(dto.getStartDate(),dto.getEndDate()); + + // 校验本次修改是否有月份已缴费(除该主键下的月份) + List payedList = icPartyMemberPayRecordDetailDao.getpayedList(monthList,dto.getPartyMemberId(),dto.getId()); + if(payedList.size() > 0){ + return new Result().error("存在已缴费月份,请重新录入"); + } + + // 更新党员缴费记录表信息 + IcPartyMemberPayRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberPayRecordEntity.class); + updateById(entity); + + // 清空该记录表主键下的党员缴费记录明细 + icPartyMemberPayRecordDetailDao.deletePayDetailByRecordId(dto.getId()); + + // 保存党员缴费记录明细 + saveDetailInfo(monthList,entity); + + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + + // 删除党员缴费记录明细 + icPartyMemberPayRecordDetailDao.deletePayDetailByRecordId(ids[0]); + } + + /** + * 根据起始时间获取该时间段所包含的所有月份,返回list + * + * @param startTime + * @param endTime + * @return + */ + public List getMonthList(String startTime, String endTime){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + // 声明保存日期集合 + List list = new ArrayList(); + try { + // 转化成日期类型 + Date startDate = sdf.parse(startTime); + Date endDate = sdf.parse(endTime); + + //用Calendar 进行日期比较判断 + Calendar calendar = Calendar.getInstance(); + while (startDate.getTime()<=endDate.getTime()){ + // 把日期添加到集合 + list.add(sdf.format(startDate)); + // 设置日期 + calendar.setTime(startDate); + //把日期增加一天 + calendar.add(Calendar.MONTH, 1); + // 获取增加后的日期 + startDate=calendar.getTime(); + } + } catch (ParseException e) { + e.printStackTrace(); + } + return list; + + } + + public void saveDetailInfo(List monthList,IcPartyMemberPayRecordEntity entity){ + // 组装党员缴费记录明细实体 + BigDecimal money = entity.getMoney(); + // 求本次缴费的月份平均缴费金额 + BigDecimal moneyDivide = money.divide(new BigDecimal(monthList.size()),2,BigDecimal.ROUND_HALF_UP); + List detailList = new ArrayList(); + for(int i = 0 ; i < monthList.size() ; i++){ + IcPartyMemberPayRecordDetailEntity detailEntity = new IcPartyMemberPayRecordDetailEntity(); + detailEntity.setCustomerId(entity.getCustomerId()); + detailEntity.setRecordId(entity.getId()); + detailEntity.setMoney(moneyDivide); + detailEntity.setPartyMemberId(entity.getPartyMemberId()); + String year = monthList.get(i).substring(0,4); + String month = monthList.get(i).substring(5,7); + detailEntity.setYear(year); + detailEntity.setMonth(month); + detailList.add(detailEntity); + } + + // 保存党员缴费记录明细表信息 + icPartyMemberPayRecordDetailService.insertBatch(detailList); + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java new file mode 100644 index 0000000000..e17339ad22 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java @@ -0,0 +1,203 @@ +package com.epmet.modules.partymember.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; + +import com.epmet.modules.partymember.dao.IcPartyMemberPointDao; +import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; +import com.epmet.modules.partymember.redis.IcPartyMemberPointRedis; +import com.epmet.modules.partymember.service.IcPartyMemberPointService; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; +import com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberExportFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointEchoFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointListFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointExportResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import jdk.nashorn.internal.parser.Token; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.sql.Time; +import java.time.Year; +import java.util.Arrays; +import java.util.Calendar; +import java.util.List; +import java.util.Map; + +/** + * 党员量化积分表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Service +public class IcPartyMemberPointServiceImpl extends BaseServiceImpl implements IcPartyMemberPointService { + + @Autowired + private IcPartyMemberPointRedis icPartyMemberPointRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPartyMemberPointDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPartyMemberPointDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyMemberPointDTO get(String id) { + IcPartyMemberPointEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPartyMemberPointDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPartyMemberPointDTO dto) { + if (dto.getBasePoint() == null) { + dto.setBasePoint(NumConstant.ZERO); + } + if (dto.getReviewPoint() == null) { + dto.setReviewPoint(NumConstant.ZERO); + } + if (dto.getInspirePoint() == null) { + dto.setInspirePoint(NumConstant.ZERO); + } + dto.setTotalScore(dto.getBasePoint() + dto.getInspirePoint() + dto.getReviewPoint()); + if (dto.getWarnPoint() != null) { + if (dto.getWarnPoint() > 0) { + dto.setTotalScore(dto.getTotalScore() - dto.getWarnPoint()); + } else { + dto.setTotalScore(dto.getTotalScore() + dto.getWarnPoint()); + } + } else { + dto.setWarnPoint(NumConstant.ZERO); + } + IcPartyMemberPointEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberPointEntity.class); + if (dto.getYear().equals(Year.now().toString())) { + baseDao.updateMember(dto.getPartyMemberId(), dto.getTotalScore()); + } + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPartyMemberPointDTO dto) { + if (baseDao.getPoint(dto.getYear(), dto.getQuarter(), dto.getCustomerId(), dto.getPartyMemberId()) != NumConstant.ZERO) { + if (dto.getBasePoint() == null) { + dto.setBasePoint(NumConstant.ZERO); + } + if (dto.getReviewPoint() == null) { + dto.setReviewPoint(NumConstant.ZERO); + } + if (dto.getInspirePoint() == null) { + dto.setInspirePoint(NumConstant.ZERO); + } + dto.setTotalScore(dto.getBasePoint() + dto.getInspirePoint() + dto.getReviewPoint()); + if (dto.getWarnPoint() != null) { + if (dto.getWarnPoint() > 0) { + dto.setTotalScore(dto.getTotalScore() - dto.getWarnPoint()); + } else { + dto.setTotalScore(dto.getTotalScore() + dto.getWarnPoint()); + } + } else { + dto.setWarnPoint(NumConstant.ZERO); + } + IcPartyMemberPointEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberPointEntity.class); + if (dto.getYear().equals(Year.now().toString())) { + baseDao.updateMember(dto.getPartyMemberId(), dto.getTotalScore()); + } + updateById(entity); + } else { + save(dto); + } + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 量化积分统计 + * + * @param form + * @param tokenDto + * @return java.util.List + * @author LZN + * @date 2022/5/18 18:20 + */ + @Override + public PageData getList(PartyMemberPointListFormDTO form, TokenDto tokenDto) { + PageHelper.startPage(form.getPageNo(), form.getPageSize(), form.getIsPage()); + List dto = baseDao.getList(form.getIdCard(), form.getMobile(), form.getName(), + form.getOrgId(), form.getYear(), tokenDto.getCustomerId()); + PageInfo pageInfo = new PageInfo<>(dto); + return new PageData<>(dto, pageInfo.getTotal()); + } + + /** + * 量化积分统计回显 + * + * @param form + * @return java.util.List + * @author LZN + * @date 2022/5/18 18:20 + */ + @Override + public List getEchoPartyMemberPoint(PartyMemberPointEchoFormDTO form, String customerId) { + List dto = baseDao.getEchoPartyMemberPoint(form.getPartyMemberId(), form.getQuarter(), form.getYear(), customerId); + return dto; + } + + /** + * 量化积分统计导出 + * + * @param form + * @return com.epmet.commons.tools.page.PageData + * @author LZN + * @date 2022/5/24 14:26 + */ + @Override + public PageData getExport(PartyMemberPointListFormDTO form, TokenDto tokenDto) { + PageHelper.startPage(form.getPageNo(), form.getPageSize(), form.getIsPage()); + List dto = baseDao.getList(form.getIdCard(), form.getMobile(), form.getName(), + form.getOrgId(), form.getYear(), tokenDto.getCustomerId()); + PageInfo pageInfo = new PageInfo<>(dto); + return new PageData<>(dto, pageInfo.getTotal()); + } + + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java new file mode 100644 index 0000000000..122212ccfd --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java @@ -0,0 +1,676 @@ +package com.epmet.modules.partymember.service.impl; + +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.DictListFormDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.enums.IcFormCodeEnum; +import com.epmet.commons.tools.enums.PartyPostEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.*; +import com.epmet.constants.ImportTaskConstants; +import com.epmet.dto.form.IcFormOptionsQueryFormDTO; +import com.epmet.dto.form.IcPartyMemberFormDTO; +import com.epmet.dto.form.IcPartyMemberListFormDTO; +import com.epmet.dto.result.PartyMemberAgeResultDTO; +import com.epmet.dto.result.PartyMemberEducationResultDTO; +import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.feign.OssFeignClient; +import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; +import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; +import com.epmet.modules.partyOrg.service.IcPartyOrgService; +import com.epmet.modules.partymember.dao.IcPartyMemberDao; +import com.epmet.modules.partymember.dao.IcPartyMemberPayRecordDao; +import com.epmet.modules.partymember.dao.IcPartyMemberPointDao; +import com.epmet.modules.partymember.entity.IcPartyMemberEntity; +import com.epmet.modules.partymember.entity.IcPartyMemberPayRecordEntity; +import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; +import com.epmet.modules.partymember.excel.IcPartyMemberImportExcel; +import com.epmet.modules.partymember.excel.handler.IcPartyMemberImportListener; +import com.epmet.modules.partymember.service.IcPartyMemberService; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; +import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; +import com.epmet.utils.ImportTaskUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.entity.ContentType; +import org.apache.poi.util.IOUtils; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.commons.CommonsMultipartFile; + +import javax.annotation.Resource; +import java.io.IOException; +import java.io.OutputStream; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 数字平台党员信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Slf4j +@Service +public class IcPartyMemberServiceImpl extends BaseServiceImpl implements IcPartyMemberService, ResultDataResolver { + + @Resource + private IcPartyOrgService icPartyOrgService; + @Resource + private IcPartyOrgDao icPartyOrgDao; + @Resource + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Resource + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + @Resource + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Resource + private IcPartyMemberPayRecordDao icPartyMemberPayRecordDao; + @Resource + private IcPartyMemberPointDao icPartyMemberPointDao; + @Resource + private OssFeignClient ossFeignClient; + + @Override + public PageData page(TokenDto tokenDto, IcPartyMemberFromDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + if (StringUtils.isBlank(formDTO.getPartyOrgId())) { + //获取工作人员所属组织同级的党组织 + LambdaQueryWrapper orgWrapper = new LambdaQueryWrapper<>(); + orgWrapper.eq(IcPartyOrgEntity::getCustomerId, tokenDto.getCustomerId()); + orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId()); + orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR); + IcPartyOrgEntity org = icPartyOrgDao.selectOne(orgWrapper); + if (null == org) { + return new PageData<>(Collections.emptyList(), 0); + } + formDTO.setPartyOrgId(org.getId()); + } + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setYear(DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY)); + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectList(formDTO); + + PageInfo pageInfo = new PageInfo<>(list); + //获取文化程度字典 + Result> education = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); + if (!education.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取文化程度信息失败", "获取文化程度信息失败"); + } + if (CollectionUtils.isNotEmpty(list)) { + //获取志愿者类别 + IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); + optionsForm.setCustomerId(tokenDto.getCustomerId()); + optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); + optionsForm.setColumnName("VOLUNTEER_CATEGORY"); + Result> volunteerMap = operCustomizeOpenFeignClient.getOptionsMap(optionsForm); + //构造数据 + list.forEach(item -> { + item.setIsLd(NumConstant.ONE_STR.equals(item.getIsLd()) ? "是" : "否"); + item.setIsPay(NumConstant.ONE_STR.equals(item.getIsPay()) ? "是" : "否"); + item.setPartyZw(PartyPostEnum.getName(item.getPartyZw())); + item.setCulture(education.getData().get(item.getCulture())); + item.setPoint(("0.00").equals(item.getPoint()) ? StrConstant.HYPHEN : item.getPoint()); + if (StringUtils.isNotBlank(item.getVolunteerCategory())) { + List category = Arrays.asList(item.getVolunteerCategory().split(StrConstant.COMMA)); + List categoryNames = category.stream().map(volunteerMap.getData()::get).collect(Collectors.toList()); + item.setVolunteerCategory(String.join(String.valueOf((char) 10), categoryNames)); + } + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPartyMemberDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyMemberDTO get(TokenDto tokenDto, String id) { + + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + //获取工作人员所属组织同级的党组织 + LambdaQueryWrapper orgWrapper = new LambdaQueryWrapper<>(); + orgWrapper.eq(IcPartyOrgEntity::getCustomerId, tokenDto.getCustomerId()); + orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId()); + orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR); + IcPartyOrgEntity orgInfo = icPartyOrgDao.selectOne(orgWrapper); + if (null == orgInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "党组织不存在", "党组织不存在"); + } + + IcPartyMemberEntity entity = baseDao.selectById(id); + if (null == entity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "党员不存在", "党员不存在"); + } + IcPartyMemberDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyMemberDTO.class); + //党组织名 + if (StringUtils.isNotBlank(dto.getSszb())) { + IcPartyOrgEntity org = icPartyOrgService.selectById(dto.getSszb()); + if (null == org) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取党组织信息失败", "获取党组织信息失败"); + } + dto.setOrgName(org.getPartyOrgName()); + + if (NumConstant.ZERO_STR.equals(dto.getOrgPids())) { + dto.setOrgPids(dto.getSszb()); + } else { + dto.setOrgPids(dto.getOrgPids().concat(StrConstant.COLON).concat(dto.getSszb())); + } + int index = dto.getOrgPids().lastIndexOf(orgInfo.getId()); + dto.setOrgPids(dto.getOrgPids().substring(index)); + } + //职务 + if (StringUtils.isNotBlank(dto.getPartyZw())) { + dto.setPostName(PartyPostEnum.getName(dto.getPartyZw())); + } + //文化程度 + if (StringUtils.isNotBlank(dto.getCulture())) { + Result> education = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); + if (!education.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取文化程度信息失败", "获取文化程度信息失败"); + } + dto.setCultureName(education.getData().get(dto.getCulture())); + } + //志愿者类别 + if (StringUtils.isNotBlank(dto.getVolunteerCategory())) { + IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); + optionsForm.setCustomerId(dto.getCustomerId()); + optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); + optionsForm.setColumnName("VOLUNTEER_CATEGORY"); + Result> volunteerMap = operCustomizeOpenFeignClient.getOptionsMap(optionsForm); + List category = Arrays.asList(dto.getVolunteerCategory().split(StrConstant.COMMA)); + dto.setVolunteerCategoryName(category.stream().map(volunteerMap.getData()::get).collect(Collectors.toList())); + } + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String save(IcPartyMemberDTO dto) { + //获取党组织信息 + IcPartyOrgEntity org = icPartyOrgService.selectById(dto.getSszb()); + if (null == org) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "党组织不存在", "党组织不存在"); + } + if (!NumConstant.FIVE_STR.equals(org.getPartyOrgType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所选党组织不是支部", "所选党组织不是支部"); + } + dto.setCustomerId(org.getCustomerId()); + dto.setAgencyId(org.getAgencyId()); + dto.setAgencyPids(org.getAgencyPids()); + dto.setOrgPids(org.getOrgPids()); + + //判断党员是否已存在 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyMemberEntity::getCustomerId, org.getCustomerId()); + wrapper.eq(IcPartyMemberEntity::getIdCard, dto.getIdCard()); + IcPartyMemberEntity partyMember = baseDao.selectOne(wrapper); + if (null != partyMember) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "党员已存在", "党员已存在"); + } + + //同步ic_resi_user表对应的数据,并获取志愿者类型 + Result result = epmetUserOpenFeignClient.icPartyMemberSync(dto); + if (!result.success()) { + throw new EpmetException(result.getCode(), result.getMsg(), result.getMsg()); + } + if (null != result.getData()) { + dto.setIcResiUser(result.getData().getIcResiUser()); + dto.setVolunteerCategory(result.getData().getVolunteerCategory()); + } + IcPartyMemberEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberEntity.class); + + insert(entity); + + return entity.getId(); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPartyMemberDTO dto) { + //获取党组织信息 + IcPartyOrgEntity org = icPartyOrgService.selectById(dto.getSszb()); + if (null == org) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "党组织不存在", "党组织不存在"); + } + if (!NumConstant.FIVE_STR.equals(org.getPartyOrgType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所选党组织不是支部", "所选党组织不是支部"); + } + dto.setAgencyId(org.getAgencyId()); + dto.setAgencyPids(org.getAgencyPids()); + dto.setOrgPids(org.getOrgPids()); + + //判断党员是否已存在 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyMemberEntity::getCustomerId, org.getCustomerId()); + wrapper.eq(IcPartyMemberEntity::getIdCard, dto.getIdCard()); + IcPartyMemberEntity partyMember = baseDao.selectOne(wrapper); + if (null != partyMember && !partyMember.getId().equals(dto.getId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "党员已存在", "党员已存在"); + } + + //同步ic_resi_user表对应的数据,并获取志愿者类型 + Result result = epmetUserOpenFeignClient.icPartyMemberSync(dto); + if (!result.success()) { + throw new EpmetException(result.getCode(), result.getMsg(), result.getMsg()); + } + + if (null != result.getData()) { + dto.setIcResiUser(result.getData().getIcResiUser()); + dto.setVolunteerCategory(result.getData().getVolunteerCategory()); + } + + IcPartyMemberEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + List idList = Arrays.asList(ids); + baseDao.deleteBatchIds(idList); + + LambdaUpdateWrapper payWrapper = new LambdaUpdateWrapper<>(); + payWrapper.in(IcPartyMemberPayRecordEntity::getPartyMemberId, idList); + icPartyMemberPayRecordDao.delete(payWrapper); + + LambdaUpdateWrapper pointWrapper = new LambdaUpdateWrapper<>(); + pointWrapper.in(IcPartyMemberPointEntity::getPartyMemberId, idList); + icPartyMemberPointDao.delete(pointWrapper); + } + + /** + * 党员信息同步 + * + * @param dto + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/5/18 10:16 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void icPartyMemberSync(IcPartyMemberDTO dto) { + //查询党员信息 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyMemberEntity::getCustomerId, dto.getCustomerId()); + wrapper.eq(IcPartyMemberEntity::getIdCard, dto.getIdCard()); + IcPartyMemberEntity partyMember = baseDao.selectOne(wrapper); + + //查询党组织信息 + if (StringUtils.isNotBlank(dto.getSszb())) { + List orgIdList = Arrays.asList(dto.getSszb().split(StrConstant.COMMA)); + String sszb = orgIdList.get(orgIdList.size() - 1); + dto.setSszb(sszb); + //获取党组织信息 + IcPartyOrgEntity org = icPartyOrgService.selectById(sszb); + dto.setAgencyId(org.getAgencyId()); + dto.setAgencyPids(org.getAgencyPids()); + dto.setOrgPids(org.getOrgPids()); + } + IcPartyMemberEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberEntity.class); + + //判断党员是否已存在,有则更新,没有则添加 + if (null != partyMember) { + entity.setId(partyMember.getId()); + baseDao.updateById(entity); + } else { + baseDao.insert(entity); + } + } + + @Override + public List partyMemberEducationStatistics(IcPartyMemberFormDTO formDTO) { + //获取文化程度字典 + DictListFormDTO dictFormDTO = new DictListFormDTO(); + dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode()); + Result> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO); + Map map = new HashMap<>(); + //统计组织下文化程度党员人数 + List list = baseDao.getPartyMemberEducationStatistics(formDTO.getAgencyId(),formDTO.getOrgId()); + int total = 0; + if (CollectionUtils.isNotEmpty(list)) { + map = list.stream().collect(Collectors.toMap(OptionDataResultDTO::getCode, OptionDataResultDTO::getValue)); + total = list.stream().mapToInt(item -> Integer.parseInt(item.getValue())).sum(); + } + Map finalMap = map; + int finalTotal = total; + return dictResult.getData().stream().map(item -> { + OptionDataResultDTO dto = new OptionDataResultDTO(); + dto.setCode(item.getValue()); + dto.setLabel(item.getLabel()); + dto.setValue(null == finalMap.get(item.getValue()) ? NumConstant.ZERO_STR : finalMap.get(item.getValue())); + BigDecimal radio = new BigDecimal("0.00"); + if (NumConstant.ZERO != finalTotal) { + BigDecimal sum = new BigDecimal(finalTotal); + BigDecimal count = new BigDecimal(dto.getValue()); + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + radio = count.multiply(hundred).divide(sum, NumConstant.TWO, RoundingMode.HALF_UP); + } + dto.setRadio(radio.stripTrailingZeros().toPlainString().concat("%")); + return dto; + }).collect(Collectors.toList()); + } + + @Override + public PageData getPartyMemberAgeList(IcPartyMemberListFormDTO formDTO) { + if (formDTO.getIsPage()) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getPartyMemberAgeList(formDTO.getAgencyId(),formDTO.getOrgId(), formDTO.getCode()); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + List list = baseDao.getPartyMemberAgeList(formDTO.getAgencyId(),formDTO.getOrgId(), formDTO.getCode()); + return new PageData<>(list, null == list?NumConstant.ZERO:list.size()); + } + + @Override + public PageData getPartyMemberEducationList(IcPartyMemberListFormDTO formDTO) { + if (formDTO.getIsPage()) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getPartyMemberEducationList(formDTO.getAgencyId(),formDTO.getOrgId(), formDTO.getCode()); + Result> mapResult = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation())); + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } + List list = baseDao.getPartyMemberEducationList(formDTO.getAgencyId(),formDTO.getOrgId(), formDTO.getCode()); + Result> mapResult = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation())); + }); + } + return new PageData<>(list, null == list?NumConstant.ZERO:list.size()); + + } + + @Override + public List partyMemberAgeStatistics(IcPartyMemberFormDTO formDTO) { + //获取年龄范围字典 + DictListFormDTO dictFormDTO = new DictListFormDTO(); + dictFormDTO.setDictType(DictTypeEnum.AGE_GROUP.getCode()); + Result> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO); + Map map = new HashMap<>(); + int total = 0; + //统计组织下各年龄范围人数 + List list = baseDao.getPartyMemberAgeStatistics(formDTO.getAgencyId(),formDTO.getOrgId()); + if (CollectionUtils.isNotEmpty(list)) { + map = list.stream().collect(Collectors.toMap(OptionDataResultDTO::getCode, OptionDataResultDTO::getValue)); + total = list.stream().mapToInt(item -> Integer.parseInt(item.getValue())).sum(); + } + Map finalMap = map; + int finalTotal = total; + return dictResult.getData().stream().map(item -> { + OptionDataResultDTO dto = new OptionDataResultDTO(); + dto.setCode(item.getValue()); + dto.setLabel(item.getLabel()); + dto.setValue(null == finalMap.get(item.getValue()) ? NumConstant.ZERO_STR : finalMap.get(item.getValue())); + BigDecimal radio = new BigDecimal("0.00"); + if (NumConstant.ZERO != finalTotal) { + BigDecimal sum = new BigDecimal(finalTotal); + BigDecimal count = new BigDecimal(dto.getValue()); + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + radio = count.multiply(hundred).divide(sum, NumConstant.TWO, RoundingMode.HALF_UP); + } + dto.setRadio(radio.stripTrailingZeros().toPlainString().concat("%")); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 执行Excel导入 + * + * @param filePath + * @param importTaskId + */ + @Async + @Override + public void execAsyncExcelImport(Path filePath, String importTaskId) { + String userId = null; + + try { + userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); + String app = EpmetRequestHolder.getHeader(AppClientConstant.APP); + String client = EpmetRequestHolder.getHeader(AppClientConstant.CLIENT); + + log.info("【党员信息导入】userId:{}, app:{}, client:{}", userId, app, client); + + + IcPartyMemberImportListener listener = new IcPartyMemberImportListener(userId, this); + + EasyExcel.read(filePath.toFile(), IcPartyMemberImportExcel.class, listener).headRowNumber(2).sheet(0).doRead(); + + String errorDesFileUrl = null; + + List errorRows = listener.getErrorRows(); + List otherRows = listener.getOtherRows(); + + boolean failed = errorRows.size() > 0; + + // 合并到一起写入 + errorRows.addAll(otherRows); + + // 生成并上传描述文件 + OutputStream os = null; + FileItem fileItem = null; + if (errorRows.size() > 0) { + try { + // 文件生成 + Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_nat", "import", "error_des"); + String timeMillis = String.valueOf(System.currentTimeMillis()); + String fileName = "icnat_import_error_".concat(timeMillis).concat(".xlsx"); + + fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, errorDescDir.toFile()) + .createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName); + + os = fileItem.getOutputStream(); + + EasyExcel.write(os, IcPartyMemberImportExcel.RowRemarkMessage.class).sheet("信息列表").doWrite(errorRows); + // 文件上传oss + Result errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + if (errorDesFileUploadResult.success()) { + errorDesFileUrl = errorDesFileUploadResult.getData().getUrl(); + } + } finally { + IOUtils.closeQuietly(os); + try { + fileItem.delete(); + } catch (Exception e){ + log.error("【党员信息导入】删除临时描述文件失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + // 完成导入 + Result result = ImportTaskUtils.finishImportTask(importTaskId, + failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS, + errorDesFileUrl, + ""); + + if (!result.success()) { + log.error("【党员信息导入】导入记录状态修改为'finished_success'失败"); + } + } catch (Exception e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【党员信息导入】出错:{}", errorMsg); + + Result result = ImportTaskUtils.finishImportTask(importTaskId, ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, null, "导入失败"); + + if (!result.success()) { + log.error("【党员信息导入】导入记录状态修改为'finished_fail'失败"); + } + } finally { + // 删除临时文件 + if (Files.exists(filePath)) { + try { + Files.delete(filePath); + } catch (IOException e) { + log.error("method exception", e); + } + } + } + } + + /** + * 批量持久化 + * @param entities + */ + public void batchPersist(List entities, IcPartyMemberImportListener listener) { + String customerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID); + String currentUserId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); + + entities.forEach(e -> { + try { + persistPartyMember(e, customerId, currentUserId, listener); + } catch (Exception exception) { + String errorMsg = ExceptionUtils.getErrorStackTrace(exception); + log.error(errorMsg); + + IcPartyMemberImportExcel.RowRemarkMessage errorRow = new IcPartyMemberImportExcel.RowRemarkMessage(); + errorRow.setName(e.getName()); + errorRow.setMobile(e.getMobile()); + errorRow.setIdCard(e.getIdCard()); + errorRow.setErrorInfo("未知系统错误"); + listener.getErrorRows().add(errorRow); + } + }); + } + + /** + * 单条持久化 + * @Param e + * @Param customerId + * @Param currentUserId + * @Param listener + * @Return + * @Author zhaoqifeng + * @Date 2022/5/23 15:24 + */ + @Transactional(rollbackFor = Exception.class) + public void persistPartyMember(IcPartyMemberEntity e, String customerId, String currentUserId, IcPartyMemberImportListener listener) { + List otherRows = listener.getOtherRows(); + String idCard = e.getIdCard(); + String name = e.getName(); + String mobile = e.getMobile(); + + //获取党组织信息 + LambdaUpdateWrapper orgWrapper = new LambdaUpdateWrapper<>(); + orgWrapper.eq(IcPartyOrgEntity::getCustomerId, customerId); + orgWrapper.eq(IcPartyOrgEntity::getPartyOrgName, e.getSszb()); + IcPartyOrgEntity org = icPartyOrgDao.selectOne(orgWrapper); + if (null == org) { + String message = "所属党组织不存在"; + IcPartyMemberImportExcel.RowRemarkMessage errorRow = new IcPartyMemberImportExcel.RowRemarkMessage(); + errorRow.setName(name); + errorRow.setMobile(mobile); + errorRow.setIdCard(idCard); + errorRow.setErrorInfo(message); + otherRows.add(errorRow); + return; + } + + //判断党员是否已存在 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyMemberEntity::getCustomerId, customerId); + wrapper.eq(IcPartyMemberEntity::getIdCard, e.getIdCard()); + IcPartyMemberEntity partyMember = baseDao.selectOne(wrapper); + if (null != partyMember) { + String message = "党员已存在"; + IcPartyMemberImportExcel.RowRemarkMessage errorRow = new IcPartyMemberImportExcel.RowRemarkMessage(); + errorRow.setName(name); + errorRow.setMobile(mobile); + errorRow.setIdCard(idCard); + errorRow.setErrorInfo(message); + otherRows.add(errorRow); + return; + } + e.setCustomerId(customerId); + e.setAgencyId(org.getAgencyId()); + e.setAgencyPids(org.getAgencyPids()); + e.setSszb(org.getId()); + e.setOrgPids(org.getOrgPids()); + + e.setIsLd(("是").equals(e.getIsLd())?NumConstant.ONE_STR:NumConstant.ZERO_STR); + e.setIsDyzxh(("是").equals(e.getIsDyzxh())?NumConstant.ONE_STR:NumConstant.ZERO_STR); + e.setIsMxx(("是").equals(e.getIsMxx())?NumConstant.ONE_STR:NumConstant.ZERO_STR); + //职务 + e.setPartyZw(PartyPostEnum.getCode(e.getPartyZw())); + //文化程度 + //获取文化程度字典 + DictListFormDTO dictFormDTO = new DictListFormDTO(); + dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode()); + Result> education = epmetAdminOpenFeignClient.dictList(dictFormDTO); + if (CollectionUtils.isNotEmpty(education.getData())) { + Map map = education.getData().stream().collect(Collectors.toMap(DictListResultDTO::getLabel, DictListResultDTO::getValue)); + e.setCulture(map.get(e.getCulture())); + } + + //同步ic_resi_user表对应的数据,并获取志愿者类型 + Result result = epmetUserOpenFeignClient.icPartyMemberSync(ConvertUtils.sourceToTarget(e, IcPartyMemberDTO.class)); + if (!result.success() && null != result.getData()) { + e.setIcResiUser(result.getData().getIcResiUser()); + e.setVolunteerCategory(result.getData().getVolunteerCategory()); + } + e.setCreatedBy(currentUserId); + e.setUpdatedBy(currentUserId); + baseDao.insert(e); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.4__party_member_manage.sql b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.4__party_member_manage.sql new file mode 100644 index 0000000000..cff80410de --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.4__party_member_manage.sql @@ -0,0 +1,132 @@ +CREATE TABLE `ic_party_member` +( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', + `ORG_PIDS` varchar(255) DEFAULT NULL COMMENT '党组织的所有上级ID,没有上级时为0', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '行政组织 机关ID', + `AGENCY_PIDS` varchar(255) NOT NULL COMMENT '行政组织 机关ID', + `IC_RESI_USER` varchar(64) DEFAULT NULL COMMENT '对应的ic_resi_user主表Id', + `NAME` varchar(64) NOT NULL COMMENT '姓名', + `MOBILE` varchar(15) DEFAULT NULL COMMENT '手机号', + `ID_CARD` varchar(18) NOT NULL COMMENT '身份证号', + `ADDRESS` varchar(255) DEFAULT NULL COMMENT '地址', + `RDSJ` varchar(64) DEFAULT NULL COMMENT '入党时间', + `SSZB` varchar(256) DEFAULT NULL COMMENT '所属支部', + `IS_LD` char(2) DEFAULT NULL COMMENT '是否流动党员', + `LDZH` varchar(64) DEFAULT NULL COMMENT '流动党员活动证号', + `PARTY_ZW` varchar(256) DEFAULT NULL COMMENT '职务', + `IS_TX` char(2) DEFAULT NULL COMMENT '是否退休', + `IS_DYZXH` char(2) DEFAULT NULL COMMENT '是否党员中心户', + `IS_MXX` char(2) DEFAULT NULL COMMENT '是否免学习0否,1是', + `CULTURE` varchar(20) DEFAULT NULL COMMENT '文化程度【字典表】', + `VOLUNTEER_CATEGORY` varchar(255) DEFAULT NULL COMMENT '志愿者类型,逗号隔开', + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注', + `FIELD1` varchar(256) DEFAULT NULL COMMENT '预留字段1', + `FIELD2` varchar(256) DEFAULT NULL COMMENT '预留字段2', + `FIELD3` varchar(256) DEFAULT NULL COMMENT '预留字段3', + `FIELD4` varchar(256) DEFAULT NULL COMMENT '预留字段4', + `FIELD5` varchar(256) DEFAULT NULL COMMENT '预留字段5', + `DEL_FLAG` int(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + UNIQUE KEY `un_party_mem` (`IC_RESI_USER`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + ROW_FORMAT = COMPACT COMMENT ='数字平台党员信息表'; + +CREATE TABLE `ic_party_member_pay_record` +( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id (customer.id)', + `PARTY_MEMBER_ID` varchar(64) NOT NULL COMMENT '党员ID', + `PAY_DATE` varchar(18) NOT NULL COMMENT '缴费日期', + `MONEY` decimal(8, 2) NOT NULL COMMENT '缴费金额', + `START_DATE` varchar(18) NOT NULL COMMENT '缴费开始时间', + `END_DATE` varchar(18) NOT NULL COMMENT '缴费结束时间', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + ROW_FORMAT = COMPACT COMMENT ='党员缴费记录表'; + +CREATE TABLE `ic_party_member_pay_record_detail` +( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id (customer.id)', + `PARTY_MEMBER_ID` varchar(64) NOT NULL COMMENT '党员ID', + `RECORD_ID` varchar(64) NOT NULL COMMENT '党员缴费记录表ID', + `YEAR` varchar(18) NOT NULL COMMENT '缴费年度', + `MONTH` varchar(18) NOT NULL COMMENT '缴费月份', + `MONEY` decimal(8, 2) NOT NULL COMMENT '缴费金额', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + ROW_FORMAT = COMPACT COMMENT ='党员缴费记录明细表'; + +CREATE TABLE `ic_party_member_point` +( + `ID` varchar(64) NOT NULL DEFAULT '0' COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id (customer.id)', + `PARTY_MEMBER_ID` varchar(64) NOT NULL COMMENT '党员ID', + `YEAR` varchar(8) NOT NULL COMMENT '年', + `QUARTER` varchar(8) NOT NULL COMMENT '季度', + `BASE_POINT` int(11) DEFAULT '0' COMMENT '基础积分分值', + `BASE_OPTIONS` varchar(20) DEFAULT NULL COMMENT '基础积分选项 英文逗号隔开', + `REVIEW_POINT` int(11) DEFAULT '0' COMMENT '民主评议积分分值', + `REVIEW_OPTIONS` varchar(20) DEFAULT NULL COMMENT '民主评议积分选项', + `INSPIRE_POINT` int(11) unsigned DEFAULT '0' COMMENT '激励积分分值', + `INSPIRE_OPTIONS` varchar(20) DEFAULT NULL COMMENT '激励积分选项', + `WARN_POINT` int(11) DEFAULT '0' COMMENT '警示扣分分值', + `WARN_OPTIONS` varchar(20) DEFAULT NULL COMMENT '警示扣分选项', + `TOTAL_SCORE` int(32) DEFAULT '0' COMMENT '总分', + `DEL_FLAG` int(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + ROW_FORMAT = COMPACT COMMENT ='党员量化积分表'; + +CREATE TABLE `ic_party_org` +( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id (customer.id)', + `ORG_PID` varchar(64) NOT NULL COMMENT '党组织的上级ID,没有上级时为0', + `ORG_PIDS` varchar(512) NOT NULL COMMENT '党组织的所有上级ID,没有上级时为0', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '行政组织 机关ID', + `AGENCY_PIDS` varchar(512) NOT NULL COMMENT '行政组织 机关ID', + `PARTY_ORG_TYPE` char(1) NOT NULL COMMENT '党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部', + `PARTY_ORG_NAME` varchar(20) NOT NULL COMMENT '组织名称', + `PARTY_ORG_CODE` varchar(128) DEFAULT NULL COMMENT '组织编码', + `LONGITUDE` varchar(32) NOT NULL COMMENT '经度', + `LATITUDE` varchar(32) NOT NULL COMMENT '纬度', + `ADDRESS` varchar(255) DEFAULT NULL COMMENT '地址', + `INTRODUCTION` varchar(500) DEFAULT NULL COMMENT '党组织介绍', + `DEL_FLAG` int(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + ROW_FORMAT = COMPACT COMMENT ='党组织表'; \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.5__add_total_score.sql b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.5__add_total_score.sql new file mode 100644 index 0000000000..5fe8a448dc --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.5__add_total_score.sql @@ -0,0 +1,2 @@ +ALTER TABLE `epmet_resi_partymember`.`ic_party_member` +CHANGE COLUMN `FIELD1` `TOTAL_SCORE` int(64) NULL DEFAULT NULL COMMENT '总分' AFTER `REMARK`; \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/excel/ic_party_member.xlsx b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/excel/ic_party_member.xlsx new file mode 100644 index 0000000000..d663ad01c5 Binary files /dev/null and b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/excel/ic_party_member.xlsx differ diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml new file mode 100644 index 0000000000..34f4cc1a79 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml new file mode 100644 index 0000000000..d71cdbd883 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml @@ -0,0 +1,269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDao.xml new file mode 100644 index 0000000000..7863205208 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDao.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml new file mode 100644 index 0000000000..aaf0abe2c1 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + update ic_party_member_pay_record_detail set DEL_FLAG = 1 + where RECORD_ID = #{recordId} + + + + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml new file mode 100644 index 0000000000..60fa191f70 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml @@ -0,0 +1,171 @@ + + + + + + UPDATE ic_party_member + SET TOTAL_SCORE = #{totalScore} + WHERE + id = #{partyMemberId} + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserConfirmDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserConfirmDTO.java new file mode 100644 index 0000000000..39ee709284 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserConfirmDTO.java @@ -0,0 +1,190 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class IcResiUserConfirmDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 户籍所在地地区码 + */ + private String hjszdCode; + + /** + * 户籍所在地层级编码 + */ + private String hjszdPathCode; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 现居住地地区码 + */ + private String xjzdCode; + + /** + * 现居住地层级编码 + */ + private String xjzdPathCode; + + /** + * 详细地址 + */ + private String xxdz; + + /** + * 民族【字典表】 + */ + private String mz; + + /** + * 名族名称 + */ + private String mzName; + + /** + * 与户主关系 + */ + private String yhzgx; + + /** + * 与户主关系名称 + */ + private String yhzgxName; + + /** + * 审核状态0未审核,1审核通过,2审核不通过 + */ + private String confirmResult; + + /** + * 审核不通过的原因 + */ + private String reason; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * ic_resi_user表id + */ + private String icResiUserId; + + /** + * 操作类型:新增add 修改 update 删除 delete + */ + private String submitType; + + /** + * 删除原因 + */ + private String deleteReason; + + /** + * 操作说明 + */ + private String operationDescribe; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyCategoryDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyCategoryDTO.java new file mode 100644 index 0000000000..4b4737d46e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyCategoryDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +public class IcVolunteerPolyCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 类别【字典表】 + */ + private String volunteerCategory; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyDTO.java new file mode 100644 index 0000000000..feee07ea09 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyDTO.java @@ -0,0 +1,113 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +public class IcVolunteerPolyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 居民端用户id + */ + private String userId; + + /** + * 对应的ic_resi_user主表Id + */ + private String icResiUser; + + /** + * 居住成员1姓名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + private String isParty; + private String isDyzxh; + private String volunteerCategory; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DemandUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DemandUserFormDTO.java index 56822cbe2c..59e16ce90a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DemandUserFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DemandUserFormDTO.java @@ -13,7 +13,7 @@ public class DemandUserFormDTO implements Serializable { // public interface GridIdGroup extends CustomerClientShowGroup { // } - @NotBlank(message = "工作人员所属组织id不能为空", groups = InternalGroup.class) + // @NotBlank(message = "工作人员所属组织id不能为空", groups = InternalGroup.class) private String agencyId; // @NotBlank(message = "请先选择所属网格", groups = GridIdGroup.class) @@ -21,5 +21,6 @@ public class DemandUserFormDTO implements Serializable { private String name; - + private String userId; + private String customerId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcPartyMemberFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcPartyMemberFormDTO.java new file mode 100644 index 0000000000..aafbf95b77 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcPartyMemberFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/12/10 15:46 + */ +@Data +public class IcPartyMemberFormDTO implements Serializable { + private static final long serialVersionUID = 1027174449735636944L; + + private String orgId; + + private String agencyId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcPartyMemberListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcPartyMemberListFormDTO.java new file mode 100644 index 0000000000..b2dbe3f596 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcPartyMemberListFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/12/10 15:49 + */ +@Data +public class IcPartyMemberListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -6085134769034337175L; + + private String orgId; + + private String code; + + private String agencyId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcPartyMemberSyncDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcPartyMemberSyncDTO.java new file mode 100644 index 0000000000..48ffd910b4 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcPartyMemberSyncDTO.java @@ -0,0 +1,115 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/17 18:13 + */ +@Data +public class IcPartyMemberSyncDTO implements Serializable { + private static final long serialVersionUID = 663543282690909994L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 党组织的所有上级ID,没有上级时为0 + */ + private String orgPids; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 对应的ic_resi_user主表Id + */ + private String icResiUser; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 地址 + */ + private String address; + + /** + * 入党时间 + */ + private String rdsj; + + /** + * 所属支部 + */ + private String sszb; + + /** + * 是否流动党员 + */ + private String isLd; + + /** + * 流动党员活动证号 + */ + private String ldzh; + + /** + * 职务 + */ + private String partyZw; + + /** + * 是否退休 + */ + private String isTx; + + /** + * 是否党员中心户 + */ + private String isDyzxh; + + /** + * 是否免学习0否,1是 + */ + private String isMxx; + + /** + * 文化程度【字典表】 + */ + private String culture; + + /** + * 志愿者类型,逗号隔开 + */ + private String volunteerCategory; + + /** + * 备注 + */ + private String remark; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmGetDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmGetDTO.java new file mode 100644 index 0000000000..10e36979f5 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmGetDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 查询家庭成员信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class IcResiUserConfirmGetDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ic_resi_user表id + */ + private String icResiUserId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmSubmitDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmSubmitDTO.java new file mode 100644 index 0000000000..429852ff04 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmSubmitDTO.java @@ -0,0 +1,210 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class IcResiUserConfirmSubmitDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 单元id + */ + private String unitId; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 姓 + */ + private String surname; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 户籍所在地地区码 + */ + private String hjszdCode; + + /** + * 户籍所在地层级编码 + */ + private String hjszdPathCode; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 现居住地地区码 + */ + private String xjzdCode; + + /** + * 现居住地层级编码 + */ + private String xjzdPathCode; + + /** + * 详细地址 + */ + private String xxdz; + + /** + * 民族【字典表】 + */ + private String mz; + + /** + * 名族名称 + */ + private String mzName; + + /** + * 与户主关系 + */ + private String yhzgx; + + /** + * 与户主关系名称 + */ + private String yhzgxName; + + /** + * 审核状态0未审核,1审核通过,2审核不通过 + */ + private String confirmResult; + + /** + * 审核不通过的原因 + */ + private String reason; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * ic_resi_user表id + */ + private String icResiUserId; + + /** + * 操作类型:新增add 修改 update 删除 delete + */ + private String submitType; + + /** + * 删除原因 + */ + private String deleteReason; + + /** + * 操作说明 + */ + private String operationDescribe; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LonAndLatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LonAndLatFormDTO.java new file mode 100644 index 0000000000..b491935153 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LonAndLatFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class LonAndLatFormDTO implements Serializable { + + private static final long serialVersionUID = -4097378626418182909L; + + private String customerId; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 关联关系 + */ + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RegisterAndBindFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RegisterAndBindFormDTO.java new file mode 100644 index 0000000000..5869490ead --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RegisterAndBindFormDTO.java @@ -0,0 +1,70 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/1 9:39 + */ +@NoArgsConstructor +@Data +public class RegisterAndBindFormDTO implements Serializable { + + private static final long serialVersionUID = 7068763631425911170L; + private String customerId; + private String userId; + /** + * 姓 + */ + private String surname; + /** + * 名 + */ + private String name; + /** + * 昵称 + */ + private String nickname; + /** + * 头像 + */ + private String headImgUrl; + /** + * 身份证 + */ + private String idCard; + /** + * 手机号 + */ + private String mobile; + /** + * 网格 + */ + private String gridId; + /** + * 小区 + */ + private String villageId; + /** + * 楼栋 + */ + private String buildId; + /** + * 单元 + */ + private String unitId; + /** + * 房屋 + */ + private String homeId; + /** + * 路牌号 + */ + private String address; + + private String visitId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java index 14675f3046..ff71263f95 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java @@ -29,5 +29,9 @@ public class UserChartFormDTO implements Serializable { //token这信息 private String customerId; private String userId; + //无效组织Id集合 + private List agencyIdList; + //无效网格Id集合 + private List gridIdList; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyListFormDTO.java new file mode 100644 index 0000000000..ca2126c3d7 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyListFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class VolunteerPolyListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -1097706840486437520L; + + /** + * 志愿者代码 + */ + private String code; + + /** + * 用户id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyMapDataFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyMapDataFormDTO.java new file mode 100644 index 0000000000..57812e784b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyMapDataFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class VolunteerPolyMapDataFormDTO implements Serializable { + + private static final long serialVersionUID = 341371496246696462L; + + /** + * 志愿者分类code + */ + private String code; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyPieFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyPieFormDTO.java new file mode 100644 index 0000000000..38cbe0491f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyPieFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class VolunteerPolyPieFormDTO implements Serializable { + + private static final long serialVersionUID = 6284245738483042805L; + + @NotBlank(message = "agencyId必填") + private String agencyId; + + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleTemplateDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleTemplateDTO.java index bbdba74e4b..0cd96df6cf 100755 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleTemplateDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleTemplateDTO.java @@ -67,7 +67,7 @@ public class GovStaffRoleTemplateDTO implements Serializable { /** * 排序 */ - private String sort; + private Integer sort; /** * diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeInfoResultDTO.java new file mode 100644 index 0000000000..5ff591455f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeInfoResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/1 16:49 + */ +@NoArgsConstructor +@Data +public class HomeInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -6109420020924607393L; + private String icResiUserId; + private String houseName; + private String houseCode; + private String qrCodeUrl; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java index ad44b7a13a..c98753f30f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java @@ -15,4 +15,6 @@ public class HouseUserDTO implements Serializable { */ private String icResiUserId; private String icUserName; + private String agencyId; + private String gridId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserInfoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserInfoDTO.java new file mode 100644 index 0000000000..0457fd979d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserInfoDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/20 9:55 + */ +@Data +public class IcResiUserInfoDTO implements Serializable { + private static final long serialVersionUID = -6071352387529766881L; + private String icResiUserId; + private String name; + private String mobile; + private String address; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserRoleResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserRoleResultDTO.java new file mode 100644 index 0000000000..cfcd9da6aa --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserRoleResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/31 9:44 + */ +@Data +public class IcUserRoleResultDTO implements Serializable { + private static final long serialVersionUID = 6755574567711827403L; + /** + * 是否是志愿者0否,1是 + */ + private String isVolunteer; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyResiUserInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyResiUserInfoResultDTO.java index a81e542024..7c8b9bcd3f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyResiUserInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyResiUserInfoResultDTO.java @@ -56,4 +56,14 @@ public class MyResiUserInfoResultDTO implements Serializable { * 今日已获得积分,用于积分任务列表显示 * */ private Integer todayObtainedPoint; + + /** + * 是否是志愿者:0否1是 + */ + private String volunteerFlag; + + /** + * 类别【字典表】 + */ + private String volunteerCategory; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyselfMsgResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyselfMsgResultDTO.java index cb15d9440b..bf68534dad 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyselfMsgResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyselfMsgResultDTO.java @@ -42,4 +42,10 @@ public class MyselfMsgResultDTO implements Serializable { * 身份证号 * */ private String idNum; + + /** + * 是否是志愿者:0否1是 + */ + private String volunteerFlag; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberAgeResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberAgeResultDTO.java index 85b0ced524..a700a87a91 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberAgeResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberAgeResultDTO.java @@ -16,4 +16,5 @@ public class PartyMemberAgeResultDTO implements Serializable { private String name; private String age; private String mobile; + private String icResiUser; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberEducationResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberEducationResultDTO.java index 421d0139a3..f686a1ce43 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberEducationResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberEducationResultDTO.java @@ -16,4 +16,5 @@ public class PartyMemberEducationResultDTO implements Serializable { private String name; private String education; private String mobile; + private String icResiUser; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffAndResiResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffAndResiResultDTO.java new file mode 100644 index 0000000000..2ae73db285 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffAndResiResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/5/25 09:06 + * @DESC + */ +@Data +public class StaffAndResiResultDTO implements Serializable { + + private static final long serialVersionUID = 5546194837482246174L; + + /** + * staff工作人员,resi居民 + */ + private String type; + + private String userId; + + /** + * 手机号(注册手机号) + */ + private String mobile; + + /** + * 姓名 + */ + private String realName; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + private String address; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyListResultDTO.java new file mode 100644 index 0000000000..fcbd7b7d9c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyListResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class VolunteerPolyListResultDTO implements Serializable { + + private static final long serialVersionUID = -882118974053517358L; + + /** + * 主键 + */ + private String id; + + /** + * 名字 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 用户id + */ + private String userId; + + /** + * 关联表id + */ + private String icResiUser; + + /** + * 身份证号 + */ + private String idCard; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyMapDataResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyMapDataResultDTO.java new file mode 100644 index 0000000000..1665ebdb65 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyMapDataResultDTO.java @@ -0,0 +1,79 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class VolunteerPolyMapDataResultDTO implements Serializable { + + private static final long serialVersionUID = -6310126790215323874L; + + /** + * 主键 + */ + private String id; + + /** + * 名字 + */ + private String name; + + /** + * 所属网格 + */ + private String gridName; + + /** + * 网格id + */ + private String gridId; + + /** + * 所属房屋 + */ + private String houseName; + + /** + * 房屋id + */ + private String homeId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 工作单位 + */ + private String gzdw; + + /** + * 人户状况 + */ + private String rhzk; + + private String longitude; + + private String latitude; + + /** + * 类别 + */ + private String volunteerCategory; + + /** + * 居民id + */ + private String icResiUser; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyPieResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyPieResultDTO.java new file mode 100644 index 0000000000..46a389125c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyPieResultDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class VolunteerPolyPieResultDTO implements Serializable { + + private static final long serialVersionUID = 777585539653982139L; + + private String label; + private String value; + private String code; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/CustomizeEnum.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/CustomizeEnum.java new file mode 100644 index 0000000000..324d7964e2 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/CustomizeEnum.java @@ -0,0 +1,42 @@ +package com.epmet.enums; + +import com.epmet.commons.tools.enums.IcFormCodeEnum; + +/** + * 要排除的饼状图枚举类 + * + * @return + * @author LZN + * @date 2022/5/30 15:13 + */ +public enum CustomizeEnum { + QI_TA("qita","其他"), + LAO_YOU_JV_LE_BU("laoyoujulebu","老友俱乐部"), + LOU_WEI_HUI("louweihui","楼委会"), + WEN_HUA_DUI_WU("wenhuaduiwu","文化队伍") + ; + private String code; + private String name; + + CustomizeEnum(String code,String name) { + this.code = code; + this.name = name; + } + + public static IcFormCodeEnum getEnum(String code) { + IcFormCodeEnum[] values = IcFormCodeEnum.values(); + for (IcFormCodeEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + public String getCode() { + return code; + } + public String getName(){ + return name; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 6ad96ff185..e5952a2726 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -9,6 +9,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.form.patrol.PatrolQueryFormDTO; import com.epmet.dto.result.*; import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallbackFactory; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; @@ -756,4 +757,53 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/icresiuser/changeIcResiUserBelongTo") Result changeIcResiUserBelongTo(@RequestBody IcUserBelongToChangedFormDTO formDTO); + + /** + * 使用身份证号查询家属信息 + * @param idCard + * @return + */ + @GetMapping("/epmetuser/icresiuser/findFamilyMemByIdCard/{id-card}") + Result findFamilyMemByIdCard(@PathVariable("id-card") String idCard); + + /** + * 身份证号查询居民信息 + * @param idCard + * @return + */ + @PostMapping("/epmetuser/icresiuser/getByResiIdCard/{idcard}") + Result getByResiIdCard(@PathVariable("idcard") String idCard); + + /** + * 根据身份证号查询ic_resi_user.id+居民端用户id + * + * @param idCard + * @return + */ + @PostMapping("/epmetuser/icresiuser/getAllUserIds") + Result> getAllUserIds(@RequestParam("idcard") String idCard, @RequestParam("customerId") String customerId); + + /** + * Desc: 获取是否注册居民标志,true:已注册,false:未注册 + * @param userId + * @author zxc + * @date 2022/5/23 13:52 + */ + @PostMapping("/epmetuser/userresiinfo/isResiFlag") + Result getIsResiFlag(@RequestParam("userId") String userId); + + /** + * Desc: 在不确定userId是工作人员还是居民时,使用此接口查询信息 + * @param userIds + * @author zxc + * @date 2022/5/25 09:17 + */ + @PostMapping("/epmetuser/userresiinfo/getStaffAndResi") + Result> getStaffAndResi(@RequestBody List userIds); + + @PostMapping("/epmetuser/icresiuser/icPartyMemberSync") + Result icPartyMemberSync(@RequestBody IcPartyMemberDTO formDTO); + + @PostMapping("/epmetuser/icVolunteerPoly/volunteerDataExtraction/{customerId}") + Result volunteerDataExtraction(@PathVariable("customerId") String customerId); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index a170b1e617..404ba7d0c3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -9,6 +9,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.form.patrol.PatrolQueryFormDTO; import com.epmet.dto.result.*; import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -553,4 +554,45 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "changeIcResiUserBelongTo", formDTO); } + @Override + public Result findFamilyMemByIdCard(String idCard) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "findFamilyMemByIdCard", idCard); + } + + @Override + public Result getByResiIdCard(String idCard) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getByResiIdCard", idCard); + } + + /** + * 根据身份证号查询ic_resi_user.id+居民端用户id + * + * @param idCard + * @param customerId + * @return + */ + @Override + public Result> getAllUserIds(String idCard, String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getAllUserIds", idCard,customerId); + } + + @Override + public Result getIsResiFlag(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getIsResiFlag", userId); + } + + @Override + public Result> getStaffAndResi(List userIds) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffAndResi", userIds); + } + @Override + public Result icPartyMemberSync(IcPartyMemberDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "icPartyMemberSync", formDTO); + } + + @Override + public Result volunteerDataExtraction(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "volunteerDataExtraction", customerId); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java index d35d1dbdaf..18c40e286e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java @@ -99,8 +99,10 @@ public class IcMoveInRecordController { @PostMapping("export") public void export(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO, HttpServletResponse response) throws IOException { formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); formDTO.setIsPage(false); ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); formDTO.setPageSize(NumConstant.TEN_THOUSAND); try { String fileName = "迁入管理" + DateUtils.format(new Date()) + ".xlsx"; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserConfirmController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserConfirmController.java new file mode 100644 index 0000000000..fc1e27a907 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserConfirmController.java @@ -0,0 +1,95 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +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.IcResiUserConfirmDTO; +import com.epmet.excel.IcResiUserConfirmExcel; +import com.epmet.service.IcResiUserConfirmService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@RestController +@RequestMapping("icResiUserConfirm") +public class IcResiUserConfirmController { + + @Autowired + private IcResiUserConfirmService icResiUserConfirmService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icResiUserConfirmService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcResiUserConfirmDTO data = icResiUserConfirmService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcResiUserConfirmDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icResiUserConfirmService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcResiUserConfirmDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icResiUserConfirmService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icResiUserConfirmService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icResiUserConfirmService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcResiUserConfirmExcel.class); + } + + + /** + * 审核 + * + * @Param tokenDto + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/6/1 17:26 + */ + @PostMapping("confirm") + public Result confirm(@RequestBody IcResiUserConfirmDTO dto) { + icResiUserConfirmService.confirm(dto); + return new Result(); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 97660e7ac9..ed4f055713 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -30,6 +30,7 @@ import com.epmet.commons.tools.constant.AppClientConstant; 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.form.mq.MqBaseFormDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.enums.IcFormCodeEnum; @@ -59,6 +60,8 @@ import com.epmet.excel.support.ExportResiUserItemDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.feign.OssFeignClient; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.IcResiUserExportService; import com.epmet.service.IcResiUserImportService; import com.epmet.service.IcResiUserService; @@ -216,9 +219,24 @@ public class IcResiUserController implements ResultDataResolver { form.setMessageType(SystemMessageType.IC_RESI_USER_ADD); form.setContent(mqMsg); epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + + this.sendVolunteerMsg(tokenDto.getCustomerId(), resiUserId); return new Result(); } + /** + * desc:发送 志愿者变动消息 + * @param customerId + * @param resiUserId + */ + private void sendVolunteerMsg(String customerId, String resiUserId) { + //发送志愿者人员消息变动 + boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendRocketMqMsg(SystemMessageType.VOLUNTEER_CHANGED, new MqBaseFormDTO(customerId, resiUserId)); + if (!flag){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"发送志愿者变动消息失败","发送志愿者变动消息失败"); + } + } + /** * @Author sun * @Description 党建互联平台--修改居民信息 @@ -229,6 +247,8 @@ public class IcResiUserController implements ResultDataResolver { String resiUserId = icResiUserService.edit(tokenDto, formDTO); //推送MQ事件 editResiMq(tokenDto.getCustomerId(), resiUserId); + + this.sendVolunteerMsg(tokenDto.getCustomerId(), resiUserId); return new Result(); } @@ -705,7 +725,9 @@ public class IcResiUserController implements ResultDataResolver { * 新增需求,需求人列表:展示当前工作人员所属组织+页面已选择所属网格 下的居民列 */ @PostMapping("demandusers") - public Result> queryDemandUsers(@RequestBody DemandUserFormDTO formDTO) { + public Result> queryDemandUsers(@LoginUser TokenDto tokenDto,@RequestBody DemandUserFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, DemandUserFormDTO.InternalGroup.class); return new Result>().ok(icResiUserService.queryDemandUsers(formDTO)); } @@ -1059,4 +1081,84 @@ public class IcResiUserController implements ResultDataResolver { Result> getResiUserGroupHomeId(@RequestBody RentTenantDataFormDTO formDTO) { return new Result().ok(icResiUserService.getResiUserGroupHomeId(formDTO)); } + + /** + * 使用身份证号查询家属信息 + * @param idCard + * @return + */ + @GetMapping("findFamilyMemByIdCard/{id-card}") + public Result findFamilyMemByIdCard(@PathVariable("id-card") String idCard) { + IcResiUserBriefDTO r = icResiUserService.findFamilyMemByIdCard(idCard); + return new Result().ok(r); + } + + /** + * 身份证号查询居民信息 + * @param idCard + * @return + */ + @PostMapping("getByResiIdCard/{idcard}") + public Result getByResiIdCard(@PathVariable("idcard") String idCard) { + IcResiUserDTO resi = icResiUserService.getByResiId(idCard); + return new Result().ok(resi); + } + + /** + * 根据身份证号查询ic_resi_user.id+居民端用户id + * + * @param idCard + * @return + */ + @PostMapping("getAllUserIds") + public Result> getAllUserIds(@RequestParam("idcard") String idCard, @RequestParam("customerId") String customerId) { + List list = icResiUserService.getAllUserIds(idCard, customerId); + return new Result>().ok(list); + } + + /** + * 党员信息同步 + * + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/17 19:14 + */ + @PostMapping("icPartyMemberSync") + public Result icPartyMemberSync(@RequestBody IcPartyMemberDTO formDTO) { + IcPartyMemberDTO dto = icResiUserService.icPartyMemberSync(formDTO); + if (StringUtils.isNotBlank(dto.getIcResiUser())) { + this.sendVolunteerMsg(formDTO.getCustomerId(), dto.getIcResiUser()); + } + return new Result().ok(dto); + } + + /** + * 根据身份证获取居民信息(党员管理用,主要显示住址) + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result< IcResiUserInfoDTO>} + * @Author zhaoqifeng + * @Date 2022/5/20 10:11 + */ + @PostMapping("getUserByIdCard") + public Result getUserByIdCard(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(icResiUserService.getUserByIdCard(formDTO)); + } + + /** + * 根据身份证获取居民角色(目前只有是否是志愿者) + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/31 9:47 + */ + @PostMapping("getUserRoleByIdCard") + public Result getUserRoleByIdCard(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(icResiUserService.getUserRoleByIdCard(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java new file mode 100644 index 0000000000..fe0f268681 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java @@ -0,0 +1,174 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO; +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.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.IcVolunteerPolyDTO; +import com.epmet.dto.form.LonAndLatFormDTO; +import com.epmet.dto.form.VolunteerPolyListFormDTO; +import com.epmet.dto.form.VolunteerPolyMapDataFormDTO; +import com.epmet.dto.form.VolunteerPolyPieFormDTO; +import com.epmet.dto.result.VolunteerPolyMapDataResultDTO; +import com.epmet.dto.result.VolunteerPolyPieResultDTO; +import com.epmet.service.IcVolunteerPolyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@RestController +@RequestMapping("icVolunteerPoly") +public class IcVolunteerPolyController { + + @Autowired + private IcVolunteerPolyService icVolunteerPolyService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = icVolunteerPolyService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { + IcVolunteerPolyDTO data = icVolunteerPolyService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcVolunteerPolyDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icVolunteerPolyService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcVolunteerPolyDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icVolunteerPolyService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icVolunteerPolyService.delete(ids); + return new Result(); + } + + /** + * 【网格党建平面图】地图 + * + * @param form + * @return com.epmet.commons.tools.utils.Result> + * @author LZN + * @date 2022/5/19 13:54 + */ + @PostMapping("/mapData") + public Result> getMapData(@RequestBody VolunteerPolyMapDataFormDTO form, @LoginUser TokenDto tokenDto) { + form.setCustomerId(tokenDto.getCustomerId()); + List dto = icVolunteerPolyService.getMapData(form); + return new Result>().ok(dto); + } + + /** + * 【网格党建平面图】列表 + * + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/5/19 14:49 + */ + @PostMapping("list") + public Result getList(@RequestBody VolunteerPolyListFormDTO form, @LoginUser TokenDto tokenDto) { + form.setCustomerId(tokenDto.getCustomerId()); + PageData data = icVolunteerPolyService.getList(form); + return new Result().ok(data); + } + + /** + * 抽取志愿者数据 + * + * @Param customerId + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/19 15:41 + */ + @PostMapping("volunteerDataExtraction/{customerId}") + public Result volunteerDataExtraction(@PathVariable("customerId") String customerId) { + icVolunteerPolyService.volunteerDataExtraction(customerId); + return new Result(); + } + + /** + * 志愿者变动 + * + * @Param form + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/19 18:05 + */ + @PostMapping("volunteerChanged") + public Result volunteerChanged(@RequestBody MqBaseFormDTO form) { + icVolunteerPolyService.volunteerChanged(form); + return new Result(); + } + + /** + * 【网格党建平面图】饼图 + * + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/5/19 17:21 + */ + @PostMapping("statistics") + public Result> getStatistics(@RequestBody VolunteerPolyPieFormDTO form, @LoginUser TokenDto tokenDto) { + form.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(form); + List dto = icVolunteerPolyService.getStatistics(form); + return new Result>().ok(dto); + } + + /** + * 修改经纬度 + * + * @param tokenDto + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/5/24 15:07 + */ + @PostMapping("LonAndLat") + public Result LonAndLat(@LoginUser TokenDto tokenDto, @RequestBody LonAndLatFormDTO form) { + form.setUserId(tokenDto.getUserId()); + form.setCustomerId(tokenDto.getCustomerId()); + icVolunteerPolyService.updateLonAndLat(form); + return new Result(); + + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/MyHomeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/MyHomeController.java new file mode 100644 index 0000000000..4b28ce6ac2 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/MyHomeController.java @@ -0,0 +1,164 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.enums.HomeMemberOperationEnum; +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.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcResiUserConfirmDTO; +import com.epmet.dto.form.IcResiUserConfirmGetDTO; +import com.epmet.dto.form.IcResiUserConfirmSubmitDTO; +import com.epmet.dto.form.RegisterAndBindFormDTO; +import com.epmet.dto.result.HomeInfoResultDTO; +import com.epmet.dto.result.HomeUserBriefResultDTO; +import com.epmet.service.IcResiUserConfirmService; +import com.epmet.service.IcResiUserService; +import com.epmet.service.MyHomeService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/31 16:20 + */ +@Slf4j +@RestController +@RequestMapping("myHome") +public class MyHomeController { + + @Autowired + private MyHomeService myHomeService; + + @Autowired + private IcResiUserConfirmService icResiUserConfirmService; + + @Autowired + private IcResiUserService icResiUserService; + + + @MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) + @PostMapping("memberList/{houseCode}") + public Result> selectListHomeMember(@PathVariable("houseCode") String houseCode, @LoginUser TokenDto tokenDto) { + return new Result().ok(myHomeService.selectListHomeMember(houseCode, tokenDto.getCustomerId())); + } + + +// /** +// * @describe: 新增家庭成员 +// * @author wangtong +// * @date 2022/6/1 15:50 +// * @params [dto] +// * @return com.epmet.commons.tools.utils.Result +// */ +// @PostMapping("addMember") +// public Result addMember(@RequestBody IcResiUserConfirmSubmitDTO dto){ +// //效验数据 +// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); +// dto.setSubmitType(HomeMemberOperationEnum.ADD.getCode()); +// return icResiUserConfirmService.addMember(dto); +// } +// +// /** +// * @describe: 修改家庭成员 +// * @author wangtong +// * @date 2022/6/1 15:27 +// * @params [dto] +// * @return com.epmet.commons.tools.utils.Result +// */ +// @PostMapping("editMember") +// public Result save(@RequestBody IcResiUserConfirmSubmitDTO dto){ +// //效验数据 +// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); +// dto.setSubmitType(HomeMemberOperationEnum.UPDATE.getCode()); +// return icResiUserConfirmService.editMember(dto); +// } +// + /** + * @describe: 删除家庭成员 + * @author wangtong + * @date 2022/6/1 16:10 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("delMember") + public Result delMember(@RequestBody IcResiUserConfirmSubmitDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + dto.setSubmitType(HomeMemberOperationEnum.DELETE.getCode()); + return icResiUserConfirmService.delMember(dto); + } + + /** + * @describe: 新增家庭成员 + * @author wangtong + * @date 2022/6/1 15:50 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("addMember") + public Result addMember(@RequestBody IcResiUserConfirmSubmitDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return icResiUserService.addMember(dto); + } + + /** + * @describe: 修改家庭成员 + * @author wangtong + * @date 2022/6/1 15:27 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("editMember") + public Result editMember(@RequestBody IcResiUserConfirmSubmitDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return icResiUserService.editMember(dto); + } + + + + /** + * @describe: 查询家庭成员信息 + * @author wangtong + * @date 2022/6/1 16:14 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("getMemberDetail") + public Result getMemberDetail(@RequestBody IcResiUserConfirmGetDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return icResiUserConfirmService.getMemberDetail(dto); + } + + /** + * 注册绑定家庭信息 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/6/1 10:26 + */ + @PostMapping("registerAndBind") + public Result registerAndBind(@LoginUser TokenDto tokenDto, @RequestBody RegisterAndBindFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + myHomeService.registerAndBind(formDTO); + return new Result(); + } + + @PostMapping("homeInfo") + public Result getHomeInfo(@LoginUser TokenDto tokenDto) { + HomeInfoResultDTO result = myHomeService.getHomeInfo(tokenDto); + return new Result().ok(result); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java index 820f310a40..5f8a5ca171 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java @@ -30,6 +30,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.IssueInitiatorResultDTO; +import com.epmet.dto.result.StaffAndResiResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.excel.UserResiInfoExcel; import com.epmet.service.UserResiInfoService; @@ -219,4 +220,27 @@ public class UserResiInfoController { userResiInfoService.submitInLink(param); return new Result(); } + + /** + * Desc: 获取是否注册居民标志,true:已注册,false:未注册 + * @param userId + * @author zxc + * @date 2022/5/23 13:52 + */ + @PostMapping("isResiFlag") + public Result getIsResiFlag(@RequestParam("userId") String userId){ + return new Result().ok(userResiInfoService.getIsResiFlag(userId)); + } + + /** + * Desc: 在不确定userId是工作人员还是居民时,使用此接口查询信息 + * @param userIds + * @author zxc + * @date 2022/5/25 09:17 + */ + @PostMapping("getStaffAndResi") + public Result> getStaffAndResi(@RequestBody List userIds){ + return new Result>().ok(userResiInfoService.getStaffAndResi(userIds)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ChangeWelfareDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ChangeWelfareDao.java index ba7aadeea2..c7f64d3231 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ChangeWelfareDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ChangeWelfareDao.java @@ -6,6 +6,9 @@ import com.epmet.entity.ChangeWelfareEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; +import java.util.Map; + /** * 福利表 * @@ -15,6 +18,16 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface ChangeWelfareDao extends BaseDao { + /** + * 福利名单列表 + * + * @param params + * @return java.util.List + * @author zhy + * @date 2022/5/12 17:44 + */ + List getWelfareList(Map params); + /** * @describe: 通过身份证号查询福利人员 * @author wangtong diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPartyMemberDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPartyMemberDao.java new file mode 100644 index 0000000000..0bfc139ce4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPartyMemberDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPartyMemberEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 党员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcPartyMemberDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserConfirmDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserConfirmDao.java new file mode 100644 index 0000000000..beb7ae9d77 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserConfirmDao.java @@ -0,0 +1,25 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcResiUserConfirmEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Mapper +public interface IcResiUserConfirmDao extends BaseDao { + + /** + * @describe: 根据icResiUserId查询 + * @author wangtong + * @date 2022/6/1 16:01 + * @params [icResiUserId] + * @return com.epmet.entity.IcResiUserConfirmEntity + */ + IcResiUserConfirmEntity selectByIcResiUserId(@Param("icResiUserId") String icResiUserId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 190d57f259..f76ad8e2ad 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -19,7 +19,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.dto.IcResiUserConfirmDTO; import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.form.EpidemicPreventionFormDTO; import com.epmet.dto.form.RentTenantDataFormDTO; import com.epmet.dto.form.ResiUserQueryValueDTO; @@ -49,6 +51,12 @@ public interface IcResiUserDao extends BaseDao { **/ void add(@Param("tableName") String tableName, @Param("map") Map map); + /** + * @Author sun + * @Description 居民信息修改先删除字表可能存在的数据 + **/ + void del(@Param("tableName") String tableName, @Param("resiUserId") String resiUserId); + /** * @Author sun * @Description 更新或新增居民信息各表数据 @@ -300,7 +308,7 @@ public interface IcResiUserDao extends BaseDao { IcResiUserEntity selectResiNoDelFlag(@Param("icResiUserId") String icResiUserId); - List userChart(@Param("orgId") String orgId, @Param("orgType") String orgType); + List userChart(@Param("orgId") String orgId, @Param("orgType") String orgType, @Param("agencyIdList") List agencyIdList, @Param("gridIdList") List gridIdList); /** * desc:根据维度获取居民信息表的数据[正常状态的居民] @@ -317,4 +325,24 @@ public interface IcResiUserDao extends BaseDao { * @return */ List listUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId); + + List getAllUserIds(@Param("idCard") String idCard, @Param("customerId")String customerId); + + /** + * 获取客户下志愿者信息 + * @Param customerId + * @Return {@link List< IcVolunteerPolyDTO>} + * @Author zhaoqifeng + * @Date 2022/5/19 10:40 + */ + List getVolunteerList(@Param("customerId") String customerId, @Param("userId") String userId); + + /** + * @describe: 查询家庭成员信息 + * @author wangtong + * @date 2022/6/1 16:16 + * @params [icResiUserId] + * @return com.epmet.dto.IcResiUserConfirmDTO + */ + IcResiUserConfirmDTO selectMemberDetail(@Param("icResiUserId") String icResiUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerDao.java new file mode 100644 index 0000000000..de9ccd3bb0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcVolunteerEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿者 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcVolunteerDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyCategoryDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyCategoryDao.java new file mode 100644 index 0000000000..d585715290 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyCategoryDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcVolunteerPolyCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Mapper +public interface IcVolunteerPolyCategoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java new file mode 100644 index 0000000000..04fa1977b0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java @@ -0,0 +1,47 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.LonAndLatFormDTO; +import com.epmet.dto.form.VolunteerPolyPieFormDTO; +import com.epmet.dto.result.VolunteerPolyListResultDTO; +import com.epmet.dto.result.VolunteerPolyMapDataResultDTO; +import com.epmet.dto.result.VolunteerPolyPieResultDTO; +import com.epmet.entity.IcVolunteerPolyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Mapper +public interface IcVolunteerPolyDao extends BaseDao { + + /** + * 【网格党建平面图】地图 + * @param code + */ + List getMapData(@Param("code") String code, + @Param("customerId") String customerId, + @Param("agencyId") String agencyId); + + /** + * 【网格党建平面图】列表 + * @param code + */ + List getList(@Param("code") String code, + @Param("customerId") String customerId, + @Param("agencyId") String agencyId); + + void deleteDataByCustomerId(@Param("customerId") String customerId); + void deleteCategoryByCustomerId(@Param("customerId") String customerId); + + List getStatistics(VolunteerPolyPieFormDTO form); + + void updateLonAndLat(@Param("form") LonAndLatFormDTO form); + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java index 1fddb41280..925e62f61a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java @@ -22,6 +22,7 @@ import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.dto.result.IssueInitiatorResultDTO; +import com.epmet.dto.result.StaffAndResiResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.entity.UserResiInfoEntity; import org.apache.ibatis.annotations.Mapper; @@ -109,4 +110,12 @@ public interface UserResiInfoDao extends BaseDao { List selectCommonIdNumUser(@Param("customerId") String customerId, @Param("idNum")String idNum); + + /** + * Desc: 在不确定userId是工作人员还是居民时,使用此接口查询信息 + * @param userIds + * @author zxc + * @date 2022/5/25 09:17 + */ + List getStaffAndResi(@Param("userIds") List userIds); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserConfirmEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserConfirmEntity.java new file mode 100644 index 0000000000..5c06a854e7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserConfirmEntity.java @@ -0,0 +1,157 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_user_confirm") +public class IcResiUserConfirmEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 户籍所在地地区码 + */ + private String hjszdCode; + + /** + * 户籍所在地层级编码 + */ + private String hjszdPathCode; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 现居住地地区码 + */ + private String xjzdCode; + + /** + * 现居住地层级编码 + */ + private String xjzdPathCode; + + /** + * 详细地址 + */ + private String xxdz; + + /** + * 民族【字典表】 + */ + private String mz; + + /** + * 名族名称 + */ + private String mzName; + + /** + * 与户主关系 + */ + private String yhzgx; + + /** + * 与户主关系名称 + */ + private String yhzgxName; + + /** + * 审核状态0未审核,1审核通过,2审核不通过 + */ + private String confirmResult; + + /** + * 审核不通过的原因 + */ + private String reason; + + /** + * ic_resi_user表id + */ + private String icResiUserId; + + /** + * 操作类型:新增add 修改 update 删除 delete + */ + private String submitType; + + /** + * 删除原因 + */ + private String deleteReason; + + /** + * 操作说明 + */ + private String operationDescribe; + +} + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyCategoryEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyCategoryEntity.java new file mode 100644 index 0000000000..f37b64ad82 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyCategoryEntity.java @@ -0,0 +1,37 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_volunteer_poly_category") +public class IcVolunteerPolyCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 类别【字典表】 + */ + private String volunteerCategory; + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyEntity.java new file mode 100644 index 0000000000..8eb0922704 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyEntity.java @@ -0,0 +1,76 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_volunteer_poly") +public class IcVolunteerPolyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 居民端用户id + */ + private String userId; + + /** + * 对应的ic_resi_user主表Id + */ + private String icResiUser; + + /** + * 居住成员1姓名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserConfirmExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserConfirmExcel.java new file mode 100644 index 0000000000..be302d0a35 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserConfirmExcel.java @@ -0,0 +1,105 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class IcResiUserConfirmExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "组织Id") + private String agencyId; + + @Excel(name = "组织的pids") + private String pids; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "姓") + private String surname; + + @Excel(name = "名") + private String name; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "性别") + private String gender; + + @Excel(name = "身份证号") + private String idCard; + + @Excel(name = "出生日期") + private String birthday; + + @Excel(name = "户籍所在地地区码") + private String hjszdCode; + + @Excel(name = "户籍所在地") + private String hjszd; + + @Excel(name = "现居住地地区码") + private String xjzdCode; + + @Excel(name = "现居住地") + private String xjzd; + + @Excel(name = "民族【字典表】") + private String mz; + + @Excel(name = "与户主关系") + private String yhzgx; + + @Excel(name = "审核状态0未审核,1审核通过,2审核不通过") + private String confirmResult; + + @Excel(name = "审核不通过的原因") + private String reason; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer 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 = "ic_resi_user表id") + private String icUserId; + + @Excel(name = "操作类型:新增add 修改 update 删除 delete") + private String submitType; + + @Excel(name = "删除原因") + private String deleteReason; + + @Excel(name = "操作说明") + private String operationDescribe; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcResiImportDynamicExcelListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcResiImportDynamicExcelListener.java index 427e70f0a3..2e98774f6e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcResiImportDynamicExcelListener.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcResiImportDynamicExcelListener.java @@ -2,10 +2,19 @@ package com.epmet.excel.handler; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.constant.SystemMessageType; import com.epmet.dto.result.FormItemResult; +import com.epmet.enums.IcResiUserTableEnum; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.impl.IcResiUserImportServiceImpl; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.HashMap; @@ -22,7 +31,7 @@ public class IcResiImportDynamicExcelListener extends AnalysisEventListener formItemList, Integer headRowNumber) { + String currUserAgencyPids, Boolean isPrimary, + List formItemList, IcResiUserTableEnum sheetEnumObject) { this.customerId = customerId; this.icResiUserImportService = icResiUserImportService; @@ -101,8 +105,7 @@ public class IcResiImportDynamicExcelListener extends AnalysisEventListener headMap, AnalysisContext context) { headList.add(headMap); - if (headList.size() < headRowNumber) { + if (headList.size() < sheetEnumObject.getHeadRowNo()) { return; } @@ -180,9 +183,19 @@ public class IcResiImportDynamicExcelListener extends AnalysisEventListener successIdCards = icResiUserImportService.persistIcResiExtraInfo(itemIdAndColumnWrapper, dataList, currUserAgencyId, abandonedHeaders, currentUserId, sheetEnumObject.getTableName(), customerId); + + // 对于志愿者,发送一个mq消息,对端监听器会对志愿者做相应处理 + if (sheetEnumObject == IcResiUserTableEnum.IC_VOLUNTEER && !CollectionUtils.isEmpty(successIdCards)) { + MqBaseFormDTO msg = new MqBaseFormDTO(); + msg.setCustomerId(EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID)); + msg.setObjectIdList(successIdCards); + SendMqMsgUtil.build() + .openFeignClient(SpringContextUtils.getBean(EpmetMessageOpenFeignClient.class)) + .sendRocketMqMsg(SystemMessageType.VOLUNTEER_CHANGED, msg); + } } dataList.clear(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/RocketMQWarnStatsRegister.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/RocketMQWarnStatsRegister.java index 2e7068ae04..0160fb63f9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/RocketMQWarnStatsRegister.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/RocketMQWarnStatsRegister.java @@ -5,6 +5,7 @@ import com.epmet.commons.rocketmq.constants.TopicConstants; import com.epmet.commons.rocketmq.register.MQAbstractRegister; import com.epmet.commons.rocketmq.register.MQConsumerProperties; import com.epmet.mq.listener.ICWarnStatsEventListener; +import com.epmet.mq.listener.VolunteerChangeEventListener; import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; import org.springframework.stereotype.Component; @@ -27,5 +28,12 @@ public class RocketMQWarnStatsRegister extends MQAbstractRegister { new ICWarnStatsEventListener()); // ...其他监听器类似 + // 客户初始化监听器注册 + register(consumerProperties, + ConsomerGroupConstants.VOLUNTEER_CHANGE_EVENT_LISTENER_GROUP, + MessageModel.CLUSTERING, + TopicConstants.VOLUNTEER, + "*", + new VolunteerChangeEventListener()); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/VolunteerChangeEventListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/VolunteerChangeEventListener.java new file mode 100644 index 0000000000..2ce92cd3c1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/VolunteerChangeEventListener.java @@ -0,0 +1,94 @@ +package com.epmet.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.service.IcVolunteerPolyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/19 17:54 + */ +@Slf4j +public class VolunteerChangeEventListener implements MessageListenerConcurrently { + private RedisUtils redisUtils; + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + log.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + // msg即为消息体 + // tags为SystemMessageType.java中的项,为具体的操作,此处拿到tags,判断是创建还是变更,来做响应的后续操作即可 + String msg = new String(messageExt.getBody()); + log.info("msg is {}",msg); + String topic = messageExt.getTopic(); + String tags = messageExt.getTags(); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + + log.info("【开放数据事件监听器】-志愿者变动-收到消息内容:{},操作:{}", msg, tags); + MqBaseFormDTO obj = JSON.parseObject(msg, MqBaseFormDTO.class); + log.info("obj is {}",JSON.toJSONString(obj)); + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:ic_warn_stats:%s", obj.getCustomerId()), + 30L, 30L, TimeUnit.SECONDS); + //待执行方法 + SpringContextUtils.getBean(IcVolunteerPolyService.class).volunteerChanged(obj); + + } catch (EpmetException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + log.error("【开放数据事件监听器】-志愿者变动MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + log.error("【开放数据事件监听器】-志愿者变动MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + assert distributedLock != null; + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + log.error("【开放数据事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiUserConfirmRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiUserConfirmRedis.java new file mode 100644 index 0000000000..7d94a32386 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiUserConfirmRedis.java @@ -0,0 +1,30 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Component +public class IcResiUserConfirmRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserConfirmService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserConfirmService.java new file mode 100644 index 0000000000..692b12e514 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserConfirmService.java @@ -0,0 +1,127 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcResiUserConfirmDTO; +import com.epmet.dto.form.IcResiUserConfirmGetDTO; +import com.epmet.dto.form.IcResiUserConfirmSubmitDTO; +import com.epmet.entity.IcResiUserConfirmEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +public interface IcResiUserConfirmService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-01 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-01 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcResiUserConfirmDTO + * @author generator + * @date 2022-06-01 + */ + IcResiUserConfirmDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-01 + */ + void save(IcResiUserConfirmDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-01 + */ + void update(IcResiUserConfirmDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-01 + */ + void delete(String[] ids); + + /** + * @describe: 新增家庭成员 + * @author wangtong + * @date 2022/6/1 15:30 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result editMember(IcResiUserConfirmSubmitDTO dto); + + /** + * @describe: 新增家庭成员 + * @author wangtong + * @date 2022/6/1 15:50 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result addMember(IcResiUserConfirmSubmitDTO dto); + + /** + * @describe: 删除家庭成员 + * @author wangtong + * @date 2022/6/1 16:11 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result delMember(IcResiUserConfirmSubmitDTO dto); + + /** + * @describe: 查询家庭成员信息 + * @author wangtong + * @date 2022/6/1 16:15 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result getMemberDetail(IcResiUserConfirmGetDTO dto); + + /** + * 审核 + * + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/6/1 17:27 + */ + void confirm(IcResiUserConfirmDTO dto); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 5f46d966b7..0e3d0658e9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -21,11 +21,13 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; 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.dto.IcResiUserDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.IcResiUserEntity; import com.epmet.excel.support.ExportResiUserItemDTO; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import java.util.List; import java.util.Map; @@ -88,15 +90,19 @@ public interface IcResiUserService extends BaseService { String staffOrgPath); /** - * @Description 查询个人数据 * @param formDTO + * @Description 查询个人数据 * @author zxc * @date 2021/11/3 9:21 上午 */ PersonDataResultDTO personData(PersonDataFormDTO formDTO); /** - * @param formDTO + * @param formDTO <<<<<<< HEAD + * ======= + * @Description 根据名字搜索 + * @Description 根据名字搜索 + * >>>>>>> master * @author zxc * @date 2021/11/3 1:42 下午 */ @@ -275,7 +281,8 @@ public interface IcResiUserService extends BaseService { **/ List userChartList(UserChartFormDTO formDTO); - List> dynamicQuery(String loginUserCustomerId, String formCode, String icResiUser, List showSqlColumns, List conditions, String agencyId, String finalStaffOrgPath); + + List> dynamicQuery(String loginUserCustomerId, String formCode, String icResiUser, List showSqlColumns, List conditions, String agencyId, String finalStaffOrgPath); /** * 租客房东黑名单查询个人数据 @@ -328,8 +335,10 @@ public interface IcResiUserService extends BaseService { * @return */ SyncResiResDTO checkUser(String customerId, String idCard, String agencyId); + /** * desc:条件获取居民基础信息 + * * @param formDTO * @return */ @@ -344,4 +353,59 @@ public interface IcResiUserService extends BaseService { */ List changeIcResiUserBelongTo(TokenDto tokenDto, IcUserBelongToChangedFormDTO formDTO); + + IcResiUserBriefDTO findFamilyMemByIdCard(String idCard); + + IcResiUserDTO getByResiId(String idCard); + + List getAllUserIds(String idCard, String customerId); + + + /** + * 党员信息同步 + * + * @Param formDTO + * @Return {@link IcPartyMemberDTO} + * @Author zhaoqifeng + * @Date 2022/5/17 19:12 + */ + IcPartyMemberDTO icPartyMemberSync(IcPartyMemberDTO formDTO); + + /** + * 根据身份证获取居民信息(党员管理用,主要显示住址) + * + * @Param formDTO + * @Return {@link IcResiUserInfoDTO} + * @Author zhaoqifeng + * @Date 2022/5/20 9:59 + */ + IcResiUserInfoDTO getUserByIdCard(IcResiUserDTO formDTO); + + /** + * 根据身份证获取居民角色(目前只有是否是志愿者) + * + * @Param formDTO + * @Return {@link IcUserRoleResultDTO} + * @Author zhaoqifeng + * @Date 2022/5/31 9:50 + */ + IcUserRoleResultDTO getUserRoleByIdCard(IcResiUserDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 新增家庭成员 + * @author wangtong + * @date 2022/6/6 10:36 + * @params [dto] + */ + Result addMember(IcResiUserConfirmSubmitDTO dto); + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 修改家庭成员 + * @author wangtong + * @date 2022/6/6 10:36 + * @params [dto] + */ + Result editMember(IcResiUserConfirmSubmitDTO dto); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyCategoryService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyCategoryService.java new file mode 100644 index 0000000000..0dd4cfa523 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyCategoryService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcVolunteerPolyCategoryDTO; +import com.epmet.entity.IcVolunteerPolyCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +public interface IcVolunteerPolyCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcVolunteerPolyCategoryDTO + * @author generator + * @date 2022-05-19 + */ + IcVolunteerPolyCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void save(IcVolunteerPolyCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void update(IcVolunteerPolyCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java new file mode 100644 index 0000000000..6a2b9f8f73 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java @@ -0,0 +1,145 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.dto.form.LonAndLatFormDTO; +import com.epmet.dto.form.VolunteerPolyListFormDTO; +import com.epmet.dto.form.VolunteerPolyMapDataFormDTO; +import com.epmet.dto.form.VolunteerPolyPieFormDTO; +import com.epmet.dto.result.VolunteerPolyMapDataResultDTO; +import com.epmet.dto.result.VolunteerPolyPieResultDTO; +import com.epmet.entity.IcVolunteerPolyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +public interface IcVolunteerPolyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcVolunteerPolyDTO + * @author generator + * @date 2022-05-19 + */ + IcVolunteerPolyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void save(IcVolunteerPolyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void update(IcVolunteerPolyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-19 + */ + void delete(String[] ids); + + /** + * 【网格党建平面图】地图 + * + * @param form + * @return java.util.List + * @author LZN + * @date 2022/5/19 13:55 + */ + List getMapData(VolunteerPolyMapDataFormDTO form); + + /** + * 【网格党建平面图】列表 + * + * @param form + * @return com.epmet.commons.tools.page.PageData + * @author LZN + * @date 2022/5/19 14:49 + */ + PageData getList(VolunteerPolyListFormDTO form); + + /** + * 志愿者数据抽取 + * + * @Param customerId + * @Return void + * @Author zhaoqifeng + * @Date 2022/5/19 10:00 + */ + void volunteerDataExtraction(String customerId); + + /** + * 志愿者变动 + * + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/5/19 16:02 + */ + void volunteerChanged(MqBaseFormDTO dto); + + /** + * 【网格党建平面图】饼图 + * + * @param form + * @return com.epmet.dto.result.VolunteerPolyPieResultDTO + * @author LZN + * @date 2022/5/19 17:21 + */ + List getStatistics(VolunteerPolyPieFormDTO form); + + /** + * 修改经纬度 + * + * @param form + * @return void + * @author LZN + * @date 2022/5/24 15:07 + */ + void updateLonAndLat(LonAndLatFormDTO form); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/MyHomeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/MyHomeService.java new file mode 100644 index 0000000000..0d1667b03d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/MyHomeService.java @@ -0,0 +1,46 @@ +package com.epmet.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.RegisterAndBindFormDTO; +import com.epmet.dto.result.HomeInfoResultDTO; +import com.epmet.dto.result.HomeUserBriefResultDTO; + +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/31 16:21 + */ +public interface MyHomeService { + /** + * 注册绑定房屋信息 + * + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/6/1 16:33 + */ + void registerAndBind(RegisterAndBindFormDTO formDTO); + + /** + * 获取用户绑定的房屋信息 + * + * @Param tokenDto + * @Return {@link HomeInfoResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/1 16:52 + */ + HomeInfoResultDTO getHomeInfo(TokenDto tokenDto); + + /** + * 查询家庭成员 + * + * @param houseCode 房屋编码 + * @param customerId + * @return java.util.List + * @author work@yujt.net.cn + * @date 2022/6/1/0001 16:12 + */ + List selectListHomeMember(String houseCode, String customerId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java index 1334034ebd..9e3a9f86fe 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.IssueInitiatorResultDTO; +import com.epmet.dto.result.StaffAndResiResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.entity.UserResiInfoEntity; @@ -195,4 +196,21 @@ public interface UserResiInfoService extends BaseService { * @date 2020.12.18 16:34 */ void submitInLink(AfterRegisterResidentInSharableLinkFormDTO param); + + /** + * Desc: 获取是否注册居民标志,true:已注册,false:未注册 + * @param userId + * @author zxc + * @date 2022/5/23 13:52 + */ + Boolean getIsResiFlag(String userId); + + /** + * Desc: 在不确定userId是工作人员还是居民时,使用此接口查询信息 + * @param userIds + * @author zxc + * @date 2022/5/25 09:17 + */ + List getStaffAndResi(List userIds); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeWelfareServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeWelfareServiceImpl.java index ff7e8b3ad6..87cf889ab7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeWelfareServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeWelfareServiceImpl.java @@ -49,11 +49,9 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl page(Map params) { params.put("customerId", loginUserUtil.getLoginUserCustomerId()); - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, ChangeWelfareDTO.class); + IPage page = getPage(params); + List list = baseDao.getWelfareList(params); + return new PageData<>(list, page.getTotal()); } @Override diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 01283f45c4..3b836920e9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -36,7 +36,6 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerStaffConstant; import com.epmet.constant.RoleKeyConstants; @@ -53,7 +52,6 @@ import com.epmet.entity.GovStaffRoleEntity; import com.epmet.entity.StaffRoleEntity; import com.epmet.entity.UserEntity; import com.epmet.feign.AuthFeignClient; -import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.CustomerStaffService; @@ -82,550 +80,545 @@ import java.util.stream.Collectors; @Slf4j @Service public class CustomerStaffServiceImpl extends BaseServiceImpl implements CustomerStaffService { - private final Logger logger = LogManager.getLogger(getClass()); - @Autowired - private GovStaffRoleService govStaffRoleService; - @Autowired - private UserService userService; - @Autowired - private StaffRoleService staffRoleService; - @Autowired - private StaffRoleDao staffRoleDao; - @Autowired - private CpUserDetailRedis cpUserDetailRedis; - @Autowired - private AuthFeignClient authFeignClient; - @Autowired - private GovOrgOpenFeignClient govOrgOpenFeignClient; - @Autowired - private CustomerStaffDao customerStaffDao; - @Autowired - private GovStaffRoleDao govStaffRoleDao; + private final Logger logger = LogManager.getLogger(getClass()); @Autowired - private OperCrmOpenFeignClient operCrmOpenFeignClient; + private GovStaffRoleService govStaffRoleService; @Autowired - private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, CustomerStaffDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, CustomerStaffDTO.class); - } - - private QueryWrapper getWrapper(Map params) { - String id = (String) params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public CustomerStaffDTO get(String id) { - CustomerStaffEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, CustomerStaffDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(CustomerStaffDTO dto) { - CustomerStaffEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(CustomerStaffDTO dto) { - CustomerStaffEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - - @Override - public Result> getCustsomerStaffByPhone(String mobile) { - //判断用户是否存在 - List customerStaffDTOList = baseDao.selectListCustomerStaffDTO(mobile); - if (null == customerStaffDTOList || customerStaffDTOList.size() == 0) { - logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", mobile, EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); - return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); - } - return new Result>().ok(customerStaffDTOList); - } + private UserService userService; + @Autowired + private StaffRoleService staffRoleService; + @Autowired + private StaffRoleDao staffRoleDao; + @Autowired + private AuthFeignClient authFeignClient; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private GovStaffRoleDao govStaffRoleDao; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerStaffDTO.class); + } - @Override - public Result getCustomerStaffInfo(CustomerStaffFormDTO formDTO) { - CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(formDTO); - if (null == customerStaffDTO) { - logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); - return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); - } - //判断用户是否已被禁用 - if (null != customerStaffDTO && UserConstant.DISABLED.equals(customerStaffDTO.getEnableFlag())) { - logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), EpmetErrorCode.GOV_STAFF_DISABLED.getMsg())); - return new Result().error(EpmetErrorCode.GOV_STAFF_DISABLED.getCode()); - } - return new Result().ok(customerStaffDTO); - } - - @Override - public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { - CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfoByUserId(formDTO); - return new Result().ok(customerStaffDTO); - } - - @Override - public Result> selectStaffGridListByUserId(List customerStaffGridDTOS) { - if (CollectionUtils.isEmpty(customerStaffGridDTOS)){ - return new Result>().ok(new ArrayList<>()); - } - List gridManager = staffRoleService.listStaffsInRole(UserRoleConstant.GRID_MANAGER, customerStaffGridDTOS.get(0).getPid(), DataScope.getDefault()); - List staffGridListDTOS = baseDao.selectStaffGridListByUserId(customerStaffGridDTOS); - for (GovStaffRoleResultDTO govStaffRoleResultDTO : gridManager) { - if (govStaffRoleResultDTO.getRoleKey().equals(UserRoleConstant.GRID_MANAGER)){ - for (StaffGridListDTO staffGridListDTO : staffGridListDTOS) { - if (staffGridListDTO.getStaffId().equals(govStaffRoleResultDTO.getStaffId())){ - staffGridListDTO.setRoleName(govStaffRoleResultDTO.getRoleName()); - } - } - } - } - return new Result>().ok(staffGridListDTOS); - } - - @Override - public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { - List list = baseDao.selectCustomerStaffList(fromDTO); - if (null == list) { - list = new ArrayList<>(); - } - return new Result>().ok(list); - } - - @Override - public Result> getStaffList(StaffsInAgencyFromDTO fromDTO) { - List list = baseDao.selectStaffList(fromDTO); - if (null == list) { - list = new ArrayList<>(); - } - if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) { - Map> map = govStaffRoleService.getStaffRoles(fromDTO.getStaffList(), fromDTO.getAgencyId()); - list.forEach(item -> { - item.setRoles(map.get(item.getStaffId())); - }); - } - return new Result>().ok(list); - } + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); - @Override - public Result> addStaffInit(StaffInfoFromDTO fromDTO) { - GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); - govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); - List roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO); + return ConvertUtils.sourceToTarget(entityList, CustomerStaffDTO.class); + } - if (null == roleList || roleList.size() == 0) { - return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); - } - List staffRoleList = roleList.stream() - .filter(p -> !RoleKeyConstants.ROLE_KEY_ROOT_MANAGER.equals(p.getRoleKey())) - .map(p -> { - RoleInfoResultDTO staffRoleResultDTO = new RoleInfoResultDTO(); - staffRoleResultDTO.setRoleId(p.getId()); - staffRoleResultDTO.setRoleName(p.getRoleName()); - staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly()); - staffRoleResultDTO.setDescription(p.getDescription()); - return staffRoleResultDTO; - }).collect(Collectors.toList()); - return new Result>().ok(staffRoleList); - } - - @Override - public Result editStaffInit(StaffInfoFromDTO fromDTO) { - StaffInitResultDTO resultDTO = new StaffInitResultDTO(); - //获取工作人员信息 - CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfo(fromDTO); - if (null == customerStaffDTO) { - log.warn("工作人员不存在"); - } - resultDTO.setStaffId(customerStaffDTO.getUserId()); - resultDTO.setName(customerStaffDTO.getRealName()); - resultDTO.setGender(customerStaffDTO.getGender()); - resultDTO.setMobile(customerStaffDTO.getMobile()); - resultDTO.setWorkType(customerStaffDTO.getWorkType()); - //获取角色列表 - GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); - govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); - List roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO); - //获取工作人员角色 - List staffRoles = govStaffRoleService.listRolesByStaffId(fromDTO.getStaffId(), fromDTO.getAgencyId()); - List staffRoleList = roleList - .stream() - .filter(p -> !RoleKeyConstants.ROLE_KEY_ROOT_MANAGER.equals(p.getRoleKey())) - .map(p -> { - StaffRoleResultDTO staffRoleResultDTO = new StaffRoleResultDTO(); - staffRoleResultDTO.setRoleId(p.getId()); - staffRoleResultDTO.setRoleName(p.getRoleName()); - staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly()); - staffRoleResultDTO.setDescription(p.getDescription()); - staffRoleResultDTO.setSelected(false); - return staffRoleResultDTO; - }).collect(Collectors.toList()); - - staffRoleList.forEach(role -> staffRoles.forEach(staffRole -> { - if (role.getRoleId().equals(staffRole.getId())) { - role.setSelected(true); - } - })); - resultDTO.setRoleList(staffRoleList); - - return new Result().ok(resultDTO); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Result addStaff(StaffSubmitFromDTO fromDTO) { - CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); - customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); - customerStaffFormDTO.setMobile(fromDTO.getMobile()); - CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); - if (null != customerStaffDTO) { - return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); - } - //USER表插入数据 - UserEntity userEntity = new UserEntity(); - userEntity.setFromApp(fromDTO.getApp()); - userEntity.setFromClient(fromDTO.getClient()); - userEntity.setCustomerId(fromDTO.getCustomerId()); - userService.insert(userEntity); - //Customer_Staff表插入数据 - CustomerStaffEntity staffEntity = new CustomerStaffEntity(); - staffEntity.setCustomerId(fromDTO.getCustomerId()); - staffEntity.setUserId(userEntity.getId()); - staffEntity.setRealName(fromDTO.getName()); - staffEntity.setMobile(fromDTO.getMobile()); - staffEntity.setActiveFlag(CustomerStaffConstant.INACTIVE); - staffEntity.setGender(fromDTO.getGender()); - staffEntity.setWorkType(fromDTO.getWorkType()); - staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE); - baseDao.insert(staffEntity); - - //工作人员角色关联表 - fromDTO.getRoles().forEach(role -> { - StaffRoleEntity staffRoleEntity = new StaffRoleEntity(); - staffRoleEntity.setStaffId(userEntity.getId()); - staffRoleEntity.setRoleId(role); - staffRoleEntity.setOrgId(fromDTO.getAgencyId()); - staffRoleEntity.setCustomerId(fromDTO.getCustomerId()); - staffRoleService.insert(staffRoleEntity); - }); - - // 角色放缓存 - CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO(); - List roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); - dto.setCustomerId(fromDTO.getCustomerId()); - dto.setStaffId(userEntity.getId()); - dto.setAgencyId(fromDTO.getAgencyId()); - Map m = new HashMap(16); - roleKeyValue.forEach(r -> { - m.put(r.getRoleKey(),r.getRoleName()); - }); - dto.setRoles(m); - CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); - - return new Result().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Result editStaff(StaffSubmitFromDTO fromDTO) { - CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); - customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); - customerStaffFormDTO.setMobile(fromDTO.getMobile()); - CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); - if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())){ - return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); - } + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); - CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); - //Customer_Staff表插入数据 - CustomerStaffEntity staffEntity = new CustomerStaffEntity(); - staffEntity.setId(customerStaffEntity.getId()); - staffEntity.setRealName(fromDTO.getName()); - staffEntity.setMobile(fromDTO.getMobile()); - staffEntity.setGender(fromDTO.getGender()); - staffEntity.setWorkType(fromDTO.getWorkType()); - baseDao.updateById(staffEntity); - - //清空权限关联 - StaffRoleDTO staffRoleDTO = new StaffRoleDTO(); - staffRoleDTO.setStaffId(fromDTO.getStaffId()); - staffRoleDTO.setOrgId(fromDTO.getAgencyId()); - staffRoleService.clearStaffRoles(staffRoleDTO); - //重新添加角色关联 - fromDTO.getRoles().forEach(role -> { - StaffRoleEntity staffRoleEntity = new StaffRoleEntity(); - staffRoleEntity.setStaffId(fromDTO.getStaffId()); - staffRoleEntity.setRoleId(role); - staffRoleEntity.setOrgId(fromDTO.getAgencyId()); - staffRoleService.insert(staffRoleEntity); - }); - - // 重新查询用户的角色列表(可以取到前端没有传过来的角色,例如根管理员) - List staffRoleEntytiesByStaffIdAndOrgId = staffRoleService.getStaffRoleEntytiesByStaffIdAndOrgId(fromDTO.getAgencyId(), fromDTO.getStaffId()); - List roleIds = new ArrayList<>(); - if (!CollectionUtils.isEmpty(staffRoleEntytiesByStaffIdAndOrgId)) { - roleIds = staffRoleEntytiesByStaffIdAndOrgId.stream().map(sr -> sr.getRoleId()).collect(Collectors.toList()); - } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - // redis缓存角色修改 - UpdateCachedRolesFormDTO updateRolesForm = new UpdateCachedRolesFormDTO(); - updateRolesForm.setOrgId(fromDTO.getAgencyId()); - updateRolesForm.setStaffId(fromDTO.getStaffId()); - updateRolesForm.setRoleIds(roleIds); - try { - Result result = authFeignClient.updateCachedRoles(updateRolesForm); - if (!result.success()) { - logger.error("修改用户信息:修改用户已缓存的角色列表失败:{}", result.getInternalMsg()); - } - logger.info("修改用户信息:修改用户已缓存的角色列表成功"); - } catch (Exception e) { - log.error("method exception", e); - logger.error("修改用户信息:修改用户已缓存的角色列表异常:{}", ExceptionUtils.getErrorStackTrace(e)); - } + return wrapper; + } - // 角色放缓存 - CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO(); - List roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); - dto.setCustomerId(fromDTO.getCustomerId()); - dto.setStaffId(fromDTO.getStaffId()); - dto.setAgencyId(fromDTO.getAgencyId()); - Map m = new HashMap(16); - roleKeyValue.forEach(r -> { - m.put(r.getRoleKey(),r.getRoleName()); - }); - dto.setRoles(m); - CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); - - return new Result(); - } - - @Override - public Result getStaffDetail(StaffInfoFromDTO fromDTO) { - StaffDetailResultDTO resultDTO = new StaffDetailResultDTO(); - //获取工作人员信息 - CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfo(fromDTO); - resultDTO.setStaffId(customerStaffDTO.getUserId()); - resultDTO.setName(customerStaffDTO.getRealName()); - resultDTO.setMobile(customerStaffDTO.getMobile()); - resultDTO.setHeadPhoto(customerStaffDTO.getHeadPhoto()); - resultDTO.setGender(customerStaffDTO.getGender()); - resultDTO.setActiveFlag(customerStaffDTO.getActiveFlag()); - resultDTO.setActiveTime(customerStaffDTO.getActiveTime()); - resultDTO.setEnableFlag(customerStaffDTO.getEnableFlag()); - - //获取工作人员角色 - List staffRoles = govStaffRoleService.listRolesByStaffId(fromDTO.getStaffId(), fromDTO.getAgencyId()); - List roles = staffRoles.stream().map(GovStaffRoleEntity::getRoleName).collect(Collectors.toList()); - resultDTO.setRoles(roles); - return new Result().ok(resultDTO); - } - - @Override - public Result disabledStaff(StaffInfoFromDTO fromDTO) { - CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); - CustomerStaffEntity staffEntity = new CustomerStaffEntity(); - staffEntity.setId(customerStaffEntity.getId()); - staffEntity.setEnableFlag(CustomerStaffConstant.DISABLED); - baseDao.updateById(staffEntity); - //2021.8.24 sun 人员禁用时删除工作人员的缓存信息 - CustomerStaffRedis.delStaffInfoFormCache(fromDTO.getCustomerId(), fromDTO.getStaffId()); - return new Result(); - } - - /** - * 根据userId查询网格下未被禁用的人员数量 - * - * @param userIdDTO - * @return - */ - @Override - public Result selectGridStaffCountByUserId(List userIdDTO) { - Result gridStaffCountDTOResult = new Result(); - GridStaffCountDTO gridStaffCountDTO = baseDao.selectGridStaffCountByUserId(userIdDTO); - gridStaffCountDTOResult.setData(gridStaffCountDTO); - return gridStaffCountDTOResult; - } - - @Override - public Result> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { - //1:根据userId集合查询人员基本信息 - List staffList = baseDao.selectDepartmentStaffList(formDTO); - //2:根据组织Id查询部门下是领导角色的用户 - List staffRoleDTOS = staffRoleService.listStaffsInRole(UserRoleConstant.DEPT_LEADER, formDTO.getAgencyId(), DataScope.getDefault()); - staffRoleDTOS.forEach(roleDto -> { - staffList.stream().filter(staffDto -> - roleDto.getStaffId().equals(staffDto.getStaffId())).findAny().ifPresent(result -> - result.setRoleName(roleDto.getRoleName())); - }); - return new Result>().ok(staffList); - } - - /** - * @return Result> - * @Description 通过userId列表查询未被禁用的用户信息 - * @Param CommonUserIdListFormDTO :: getUserIdList - * @Author wangc - * @Date 2020.04.24 15:44 - **/ - @Override - public Result> getEnableStaffMsgList(CommonUserIdListFormDTO userIdList) { - if (userIdList.getUserIdList().size() <= NumConstant.ZERO) { - return new Result>().ok(new ArrayList<>()); - } + @Override + public CustomerStaffDTO get(String id) { + CustomerStaffEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerStaffDTO.class); + } - return new Result>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList(), userIdList.getCustomerId())); - } - - /** - * @param staffIdList - * @return - * @Author sun - * @Description 根据staffId集合查询工作人员基础信息 - **/ - @Override - public CustomerStaffListResultDTO getCustomerStaffList(List staffIdList) { - //1:批量查询人员基本信息 - List staffList = baseDao.selectStaffByIds(staffIdList); - //2:批量查询人员拥有的所有角色信息 - List roleList = staffRoleDao.selectStaffRoleList(staffIdList); - CustomerStaffListResultDTO list = new CustomerStaffListResultDTO(); - list.setStaffList(staffList); - list.setRoleList(roleList); - return list; - } - - /** - * @param staffId - * @return - * @Author sun - * @Description 根据staffId查询工作人员基本信息 - **/ - @Override - public CustomerStaffDTO getCustomerStaff(String staffId) { - return baseDao.selectByStaffId(staffId); - } - - /** - * @param staffResetPwFormDTO - * @return void - * @author yinzuomei - * @description 工作端,修改工作人员密码 - * @Date 2020/7/1 10:41 - **/ - @Override - public void resetStaffPassword(StaffResetPwFormDTO staffResetPwFormDTO) { - CustomerStaffDTO customerStaffDTO=this.getCustomerStaff(staffResetPwFormDTO.getStaffId()); - if(null==customerStaffDTO){ - return; - } - //密码加密 - String password = PasswordUtils.encode(staffResetPwFormDTO.getNewPassword()); - logger.info(String.format("密码%s加密后为%s",staffResetPwFormDTO.getNewPassword(),password)); - customerStaffDTO.setPassword(password); - this.update(customerStaffDTO); - } - - /** - * @Description 得到工组人员的头像、名称、所属机关名称 - * @param userId - * @return - * @author wangc - * @date 2020.07.27 14:45 - **/ - @Override - public StaffEtAgencyResultDTO getStaffMsg(IssueInitiatorFormDTO userId) { - StaffEtAgencyResultDTO result = new StaffEtAgencyResultDTO(); - CustomerStaffDTO staff = baseDao.selectByStaffId(userId.getUserId()); - if(null != staff){ - Result agencyResult = govOrgOpenFeignClient.getAgencyByStaff(userId.getUserId()); - if(agencyResult.success() && null != agencyResult.getData()){ - result = ConvertUtils.sourceToTarget(agencyResult.getData(),StaffEtAgencyResultDTO.class); - result.setAgencyId(agencyResult.getData().getId()); - result.setNickname(new StringBuilder(agencyResult.getData().getOrganizationName()).append(ModuleConstant.DASH).append(staff.getRealName()).toString()); - } - } - return result; - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 根据客户ID、手机号查询政府端工作人员基本信息,校验用户是否存在 - **/ - @Override - public List getCustsomerStaffByIdAndPhone(ThirdCustomerStaffFormDTO formDTO) { - //根据客户Id和手机号查询工作人员信息 - List customerStaffDTOList = baseDao.selectStaff(formDTO); - if (null == customerStaffDTOList || customerStaffDTOList.size() < NumConstant.ONE) { - logger.warn(String.format("根据客户Id和手机号查询用户异常,客户Id:[%s],手机号:[%s],code[%s],msg[%s]", - formDTO.getCustomerId(), formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), - EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); - throw new RenException(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); - } - return customerStaffDTOList; - } - - /** - * @Description 查询工作人员的信息 - * @param formDTO - * @author zxc - * @date 2020/8/13 1:45 下午 - */ - @Override - public List getStaffInfoList(UserIdsFormDTO formDTO) { - List userIds = formDTO.getUserIds(); - // 1. 根据userId查询人员基本信息 - List staffInfoList = new ArrayList<>(); - userIds.forEach(staffId->{ - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), staffId); - if (staffInfo ==null){ - log.error("getStaffInfoList fail customerId:{}, staffId:{} not exist in db",formDTO.getCustomerId(), staffId); - return; - } - StaffSinGridResultDTO resultDTO = new StaffSinGridResultDTO(); - resultDTO.setStaffId(staffId); - resultDTO.setStaffName(staffInfo.getRealName()); - resultDTO.setHeadPhoto(staffInfo.getHeadPhoto()); - resultDTO.setGender(staffInfo.getGender()); - - List roleInfoList = new ArrayList<>(); - staffInfo.getRoleMap().forEach((key,value) ->{ - RoleResultDTO dto = new RoleResultDTO(); - dto.setRoleKey(key); - dto.setRoleName(value); - roleInfoList.add(dto); - }); - resultDTO.setRoleList(roleInfoList); - staffInfoList.add(resultDTO); - }); + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerStaffDTO dto) { + CustomerStaffEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerStaffDTO dto) { + CustomerStaffEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result> getCustsomerStaffByPhone(String mobile) { + //判断用户是否存在 + List customerStaffDTOList = baseDao.selectListCustomerStaffDTO(mobile); + if (null == customerStaffDTOList || customerStaffDTOList.size() == 0) { + logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", mobile, EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); + return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); + } + return new Result>().ok(customerStaffDTOList); + } + + + @Override + public Result getCustomerStaffInfo(CustomerStaffFormDTO formDTO) { + CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(formDTO); + if (null == customerStaffDTO) { + logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); + return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); + } + //判断用户是否已被禁用 + if (null != customerStaffDTO && UserConstant.DISABLED.equals(customerStaffDTO.getEnableFlag())) { + logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), EpmetErrorCode.GOV_STAFF_DISABLED.getMsg())); + return new Result().error(EpmetErrorCode.GOV_STAFF_DISABLED.getCode()); + } + return new Result().ok(customerStaffDTO); + } + + @Override + public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfoByUserId(formDTO); + return new Result().ok(customerStaffDTO); + } + + @Override + public Result> selectStaffGridListByUserId(List customerStaffGridDTOS) { + if (CollectionUtils.isEmpty(customerStaffGridDTOS)) { + return new Result>().ok(new ArrayList<>()); + } + List gridManager = staffRoleService.listStaffsInRole(UserRoleConstant.GRID_MANAGER, customerStaffGridDTOS.get(0).getPid(), DataScope.getDefault()); + List staffGridListDTOS = baseDao.selectStaffGridListByUserId(customerStaffGridDTOS); + for (GovStaffRoleResultDTO govStaffRoleResultDTO : gridManager) { + if (govStaffRoleResultDTO.getRoleKey().equals(UserRoleConstant.GRID_MANAGER)) { + for (StaffGridListDTO staffGridListDTO : staffGridListDTOS) { + if (staffGridListDTO.getStaffId().equals(govStaffRoleResultDTO.getStaffId())) { + staffGridListDTO.setRoleName(govStaffRoleResultDTO.getRoleName()); + } + } + } + } + return new Result>().ok(staffGridListDTOS); + } + + @Override + public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { + List list = baseDao.selectCustomerStaffList(fromDTO); + if (null == list) { + list = new ArrayList<>(); + } + return new Result>().ok(list); + } + + @Override + public Result> getStaffList(StaffsInAgencyFromDTO fromDTO) { + List list = baseDao.selectStaffList(fromDTO); + if (null == list) { + list = new ArrayList<>(); + } + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) { + Map> map = govStaffRoleService.getStaffRoles(fromDTO.getStaffList(), fromDTO.getAgencyId()); + list.forEach(item -> { + item.setRoles(map.get(item.getStaffId())); + }); + } + return new Result>().ok(list); + } + + @Override + public Result> addStaffInit(StaffInfoFromDTO fromDTO) { + GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); + govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); + List roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO); + + if (null == roleList || roleList.size() == 0) { + return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + List staffRoleList = roleList.stream() + .filter(p -> !RoleKeyConstants.ROLE_KEY_ROOT_MANAGER.equals(p.getRoleKey())) + .map(p -> { + RoleInfoResultDTO staffRoleResultDTO = new RoleInfoResultDTO(); + staffRoleResultDTO.setRoleId(p.getId()); + staffRoleResultDTO.setRoleName(p.getRoleName()); + staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly()); + staffRoleResultDTO.setDescription(p.getDescription()); + return staffRoleResultDTO; + }).collect(Collectors.toList()); + return new Result>().ok(staffRoleList); + } + + @Override + public Result editStaffInit(StaffInfoFromDTO fromDTO) { + StaffInitResultDTO resultDTO = new StaffInitResultDTO(); + //获取工作人员信息 + CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfo(fromDTO); + if (null == customerStaffDTO) { + log.warn("工作人员不存在"); + } + resultDTO.setStaffId(customerStaffDTO.getUserId()); + resultDTO.setName(customerStaffDTO.getRealName()); + resultDTO.setGender(customerStaffDTO.getGender()); + resultDTO.setMobile(customerStaffDTO.getMobile()); + resultDTO.setWorkType(customerStaffDTO.getWorkType()); + //获取角色列表 + GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); + govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); + List roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO); + //获取工作人员角色 + List staffRoles = govStaffRoleService.listRolesByStaffId(fromDTO.getStaffId(), fromDTO.getAgencyId()); + List staffRoleList = roleList + .stream() + .filter(p -> !RoleKeyConstants.ROLE_KEY_ROOT_MANAGER.equals(p.getRoleKey())) + .map(p -> { + StaffRoleResultDTO staffRoleResultDTO = new StaffRoleResultDTO(); + staffRoleResultDTO.setRoleId(p.getId()); + staffRoleResultDTO.setRoleName(p.getRoleName()); + staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly()); + staffRoleResultDTO.setDescription(p.getDescription()); + staffRoleResultDTO.setSelected(false); + return staffRoleResultDTO; + }).collect(Collectors.toList()); + + staffRoleList.forEach(role -> staffRoles.forEach(staffRole -> { + if (role.getRoleId().equals(staffRole.getId())) { + role.setSelected(true); + } + })); + resultDTO.setRoleList(staffRoleList); + + return new Result().ok(resultDTO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result addStaff(StaffSubmitFromDTO fromDTO) { + CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); + customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); + customerStaffFormDTO.setMobile(fromDTO.getMobile()); + CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); + if (null != customerStaffDTO) { + return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + } + //USER表插入数据 + UserEntity userEntity = new UserEntity(); + userEntity.setFromApp(fromDTO.getApp()); + userEntity.setFromClient(fromDTO.getClient()); + userEntity.setCustomerId(fromDTO.getCustomerId()); + userService.insert(userEntity); + //Customer_Staff表插入数据 + CustomerStaffEntity staffEntity = new CustomerStaffEntity(); + staffEntity.setCustomerId(fromDTO.getCustomerId()); + staffEntity.setUserId(userEntity.getId()); + staffEntity.setRealName(fromDTO.getName()); + staffEntity.setMobile(fromDTO.getMobile()); + staffEntity.setActiveFlag(CustomerStaffConstant.INACTIVE); + staffEntity.setGender(fromDTO.getGender()); + staffEntity.setWorkType(fromDTO.getWorkType()); + staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE); + staffEntity.setPassword(PasswordUtils.encode("12345678")); + baseDao.insert(staffEntity); + + //工作人员角色关联表 + fromDTO.getRoles().forEach(role -> { + StaffRoleEntity staffRoleEntity = new StaffRoleEntity(); + staffRoleEntity.setStaffId(userEntity.getId()); + staffRoleEntity.setRoleId(role); + staffRoleEntity.setOrgId(fromDTO.getAgencyId()); + staffRoleEntity.setCustomerId(fromDTO.getCustomerId()); + staffRoleService.insert(staffRoleEntity); + }); + + // 角色放缓存 + CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO(); + List roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); + dto.setCustomerId(fromDTO.getCustomerId()); + dto.setStaffId(userEntity.getId()); + dto.setAgencyId(fromDTO.getAgencyId()); + Map m = new HashMap(16); + roleKeyValue.forEach(r -> { + m.put(r.getRoleKey(), r.getRoleName()); + }); + dto.setRoles(m); + CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); + + return new Result().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result editStaff(StaffSubmitFromDTO fromDTO) { + CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); + customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); + customerStaffFormDTO.setMobile(fromDTO.getMobile()); + CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); + if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())) { + return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + } + + CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); + //Customer_Staff表插入数据 + CustomerStaffEntity staffEntity = new CustomerStaffEntity(); + staffEntity.setId(customerStaffEntity.getId()); + staffEntity.setRealName(fromDTO.getName()); + staffEntity.setMobile(fromDTO.getMobile()); + staffEntity.setGender(fromDTO.getGender()); + staffEntity.setWorkType(fromDTO.getWorkType()); + baseDao.updateById(staffEntity); + + //清空权限关联 + StaffRoleDTO staffRoleDTO = new StaffRoleDTO(); + staffRoleDTO.setStaffId(fromDTO.getStaffId()); + staffRoleDTO.setOrgId(fromDTO.getAgencyId()); + staffRoleService.clearStaffRoles(staffRoleDTO); + //重新添加角色关联 + fromDTO.getRoles().forEach(role -> { + StaffRoleEntity staffRoleEntity = new StaffRoleEntity(); + staffRoleEntity.setStaffId(fromDTO.getStaffId()); + staffRoleEntity.setRoleId(role); + staffRoleEntity.setOrgId(fromDTO.getAgencyId()); + staffRoleService.insert(staffRoleEntity); + }); + + // 重新查询用户的角色列表(可以取到前端没有传过来的角色,例如根管理员) + List staffRoleEntytiesByStaffIdAndOrgId = staffRoleService.getStaffRoleEntytiesByStaffIdAndOrgId(fromDTO.getAgencyId(), fromDTO.getStaffId()); + List roleIds = new ArrayList<>(); + if (!CollectionUtils.isEmpty(staffRoleEntytiesByStaffIdAndOrgId)) { + roleIds = staffRoleEntytiesByStaffIdAndOrgId.stream().map(sr -> sr.getRoleId()).collect(Collectors.toList()); + } + + // redis缓存角色修改 + UpdateCachedRolesFormDTO updateRolesForm = new UpdateCachedRolesFormDTO(); + updateRolesForm.setOrgId(fromDTO.getAgencyId()); + updateRolesForm.setStaffId(fromDTO.getStaffId()); + updateRolesForm.setRoleIds(roleIds); + try { + Result result = authFeignClient.updateCachedRoles(updateRolesForm); + if (!result.success()) { + logger.error("修改用户信息:修改用户已缓存的角色列表失败:{}", result.getInternalMsg()); + } + logger.info("修改用户信息:修改用户已缓存的角色列表成功"); + } catch (Exception e) { + log.error("method exception", e); + logger.error("修改用户信息:修改用户已缓存的角色列表异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + // 角色放缓存 + CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO(); + List roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); + dto.setCustomerId(fromDTO.getCustomerId()); + dto.setStaffId(fromDTO.getStaffId()); + dto.setAgencyId(fromDTO.getAgencyId()); + Map m = new HashMap(16); + roleKeyValue.forEach(r -> { + m.put(r.getRoleKey(), r.getRoleName()); + }); + dto.setRoles(m); + CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); + + return new Result(); + } + + @Override + public Result getStaffDetail(StaffInfoFromDTO fromDTO) { + StaffDetailResultDTO resultDTO = new StaffDetailResultDTO(); + //获取工作人员信息 + CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfo(fromDTO); + resultDTO.setStaffId(customerStaffDTO.getUserId()); + resultDTO.setName(customerStaffDTO.getRealName()); + resultDTO.setMobile(customerStaffDTO.getMobile()); + resultDTO.setHeadPhoto(customerStaffDTO.getHeadPhoto()); + resultDTO.setGender(customerStaffDTO.getGender()); + resultDTO.setActiveFlag(customerStaffDTO.getActiveFlag()); + resultDTO.setActiveTime(customerStaffDTO.getActiveTime()); + resultDTO.setEnableFlag(customerStaffDTO.getEnableFlag()); + + //获取工作人员角色 + List staffRoles = govStaffRoleService.listRolesByStaffId(fromDTO.getStaffId(), fromDTO.getAgencyId()); + List roles = staffRoles.stream().map(GovStaffRoleEntity::getRoleName).collect(Collectors.toList()); + resultDTO.setRoles(roles); + return new Result().ok(resultDTO); + } + + @Override + public Result disabledStaff(StaffInfoFromDTO fromDTO) { + CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); + CustomerStaffEntity staffEntity = new CustomerStaffEntity(); + staffEntity.setId(customerStaffEntity.getId()); + staffEntity.setEnableFlag(CustomerStaffConstant.DISABLED); + baseDao.updateById(staffEntity); + //2021.8.24 sun 人员禁用时删除工作人员的缓存信息 + CustomerStaffRedis.delStaffInfoFormCache(fromDTO.getCustomerId(), fromDTO.getStaffId()); + return new Result(); + } + + /** + * 根据userId查询网格下未被禁用的人员数量 + * + * @param userIdDTO + * @return + */ + @Override + public Result selectGridStaffCountByUserId(List userIdDTO) { + Result gridStaffCountDTOResult = new Result(); + GridStaffCountDTO gridStaffCountDTO = baseDao.selectGridStaffCountByUserId(userIdDTO); + gridStaffCountDTOResult.setData(gridStaffCountDTO); + return gridStaffCountDTOResult; + } + + @Override + public Result> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { + //1:根据userId集合查询人员基本信息 + List staffList = baseDao.selectDepartmentStaffList(formDTO); + //2:根据组织Id查询部门下是领导角色的用户 + List staffRoleDTOS = staffRoleService.listStaffsInRole(UserRoleConstant.DEPT_LEADER, formDTO.getAgencyId(), DataScope.getDefault()); + staffRoleDTOS.forEach(roleDto -> { + staffList.stream().filter(staffDto -> + roleDto.getStaffId().equals(staffDto.getStaffId())).findAny().ifPresent(result -> + result.setRoleName(roleDto.getRoleName())); + }); + return new Result>().ok(staffList); + } + + /** + * @return Result> + * @Description 通过userId列表查询未被禁用的用户信息 + * @Param CommonUserIdListFormDTO :: getUserIdList + * @Author wangc + * @Date 2020.04.24 15:44 + **/ + @Override + public Result> getEnableStaffMsgList(CommonUserIdListFormDTO userIdList) { + if (userIdList.getUserIdList().size() <= NumConstant.ZERO) { + return new Result>().ok(new ArrayList<>()); + } + + return new Result>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList(), userIdList.getCustomerId())); + } + + /** + * @param staffIdList + * @return + * @Author sun + * @Description 根据staffId集合查询工作人员基础信息 + **/ + @Override + public CustomerStaffListResultDTO getCustomerStaffList(List staffIdList) { + //1:批量查询人员基本信息 + List staffList = baseDao.selectStaffByIds(staffIdList); + //2:批量查询人员拥有的所有角色信息 + List roleList = staffRoleDao.selectStaffRoleList(staffIdList); + CustomerStaffListResultDTO list = new CustomerStaffListResultDTO(); + list.setStaffList(staffList); + list.setRoleList(roleList); + return list; + } + + /** + * @param staffId + * @return + * @Author sun + * @Description 根据staffId查询工作人员基本信息 + **/ + @Override + public CustomerStaffDTO getCustomerStaff(String staffId) { + return baseDao.selectByStaffId(staffId); + } + + /** + * @param staffResetPwFormDTO + * @return void + * @author yinzuomei + * @description 工作端,修改工作人员密码 + * @Date 2020/7/1 10:41 + **/ + @Override + public void resetStaffPassword(StaffResetPwFormDTO staffResetPwFormDTO) { + CustomerStaffDTO customerStaffDTO = this.getCustomerStaff(staffResetPwFormDTO.getStaffId()); + if (null == customerStaffDTO) { + return; + } + //密码加密 + String password = PasswordUtils.encode(staffResetPwFormDTO.getNewPassword()); + logger.info(String.format("密码%s加密后为%s", staffResetPwFormDTO.getNewPassword(), password)); + customerStaffDTO.setPassword(password); + this.update(customerStaffDTO); + } + + /** + * @param userId + * @return + * @Description 得到工组人员的头像、名称、所属机关名称 + * @author wangc + * @date 2020.07.27 14:45 + **/ + @Override + public StaffEtAgencyResultDTO getStaffMsg(IssueInitiatorFormDTO userId) { + StaffEtAgencyResultDTO result = new StaffEtAgencyResultDTO(); + CustomerStaffDTO staff = baseDao.selectByStaffId(userId.getUserId()); + if (null != staff) { + Result agencyResult = govOrgOpenFeignClient.getAgencyByStaff(userId.getUserId()); + if (agencyResult.success() && null != agencyResult.getData()) { + result = ConvertUtils.sourceToTarget(agencyResult.getData(), StaffEtAgencyResultDTO.class); + result.setAgencyId(agencyResult.getData().getId()); + result.setNickname(new StringBuilder(agencyResult.getData().getOrganizationName()).append(ModuleConstant.DASH).append(staff.getRealName()).toString()); + } + } + return result; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据客户ID、手机号查询政府端工作人员基本信息,校验用户是否存在 + **/ + @Override + public List getCustsomerStaffByIdAndPhone(ThirdCustomerStaffFormDTO formDTO) { + //根据客户Id和手机号查询工作人员信息 + List customerStaffDTOList = baseDao.selectStaff(formDTO); + if (null == customerStaffDTOList || customerStaffDTOList.size() < NumConstant.ONE) { + logger.warn(String.format("根据客户Id和手机号查询用户异常,客户Id:[%s],手机号:[%s],code[%s],msg[%s]", + formDTO.getCustomerId(), formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), + EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); + throw new RenException(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); + } + return customerStaffDTOList; + } + + /** + * @param formDTO + * @Description 查询工作人员的信息 + * @author zxc + * @date 2020/8/13 1:45 下午 + */ + @Override + public List getStaffInfoList(UserIdsFormDTO formDTO) { + List userIds = formDTO.getUserIds(); + // 1. 根据userId查询人员基本信息 + List staffInfoList = new ArrayList<>(); + userIds.forEach(staffId -> { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), staffId); + if (staffInfo == null) { + log.error("getStaffInfoList fail customerId:{}, staffId:{} not exist in db", formDTO.getCustomerId(), staffId); + return; + } + StaffSinGridResultDTO resultDTO = new StaffSinGridResultDTO(); + resultDTO.setStaffId(staffId); + resultDTO.setStaffName(staffInfo.getRealName()); + resultDTO.setHeadPhoto(staffInfo.getHeadPhoto()); + resultDTO.setGender(staffInfo.getGender()); + + List roleInfoList = new ArrayList<>(); + staffInfo.getRoleMap().forEach((key, value) -> { + RoleResultDTO dto = new RoleResultDTO(); + dto.setRoleKey(key); + dto.setRoleName(value); + roleInfoList.add(dto); + }); + resultDTO.setRoleList(roleInfoList); + staffInfoList.add(resultDTO); + }); /*List staffInfoList = customerStaffDao.getStaffInfoList(userIds); if (staffInfoList.size() == NumConstant.ZERO){ @@ -644,14 +637,14 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl govOrgResult = - govOrgOpenFeignClient.staffInfoExt(result); - if(govOrgResult.success() && null != govOrgResult.getData()){ + govOrgOpenFeignClient.staffInfoExt(result); + if (govOrgResult.success() && null != govOrgResult.getData()) { return govOrgResult.getData(); } } - log.warn("com.epmet.service.impl.CustomerStaffServiceImpl.extStaffInfo,根据传入的用户Id未找到对应的工作人员,传参:{}",JSON.toJSONString(staffParam)); + log.warn("com.epmet.service.impl.CustomerStaffServiceImpl.extStaffInfo,根据传入的用户Id未找到对应的工作人员,传参:{}", JSON.toJSONString(staffParam)); return null; } - @Override - public void updateRootManage(UpdateRootManageFormDTO formDTO) { - CustomerStaffDTO dto = baseDao.selectRootManage(formDTO.getOrgId(), formDTO.getRoleKey()); - if (null == dto) { - throw new RenException("查询客户管理员失败"); - } - dto.setRealName(formDTO.getRootManageName()); - dto.setMobile(formDTO.getRootManagePhone()); - update(dto); - } + @Override + public void updateRootManage(UpdateRootManageFormDTO formDTO) { + CustomerStaffDTO dto = baseDao.selectRootManage(formDTO.getOrgId(), formDTO.getRoleKey()); + if (null == dto) { + throw new RenException("查询客户管理员失败"); + } + dto.setRealName(formDTO.getRootManageName()); + dto.setMobile(formDTO.getRootManagePhone()); + update(dto); + } - @Override - public Result> selectCustomerList(CustomerListFormDTO formDTO) { + @Override + public Result> selectCustomerList(CustomerListFormDTO formDTO) { List listResultDTO = new ArrayList<>(); CustomerDTO customerDTO = new CustomerDTO(); - // 1.根据手机号,去 customer_staff表,进行查询; 查询结果 多条:字段 customer_id,user_id + // 1.根据手机号,去 customer_staff表,进行查询; 查询结果 多条:字段 customer_id,user_id List customerStaffList = baseDao.selectListCustomerStaffDTO(formDTO.getPhone()); //sun 2020.11.12 需求变更-之前pc工作端只能是工作端小程序的超级管理员能登陆 现调整为工作端小程序的工作人员均可登陆(使用账号密码登陆) start @@ -714,150 +707,155 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); - if (!customerInfo.success()) { - logger.warn(String.format("获取客户信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); - } else { - if (null != customerInfo.getData()){ - CustomerListResultDTO resultDTO = new CustomerListResultDTO(); - resultDTO.setCustomerId(customerInfo.getData().getId()); - resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); - listResultDTO.add(resultDTO); - } - } - } - //2020.11.12 sun end - return new Result>().ok(listResultDTO); - } - - @Override - public Result selectStaffBasicInfo(String userId, String customerId) { - StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId); - if (null != resultDTO) { - resultDTO.setRoleList(baseDao.selectStaffRoles(userId, resultDTO.getCustomerId())); - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); - if (null != staffInfo) { - resultDTO.setAgencyId(staffInfo.getAgencyId()); - resultDTO.setAgencyName(staffInfo.getAgencyName()); - resultDTO.setLevel(staffInfo.getLevel()); - resultDTO.setLongitude(staffInfo.getLongitude()); - resultDTO.setLatitude(staffInfo.getLatitude()); - AgencyInfoCache agency = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); - resultDTO.setAreaCodePath(null != agency && !CollectionUtils.isEmpty(agency.getAreaCodePath()) ? agency.getAreaCodePath() : new ArrayList<>()); - resultDTO.setAreaCode(null != agency && StringUtils.isNotBlank(agency.getAreaCode()) ? agency.getAreaCode() : StrConstant.EPMETY_STR); - } - //获取工作人员所属客户名 - CustomerDTO dto = new CustomerDTO(); - dto.setId(customerId); - Result customerResult = operCrmOpenFeignClient.getCustomerInfo(dto); - if (!customerResult.success()) { - throw new RenException(customerResult.getCode(), customerResult.getMsg()); - } - if (null != customerResult.getData()) { - resultDTO.setCustomerName(customerResult.getData().getCustomerName()); - } - } - return new Result().ok(resultDTO); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 - **/ - @Override - public GovWebOperLoginResultDTO getStaffIdAndPwd(GovWebOperLoginFormDTO formDTO) { - //1.根据客户Id和手机号查询用户信息 - return baseDao.selectByCustomerIdAndPhone(formDTO); - } - - /** - * 根据staffId查询用户基本信息 - * @author sun - * @return - */ - @Override - public BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO) { - return baseDao.getStaffBasicInfo(fromDTO); - } - - @Override - public List list(String customerId, String realName, String mobile, List userIds) { - return baseDao.listDTOS(customerId, realName, mobile, userIds); - } - - /** - * 【通讯录】工作人员解禁 - * @author sun - */ - @Override - public void enableStaff(EnableStaffFormDTO fromDTO) { - CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); - if (null == customerStaffEntity) { - logger.error(String.format("工作人员解禁,未查询到被解禁人信息,被解禁人Id->%s", fromDTO.getStaffId())); - throw new RenException("未查询到被解禁人信息,请核对后操作"); - } - CustomerStaffEntity staffEntity = new CustomerStaffEntity(); - staffEntity.setId(customerStaffEntity.getId()); - staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE); - baseDao.updateById(staffEntity); - } - - /** - * @Author sun - * @Description 根据工作人员姓名批量查询基础信息数据 - **/ - @Override - public List getByRealNames(GetByRealNamesFormDTO formDTO) { - return baseDao.getByRealNames(formDTO); - } - - /** - * @Author sun - * @Description 【事件】网格员服务电话 - **/ - @Override - public List gridMobileList(String gridId, String userId) { - List resultList = new ArrayList<>(); - //1.查询网格下工作人员列表 - CommonGridIdFormDTO dto = new CommonGridIdFormDTO(); - dto.setGridId(gridId); - dto.setUserId(userId); - Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(dto); - if (!gridStaffs.success()) { - throw new RenException("获取网格下工作人员列表失败!"); - } - if (gridStaffs.getData().size() < NumConstant.ONE) { - return resultList; - } + for (CustomerStaffDTO staffDTO : customerStaffList) { + customerDTO.setId(staffDTO.getCustomerId()); + Result customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); + if (!customerInfo.success()) { + logger.warn(String.format("获取客户信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); + } else { + if (null != customerInfo.getData()) { + CustomerListResultDTO resultDTO = new CustomerListResultDTO(); + resultDTO.setCustomerId(customerInfo.getData().getId()); + resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); + listResultDTO.add(resultDTO); + } + } + } + //2020.11.12 sun end + return new Result>().ok(listResultDTO); + } - //2.查询工作人员中拥有网格长网格员角色的人员列表 - List staffRoleList = staffRoleDao.staffRoleList(gridStaffs.getData()); - - //3.查询工作人员基础信息 - List staffIdList = staffRoleList.stream().map(GridMobileListResultDTO.Role::getStaffId).collect(Collectors.toList()); - staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); - List list = baseDao.selectStaffByIds(staffIdList); - - //4.封装数据并返回 - resultList = ConvertUtils.sourceToTarget(list, GridMobileListResultDTO.class); - List roleList = null; - for (GridMobileListResultDTO re : resultList) { - roleList = new ArrayList<>(); - for (GridMobileListResultDTO.Role r : staffRoleList) { - if (re.getStaffId().equals(r.getStaffId())) { - GridMobileListResultDTO.Role role = ConvertUtils.sourceToTarget(r, GridMobileListResultDTO.Role.class); - roleList.add(role); - } - } - re.setGridId(gridId); - re.setRoleList(roleList); - } + @Override + public Result selectStaffBasicInfo(String userId, String customerId) { + StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId); + if (null != resultDTO) { + resultDTO.setRoleList(baseDao.selectStaffRoles(userId, resultDTO.getCustomerId())); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); + if (null != staffInfo) { + resultDTO.setAgencyId(staffInfo.getAgencyId()); + resultDTO.setAgencyName(staffInfo.getAgencyName()); + resultDTO.setLevel(staffInfo.getLevel()); + resultDTO.setLongitude(staffInfo.getLongitude()); + resultDTO.setLatitude(staffInfo.getLatitude()); + AgencyInfoCache agency = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (agency != null) { + resultDTO.setAreaCodePath(!CollectionUtils.isEmpty(agency.getAreaCodePath()) ? agency.getAreaCodePath() : new ArrayList<>()); + resultDTO.setAreaCode(StringUtils.isNotBlank(agency.getAreaCode()) ? agency.getAreaCode() : StrConstant.EPMETY_STR); + resultDTO.setLevel(agency.getLevel()); + } + } + //获取工作人员所属客户名 + CustomerDTO dto = new CustomerDTO(); + dto.setId(customerId); + Result customerResult = operCrmOpenFeignClient.getCustomerInfo(dto); + if (!customerResult.success()) { + throw new RenException(customerResult.getCode(), customerResult.getMsg()); + } + if (null != customerResult.getData()) { + resultDTO.setCustomerName(customerResult.getData().getCustomerName()); + } + } + return new Result().ok(resultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 + **/ + @Override + public GovWebOperLoginResultDTO getStaffIdAndPwd(GovWebOperLoginFormDTO formDTO) { + //1.根据客户Id和手机号查询用户信息 + return baseDao.selectByCustomerIdAndPhone(formDTO); + } - return resultList; - } + /** + * 根据staffId查询用户基本信息 + * + * @return + * @author sun + */ + @Override + public BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO) { + return baseDao.getStaffBasicInfo(fromDTO); + } + + @Override + public List list(String customerId, String realName, String mobile, List userIds) { + return baseDao.listDTOS(customerId, realName, mobile, userIds); + } + + /** + * 【通讯录】工作人员解禁 + * + * @author sun + */ + @Override + public void enableStaff(EnableStaffFormDTO fromDTO) { + CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); + if (null == customerStaffEntity) { + logger.error(String.format("工作人员解禁,未查询到被解禁人信息,被解禁人Id->%s", fromDTO.getStaffId())); + throw new RenException("未查询到被解禁人信息,请核对后操作"); + } + CustomerStaffEntity staffEntity = new CustomerStaffEntity(); + staffEntity.setId(customerStaffEntity.getId()); + staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE); + baseDao.updateById(staffEntity); + } + + /** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ + @Override + public List getByRealNames(GetByRealNamesFormDTO formDTO) { + return baseDao.getByRealNames(formDTO); + } + + /** + * @Author sun + * @Description 【事件】网格员服务电话 + **/ + @Override + public List gridMobileList(String gridId, String userId) { + List resultList = new ArrayList<>(); + //1.查询网格下工作人员列表 + CommonGridIdFormDTO dto = new CommonGridIdFormDTO(); + dto.setGridId(gridId); + dto.setUserId(userId); + Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(dto); + if (!gridStaffs.success()) { + throw new RenException("获取网格下工作人员列表失败!"); + } + if (gridStaffs.getData().size() < NumConstant.ONE) { + return resultList; + } + + //2.查询工作人员中拥有网格长网格员角色的人员列表 + List staffRoleList = staffRoleDao.staffRoleList(gridStaffs.getData()); + + //3.查询工作人员基础信息 + List staffIdList = staffRoleList.stream().map(GridMobileListResultDTO.Role::getStaffId).collect(Collectors.toList()); + staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); + List list = baseDao.selectStaffByIds(staffIdList); + + //4.封装数据并返回 + resultList = ConvertUtils.sourceToTarget(list, GridMobileListResultDTO.class); + List roleList = null; + for (GridMobileListResultDTO re : resultList) { + roleList = new ArrayList<>(); + for (GridMobileListResultDTO.Role r : staffRoleList) { + if (re.getStaffId().equals(r.getStaffId())) { + GridMobileListResultDTO.Role role = ConvertUtils.sourceToTarget(r, GridMobileListResultDTO.Role.class); + roleList.add(role); + } + } + re.setGridId(gridId); + re.setRoleList(roleList); + } + + return resultList; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java new file mode 100644 index 0000000000..ed2bd8e05d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java @@ -0,0 +1,179 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.GenderEnum; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcResiUserConfirmDao; +import com.epmet.dao.IcResiUserDao; +import com.epmet.dto.IcResiUserConfirmDTO; +import com.epmet.dto.form.IcResiUserConfirmGetDTO; +import com.epmet.dto.form.IcResiUserConfirmSubmitDTO; +import com.epmet.entity.IcResiUserConfirmEntity; +import com.epmet.entity.IcResiUserEntity; +import com.epmet.redis.IcResiUserConfirmRedis; +import com.epmet.service.IcResiUserConfirmService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Service +public class IcResiUserConfirmServiceImpl extends BaseServiceImpl implements IcResiUserConfirmService { + + @Autowired + private IcResiUserConfirmRedis icResiUserConfirmRedis; + + @Autowired + private IcResiUserDao icResiUserDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcResiUserConfirmDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcResiUserConfirmDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcResiUserConfirmDTO get(String id) { + IcResiUserConfirmEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcResiUserConfirmDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcResiUserConfirmDTO dto) { + IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcResiUserConfirmDTO dto) { + IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result editMember(IcResiUserConfirmSubmitDTO dto) { + IcResiUserConfirmEntity oldEntity = baseDao.selectByIcResiUserId(dto.getIcResiUserId()); + if (null != oldEntity) { + dto.setId(oldEntity.getId()); + IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); + updateById(entity); + } else { + addMember(dto); + } + return new Result().ok("修改成功"); + } + + @Override + public Result addMember(IcResiUserConfirmSubmitDTO dto) { + IcResiUserEntity user = icResiUserDao.selectById(dto.getIcResiUserId()); + dto.setCustomerId(user.getCustomerId()); + dto.setAgencyId(user.getAgencyId()); + dto.setPids(user.getPids()); + dto.setGridId(user.getGridId()); + + IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); + entity.setIcResiUserId(null); + insert(entity); + + return new Result().ok("新增成功"); + } + + @Override + public Result delMember(IcResiUserConfirmSubmitDTO dto) { + IcResiUserConfirmEntity oldEntity = baseDao.selectByIcResiUserId(dto.getIcResiUserId()); + if (null != oldEntity) { + dto.setId(oldEntity.getId()); + IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); + updateById(entity); + } else { + addMember(dto); + } + return new Result().ok("删除成功"); + } + + @Override + public Result getMemberDetail(IcResiUserConfirmGetDTO dto) { + IcResiUserConfirmDTO result = icResiUserDao.selectMemberDetail(dto.getIcResiUserId()); + if (null != result && StringUtils.isBlank(result.getGender())) { + result.setGender(GenderEnum.UN_KNOWN.getCode()); + } + return new Result().ok(result); + } + + /** + * 审核 + * + * @param dto + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/6/1 17:27 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void confirm(IcResiUserConfirmDTO dto) { + baseDao.updateById(ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class)); + if (NumConstant.ONE_STR.equals(dto.getConfirmResult())) { + //审核通过,修改居民信息 + IcResiUserConfirmEntity confirmEntity = baseDao.selectById(dto.getId()); + if ("edit".equals(confirmEntity.getSubmitType())) { + IcResiUserEntity entity = ConvertUtils.sourceToTarget(confirmEntity, IcResiUserEntity.class); + entity.setName(confirmEntity.getSurname() + confirmEntity.getName()); + entity.setId(confirmEntity.getIcResiUserId()); + icResiUserDao.updateById(entity); + } else if ("delete".equals(confirmEntity.getSubmitType())) { + IcResiUserEntity entity = new IcResiUserEntity(); + entity.setId(confirmEntity.getIcResiUserId()); + entity.setStatus(confirmEntity.getDeleteReason()); + icResiUserDao.updateById(entity); + } + } else { + //TODO 发送消息 + } + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index d952fddea7..8562af6077 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -23,7 +23,10 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.FileUtils; @@ -47,6 +50,7 @@ import com.epmet.enums.IcResiUserTableEnum; import com.epmet.excel.handler.IcResiImportDynamicExcelListener; import com.epmet.excel.handler.IcResiVirtualSheetImportListener; import com.epmet.feign.*; +import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; import com.epmet.service.IcResiUserImportService; import com.epmet.service.UserService; import com.google.common.cache.Cache; @@ -87,7 +91,7 @@ import java.util.stream.Collectors; public class IcResiUserImportServiceImpl implements IcResiUserImportService, ResultDataResolver { public static final List controlGroup1 = Arrays.asList("input", "textarea", "datepicker", "daterange"); - public static final List controlGroup2 = Arrays.asList("select", "radio"); + public static final List controlGroup2 = Arrays.asList("select", "radio", "cascader"); /** * 15位身份证号的正则表达式 @@ -165,6 +169,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; @Autowired private OssFeignClient ossFeignClient; + @Autowired + private ResiPartyMemberOpenFeignClient partyMemberOpenFeignClient; /** * 子表中不需要的列。因为主表中需要身份证号,网格等信息,但子表中不需要这些列必填,只要有身份证号即可,因此字表判断的时候需要排除这些列 @@ -259,8 +265,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res // 上传主表信息 log.info("======开始导入基础信息======="); - importIcResiBaseInfoFromExcel(formItemList,excelPathName, IcResiUserTableEnum.IC_RESI_USER.getSheetNo(), IcResiUserTableEnum.IC_RESI_USER.getHeadRowNo(), - currUserAgencyId, agencyInfo.getPids(), loginUserId, IcResiUserTableEnum.IC_RESI_USER.getTableName(), customerId); + importIcResiBaseInfoFromExcel(formItemList,excelPathName, IcResiUserTableEnum.IC_RESI_USER, + currUserAgencyId, agencyInfo.getPids(), loginUserId, customerId); // 上传附表信息 for (IcResiUserTableEnum sheet : IcResiUserTableEnum.values()) { @@ -379,19 +385,21 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res * excel导入居民基本信息 * * @param formItemList - * @param sheetNo - * @param headRowNumber * @param currUserAgencyId * @param currUserAgencyPids * @param currentUserId * @return */ - private void importIcResiBaseInfoFromExcel(List formItemList, String excelPathName, int sheetNo, int headRowNumber, String currUserAgencyId, String currUserAgencyPids, String currentUserId, - String tableName, String customerId) { + private void importIcResiBaseInfoFromExcel(List formItemList, String excelPathName, IcResiUserTableEnum sheetTableEnum, String currUserAgencyId, String currUserAgencyPids, String currentUserId, + String customerId) { IcResiImportDynamicExcelListener readListener = new IcResiImportDynamicExcelListener(this, customerId, currentUserId, currUserAgencyId, currUserAgencyPids, - true, tableName, formItemList, headRowNumber); - EasyExcel.read(new File(excelPathName)).registerReadListener(readListener).headRowNumber(headRowNumber).sheet(sheetNo).doRead(); + true, formItemList, sheetTableEnum); + EasyExcel.read(new File(excelPathName)) + .registerReadListener(readListener) + .headRowNumber(sheetTableEnum.getHeadRowNo()) + .sheet(sheetTableEnum.getTableComment()) + .doRead(); } /** @@ -411,7 +419,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res if (sheetEnumObject.isExistsDBTable()) { IcResiImportDynamicExcelListener readListener = new IcResiImportDynamicExcelListener( this, customerId, currentUserId, currUserAgencyId, null, - false, sheetEnumObject.getTableName(), formItemList, sheetEnumObject.getHeadRowNo()); + false, formItemList, sheetEnumObject); EasyExcelFactory.read(new File(excelPathName)) .registerReadListener(readListener) @@ -502,8 +510,15 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res columnAndValues.put("IS_FLOATING", existingResiMap.get("IS_FLOATING")); } - columnAndValues.put("AGENCY_ID", currUserAgencyId); - columnAndValues.put("PIDS", currUserAgencyPids); + String gridId = columnAndValues.get("GRID_ID"); + AgencyInfoCache agencyInfo = getAgencyInfo(gridId); + if (agencyInfo != null) { + columnAndValues.put("AGENCY_ID", agencyInfo.getId()); + columnAndValues.put("PIDS", agencyInfo.getPids()); + } else { + String msg = String.format("【居民信息导入】根据网格查询组织失败,网格ID:%s", gridId); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } columnAndValues.put("CUSTOMER_ID", EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID.toLowerCase())); columnAndValues.put("UPDATED_BY", currentUserId); @@ -560,6 +575,11 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } } + private AgencyInfoCache getAgencyInfo(String gridId) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(gridId); + return CustomerOrgRedis.getAgencyInfo(gridInfo.getPid()); + } + /** * 执行指定的检查以及数据的补充 * @param columnAndValues @@ -645,7 +665,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res * @param checkBoxOptionColumnIdxAndLabel 复选框的列号&label中文 * @param targetTableName 要插入到哪一个表 */ - public void persistIcResiExtraInfo(Map headerColumnWrapper, List> dataRows, + public List persistIcResiExtraInfo(Map headerColumnWrapper, List> dataRows, String currUserAgencyId, Map checkBoxOptionColumnIdxAndLabel, String currentUserId, String targetTableName, String customerId) { @@ -653,6 +673,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String loginUserCustomerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID.toLowerCase()); + // 成功处理的数据的身份证号 + List successIdCards = new ArrayList<>(); + // 遍历每一行,将行内容转化为 for (Map row : dataRows) { @@ -706,6 +729,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res Objects.requireNonNull(IcResiUserTableEnum.getObjectByTableName(targetTableName)).getMainTableFlagColumnName(), existResiInfoMap); + // 将成功的居民的身份证号添加到列表中 + successIdCards.add(row.get(ID_CARD_COLUMN_NO)); } catch (Exception e) { String errorMsg; if (e instanceof RenException || e instanceof EpmetException) { @@ -725,6 +750,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res columnAndValues.clear(); } } + + return successIdCards; } /** @@ -1317,6 +1344,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res case "/sys/dict/data/relationship": options = getResultDataOrThrowsException(adminOpenFeignClient.getRelationshipOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); break; + case "/resi/partymember/icPartyOrg/branchlist": + options = this.listBranchOptions(); + break; default: log.warn("listRemoteOptions url is not supported"); @@ -1359,6 +1389,20 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } + /** + * 支部列表选项 + * @return + */ + private List listBranchOptions() { + String msg = "查询支部列表失败"; + List branchList = getResultDataOrThrowsException(partyMemberOpenFeignClient.branchlist(), + ServiceConstant.RESI_PARTYMEMBER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); + //结果平铺展开 + Map resultMap = new HashMap<>(); + branchList.forEach(option-> option.getCurrenNodeAllChild(option,resultMap)); + return branchList; + } + @Override public Map listRemoteCascadeOptions(String pureUri, String cascadeItemId, Map columnWrappers, String currentStaffAgencyId, String query) { ColumnWrapper cascadeItemColumnWrapper = null; @@ -1374,9 +1418,12 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res options = getResultDataOrThrowsException(epmetHeartOpenFeignClient.getDemandOptions(), ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); break; + case "/resi/partymember/icPartyOrg/branchlist": + options = this.listBranchOptions(); + break; } if (options == null) { - return null; + return new HashMap<>(); } //结果平铺展开 Map resultMap = new HashMap<>(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 7c6e1b69dd..9a5aa2d787 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -36,29 +36,30 @@ import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.IcPlatformConstant; import com.epmet.constant.IcResiUserConstant; import com.epmet.constant.UserConstant; +import com.epmet.dao.IcPartyMemberDao; import com.epmet.dao.IcResiUserDao; +import com.epmet.dao.IcVolunteerDao; +import com.epmet.dao.UserBaseInfoDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; import com.epmet.dto.result.*; import com.epmet.dto.result.demand.IcResiDemandDictDTO; -import com.epmet.entity.IcResiUserEntity; -import com.epmet.entity.IcUserChangeDetailedEntity; -import com.epmet.entity.IcUserChangeRecordEntity; +import com.epmet.entity.*; import com.epmet.excel.support.ExportResiUserItemDTO; import com.epmet.feign.*; +import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; import com.epmet.service.*; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; @@ -133,6 +134,16 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params) { String id = (String) params.get(FieldConstant.ID_HUMP); @@ -195,6 +206,17 @@ public class IcResiUserServiceImpl extends BaseServiceImpl map = new LinkedHashMap<>(); + com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); + Map>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList)); + boolean isDyzxh = false; + //判断是否是党员中心户 + if (formMap.containsKey("ic_party_member")) { + for (LinkedHashMap hash : formMap.get("ic_party_member")) { + if (NumConstant.ONE_STR.equals(hash.get("IS_DYZXH"))) { + isDyzxh = true; + } + } + } for (IcResiUserFormDTO d : formDTO) { if ("ic_resi_user".equals(d.getTableName())) { map = d.getList().get(0); @@ -229,7 +251,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.getAgencyById(agencyId); @@ -238,8 +260,40 @@ public class IcResiUserServiceImpl extends BaseServiceImpl%s", agencyId)); } + if (isDyzxh) { + map.put("IS_VOLUNTEER", NumConstant.ONE_STR); + } //新增主表数据 baseDao.add(d.getTableName(), map); + + //2022.04.19 end + //2022.05.18 start zhaoqf 党员信息同步 + if (map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(map.get("IS_PARTY"))) { + partyMemberDTO.setCustomerId(tokenDto.getCustomerId()); + partyMemberDTO.setAgencyId(agencyId); + partyMemberDTO.setAgencyPids(result.getData().getPids()); + partyMemberDTO.setIcResiUser(resiUserId); + partyMemberDTO.setName(map.get("NAME")); + partyMemberDTO.setIdCard(map.get("ID_CARD")); + partyMemberDTO.setMobile(map.get("MOBILE")); + //查询网格信息 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(map.get("GRID_ID")); + //查询房屋信息 + HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(tokenDto.getCustomerId(), map.get("HOME_ID")); + if (null != gridInfo && null != houseInfo) { + String address; + if (StringUtils.isNotBlank(gridInfo.getAllParentName())) { + address = gridInfo.getAllParentName().concat(StrConstant.HYPHEN).concat(gridInfo.getGridNamePath()) + .concat(StrConstant.HYPHEN).concat(houseInfo.getNeighborHoodName()) + .concat(StrConstant.HYPHEN).concat(houseInfo.getHouseName()); + } else { + address = gridInfo.getGridNamePath() + .concat(StrConstant.HYPHEN).concat(houseInfo.getNeighborHoodName()) + .concat(StrConstant.HYPHEN).concat(houseInfo.getHouseName()); + } + } + } + //2022.05.18 end zhaoqf } } //2.循环字表新增数据 @@ -255,8 +309,31 @@ public class IcResiUserServiceImpl extends BaseServiceImpl hash : d.getList()) { + partyMemberDTO.setRdsj(hash.get("RDSJ")); + partyMemberDTO.setSszb(hash.get("SSZB")); + partyMemberDTO.setIsLd(hash.get("IS_LD")); + partyMemberDTO.setLdzh(hash.get("LDZH")); + partyMemberDTO.setPartyZw(hash.get("PARTY_ZW")); + partyMemberDTO.setIsTx(hash.get("IS_TX")); + partyMemberDTO.setIsDyzxh(hash.get("IS_DYZXH")); + } + } + if ("ic_volunteer".equals(d.getTableName())) { + for (LinkedHashMap hash : d.getList()) { + partyMemberDTO.setVolunteerCategory(hash.get("VOLUNTEER_CATEGORY")); + } + } + //2022.05.18 end zhaoqf }); - + if (StringUtils.isNotBlank(partyMemberDTO.getIcResiUser())) { + Result syncResult = resiPartyMemberOpenFeignClient.icPartyMemberSync(partyMemberDTO); + if (!syncResult.success()) { + log.error("同步党员信息失败"); + } + } //3.变更记录表和变更记录明细表新增数据 saveUserChangeRecord(tokenDto,map,resiUserId,name); @@ -345,6 +422,17 @@ public class IcResiUserServiceImpl extends BaseServiceImpl map = new LinkedHashMap<>(); + com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); + Map>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList)); + boolean isDyzxh = false; + //判断是否是党员中心户 + if (formMap.containsKey("ic_party_member")) { + for (LinkedHashMap hash : formMap.get("ic_party_member")) { + if (NumConstant.ONE_STR.equals(hash.get("IS_DYZXH"))) { + isDyzxh = true; + } + } + } for (IcResiUserFormDTO d : formDTO) { if ("ic_resi_user".equals(d.getTableName())) { map = d.getList().get(0); @@ -379,6 +467,60 @@ public class IcResiUserServiceImpl extends BaseServiceImpl NumConstant.ONE) { + if (isDyzxh) { + map.put("IS_VOLUNTEER", NumConstant.ONE_STR); + } map.put("updated_by", tokenDto.getUserId()); baseDao.upTable("ic_resi_user", resiUserId, map); } //3.循环更新或新增字表数据 String finalResiUserId = resiUserId; + //存放子表的表名,用于删除字表数据时使用,比如未来可能会存在子表多条数据的情况,那样的只能删一次,不然第二条保存时又把第一条删了 + Map tableMap = new HashMap<>(); formDTO.forEach(d -> { if (!"ic_resi_user".equals(d.getTableName())) { for (LinkedHashMap hash : d.getList()) { @@ -408,6 +555,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl hash : d.getList()) { + partyMemberDTO.setRdsj(hash.get("RDSJ")); + partyMemberDTO.setSszb(hash.get("SSZB")); + partyMemberDTO.setIsLd(hash.get("IS_LD")); + partyMemberDTO.setLdzh(hash.get("LDZH")); + partyMemberDTO.setPartyZw(hash.get("PARTY_ZW")); + partyMemberDTO.setIsTx(hash.get("IS_TX")); + partyMemberDTO.setIsDyzxh(hash.get("IS_DYZXH")); + } + } + if ("ic_volunteer".equals(d.getTableName())) { + for (LinkedHashMap hash : d.getList()) { + partyMemberDTO.setVolunteerCategory(hash.get("VOLUNTEER_CATEGORY")); + } + } + //2022.05.18 end zhaoqf }); - + if (StringUtils.isNotBlank(partyMemberDTO.getIcResiUser())) { + Result syncResult = resiPartyMemberOpenFeignClient.icPartyMemberSync(partyMemberDTO); + if (!syncResult.success()) { + log.error("同步党员信息失败"); + } + } return resiUserId; } @@ -1163,6 +1338,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl queryDemandUsers(DemandUserFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getAgencyId()) && StringUtils.isBlank(formDTO.getGridId())) { + // 默认查询当前工作人员所属组织下的居民 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("未查询当前工作人员信息%s", formDTO.getUserId())); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + } return baseDao.selectDemandUsers(formDTO.getAgencyId(), formDTO.getGridId(), formDTO.getName()); } @@ -1661,19 +1844,34 @@ public class IcResiUserServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.getDelAgencyGridIdList(formDTO.getOrgId()); + if (!result.success()) { + throw new EpmetException(String.format("获取当前组织及下级已删除组织、网格列表失败,组织Id->%s", formDTO.getUserId())); + } + formDTO.setAgencyIdList(result.getData().getAgencyIdList()); + formDTO.setGridIdList(result.getData().getGridIdList()); + } + //2.根据入参值查询对应的房屋统计数据 - List list = baseDao.userChart(formDTO.getOrgId(), formDTO.getOrgType()); + List list = baseDao.userChart(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getAgencyIdList(), formDTO.getGridIdList()); //3.汇总数据 AtomicInteger userTotal = new AtomicInteger(); + AtomicInteger czUserTotal = new AtomicInteger(); + AtomicInteger ldUserTotal = new AtomicInteger(); list.forEach(l -> { userTotal.addAndGet(l.getNum()); if ("0".equals(l.getIsFloating())) { - resultDTO.setCzUserTotal(l.getNum()); + czUserTotal.addAndGet(l.getNum()); } else { - resultDTO.setLdUserTotal(l.getNum()); + ldUserTotal.addAndGet(l.getNum()); } }); resultDTO.setUserTotal(userTotal.get()); + resultDTO.setCzUserTotal(czUserTotal.get()); + resultDTO.setLdUserTotal(ldUserTotal.get()); resultDTO.setCzUserRatio(Double.valueOf((resultDTO.getUserTotal() == 0 || resultDTO.getCzUserTotal() > resultDTO.getUserTotal()) ? "0" : numberFormat.format(((float) resultDTO.getCzUserTotal() / (float) resultDTO.getUserTotal()) * 100))); resultDTO.setLdUserRatio(Double.valueOf((resultDTO.getUserTotal() == 0 || resultDTO.getLdUserTotal() > resultDTO.getUserTotal()) ? "0" : numberFormat.format(((float) resultDTO.getLdUserTotal() / (float) resultDTO.getUserTotal()) * 100))); resultDTO.setOrgId(formDTO.getOrgId()); @@ -1703,6 +1901,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl lqw = new LambdaQueryWrapper<>(); lqw.eq(IcResiUserEntity::getCustomerId, customerId) .eq(IcResiUserEntity::getHomeId, houseId) + .eq(IcResiUserEntity::getStatus,"0") .select( IcResiUserEntity::getId, IcResiUserEntity::getHomeId, @@ -1948,6 +2147,254 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(IcResiUserEntity::getIdCard, formDTO.getIdCard()); + wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); + user = baseDao.selectOne(wrapper); + if(null == user) { + return dto; + } + } + dto.setIcResiUser(user.getId()); + formDTO.setIcResiUser(user.getId()); + //更新居民信息并将是否是党员字段设为1 + user.setName(formDTO.getName()); + user.setMobile(formDTO.getMobile()); + user.setIsParty(NumConstant.ONE_STR); + //如果是党员中心户,则居民是志愿者 + if (NumConstant.ONE_STR.equals(formDTO.getIsDyzxh())) { + user.setIsVolunteer(NumConstant.ONE_STR); + } + user.setUpdatedBy(null); + user.setUpdatedTime(null); + baseDao.updateById(user); + + } else { + //获取居民信息 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(IcResiUserEntity::getIdCard, formDTO.getIdCard()); + wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); + IcResiUserEntity user = baseDao.selectOne(wrapper); + //居民信息不存在时返回 + if(null == user) { + return dto; + } + dto.setIcResiUser(user.getId()); + formDTO.setIcResiUser(user.getId()); + //更新居民信息并将是否是党员字段设为1 + user.setName(formDTO.getName()); + user.setMobile(formDTO.getMobile()); + user.setIsParty(NumConstant.ONE_STR); + //如果是党员中心户,则居民是志愿者 + if (NumConstant.ONE_STR.equals(formDTO.getIsDyzxh())) { + user.setIsVolunteer(NumConstant.ONE_STR); + } + user.setUpdatedBy(null); + user.setUpdatedTime(null); + baseDao.updateById(user); + } + + + //判断是否有党员信息,没有则新增一条,有的话就更新 + String branch = formDTO.getOrgPids(); + if (StringUtils.isNotBlank(branch)) { + branch = branch.replace(StrConstant.COLON, StrConstant.COMMA); + } else { + branch = ""; + } + formDTO.setSszb(branch.concat(formDTO.getSszb())); + LambdaQueryWrapper partyWrapper = new LambdaQueryWrapper<>(); + partyWrapper.eq(IcPartyMemberEntity::getIcResiUser, formDTO.getIcResiUser()); + IcPartyMemberEntity partyMember = icPartyMemberDao.selectOne(partyWrapper); + if (null == partyMember) { + partyMember = ConvertUtils.sourceToTarget(formDTO, IcPartyMemberEntity.class); + + icPartyMemberDao.insert(partyMember); + } else { + IcPartyMemberEntity partyMemberEntity = ConvertUtils.sourceToTarget(formDTO, IcPartyMemberEntity.class); + partyMemberEntity.setId(partyMember.getId()); + icPartyMemberDao.updateById(partyMemberEntity); + } + //获取志愿者类别 + LambdaQueryWrapper volunteerWrapper = new LambdaQueryWrapper<>(); + volunteerWrapper.eq(IcVolunteerEntity::getIcResiUser, dto.getIcResiUser()); + IcVolunteerEntity volunteer = icVolunteerDao.selectOne(volunteerWrapper); + if (null != volunteer) { + dto.setVolunteerCategory(volunteer.getVolunteerCategory()); + } + + return dto; + } + + /** + * 根据身份证获取居民信息(党员管理用,主要显示住址) + * + * @param formDTO + * @Param formDTO + * @Return {@link IcResiUserInfoDTO} + * @Author zhaoqifeng + * @Date 2022/5/20 9:59 + */ + @Override + public IcResiUserInfoDTO getUserByIdCard(IcResiUserDTO formDTO) { + IcResiUserInfoDTO result = new IcResiUserInfoDTO(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(IcResiUserEntity::getIdCard, formDTO.getIdCard()); + wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); + IcResiUserEntity entity = baseDao.selectOne(wrapper); + if (null != entity) { + result.setIcResiUserId(entity.getId()); + result.setName(entity.getName()); + result.setMobile(entity.getMobile()); + //查询网格信息 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(entity.getGridId()); + //查询房屋信息 + HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(formDTO.getCustomerId(), entity.getHomeId()); + if (null != gridInfo && null != houseInfo) { + String address; + if (StringUtils.isNotBlank(gridInfo.getAllParentName())) { + address = gridInfo.getAllParentName().concat(StrConstant.HYPHEN).concat(gridInfo.getGridNamePath()) + .concat(StrConstant.HYPHEN).concat(houseInfo.getNeighborHoodName()) + .concat(StrConstant.HYPHEN).concat(houseInfo.getHouseName()); + } else { + address = gridInfo.getGridNamePath() + .concat(StrConstant.HYPHEN).concat(houseInfo.getNeighborHoodName()) + .concat(StrConstant.HYPHEN).concat(houseInfo.getHouseName()); + } + result.setAddress(address); + } + } + return result; + } + + @Override + public Result addMember(IcResiUserConfirmSubmitDTO dto) { + IcResiUserEntity user = icResiUserDao.selectById(dto.getIcResiUserId()); + + IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(dto.getIdCard(), user.getCustomerId()); + if (null != userDTO && null != userDTO.getIdCard()) { + String errorMsg = "新增居民信息失败,身份证号已存在!"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + //这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户 + if (RelationshipEnum.SELF.getCode().equals(dto.getYhzgx())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId()); + wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); + List entityList = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(entityList)) { + String errorMsg = "房屋下已存在户主"; + throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); + } + } + + + dto.setCustomerId(user.getCustomerId()); + dto.setAgencyId(user.getAgencyId()); + dto.setPids(user.getPids()); + dto.setGridId(user.getGridId()); + dto.setVillageId(user.getVillageId()); + dto.setBuildId(user.getBuildId()); + dto.setUnitId(user.getUnitId()); + dto.setHomeId(user.getHomeId()); + + IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); + insert(entity); + + return new Result().ok("新增成功"); + } + + @Override + public Result editMember(IcResiUserConfirmSubmitDTO dto) { + IcResiUserEntity user = icResiUserDao.selectById(dto.getIcResiUserId()); + + LambdaQueryWrapper userWrapper = new LambdaQueryWrapper<>(); + userWrapper.ne(IcResiUserEntity::getId, dto.getIcResiUserId()); + userWrapper.eq(IcResiUserEntity::getIdCard, dto.getIdCard()); + userWrapper.eq(IcResiUserEntity::getCustomerId, user.getCustomerId()); + List userList = baseDao.selectList(userWrapper); + if (CollectionUtils.isNotEmpty(userList)) { + String errorMsg = "修改居民信息失败,身份证号已存在!"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + //这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户 + if (RelationshipEnum.SELF.getCode().equals(dto.getYhzgx())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId()); + wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); + List entityList = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(entityList)) { + String errorMsg = "房屋下已存在户主"; + throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); + } + } + + IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); + entity.setId(dto.getIcResiUserId()); + updateById(entity); + return new Result().ok("修改成功"); + } + + /** + * 根据身份证获取居民角色(目前只有是否是志愿者) + * + * @param formDTO + * @Param formDTO + * @Return {@link IcUserRoleResultDTO} + * @Author zhaoqifeng + * @Date 2022/5/31 9:50 + */ + @Override + public IcUserRoleResultDTO getUserRoleByIdCard(IcResiUserDTO formDTO) { + IcUserRoleResultDTO result = new IcUserRoleResultDTO(); + result.setIsVolunteer(NumConstant.ZERO_STR); + //根据身份证获取小程序端居民信息 + LambdaQueryWrapper baseInfoWrapper = new LambdaQueryWrapper<>(); + baseInfoWrapper.eq(UserBaseInfoEntity::getCustomerId, formDTO.getCustomerId()); + baseInfoWrapper.eq(UserBaseInfoEntity::getIdNum, formDTO.getIdCard()); + List baseInfoList = userBaseInfoDao.selectList(baseInfoWrapper); + if (CollectionUtils.isNotEmpty(baseInfoList)) { + for (UserBaseInfoEntity baseInfo : baseInfoList) { + //获取志愿者信息 + Result volunteerResult = epmetHeartOpenFeignClient.queryUserVolunteerInfo(baseInfo.getUserId()); + if (!volunteerResult.success()) { + log.error("志愿者变更-获取小程序志愿者失败"); + continue; + } + if (null != volunteerResult.getData()) { + result.setIsVolunteer(NumConstant.ONE_STR); + break; + } + } + } + + return result; + } + /** * desc:根据字段值获取 options * @param customerId @@ -1967,4 +2414,23 @@ public class IcResiUserServiceImpl extends BaseServiceImpl o1)); } + @Override + public IcResiUserBriefDTO findFamilyMemByIdCard(String idCard) { + IcResiUserDTO resi = baseDao.getResiUserByIdCard(idCard, EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID)); + if (resi == null) { + return null; + } + + return baseDao.selectIcResuUser(resi.getId()); + } + + @Override + public IcResiUserDTO getByResiId(String idCard) { + return baseDao.getResiUserByIdCard(idCard, EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID)); + } + + @Override + public List getAllUserIds(String idCard, String customerId) { + return baseDao.getAllUserIds(idCard, customerId); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyCategoryServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyCategoryServiceImpl.java new file mode 100644 index 0000000000..ff4aaa59d0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyCategoryServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcVolunteerPolyCategoryDao; +import com.epmet.dto.IcVolunteerPolyCategoryDTO; +import com.epmet.entity.IcVolunteerPolyCategoryEntity; +import com.epmet.service.IcVolunteerPolyCategoryService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Service +public class IcVolunteerPolyCategoryServiceImpl extends BaseServiceImpl implements IcVolunteerPolyCategoryService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcVolunteerPolyCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcVolunteerPolyCategoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcVolunteerPolyCategoryDTO get(String id) { + IcVolunteerPolyCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcVolunteerPolyCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcVolunteerPolyCategoryDTO dto) { + IcVolunteerPolyCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyCategoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcVolunteerPolyCategoryDTO dto) { + IcVolunteerPolyCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyCategoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java new file mode 100644 index 0000000000..f2477ae314 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java @@ -0,0 +1,537 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO; +import com.epmet.commons.tools.enums.IcFormCodeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.*; +import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.dto.VolunteerInfoDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.result.ResiUserBaseInfoResultDTO; +import com.epmet.dto.result.VolunteerPolyListResultDTO; +import com.epmet.dto.result.VolunteerPolyMapDataResultDTO; +import com.epmet.dto.result.VolunteerPolyPieResultDTO; +import com.epmet.entity.*; +import com.epmet.enums.CustomizeEnum; +import com.epmet.feign.EpmetHeartOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.IcVolunteerPolyCategoryService; +import com.epmet.service.IcVolunteerPolyService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.compress.utils.Lists; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Service +@Slf4j +public class IcVolunteerPolyServiceImpl extends BaseServiceImpl implements IcVolunteerPolyService { + + @Resource + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Resource + private IcResiUserDao icResiUserDao; + @Resource + private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; + @Resource + private UserBaseInfoDao userBaseInfoDao; + @Resource + private IcVolunteerPolyCategoryService icVolunteerPolyCategoryService; + @Resource + private IcVolunteerPolyCategoryDao icVolunteerPolyCategoryDao; + @Resource + private IcPartyMemberDao icPartyMemberDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcVolunteerPolyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcVolunteerPolyDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcVolunteerPolyDTO get(String id) { + IcVolunteerPolyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcVolunteerPolyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcVolunteerPolyDTO dto) { + IcVolunteerPolyEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcVolunteerPolyDTO dto) { + IcVolunteerPolyEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 【网格党建平面图】地图 + * + * @param form + * @return java.util.List + * @author LZN + * @date 2022/5/19 13:55 + */ + @Override + public List getMapData(VolunteerPolyMapDataFormDTO form) { + List dto = baseDao.getMapData(form.getCode(), form.getCustomerId(), form.getAgencyId()); + // 获取gridName + for (VolunteerPolyMapDataResultDTO item : dto) { + if (StringUtils.isNotEmpty(item.getGridId())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); + if (null != gridInfo) { + item.setGridName(gridInfo.getGridName()); + } + } + // 获取houseName + if (StringUtils.isNotEmpty(item.getHomeId())) { + HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(form.getCustomerId(), item.getHomeId()); + if (null != houseInfo) { + item.setHouseName(houseInfo.getHouseName()); + } + } + } + return dto; + } + + /** + * 【网格党建平面图】列表 + * + * @param form + * @return com.epmet.commons.tools.page.PageData + * @author LZN + * @date 2022/5/19 14:49 + */ + @Override + public PageData getList(VolunteerPolyListFormDTO form) { + PageHelper.startPage(form.getPageNo(), form.getPageSize()); + List result = baseDao.getList(form.getCode(), form.getCustomerId(), form.getAgencyId()); + PageInfo info = new PageInfo<>(result); + return new PageData<>(result, info.getTotal()); + } + + /** + * 志愿者数据抽取 + * + * @param customerId + * @Param customerId + * @Return void + * @Author zhaoqifeng + * @Date 2022/5/19 10:00 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void volunteerDataExtraction(String customerId) { + if (StringUtils.isEmpty(customerId)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "客户ID不能为空", "客户ID不能为空"); + } + //获取居民信息表的志愿者 + List volunteerList = icResiUserDao.getVolunteerList(customerId, null); + if (CollectionUtils.isEmpty(volunteerList)) { + volunteerList = new ArrayList<>(); + } + //获取小程序居民端志愿者 + Result> result = epmetHeartOpenFeignClient.getVolunteerList(customerId); + if (!result.success()) { + log.error("志愿者数据抽取-获取小程序志愿者失败"); + } + List appVolunteerList = result.getData(); + appVolunteerList.forEach(item -> { + if(NumConstant.ONE_STR.equals(item.getIsParty()) && (NumConstant.ONE_STR.equals(item.getIsDyzxh()))) { + item.setVolunteerCategory(item.getVolunteerCategory().concat(",dangyuanzhongxinhu")); + } + }); + if (CollectionUtils.isNotEmpty(appVolunteerList)) { + //获取居民信息 + List userIds = appVolunteerList.stream().map(IcVolunteerPolyDTO::getUserId).collect(Collectors.toList()); + + //根据志愿者的userId获取居民信息并转成map + List userList = new ArrayList<>(); + List> partition = ListUtils.partition(userIds, NumConstant.FIFTY); + partition.forEach(part -> userList.addAll(getUserInfoList(part))); + Map userMap = userList.stream().collect(Collectors.toMap(UserBaseInfoEntity::getUserId, a -> a, (o, n) -> o)); + //将居民志愿者转成map + Map volunteerMap = volunteerList.stream().collect(Collectors.toMap(IcVolunteerPolyDTO::getIdCard, a -> a, (o, n) -> o)); + //小程序与居民信息匹配不上的志愿者 + List notInList = new ArrayList<>(); + appVolunteerList.forEach(item -> { + //补充志愿者信息 + if (userMap.containsKey(item.getUserId())) { + UserBaseInfoEntity userInfo = userMap.get(item.getUserId()); + item.setName(userInfo.getRealName()); + item.setIdCard(userInfo.getIdNum()); + item.setMobile(userInfo.getMobile()); + item.setGender(userInfo.getGender()); + } + //小程序与居民信息匹配不上的志愿者拿出来 + if (!volunteerMap.containsKey(item.getIdCard())) { + notInList.add(item); + } + }); + //将小程序的志愿者列表转成map + Map appVolunteerMap = appVolunteerList.stream().collect(Collectors.toMap(IcVolunteerPolyDTO::getIdCard, a -> a, (o, n) -> o)); + ////小程序与居民信息匹配上的志愿者userId更新到居民志愿者列表 + volunteerList.forEach(item -> { + if (appVolunteerMap.containsKey(item.getIdCard())) { + item.setUserId(appVolunteerMap.get(item.getIdCard()).getUserId()); + } + }); + volunteerList.addAll(notInList); + } + if (CollectionUtils.isNotEmpty(volunteerList)) { + //删除原数据 + baseDao.deleteDataByCustomerId(customerId); + baseDao.deleteCategoryByCustomerId(customerId); + //保存新数据 + volunteerList.forEach(item -> { + IcVolunteerPolyEntity entity = ConvertUtils.sourceToTarget(item, IcVolunteerPolyEntity.class); + baseDao.insert(entity); + List categoryList = Arrays.asList(item.getVolunteerCategory().split(StrConstant.COMMA)); + List entityList = categoryList.stream().map(o -> { + IcVolunteerPolyCategoryEntity category = new IcVolunteerPolyCategoryEntity(); + category.setCustomerId(item.getCustomerId()); + category.setIdCard(item.getIdCard()); + category.setVolunteerCategory(o); + return category; + }).collect(Collectors.toList()); + icVolunteerPolyCategoryService.insertBatch(entityList); + }); + } + } + + /** + * 志愿者变动 + * + * @param dto + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/5/19 16:02 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void volunteerChanged(MqBaseFormDTO dto) { + if (StringUtils.isBlank(dto.getObjectId()) && CollectionUtils.isEmpty(dto.getObjectIdList())) { + volunteerDataExtraction(dto.getCustomerId()); + } else { + if (StringUtils.isNotBlank(dto.getObjectId())) { + icVolunteer(dto.getCustomerId(), dto.getObjectId()); + appVolunteer(dto.getCustomerId(), dto.getObjectId()); + } + if (CollectionUtils.isNotEmpty(dto.getObjectIdList())) { + dto.getObjectIdList().forEach(id -> { + icVolunteer(dto.getCustomerId(), id); + appVolunteer(dto.getCustomerId(), id); + }); + } + } + } + + /** + * 居民信息志愿者变动 + * + * @Param customerId + * @Param userId + * @Return + * @Author zhaoqifeng + * @Date 2022/5/19 16:55 + */ + private void icVolunteer(String customerId, String userId) { + IcResiUserEntity icUser = icResiUserDao.selectById(userId); + boolean isDyzxh = false; + if (null != icUser) { + //设置wrapper条件 + List volunteerList = icResiUserDao.getVolunteerList(customerId, userId); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcVolunteerPolyEntity::getCustomerId, customerId); + wrapper.eq(IcVolunteerPolyEntity::getIcResiUser, userId); + + LambdaQueryWrapper categoryWrapper = new LambdaQueryWrapper<>(); + categoryWrapper.eq(IcVolunteerPolyCategoryEntity::getCustomerId, customerId); + categoryWrapper.eq(IcVolunteerPolyCategoryEntity::getIdCard, icUser.getIdCard()); + + //判断是否党员中心户 + if (NumConstant.ONE_STR.equals(icUser.getIsParty())) { + LambdaUpdateWrapper memberWrapper = new LambdaUpdateWrapper<>(); + memberWrapper.eq(IcPartyMemberEntity::getIcResiUser, icUser.getId()); + IcPartyMemberEntity memberEntity = icPartyMemberDao.selectOne(memberWrapper); + if (null != memberEntity && NumConstant.ONE_STR.equals(memberEntity.getIsDyzxh())) { + isDyzxh = true; + } + } + //判断是否是志愿者 + if (NumConstant.ONE_STR.equals(icUser.getIsVolunteer())) { + if (CollectionUtils.isNotEmpty(volunteerList)) { + + IcVolunteerPolyEntity volunteer = baseDao.selectOne(wrapper); + IcVolunteerPolyEntity entity = ConvertUtils.sourceToTarget(volunteerList.get(NumConstant.ZERO), IcVolunteerPolyEntity.class); + if (null != volunteer) { + entity.setId(volunteer.getId()); + baseDao.updateById(entity); + } else { + baseDao.insert(entity); + } + List categoryList = new ArrayList<>(Arrays.asList(volunteerList.get(NumConstant.ZERO).getVolunteerCategory().split(StrConstant.COMMA))); + if (isDyzxh) { + categoryList.add("dangyuanzhongxinhu"); + } + List entityList = categoryList.stream().map(o -> { + IcVolunteerPolyCategoryEntity category = new IcVolunteerPolyCategoryEntity(); + category.setCustomerId(entity.getCustomerId()); + category.setIdCard(entity.getIdCard()); + category.setVolunteerCategory(o); + return category; + }).collect(Collectors.toList()); + icVolunteerPolyCategoryDao.delete(categoryWrapper); + icVolunteerPolyCategoryService.insertBatch(entityList); + } + //小程序端设为志愿者 + //根据身份证获取小程序端居民信息 + LambdaQueryWrapper baseInfoWrapper = new LambdaQueryWrapper<>(); + baseInfoWrapper.eq(UserBaseInfoEntity::getCustomerId, customerId); + baseInfoWrapper.eq(UserBaseInfoEntity::getIdNum, icUser.getIdCard()); + List baseInfoList = userBaseInfoDao.selectList(baseInfoWrapper); + if (CollectionUtils.isNotEmpty(baseInfoList)) { + baseInfoList.forEach(baseInfo -> { + ResiVolunteerAuthenticateFormDTO formDTO = new ResiVolunteerAuthenticateFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setUserId(baseInfo.getUserId()); + formDTO.setGridId(icUser.getGridId()); + epmetHeartOpenFeignClient.addVolunteer(formDTO); + }); + } + } else { + if (!isDyzxh) { + //删除志愿者信息 + baseDao.delete(wrapper); + icVolunteerPolyCategoryDao.delete(categoryWrapper); + } else { + IcVolunteerPolyEntity volunteer = baseDao.selectOne(wrapper); + IcVolunteerPolyEntity entity = ConvertUtils.sourceToTarget(volunteerList.get(NumConstant.ZERO), IcVolunteerPolyEntity.class); + if (null != volunteer) { + entity.setId(volunteer.getId()); + baseDao.updateById(entity); + } else { + baseDao.insert(entity); + } + + IcVolunteerPolyCategoryEntity category = new IcVolunteerPolyCategoryEntity(); + category.setCustomerId(entity.getCustomerId()); + category.setIdCard(entity.getIdCard()); + category.setVolunteerCategory("dangyuanzhongxinhu"); + icVolunteerPolyCategoryDao.delete(categoryWrapper); + icVolunteerPolyCategoryService.insert(category); + } + } + } + } + + /** + * 居民端小程序志愿者变动 + * + * @Param customerId + * @Param userId + * @Return + * @Author zhaoqifeng + * @Date 2022/5/19 16:55 + */ + private void appVolunteer(String customerId, String userId) { + ResiUserBaseInfoResultDTO user = userBaseInfoDao.selecUserBaseInfoByUserId(userId); + if (null != user) { + //获取志愿者信息 + Result volunteerResult = epmetHeartOpenFeignClient.queryUserVolunteerInfo(userId); + if (!volunteerResult.success()) { + log.error("志愿者变更-获取小程序志愿者失败"); + } + + //判断是否是志愿者 + if (null != volunteerResult.getData()) { + VolunteerInfoDTO appVolunteer = volunteerResult.getData(); + //设置wrapper条件 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcVolunteerPolyEntity::getCustomerId, customerId); + wrapper.eq(IcVolunteerPolyEntity::getUserId, userId); + + LambdaQueryWrapper categoryWrapper = new LambdaQueryWrapper<>(); + categoryWrapper.eq(IcVolunteerPolyCategoryEntity::getCustomerId, customerId); + categoryWrapper.eq(IcVolunteerPolyCategoryEntity::getIdCard, user.getIdNum()); + + IcVolunteerPolyEntity volunteer = baseDao.selectOne(wrapper); + + IcVolunteerPolyEntity entity = new IcVolunteerPolyEntity(); + entity.setUserId(userId); + entity.setCustomerId(customerId); + entity.setAgencyId(appVolunteer.getPid()); + entity.setAgencyPids(appVolunteer.getPids()); + entity.setGender(user.getGender()); + entity.setName(user.getRealName()); + entity.setIdCard(user.getIdNum()); + + //根据身份证判断有没有匹配的居民信息 + LambdaQueryWrapper icUserWrapper = new LambdaQueryWrapper<>(); + icUserWrapper.eq(IcResiUserEntity::getCustomerId, customerId); + icUserWrapper.eq(IcResiUserEntity::getIdCard, user.getIdNum()); + IcResiUserEntity icResiUser = icResiUserDao.selectOne(icUserWrapper); + + + if (null != volunteer && StringUtils.isBlank(volunteer.getIcResiUser())) { + entity.setId(volunteer.getId()); + if (null != icResiUser) { + entity.setIcResiUser(icResiUser.getId()); + if (!NumConstant.ONE_STR.equals(icResiUser.getIsVolunteer())) { + IcResiUserEntity icUserEntity = new IcResiUserEntity(); + icUserEntity.setId(icResiUser.getId()); + icUserEntity.setIsVolunteer(NumConstant.ONE_STR); + icResiUserDao.updateById(icUserEntity); + } + } + baseDao.updateById(entity); + + } else if (null == volunteer) { + if (null != icResiUser) { + entity.setIcResiUser(icResiUser.getId()); + if (!NumConstant.ONE_STR.equals(icResiUser.getIsVolunteer())) { + IcResiUserEntity icUserEntity = new IcResiUserEntity(); + icUserEntity.setId(icResiUser.getId()); + icUserEntity.setIsVolunteer(NumConstant.ONE_STR); + icResiUserDao.updateById(icUserEntity); + } + } + baseDao.insert(entity); + IcVolunteerPolyCategoryEntity category = new IcVolunteerPolyCategoryEntity(); + category.setCustomerId(entity.getCustomerId()); + category.setIdCard(entity.getIdCard()); + category.setVolunteerCategory("qita"); + + icVolunteerPolyCategoryDao.delete(categoryWrapper); + icVolunteerPolyCategoryDao.insert(category); + } + } + } + } + + + private List getUserInfoList(List userIds) { + LambdaQueryWrapper userInfoWrapper = new LambdaQueryWrapper<>(); + userInfoWrapper.in(UserBaseInfoEntity::getUserId, userIds); + return userBaseInfoDao.selectList(userInfoWrapper); + } + + /** + * 【网格党建平面图】饼图 + * + * @param form + * @return com.epmet.dto.result.VolunteerPolyPieResultDTO + * @author LZN + * @date 2022/5/19 17:21 + */ + @Override + public List getStatistics(VolunteerPolyPieFormDTO form) { + + List list = baseDao.getStatistics(form); + Map map = list.stream().collect(Collectors.toMap(VolunteerPolyPieResultDTO::getCode, VolunteerPolyPieResultDTO::getValue)); + + //获取志愿者类别 + IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); + optionsForm.setCustomerId(form.getCustomerId()); + optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); + optionsForm.setColumnName("VOLUNTEER_CATEGORY"); + Result> volunteerMap = operCustomizeOpenFeignClient.getOptionsMap(optionsForm); + + // 排除饼状图分类,怎加其他分类 + Map data = volunteerMap.getData(); + data.remove(CustomizeEnum.LAO_YOU_JV_LE_BU.getCode()); + data.remove(CustomizeEnum.LOU_WEI_HUI.getCode()); + data.remove(CustomizeEnum.WEN_HUA_DUI_WU.getCode()); + data.put(CustomizeEnum.QI_TA.getCode(),CustomizeEnum.QI_TA.getName()); + + List result = Lists.newArrayList(); + data.forEach((key, label) -> { + VolunteerPolyPieResultDTO dto = new VolunteerPolyPieResultDTO(); + dto.setCode(key); + dto.setLabel(label); + dto.setValue(MapUtils.getString(map, key, NumConstant.ZERO_STR)); + result.add(dto); + }); + return result; + } + + /** + * 修改经纬度 + * + * @param form + * @return void + * @author LZN + * @date 2022/5/24 15:08 + */ + @Override + public void updateLonAndLat(LonAndLatFormDTO form) { + baseDao.updateLonAndLat(form); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java new file mode 100644 index 0000000000..eba820dc92 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java @@ -0,0 +1,210 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.*; +import com.epmet.dto.IcHouseDTO; +import com.epmet.dto.UserResiInfoDTO; +import com.epmet.dto.form.EnterGridFormDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; +import com.epmet.dto.form.RegisterAndBindFormDTO; +import com.epmet.dto.result.HomeInfoResultDTO; +import com.epmet.dto.result.HomeUserBriefResultDTO; +import com.epmet.dto.result.ResiUserBaseInfoResultDTO; +import com.epmet.entity.IcResiUserEntity; +import com.epmet.entity.UserBaseInfoEntity; +import com.epmet.entity.UserResiInfoEntity; +import com.epmet.entity.UserResiRegisterVisitEntity; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.compress.utils.Lists; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/31 16:22 + */ +@Service +@Slf4j +public class MyHomeServiceImpl implements MyHomeService { + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcResiUserService icResiUserService; + @Resource + private UserRoleDao userRoleDao; + @Resource + private UserResiInfoService userResiInfoService; + @Resource + private UserResiInfoDao userResiInfoDao; + @Resource + private UserBaseInfoService userBaseInfoService; + @Resource + private UserBaseInfoDao userBaseInfoDao; + @Resource + private IcResiUserDao icResiUserDao; + @Resource + private RegisterRelationService registerRelationService; + @Resource + private UserResiRegisterVisitDao userResiRegisterVisitDao; + + @Override + public List selectListHomeMember(String houseCode, String customerId) { + + Result byHouseCode = govOrgOpenFeignClient.getByHouseCode(houseCode); + + if (byHouseCode.success() && null != byHouseCode.getData()) { + return icResiUserService.listHomeUserBrief(byHouseCode.getData().getId(), customerId); + } + + return Lists.newArrayList(); + } + + /** + * 注册绑定房屋信息 + * + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/6/1 16:33 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void registerAndBind(RegisterAndBindFormDTO formDTO) { + + LambdaQueryWrapper userWrapper = new LambdaQueryWrapper<>(); + userWrapper.eq(IcResiUserEntity::getCustomerId, formDTO.getCustomerId()); + userWrapper.eq(IcResiUserEntity::getIdCard, formDTO.getIdCard()); + IcResiUserEntity icUser = icResiUserDao.selectOne(userWrapper); + + if (null != icUser && !icUser.getHomeId().equals(formDTO.getHomeId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "已绑定其他房屋", "已绑定其他房屋"); + } + + //进入网格(entergrid)流程 + EnterGridFormDTO userInfoParams = new EnterGridFormDTO(); + userInfoParams.setUserId(formDTO.getUserId()); + userInfoParams.setCustomerId(formDTO.getCustomerId()); + userInfoParams.setGridId(formDTO.getGridId()); + registerRelationService.getUserInfoAndRoles(userInfoParams); + + //1.判断是否是居民,如果不是则注册居民,如果是则更新居民信息 + GetRoleKeyListFormDTO getRoleKeyListFormDTO = new GetRoleKeyListFormDTO(); + getRoleKeyListFormDTO.setUserId(formDTO.getUserId()); + getRoleKeyListFormDTO.setGridId(formDTO.getGridId()); + List roleList = userRoleDao.selectUserRoleKeyList(getRoleKeyListFormDTO); + + if (CollectionUtils.isNotEmpty(roleList) && roleList.contains("registered_resi")) { + //更新user_resi_info和user_base_info的信息 + UserResiInfoEntity userResiInfo = new UserResiInfoEntity(); + userResiInfo.setUserId(formDTO.getUserId()); + userResiInfo.setSurname(formDTO.getSurname()); + userResiInfo.setName(formDTO.getName()); + userResiInfo.setIdNum(formDTO.getIdCard()); + userResiInfo.setRegMobile(formDTO.getMobile()); + userResiInfo.setResiVisitId(formDTO.getVisitId()); + userResiInfo.setStreet(formDTO.getAddress()); + + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(UserResiInfoEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(UserResiInfoEntity::getUserId, formDTO.getUserId()); + userResiInfoDao.update(userResiInfo, wrapper); + + UserBaseInfoEntity userBaseInfoEntity = ConvertUtils.sourceToTarget(userResiInfo, UserBaseInfoEntity.class); + userBaseInfoService.insertOrUpdate(userBaseInfoEntity); + } else { + //visit表添加数据 + UserResiRegisterVisitEntity visit = new UserResiRegisterVisitEntity(); + visit.setCustomerId(formDTO.getCustomerId()); + visit.setGridId(formDTO.getGridId()); + visit.setUserId(formDTO.getUserId()); + visit.setVisitFrom("register_and_bind"); + visit.setLastOperateVisit("success"); + visit.setVisitTime(new Date()); + userResiRegisterVisitDao.insert(visit); + //注册居民 + UserResiInfoDTO userResiInfoDTO = ConvertUtils.sourceToTarget(formDTO, UserResiInfoDTO.class); + userResiInfoDTO.setUserId(formDTO.getUserId()); + userResiInfoDTO.setIdNum(formDTO.getIdCard()); + userResiInfoDTO.setRegMobile(formDTO.getMobile()); + userResiInfoDTO.setResiVisitId(visit.getId()); + userResiInfoDTO.setStreet(formDTO.getAddress()); + userResiInfoDTO.setCustomerId(formDTO.getCustomerId()); + userResiInfoDTO.setApp("resi"); + userResiInfoService.saveResiInfo(userResiInfoDTO); + } + //2.添加ic_resi_user信息 + HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(formDTO.getCustomerId(), formDTO.getHomeId()); + if (null == houseInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败"); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(houseInfo.getAgencyId()); + if (null == agencyInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息失败", "获取组织信息失败"); + } + IcResiUserEntity icUserEntity = ConvertUtils.sourceToTarget(formDTO, IcResiUserEntity.class); + icUserEntity.setName(formDTO.getSurname() + formDTO.getName()); + icUserEntity.setAgencyId(houseInfo.getAgencyId()); + icUserEntity.setPids(agencyInfo.getPids()); + if (null != icUser) { + icUserEntity.setId(icUser.getId()); + icResiUserDao.updateById(icUserEntity); + } else { + icResiUserDao.insert(icUserEntity); + } + } + + /** + * 获取用户绑定的房屋信息 + * + * @param tokenDto + * @Param tokenDto + * @Return {@link HomeInfoResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/1 16:52 + */ + @Override + public HomeInfoResultDTO getHomeInfo(TokenDto tokenDto) { + HomeInfoResultDTO resultDto = new HomeInfoResultDTO(); + ResiUserBaseInfoResultDTO baseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(tokenDto.getUserId()); + if (null == baseInfo) { + return resultDto; + } + + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getCustomerId, tokenDto.getCustomerId()); + wrapper.eq(IcResiUserEntity::getIdCard, baseInfo.getIdNum()); + IcResiUserEntity icUser = icResiUserDao.selectOne(wrapper); + + if (null == icUser) { + return resultDto; + } + resultDto.setIcResiUserId(icUser.getId()); + HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(tokenDto.getCustomerId(), icUser.getHomeId()); + if (null == houseInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败"); + } + resultDto.setHouseName(houseInfo.getAllName()); + resultDto.setHouseCode(houseInfo.getHouseCode()); + resultDto.setQrCodeUrl(houseInfo.getHouseQrcodeUrl()); + return resultDto; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index ee80c0809d..a0012e8a45 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -42,10 +42,7 @@ import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserResiRegisterVisitDTO; import com.epmet.dto.UserRoleDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.IssueInitiatorResultDTO; -import com.epmet.dto.result.SendVerificationCodeResultDTO; -import com.epmet.dto.result.UserBaseInfoResultDTO; -import com.epmet.dto.result.UserResiInfoResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.UserBaseInfoEntity; import com.epmet.entity.UserResiInfoEntity; import com.epmet.entity.UserResiRegisterVisitEntity; @@ -57,6 +54,7 @@ import com.epmet.resi.group.dto.topic.form.SharableTopicAndInviteeFormDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.*; import com.epmet.util.ModuleConstant; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -499,8 +497,37 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl getStaffAndResi(List userIds) { + if (CollectionUtils.isEmpty(userIds)){ + return new ArrayList<>(); + } + return baseDao.getStaffAndResi(userIds); + } + + + /** * 自动认证居民:志愿者注册,自动认证居民 * * @param userResiInfoDTO diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java index 12380e64c2..017e6e53b0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java @@ -158,8 +158,8 @@ public class UserServiceImpl extends BaseServiceImpl implem userWechatDao.updateByUserId(userWechatDTO); UserBaseInfoEntity baseInfo = new UserBaseInfoEntity(); - //UserBaseInfoResultDTO cache = userBaseInfoRedis.get(wxUserInfoFormDTO.getUserId()); - // 以下这段注释于21.12.22,只更新微信相关信息就可以 + //UserBaseInfoResultDTO cache = userBaseInfoRedis.get(wxUserInfoFormDTO.getUserId()); + // 以下这段注释于21.12.22,只更新微信相关信息就可以 /* UserResiInfoDTO resiInfo = userResiInfoDao.selectByUserId(wxUserInfoFormDTO.getUserId()); if(null != resiInfo && StringUtils.isNotBlank((resiInfo.getId()))) { baseInfo.setSurname(resiInfo.getSurname()); @@ -171,7 +171,6 @@ public class UserServiceImpl extends BaseServiceImpl implem }*/ - baseInfo.setUserId(wxUserInfoFormDTO.getUserId()); baseInfo.setNickname(wxUserInfoFormDTO.getNickName()); baseInfo.setHeadImgUrl(wxUserInfoFormDTO.getAvatarUrl()); @@ -181,7 +180,6 @@ public class UserServiceImpl extends BaseServiceImpl implem } /** - * * @Description 查询用户注册时间 * @param: formDTO * @Author zxc @@ -195,30 +193,37 @@ public class UserServiceImpl extends BaseServiceImpl implem } /** - * @Description 居民端获取个人信息 * @param myResiUserInfoFormDTO - * @return MyResiUserInfoResultDTO + * @return MyResiUserInfoResultDTO + * @Description 居民端获取个人信息 * @author wangc * @date 2020.05.22 19:24 **/ @Override public MyResiUserInfoResultDTO resiMyselfMsg(MyResiUserInfoFormDTO myResiUserInfoFormDTO) { - MyselfMsgResultDTO myselfMsg = baseDao.getMyselfMsg(myResiUserInfoFormDTO.getUserId()); - if(null != myselfMsg){ - MyResiUserInfoResultDTO result = ConvertUtils.sourceToTarget(myselfMsg,MyResiUserInfoResultDTO.class); + MyselfMsgResultDTO myselfMsg = baseDao.getMyselfMsg(myResiUserInfoFormDTO.getUserId()); + Result volun = epmetHeartOpenFeignClient.queryUserVolunteerInfo(myResiUserInfoFormDTO.getUserId()); + if (volun.success() && null != volun.getData()) { + myselfMsg.setVolunteerFlag("1");//志愿者 + } else { + myselfMsg.setVolunteerFlag("0"); + } + + if (null != myselfMsg) { + MyResiUserInfoResultDTO result = ConvertUtils.sourceToTarget(myselfMsg, MyResiUserInfoResultDTO.class); //registerFlag 是否已注册居民,true ,false result.setRegisterFlag(StringUtils.isNotBlank(myselfMsg.getResiId())); // 已录入身份证号:true;未完善:false. result.setCompleteIdNum(StringUtils.isNotBlank(myselfMsg.getIdNum())); result.setRegisterGridName(ModuleConstant.EMPTY_STR); - if(StringUtils.isNotBlank(myselfMsg.getGridId())){ + if (StringUtils.isNotBlank(myselfMsg.getGridId())) { //registerGridName 当前在哪个网格,显示哪个网格的名称 CustomerGridFormDTO gridId = new CustomerGridFormDTO(); gridId.setGridId(myResiUserInfoFormDTO.getGridId()); Result gridResult = govOrgFeignClient.getCustomerGridByGridId(gridId); - if(gridResult.success() && null != gridResult.getData() && null != gridResult.getData().getGridName()){ + if (gridResult.success() && null != gridResult.getData() && null != gridResult.getData().getGridName()) { result.setRegisterGridName(gridResult.getData().getGridName()); - }else { + } else { if (StringUtils.isNotBlank(gridResult.getMsg())) { log.warn(gridResult.getMsg()); } @@ -235,7 +240,7 @@ public class UserServiceImpl extends BaseServiceImpl implem CommonUserFormDTO pointParam = new CommonUserFormDTO(); pointParam.setCustomerId(myResiUserInfoFormDTO.getCustomerId()); Result pointResult = epmetPointOpenFeignClient.myPoint(pointParam); - if(pointResult.success() && null != pointResult.getData()){ + if (pointResult.success() && null != pointResult.getData()) { //累计积分 result.setPoint(pointResult.getData().getUsablePoint()); //今日已获得积分,用于积分任务列表显示 @@ -314,7 +319,7 @@ public class UserServiceImpl extends BaseServiceImpl implem } /** - * @Description 新增或更新用户信息 + * @Description 新增或更新用户信息 * @Param formDTO * @author zxc * @date 2021/1/19 上午10:35 @@ -323,7 +328,7 @@ public class UserServiceImpl extends BaseServiceImpl implem public UserDTO saveUserInfo(UserInfoFormDTO formDTO) { UserDTO result = new UserDTO(); UserDTO userDTO = userWechatDao.selectUserDTOByUid(formDTO.getUid(), formDTO.getApp()); - if (null == userDTO){ + if (null == userDTO) { // 用户不存在 //user表新增 UserEntity userEntity = new UserEntity(); @@ -346,7 +351,7 @@ public class UserServiceImpl extends BaseServiceImpl implem throw new RenException(UserConstant.SAVE_USER_WECHAT); } result.setId(userEntity.getId()); - }else { + } else { // 用户已存在 formDTO.setUserId(userDTO.getId()); if (userWechatDao.editByUserId(formDTO) < NumConstant.ONE) { @@ -392,11 +397,11 @@ public class UserServiceImpl extends BaseServiceImpl implem } ResiUserResDTO resiUserResDTO = ConvertUtils.sourceToTarget(formDTO, ResiUserResDTO.class); if (StringUtils.isNotBlank(formDTO.getIdNum())) { - List userBaseInfoList = userBaseInfoService.getCommonIdNumUser(formDTO.getCustomerId(),formDTO.getIdNum()); + List userBaseInfoList = userBaseInfoService.getCommonIdNumUser(formDTO.getCustomerId(), formDTO.getIdNum()); if (CollectionUtils.isEmpty(userBaseInfoList)) { log.info("user_base_info没有找到,去查下user_resi_info表吧"); - List userResiInfoDTO = userResiInfoDao.selectCommonIdNumUser(formDTO.getCustomerId(),formDTO.getIdNum()); - resiUserResDTO.setEpmetUserIdList(CollectionUtils.isNotEmpty(userResiInfoDTO) ? userResiInfoDTO.stream().map(UserResiInfoDTO::getUserId).collect(Collectors.toList()): new ArrayList<>()); + List userResiInfoDTO = userResiInfoDao.selectCommonIdNumUser(formDTO.getCustomerId(), formDTO.getIdNum()); + resiUserResDTO.setEpmetUserIdList(CollectionUtils.isNotEmpty(userResiInfoDTO) ? userResiInfoDTO.stream().map(UserResiInfoDTO::getUserId).collect(Collectors.toList()) : new ArrayList<>()); } else { resiUserResDTO.setEpmetUserIdList(userBaseInfoList.stream().map(UserBaseInfoDTO::getUserId).collect(Collectors.toList())); } @@ -412,20 +417,20 @@ public class UserServiceImpl extends BaseServiceImpl implem */ @Override public EpmetUserFamilyDTO findIcUser(FindIcUserFormDTO findIcUserFormDTO) { - EpmetUserFamilyDTO result=new EpmetUserFamilyDTO(); - String idNum=baseDao.selectIdNum(findIcUserFormDTO.getCustomerId(),findIcUserFormDTO.getEpmetUserId()); - if(StringUtils.isNotBlank(idNum)){ + EpmetUserFamilyDTO result = new EpmetUserFamilyDTO(); + String idNum = baseDao.selectIdNum(findIcUserFormDTO.getCustomerId(), findIcUserFormDTO.getEpmetUserId()); + if (StringUtils.isNotBlank(idNum)) { //同客户下,相同身份证号的,epmetuser - List epmetUserIdList=baseDao.selectCommonEpmetUser(idNum,findIcUserFormDTO.getCustomerId()); + List epmetUserIdList = baseDao.selectCommonEpmetUser(idNum, findIcUserFormDTO.getCustomerId()); result.setEpmetUserIdList(epmetUserIdList); //找到该身份证号的居民 - IcResiUserDTO icResiUserDTO=icResiUserService.getByIdCard(findIcUserFormDTO.getCustomerId(),idNum,null); - if(null!=icResiUserDTO){ + IcResiUserDTO icResiUserDTO = icResiUserService.getByIdCard(findIcUserFormDTO.getCustomerId(), idNum, null); + if (null != icResiUserDTO) { result.setIcResiUserId(icResiUserDTO.getId()); result.setIcUserName(icResiUserDTO.getName()); result.setHouseId(icResiUserDTO.getHomeId()); - IcResiUserBriefDTO icResiUserBriefDTO=icResiUserService.findFamilyMem(icResiUserDTO.getId()); - result.setHouseUserList(null!=icResiUserBriefDTO&&CollectionUtils.isNotEmpty(icResiUserBriefDTO.getHouseUserList())?icResiUserBriefDTO.getHouseUserList():new ArrayList<>()); + IcResiUserBriefDTO icResiUserBriefDTO = icResiUserService.findFamilyMem(icResiUserDTO.getId()); + result.setHouseUserList(null != icResiUserBriefDTO && CollectionUtils.isNotEmpty(icResiUserBriefDTO.getHouseUserList()) ? icResiUserBriefDTO.getHouseUserList() : new ArrayList<>()); } } result.setEpmetUserIdList(Arrays.asList(findIcUserFormDTO.getEpmetUserId())); @@ -440,27 +445,27 @@ public class UserServiceImpl extends BaseServiceImpl implem @Transactional(rollbackFor = Exception.class) @Override public void modifyRegGrid(ModifyRegGridFormDTO formDTO) { - GridInfoCache newGridInfo= CustomerOrgRedis.getGridInfo(formDTO.getGridId()); - RegisterRelationEntity originReg=registerRelationDao.selectRegisteredGridIdByUserIdAndCustomerId(formDTO.getUserId(),formDTO.getCustomerId()); + GridInfoCache newGridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); + RegisterRelationEntity originReg = registerRelationDao.selectRegisteredGridIdByUserIdAndCustomerId(formDTO.getUserId(), formDTO.getCustomerId()); if (null == newGridInfo || null == originReg) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "居民端_修改注册网格:查询网格信息异常", "服务器开小差了..."); } //修改register_relation表 - LambdaQueryWrapper originWrapper=new LambdaQueryWrapper(); - originWrapper.eq(RegisterRelationEntity::getCustomerId,formDTO.getCustomerId()) - .eq(RegisterRelationEntity::getUserId,formDTO.getUserId()) + LambdaQueryWrapper originWrapper = new LambdaQueryWrapper(); + originWrapper.eq(RegisterRelationEntity::getCustomerId, formDTO.getCustomerId()) + .eq(RegisterRelationEntity::getUserId, formDTO.getUserId()) .eq(RegisterRelationEntity::getFirstRegister, NumConstant.ONE_STR); //1、删除废弃网格的(现在生产存在同一个用户相同的网格id多条记录,所以用delete方法) registerRelationDao.delete(originWrapper); //2、删除用户与当前选择的网格的关系,新插入一条注册关系, - LambdaQueryWrapper deleteWrapper=new LambdaQueryWrapper(); - deleteWrapper.eq(RegisterRelationEntity::getCustomerId,formDTO.getCustomerId()) - .eq(RegisterRelationEntity::getUserId,formDTO.getUserId()) + LambdaQueryWrapper deleteWrapper = new LambdaQueryWrapper(); + deleteWrapper.eq(RegisterRelationEntity::getCustomerId, formDTO.getCustomerId()) + .eq(RegisterRelationEntity::getUserId, formDTO.getUserId()) .eq(RegisterRelationEntity::getGridId, formDTO.getGridId()); registerRelationDao.delete(deleteWrapper); - RegisterRelationEntity insert=new RegisterRelationEntity(); + RegisterRelationEntity insert = new RegisterRelationEntity(); insert.setCustomerId(formDTO.getCustomerId()); insert.setGridId(formDTO.getGridId()); insert.setUserId(formDTO.getUserId()); @@ -470,29 +475,30 @@ public class UserServiceImpl extends BaseServiceImpl implem registerRelationDao.insert(insert); //2、修改历史徽章表 - LambdaUpdateWrapper recUpdate=new LambdaUpdateWrapper<>(); - recUpdate.set(UserBadgeCertificateRecordEntity::getGridId,newGridInfo.getId()) - .set(UserBadgeCertificateRecordEntity::getUpdatedBy,formDTO.getUserId()) - .set(UserBadgeCertificateRecordEntity::getUpdatedTime,new Date()); - recUpdate.eq(UserBadgeCertificateRecordEntity::getCustomerId,formDTO.getCustomerId()) - .eq(UserBadgeCertificateRecordEntity::getUserId,formDTO.getUserId()); - userBadgeCertificateRecordDao.update(null,recUpdate); - - LambdaUpdateWrapper badgeUpdate=new LambdaUpdateWrapper<>(); - badgeUpdate.set(ResiUserBadgeEntity::getGridId,newGridInfo.getId()) - .set(ResiUserBadgeEntity::getUpdatedBy,formDTO.getUserId()) - .set(ResiUserBadgeEntity::getUpdatedTime,new Date());; - badgeUpdate.eq(ResiUserBadgeEntity::getCustomerId,formDTO.getCustomerId()) - .eq(ResiUserBadgeEntity::getUserId,formDTO.getUserId()); - resiUserBadgeDao.update(null,badgeUpdate); + LambdaUpdateWrapper recUpdate = new LambdaUpdateWrapper<>(); + recUpdate.set(UserBadgeCertificateRecordEntity::getGridId, newGridInfo.getId()) + .set(UserBadgeCertificateRecordEntity::getUpdatedBy, formDTO.getUserId()) + .set(UserBadgeCertificateRecordEntity::getUpdatedTime, new Date()); + recUpdate.eq(UserBadgeCertificateRecordEntity::getCustomerId, formDTO.getCustomerId()) + .eq(UserBadgeCertificateRecordEntity::getUserId, formDTO.getUserId()); + userBadgeCertificateRecordDao.update(null, recUpdate); + + LambdaUpdateWrapper badgeUpdate = new LambdaUpdateWrapper<>(); + badgeUpdate.set(ResiUserBadgeEntity::getGridId, newGridInfo.getId()) + .set(ResiUserBadgeEntity::getUpdatedBy, formDTO.getUserId()) + .set(ResiUserBadgeEntity::getUpdatedTime, new Date()); + ; + badgeUpdate.eq(ResiUserBadgeEntity::getCustomerId, formDTO.getCustomerId()) + .eq(ResiUserBadgeEntity::getUserId, formDTO.getUserId()); + resiUserBadgeDao.update(null, badgeUpdate); //3、修改支援者信息表 - modifyVolunteerGrid(formDTO,newGridInfo); + modifyVolunteerGrid(formDTO, newGridInfo); //4、删除用户缓存信息 userBaseInfoRedis.clearUserCache(Arrays.asList(formDTO.getUserId())); //5、插入用户注册网格变更记录 - UserRegGridChangeRecEntity log=new UserRegGridChangeRecEntity(); + UserRegGridChangeRecEntity log = new UserRegGridChangeRecEntity(); log.setCustomerId(formDTO.getCustomerId()); log.setUserId(formDTO.getUserId()); log.setOriginGridId(originReg.getGridId()); @@ -501,14 +507,14 @@ public class UserServiceImpl extends BaseServiceImpl implem } private void modifyVolunteerGrid(ModifyRegGridFormDTO formDTO, GridInfoCache newGridInfo) { - VolunteerInfoDTO volunteerInfoDTO=new VolunteerInfoDTO(); + VolunteerInfoDTO volunteerInfoDTO = new VolunteerInfoDTO(); volunteerInfoDTO.setCustomerId(formDTO.getCustomerId()); volunteerInfoDTO.setUserId(formDTO.getUserId()); volunteerInfoDTO.setGridId(newGridInfo.getId()); volunteerInfoDTO.setPid(newGridInfo.getPid()); volunteerInfoDTO.setPids(newGridInfo.getPids()); volunteerInfoDTO.setGridName(newGridInfo.getGridName()); - Result volunteerRes=epmetHeartOpenFeignClient.modifyVolunteerGrid(volunteerInfoDTO); + Result volunteerRes = epmetHeartOpenFeignClient.modifyVolunteerGrid(volunteerInfoDTO); if (!volunteerRes.success()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "居民端_修改注册网格:修改用户志愿者信息异常", "服务器开小差了..."); } diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.50__ic_volunteer.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.50__ic_volunteer.sql new file mode 100644 index 0000000000..621c0c6f63 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.50__ic_volunteer.sql @@ -0,0 +1,41 @@ +CREATE TABLE `ic_volunteer_poly` +( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', + `USER_ID` varchar(64) DEFAULT NULL COMMENT '居民端用户id', + `IC_RESI_USER` varchar(64) DEFAULT NULL COMMENT '对应的ic_resi_user主表Id', + `AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '行政组织 机关ID', + `AGENCY_PIDS` varchar(255) DEFAULT NULL COMMENT '行政组织 机关ID', + `NAME` varchar(32) NOT NULL COMMENT '居住成员1姓名', + `ID_CARD` varchar(18) NOT NULL COMMENT '身份证号', + `MOBILE` varchar(15) DEFAULT NULL COMMENT '手机号', + `GENDER` char(2) DEFAULT NULL COMMENT '性别', + `LONGITUDE` varchar(64) DEFAULT NULL COMMENT '经度', + `LATITUDE` varchar(64) DEFAULT NULL COMMENT '纬度', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='志愿者信息聚合'; + +CREATE TABLE `ic_volunteer_poly_category` +( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', + `ID_CARD` varchar(18) NOT NULL COMMENT '身份证号', + `VOLUNTEER_CATEGORY` varchar(256) DEFAULT NULL COMMENT '类别【字典表】', + `LONGITUDE` varchar(64) DEFAULT NULL COMMENT '经度', + `LATITUDE` varchar(64) DEFAULT NULL COMMENT '纬度', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='志愿者信息聚合,志愿者类别表'; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.51__ic_volunteer_poly_category.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.51__ic_volunteer_poly_category.sql new file mode 100644 index 0000000000..6a1b477d64 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.51__ic_volunteer_poly_category.sql @@ -0,0 +1,3 @@ +ALTER TABLE `epmet_user`.`ic_volunteer_poly_category` +DROP COLUMN `LONGITUDE`, +DROP COLUMN `LATITUDE`; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.52__ic_resi_user_confirm.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.52__ic_resi_user_confirm.sql new file mode 100644 index 0000000000..5be9280308 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.52__ic_resi_user_confirm.sql @@ -0,0 +1,39 @@ +CREATE TABLE `ic_resi_user_confirm` +( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织Id', + `PIDS` varchar(255) NOT NULL COMMENT '组织的pids', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `SURNAME` varchar(64) COMMENT '姓', + `NAME` varchar(64) COMMENT '名', + `MOBILE` varchar(15) DEFAULT NULL COMMENT '手机号', + `GENDER` char(2) DEFAULT NULL COMMENT '性别', + `ID_CARD` varchar(18) NOT NULL COMMENT '身份证号', + `BIRTHDAY` varchar(64) DEFAULT NULL COMMENT '出生日期', + `HJSZD` varchar(256) DEFAULT NULL COMMENT '户籍所在地', + `HJSZD_CODE` varchar(256) DEFAULT NULL COMMENT '户籍所在地地区码', + `HJSZD_PATH_CODE` varchar(255) DEFAULT NULL COMMENT '户籍所在地层级编码', + `XJZD` varchar(256) DEFAULT NULL COMMENT '现居住地', + `XJZD_CODE` varchar(256) DEFAULT NULL COMMENT '现居住地地区码', + `XJZD_PATH_CODE` varchar(255) DEFAULT NULL COMMENT '现居住地层级编码', + `XXDZ` varchar(255) DEFAULT NULL COMMENT '详细地址', + `MZ` varchar(64) DEFAULT NULL COMMENT '民族【字典表】', + `MZ_NAME` varchar(255) DEFAULT NULL COMMENT '名族名称', + `YHZGX` varchar(64) DEFAULT NULL COMMENT '与户主关系', + `YHZGX_NAME` varchar(255) DEFAULT NULL COMMENT '与户主关系名称', + `CONFIRM_RESULT` varchar(64) DEFAULT '0' COMMENT '审核状态0未审核,1审核通过,2审核不通过', + `REASON` varchar(64) DEFAULT NULL COMMENT '审核不通过的原因', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `IC_RESI_USER_ID` varchar(64) DEFAULT NULL COMMENT 'ic_resi_user表id', + `SUBMIT_TYPE` varchar(255) DEFAULT NULL COMMENT '操作类型:新增add 修改 update 删除 delete', + `DELETE_REASON` varchar(255) DEFAULT NULL COMMENT '删除原因', + `OPERATION_DESCRIBE` varchar(255) DEFAULT NULL COMMENT '操作说明', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='居民信息审核表'; diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeDeathDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeDeathDao.xml index 79711680bc..8e14dc15c9 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeDeathDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeDeathDao.xml @@ -26,31 +26,34 @@ SELECT - r.* + r.id, + u.`NAME`, + r.ID_CARD, + u.GENDER, + r.age, + u.MOBILE, + r.PID, + r.AGENCY_ID, + r.AGENCY_NAME, + r.VILLAGE_ID, + r.VILLAGE_NAME, + r.BUILD_ID, + r.BUILD_NAME, + r.UNIT_ID, + r.UNIT_NAME, + r.HOME_ID, + r.HOME_NAME, + r.ADDRESS, + r.TYPE, + r.OWNER_NAME, + r.OLD_DEPT, + r.OLD_ADDRESS, + r.OLD_HOME, + r.REASON, + r.CREATED_TIME, + r.UPDATED_TIME, + r.OUT_OF_TIME, + r.IC_USER_ID FROM - pli_change_relocation r - LEFT JOIN pli_change_welfare w ON r.ID_CARD = w.ID_CARD - AND w.DEL_FLAG = '0' + pli_change_relocation r + LEFT JOIN ic_resi_user u ON u.ID_CARD = r.ID_CARD + LEFT JOIN pli_change_welfare w ON r.ID_CARD = w.ID_CARD + AND w.DEL_FLAG = '0' WHERE - r.DEL_FLAG = '0' + r.DEL_FLAG = '0' AND r.CUSTOMER_ID = #{customerId} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeWelfareDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeWelfareDao.xml index 423c38d57e..e10a64a0ce 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeWelfareDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeWelfareDao.xml @@ -24,11 +24,58 @@ + + + + update pli_change_welfare set REMOVE_DATE=#{removeDate}, diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcPartyMemberDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcPartyMemberDao.xml new file mode 100644 index 0000000000..3dbbb08b3d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcPartyMemberDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserConfirmDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserConfirmDao.xml new file mode 100644 index 0000000000..4c46257dc1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserConfirmDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 9010d5f559..4187fa45ca 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 @@ -55,6 +55,14 @@ ) + + DELETE + FROM + ${tableName} + WHERE + ic_resi_user = #{resiUserId} + + UPDATE ${tableName} SET @@ -399,7 +407,9 @@ id, `name`, id_card, - mobile + mobile, + agency_id, + grid_id FROM ic_resi_user WHERE @@ -427,7 +437,9 @@ ic_resi_user ir WHERE ir.DEL_FLAG = '0' - AND ir.AGENCY_ID = #{agencyId} + + AND ir.AGENCY_ID = #{agencyId} + AND ir.GRID_ID = #{gridId} @@ -482,7 +494,9 @@ + + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerDao.xml new file mode 100644 index 0000000000..5e1de8852a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyCategoryDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyCategoryDao.xml new file mode 100644 index 0000000000..0e22f4e976 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyCategoryDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml new file mode 100644 index 0000000000..e8bec0b3b8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE ic_volunteer_poly p + SET p.LONGITUDE = #{form.longitude}, + p.LATITUDE = #{form.latitude}, + p.UPDATED_TIME = NOW() + WHERE + p.USER_ID = #{form.userId} + AND p.customer_id = #{form.customerId} + + + + + + delete from ic_volunteer_poly where CUSTOMER_ID = #{customerId} + + + delete from ic_volunteer_poly_category where CUSTOMER_ID = #{customerId} + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml index df1d830567..d308058d06 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml @@ -231,4 +231,38 @@ and uri.customer_id=#{customerId} AND uri.id_num = #{idNum} + + +