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/db/migration/V0.0.19__add_dict.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.19__add_dict.sql new file mode 100644 index 0000000000..70705df799 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.19__add_dict.sql @@ -0,0 +1,11 @@ +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 ('1000000000000000014', 'ic_service_type', '服务类别', '', '20', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16: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 ('3100000000000000000', '1000000000000000014', '社区养老', '00', '0', '', '0', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16: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 ('3100000000000000001', '1000000000000000014', '社会保障', '01', '0', '', '1', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16: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 ('3100000000000000002', '1000000000000000014', '社区救助', '02', '0', '', '2', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16: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 ('3100000000000000003', '1000000000000000014', '健康医疗', '03', '0', '', '3', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16: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 ('3100000000000000004', '1000000000000000014', '社区安全', '04', '0', '', '4', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16: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 ('3100000000000000005', '1000000000000000014', '社区卫生', '05', '0', '', '5', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16: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 ('3100000000000000006', '1000000000000000014', '社区环境', '06', '0', '', '6', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16: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 ('3100000000000000007', '1000000000000000014', '社区治安', '07', '0', '', '7', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16: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 ('3100000000000000008', '1000000000000000014', '社区文化', '08', '0', '', '8', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); 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-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..6c8f4271ce 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,9 @@ 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), + IC_SERVICE_TYPE("ic_service_type","服务类别",20), ; 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/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..425417c7d5 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,7 +255,10 @@ public enum EpmetErrorCode { IC_NAT(8924,"平台已存在记录,请去修改原有记录"), RESI_IC_NAT(8925,"已存在记录,请联系社区工作人员修改"), IC_MOVE_IN(8926,"居民信息中房屋信息与当前选择房屋不一致,是否更新?"), + NOT_REGEIST_RESI(8927,"未注册居民"), + UNIT_EXIST_HOUSES_ERROR(8928,"单元下存在房屋,不可修改单元数"), + MISMATCH(10086,"人员与房屋信息不匹配,请与工作人员联系。"), //通用错误码 start //通用的 错误消息自己定义返回 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 05e5c200a4..89e8a70ab3 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); } /** @@ -649,7 +649,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); } /** @@ -671,7 +671,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); } /** @@ -682,7 +682,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); } /** @@ -693,7 +693,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); } /** @@ -704,7 +704,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); } /** @@ -715,7 +715,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); } /** @@ -726,7 +726,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); } /** @@ -737,15 +737,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); } /** @@ -753,7 +753,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/bean/HouseInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java index 4c6551b881..075a954290 100644 --- 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 @@ -89,4 +89,21 @@ public class HouseInfoCache implements Serializable { * 组织的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-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillRowMergeStrategy.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillRowMergeStrategy.java new file mode 100644 index 0000000000..069898c31d --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillRowMergeStrategy.java @@ -0,0 +1,162 @@ +package com.epmet.commons.tools.utils.poi.excel.handler; + +import com.alibaba.excel.write.handler.RowWriteHandler; +import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; +import com.alibaba.excel.write.metadata.holder.WriteTableHolder; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTMergeCell; +import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTMergeCells; +import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet; + +import java.lang.reflect.Field; + +/** + * desc:按行对单元格合并策略 依据是第一列的值 + * + * @author liujianjun + */ +@Slf4j +public class ExcelFillRowMergeStrategy implements RowWriteHandler { + + /** + * 分段总数据量 本批次写入的数据总量 + */ + private Integer secTotalCount; + + /** + * 需要合并的列 下标 + */ + private int[] mergeColumnIndexArr; + + /** + * 默认隐藏第一列 用于合并数据 + */ + private boolean hiddenFirst = true; + + //已合并单元格数 + private int mergedTotalCount = 0; + + //合并行计数 + private int count; + + + + public ExcelFillRowMergeStrategy(int[] mergeColumnIndexArr) { + this.mergeColumnIndexArr = mergeColumnIndexArr; + } + + public ExcelFillRowMergeStrategy(int[] mergeColumnIndexArr, boolean hiddenFirst) { + this.mergeColumnIndexArr = mergeColumnIndexArr; + this.hiddenFirst = hiddenFirst; + } + + @Override + public void beforeRowCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Integer rowIndex, Integer relativeRowIndex, Boolean isHead) { + + } + + @Override + public void afterRowCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) { + // 隐藏id列 + if (hiddenFirst) { + writeSheetHolder.getSheet().setColumnHidden(0, true); + } + } + + + @Override + public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) { + //当前行索引 + int curRowNum = row.getRowNum(); + if (mergeColumnIndexArr != null && mergeColumnIndexArr.length > 0 && !isHead) { + //当前行第一列单元格 + Cell curA1Cell = row.getCell(0); + Object curA1Data = curA1Cell.getCellType() == CellType.STRING ? curA1Cell.getStringCellValue() : curA1Cell.getNumericCellValue(); + //上一行第一列单元格 + Cell preA1Cell = row.getSheet().getRow(curRowNum - 1).getCell(0); + Object preA1Data = preA1Cell.getCellType() == CellType.STRING ? preA1Cell.getStringCellValue() : preA1Cell.getNumericCellValue(); + + log.info("curRowNum:{},是否相等:{}",curRowNum,curA1Data.equals(preA1Data)); + + if (curA1Data.equals(preA1Data)){ + count ++; + log.info("需要合并的列数:{}",count); + }else { + if (count > 0){ + log.info("需要合并了"); + for (int i = 0; i < mergeColumnIndexArr.length; i++) { + mergeSomeRow(writeSheetHolder,curRowNum,count,i); + } + count = 0; + } + } + + if (curRowNum == secTotalCount && count > 0){ + for (int i = 0; i < mergeColumnIndexArr.length; i++) { + mergeSomeRow(writeSheetHolder,curRowNum + 1,count,i); + } + } + } + + } + + + /*private void mergeSameRow(WriteSheetHolder writeSheetHolder, int curRowIndex, int curColIndex) { + Sheet sheet = writeSheetHolder.getSheet(); + List mergeRegions = sheet.getMergedRegions(); + boolean isMerged = false; + for (int i = 0; i < mergeRegions.size() && !isMerged; i++) { + CellRangeAddress cellRangeAddr = mergeRegions.get(i); + // 若上一个单元格已经被合并,则先移出原有的合并单元,再重新添加合并单元 + if (cellRangeAddr.isInRange(curRowIndex - 1, curColIndex)) { + sheet.removeMergedRegion(i); + cellRangeAddr.setLastRow(curRowIndex); + sheet.addMergedRegionUnsafe(cellRangeAddr); + isMerged = true; + } + } + // 若上一个单元格未被合并,则新增合并单元 + if (!isMerged) { + CellRangeAddress cellRangeAddress = new CellRangeAddress(curRowIndex - 1, curRowIndex, curColIndex, curColIndex); + sheet.addMergedRegionUnsafe(cellRangeAddress); + } + } +*/ + + + /** + * 按列合并单元格 + * @param writeSheetHolder + * @param curRowIndex 当前行索引,有n行固定行就加n + * @param needMergeNum 需要合并的行数 + * @param curColIndex 需要合并的列 + */ + private void mergeSomeRow(WriteSheetHolder writeSheetHolder, int curRowIndex, int needMergeNum, int curColIndex) { + Sheet sheet = writeSheetHolder.getSheet(); + try { + CellRangeAddress cellAddresses = new CellRangeAddress(curRowIndex - needMergeNum - 1, curRowIndex-1, curColIndex, curColIndex); + Field sh = sheet.getClass().getDeclaredField("_sh"); + sh.setAccessible(true); + XSSFSheet shSheet = (XSSFSheet)sh.get(sheet); + CTWorksheet worksheet = shSheet.getCTWorksheet(); + CTMergeCells ctMergeCells = mergedTotalCount > 0 ? worksheet.getMergeCells() : worksheet.addNewMergeCells(); + CTMergeCell ctMergeCell = ctMergeCells.addNewMergeCell(); + ctMergeCell.setRef(cellAddresses.formatAsString()); + mergedTotalCount ++; + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void setSecTotalCount(Integer secTotalCount) { + this.secTotalCount = secTotalCount; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillRowMergeStrategy2.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillRowMergeStrategy2.java new file mode 100644 index 0000000000..e1408b5b1b --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillRowMergeStrategy2.java @@ -0,0 +1,105 @@ +package com.epmet.commons.tools.utils.poi.excel.handler; + +import com.alibaba.excel.write.handler.RowWriteHandler; +import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; +import com.alibaba.excel.write.metadata.holder.WriteTableHolder; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.util.CellRangeAddress; + +import java.util.List; + +/** + * desc:按行对单元格合并策略 依据是第一列的值 + * + * @author liujianjun + */ +@Slf4j +public class ExcelFillRowMergeStrategy2 implements RowWriteHandler { + + /** + * 需要合并的列 下标 + */ + private int[] mergeColumnIndexArr; + /** + * 从下标n行开始合并 + */ + private int mergeRowIndex; + /** + * 默认隐藏第一列 用于合并数据 + */ + private boolean hiddenFirst = true; + + + public ExcelFillRowMergeStrategy2(int mergeRowIndex, int[] mergeColumnIndexArr) { + this.mergeRowIndex = mergeRowIndex; + this.mergeColumnIndexArr = mergeColumnIndexArr; + } + + public ExcelFillRowMergeStrategy2(int mergeRowIndex, int[] mergeColumnIndexArr, boolean hiddenFirst) { + this.mergeRowIndex = mergeRowIndex; + this.mergeColumnIndexArr = mergeColumnIndexArr; + this.hiddenFirst = hiddenFirst; + } + + @Override + public void beforeRowCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Integer rowIndex, Integer relativeRowIndex, Boolean isHead) { + + } + + @Override + public void afterRowCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) { + // 隐藏id列 + if (hiddenFirst) { + writeSheetHolder.getSheet().setColumnHidden(0, true); + } + } + + + @Override + public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) { + //当前行索引 + int curRowNum = row.getRowNum(); + if (mergeColumnIndexArr != null && mergeColumnIndexArr.length > 0 && !isHead) { + //当前行第一列单元格 + Cell curA1Cell = row.getCell(0); + Object curA1Data = curA1Cell.getCellType() == CellType.STRING ? curA1Cell.getStringCellValue() : curA1Cell.getNumericCellValue(); + //上一行第一列单元格 + Cell preA1Cell = row.getSheet().getRow(curRowNum - 1).getCell(0); + Object preA1Data = preA1Cell.getCellType() == CellType.STRING ? preA1Cell.getStringCellValue() : preA1Cell.getNumericCellValue(); + + if (curA1Data.equals(preA1Data)) { + for (int value : mergeColumnIndexArr) { + mergeSameRow(writeSheetHolder, curRowNum, value); + } + } + } + + } + + + private void mergeSameRow(WriteSheetHolder writeSheetHolder, int curRowIndex, int curColIndex) { + Sheet sheet = writeSheetHolder.getSheet(); + List mergeRegions = sheet.getMergedRegions(); + boolean isMerged = false; + for (int i = 0; i < mergeRegions.size() && !isMerged; i++) { + CellRangeAddress cellRangeAddr = mergeRegions.get(i); + // 若上一个单元格已经被合并,则先移出原有的合并单元,再重新添加合并单元 + if (cellRangeAddr.isInRange(curRowIndex - 1, curColIndex)) { + sheet.removeMergedRegion(i); + cellRangeAddr.setLastRow(curRowIndex); + sheet.addMergedRegionUnsafe(cellRangeAddr); + isMerged = true; + } + } + // 若上一个单元格未被合并,则新增合并单元 + if (!isMerged) { + CellRangeAddress cellRangeAddress = new CellRangeAddress(curRowIndex - 1, curRowIndex, curColIndex, curColIndex); + sheet.addMergedRegionUnsafe(cellRangeAddress); + } + } + +} 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-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index add7341a75..d4bdb13bb2 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -203,6 +203,7 @@ INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = u.CUSTOMER_ID AND org.DEPT_ID = u.ORG_ID AND org.DEL_FLAG = '0' + 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..9a2a6d7328 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactNeighborhoodUserHouseDailyDTO.java @@ -0,0 +1,149 @@ +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 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; + +} 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..67f56957dc 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,13 @@ 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); + + @PostMapping("/data/stats/factAgencyUserHouseDaily/userHouseStatNeighborhood") + Result userHouseStatNeighborhood(@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..b5bb0013c4 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,19 @@ 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); + } + + @Override + public Result userHouseStatNeighborhood(FactUserHouseFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userHouseStatNeighborhood", 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..3ff1e7df16 --- /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 wgf + * @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..5e3d1e5477 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/IcHouseDao.java @@ -0,0 +1,28 @@ +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 houseStatNew(FactUserHouseFormDTO formDTO); + + List neighborhoodStatStat(FactUserHouseFormDTO formDTO); + + List neighborhoodStatStatNew(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..e83fb2dcc7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactNeighborhoodUserHouseDailyDao.java @@ -0,0 +1,27 @@ +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.FactNeighborhoodUserHouseDailyEntity; +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-06-01 + */ +@Mapper +public interface FactNeighborhoodUserHouseDailyDao extends BaseDao { + + void deleteByDateId(FactUserHouseFormDTO formDTO); + + List listPage(Map params); + + List getTotal(Map params); + +} 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..e879641504 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/IcResiUserDao.java @@ -0,0 +1,42 @@ +/** + * 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); + + List userStatNew(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..2c48798b2c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactNeighborhoodUserHouseDailyEntity.java @@ -0,0 +1,119 @@ +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 neighbourhoodsCount; + + /** + * 自住房屋总数 + */ + 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 wgf + * @date 2022/5/30 13:33 + */ + List houseStatNew(FactUserHouseFormDTO formDTO); + + /** + * 小区统计 + * + * @param formDTO + * @return java.util.List + * @author zhy + * @date 2022/5/30 13:33 + */ + List neighborhoodStat(FactUserHouseFormDTO formDTO); + + /** + * 小区统计(小区) + * + * @param formDTO + * @return java.util.List + * @author wgf + * @date 2022/5/30 13:33 + */ + List neighborhoodStatNew(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..f6e74ac689 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/HouseServiceImpl.java @@ -0,0 +1,42 @@ +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 houseStatNew(FactUserHouseFormDTO formDTO) { + return baseDao.houseStatNew(formDTO); + } + + @Override + public List neighborhoodStat(FactUserHouseFormDTO formDTO) { + return baseDao.neighborhoodStatStat(formDTO); + } + + @Override + public List neighborhoodStatNew(FactUserHouseFormDTO formDTO) { + return baseDao.neighborhoodStatStatNew(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..4c8905bae4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactNeighborhoodUserHouseDailyService.java @@ -0,0 +1,113 @@ +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.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +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); + + + /** + * 物理删除历史数据 + * + * @param formDTO + * @return void + * @author wgf + * @date 2022/5/30 13:32 + */ + void deleteByDateId(FactUserHouseFormDTO formDTO); + + /** + * 查询导出数据 + * + * @param params + * @return java.util.List + * @author wgf + * @date 2022-05-27 + */ + List listExport(Map params); + + /** + * 页面合计 + * + * @param params + * @return PageData + * @author wgf + * @date 2022-05-27 + */ + FactUserHouseResultDTO getTotal(Map params); + + +} 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..9221627c48 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactUserHouseService.java @@ -0,0 +1,78 @@ +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 wgf + * @date 2022/5/30 13:31 + */ + void statNeighborhood(FactUserHouseFormDTO formDTO); + + /** + * 人房组织数据 + * + * @param formDTO + * @return void + * @author zhy + * @date 2022/5/30 13:31 + */ + void statAgency(FactUserHouseFormDTO formDTO); +} 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..7aef227b16 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridUserHouseDailyServiceImpl.java @@ -0,0 +1,138 @@ +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 { + Integer houseIncr = 0; + Integer houseModify = 0; + Integer userIncr = 0; + Integer userModify = 0; + for(FactUserHouseResultDTO factUserHouseResultDTO : list){ + houseIncr = houseIncr + factUserHouseResultDTO.getHouseIncr(); + houseModify = houseModify + factUserHouseResultDTO.getHouseModify(); + userIncr = userIncr + factUserHouseResultDTO.getUserIncr(); + userModify = userModify + factUserHouseResultDTO.getUserModify(); + } + FactUserHouseResultDTO dto = list.get(list.size() - 1); + dto.setHouseIncr(houseIncr); + dto.setHouseModify(houseModify); + dto.setUserIncr(userIncr); + dto.setUserModify(userModify); + 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); + } + +} 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..8772511aa0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactNeighborhoodUserHouseDailyServiceImpl.java @@ -0,0 +1,129 @@ +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.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.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dao.stats.FactNeighborhoodUserHouseDailyDao; +import com.epmet.dto.stats.FactNeighborhoodUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactGridUserHouseDailyEntity; +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.*; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Service +public class FactNeighborhoodUserHouseDailyServiceImpl extends BaseServiceImpl implements FactNeighborhoodUserHouseDailyService { + + @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 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)); + } + + @Override + public void deleteByDateId(FactUserHouseFormDTO formDTO) { + baseDao.deleteByDateId(formDTO); + } + + @Override + public List listExport(Map params) { + return baseDao.listPage(params); + } + + @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 { + Integer houseIncr = 0; + Integer houseModify = 0; + Integer userIncr = 0; + Integer userModify = 0; + for(FactUserHouseResultDTO factUserHouseResultDTO : list){ + houseIncr = houseIncr + factUserHouseResultDTO.getHouseIncr(); + houseModify = houseModify + factUserHouseResultDTO.getHouseModify(); + userIncr = userIncr + factUserHouseResultDTO.getUserIncr(); + userModify = userModify + factUserHouseResultDTO.getUserModify(); + } + FactUserHouseResultDTO dto = list.get(list.size() - 1); + dto.setHouseIncr(houseIncr); + dto.setHouseModify(houseModify); + dto.setUserIncr(userIncr); + dto.setUserModify(userModify); + return dto; + } + } + +} 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..db20e4ccc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactUserHouseServiceImpl.java @@ -0,0 +1,307 @@ +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.entity.stats.FactNeighborhoodUserHouseDailyEntity; +import com.epmet.service.org.HouseService; +import com.epmet.service.stats.*; +import com.epmet.service.user.IcResiUserService; +import lombok.extern.slf4j.Slf4j; +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 +@Slf4j +public class FactUserHouseServiceImpl implements FactUserHouseService { + + @Autowired + private FactAgencyUserHouseDailyService factAgencyUserHouseDailyService; + + @Autowired + private FactGridUserHouseDailyService factGridUserHouseDailyService; + + @Autowired + private FactNeighborhoodUserHouseDailyService factNeighborhoodUserHouseDailyService; + + @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("neighborhood".equals(params.get("level").toString()) || OrgLevelEnum.GRID.getCode().equals(params.get("level").toString())){ + page = factNeighborhoodUserHouseDailyService.page(params); + + }else if (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("neighborhood".equals(params.get("level").toString())){ + dto = factNeighborhoodUserHouseDailyService.getTotal(params); + }else 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("neighborhood".equals(params.get("level").toString()) || OrgLevelEnum.GRID.getCode().equals(params.get("level").toString())){ + list = factNeighborhoodUserHouseDailyService.listExport(params); + }else if (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); + } + + + /** + * 小区 + * @author wgf + * @param formDTO + */ + @Override + public void statNeighborhood(FactUserHouseFormDTO formDTO) { + log.info("$$$进入业务逻辑"); + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + String dateId = formDTO.getDateId(); + String customerId = formDTO.getCustomerId(); + + // 先删除历史 + factNeighborhoodUserHouseDailyService.deleteByDateId(formDTO); + log.info("$$$删除历史完成"); + // 保证小区是全部网格后,其余数据进行循环匹配 + List neiList = houseService.neighborhoodStatNew(formDTO); + List houseList = houseService.houseStatNew(formDTO); + List userList = icResiUserService.userStatNew(formDTO); + + List addList = new ArrayList<>(); + + neiList.forEach(item -> { + String gridId = item.getGridId() == null ? "" : item.getGridId(); + String neighborHoodsId = item.getNeighbourhoodsId(); + FactUserHouseResultDTO dto = new FactUserHouseResultDTO(); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setDateId(dateId); + dto.setGridId(gridId); + dto.setPid(item.getPid() == null ? "" : item.getPid()); + dto.setPids(item.getPids() == null ? "" : item.getPids()); + dto.setNeighbourhoodsCount(item.getNeighbourhoodsCount()); + dto.setNeighbourhoodsId(item.getNeighbourhoodsId()); + dto.setNeighborHoodName(item.getNeighborHoodName()); + + Optional houseOptional = houseList.stream().filter(house -> neighborHoodsId.equals(house.getNeighbourhoodsId()) && 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()); + } else { + dto.setHouseCount(NumConstant.ZERO); + dto.setHouseSelfCount(NumConstant.ZERO); + dto.setHouseLeaseCount(NumConstant.ZERO); + dto.setHouseIdleCount(NumConstant.ZERO); + } + + Optional userOptional = userList.stream().filter(user -> neighborHoodsId.equals(user.getNeighbourhoodsId()) && customerId.equals(user.getCustomerId())).findFirst(); + if (userOptional.isPresent()) { + dto.setUserCount(userOptional.get().getUserCount()); + dto.setUserResiCount(userOptional.get().getUserResiCount()); + dto.setUserFloatCount(userOptional.get().getUserFloatCount()); + } else { + dto.setUserCount(NumConstant.ZERO); + dto.setUserResiCount(NumConstant.ZERO); + dto.setUserFloatCount(NumConstant.ZERO); + } + addList.add(dto); + }); + log.info("$$$addList:::::" + addList); + List entityList = ConvertUtils.sourceToTarget(addList, FactNeighborhoodUserHouseDailyEntity.class); + factNeighborhoodUserHouseDailyService.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)); + } + + } +} 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..a3c689b8a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/IcResiUserService.java @@ -0,0 +1,55 @@ +/** + * 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); + + /** + * 居民统计(小区) + * + * @param formDTO + * @return java.util.List + * @author wgf + * @date 2022/5/30 13:33 + */ + List userStatNew(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..e1f1e9ef1e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/IcResiUserServiceImpl.java @@ -0,0 +1,55 @@ +/** + * 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); + } + + @Override + public List userStatNew(FactUserHouseFormDTO formDTO) { + return baseDao.userStatNew(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..297d15dbd3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + 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..4ff079453d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactNeighborhoodUserHouseDailyDao.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + fact_neighborhood_user_house_daily + WHERE + DATE_ID = #{dateId} + AND CUSTOMER_ID = #{customerId} + + + + + + + + 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..7493d2d979 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/IcResiUserDao.xml @@ -0,0 +1,47 @@ + + + + + + + + + + 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/IcServiceOrgDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceOrgDTO.java new file mode 100644 index 0000000000..42d8fcf19b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceOrgDTO.java @@ -0,0 +1,115 @@ +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-27 + */ +@Data +public class IcServiceOrgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 服务类别【字典表 ic_service_type】多个值逗号分隔 + */ + private String serviceType; + + /** + * 服务组织名称 + */ + private String orgName; + + /** + * 组织描述 + */ + private String orgDescribe; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalMobile; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectAttachmentDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectAttachmentDTO.java new file mode 100644 index 0000000000..6919112fde --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectAttachmentDTO.java @@ -0,0 +1,116 @@ +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-27 + */ +@Data +public class IcServiceProjectAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icServiceId; + + private String attachTo; + + /** + * 附件名 + */ + private String attachmentName; + private String name; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + private String format; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + private String type; + + /** + * 附件地址 + */ + private String attachmentUrl; + private String url; + + /** + * 排序字段 + */ + 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/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectDTO.java new file mode 100644 index 0000000000..3d3a6c733f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectDTO.java @@ -0,0 +1,104 @@ +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-27 + */ +@Data +public class IcServiceProjectDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织ID的上级 + */ + private String pid; + + /** + * 组织ID的所有上级[包括自己] + */ + private String agencyIdPath; + + /** + * 服务类别值 + */ + private String serviceCategoryKey; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 服务内容 + */ + private String serviceContent; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevel; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 启用状态,0启用,1禁用 + */ + private Integer enabled; + + /** + * + */ + 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/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/IcServiceEditFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceEditFormDTO.java new file mode 100644 index 0000000000..140e8269c1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceEditFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.form; + + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +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.io.Serializable; +import java.util.Date; + +/** + * 【服务项目记录】修改 + */ +@Data +public class IcServiceEditFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "", groups = AddUserInternalGroup.class) + private String serviceRecordId; + private String principalName; + private String principalContact; + /** + * 服务时间 + */ + @NotNull(message = "起始服务时间不能为空", groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + @NotNull(message = "截止服务时间不能为空", groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeEnd; + + /** + * 备注 + */ + private String remark; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgAddEditFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgAddEditFormDTO.java new file mode 100644 index 0000000000..3b95afef3f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgAddEditFormDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +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 IcServiceOrgAddEditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface Del extends CustomerClientShowGroup { + } + + /** + * 服务组织Id + */ + @NotBlank(message = "服务组织Id不能为空", groups = {UpdateGroup.class, Del.class}) + private String icServiceOrgId; + /** + * 服务类型,多个值逗号分隔,字典值,字典key:ic_service_type + */ + @NotBlank(message = "服务类型不能为空", groups = {AddGroup.class}) + private String serviceType; + /** + * 服务组织名称 + */ + @NotBlank(message = "服务组织名称不能为空", groups = {AddGroup.class}) + private String orgName; + /** + * 组织描述 + */ + private String orgDescribe; + /** + * 负责人姓名 + */ + @NotBlank(message = "负责人姓名不能为空", groups = {AddGroup.class}) + private String principalName; + /** + * 联系方式 + */ + @NotBlank(message = "联系方式不能为空", groups = {AddGroup.class}) + private String principalMobile; + /** + * 经度 + */ + private String longitude; + /** + * 维度 + */ + private String latitude; + /** + * 服务地址 + */ + private String address; + /** + * 备注信息 + */ + private String remark; + + private String customerId; + private String userId; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgListFormDTO.java new file mode 100644 index 0000000000..b0cceaeb79 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgListFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【组织】服务组织列表--接口入参 + * @Author sun + */ +@Data +public class IcServiceOrgListFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + /** + * 服务类型,字典值 + */ + private String serviceType; + /** + * 服务组织名称 + */ + private String orgName; + /** + * 服务地址 + */ + private String address; + /** + * 备注信息 + */ + private String remark; + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + + private Boolean isPage = true; + private String icServiceOrgId; + private String customerId; + private String staffId; + private String agencyId; + +} 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/ServiceProjectFeedbackFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java new file mode 100644 index 0000000000..231ab79b95 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import java.util.List; + +@Data +public class ServiceProjectFeedbackFormDTO { + + /** + * 反馈接口分组 + */ + public interface FeedbackGroup {} + + /** + * 发起服务接口分组 + */ + public interface InitiateGroup {} + + @NotBlank(message = "服务记录id不能为空", groups = { FeedbackGroup.class }) + private String serviceRecordId; + private String serviceProjectId; + private String serviceGoal; + private String serviceEffect; + private Integer servicePeopleNumber; + /** + * 服务状态。in_service服务中;completed:已完成 + */ + @NotBlank(message = "服务状态不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String serviceStatus; + /** + * 满意度。不满意:bad、基本满意:good、非常满意:perfect + * 按理说,服务完成的时候才可以选,不完成应该不能选,可是谁知道呢,原型也没写 + */ + private String satisfaction; + private String longitude; + private String latitude; + private String address; + + @Valid + private List attachmentList; + + @Data + public static class Attachment { + + @NotBlank(message = "附件名称不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentName; + @NotBlank(message = "附件格式不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentFormat; + @NotBlank(message = "附件类型不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentType; + @NotBlank(message = "附件url不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentUrl; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFormDTO.java new file mode 100644 index 0000000000..524628e95c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/27 15:53 + * @DESC + */ +@Data +public class ServiceProjectFormDTO implements Serializable { + + private static final long serialVersionUID = -4573264697450644498L; + + public interface ServiceProjectAddForm{} + public interface ServiceProjectUpdateForm{} + + @NotBlank(message = "服务类别不能为空",groups = {ServiceProjectAddForm.class}) + private String serviceCategoryKey; + + @NotBlank(message = "服务名称不能为空",groups = {ServiceProjectAddForm.class,ServiceProjectUpdateForm.class}) + private String serviceName; + + @NotBlank(message = "服务内容不能为空",groups = {ServiceProjectAddForm.class,ServiceProjectUpdateForm.class}) + private String serviceContent; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevel; + + private String customerId; + + private String userId; + + @NotBlank(message = "serviceProjectId不能为空",groups = {ServiceProjectUpdateForm.class}) + private String serviceProjectId; + + /** + * 附件集合 + */ + private List attachmentList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java new file mode 100644 index 0000000000..ff265a8a44 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java @@ -0,0 +1,32 @@ +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/27 16:42 + * @DESC + */ +@Data +public class ServiceProjectListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -6508966695564469253L; + + public interface ServiceProjectDetail{} + + private String serviceCategoryKey; + private String serviceName; + private String serviceContent; + private String policyGround; + private String customerId; + private String userId; + private String agencyId; + + @NotBlank(message = "serviceProjectId不能为空",groups = ServiceProjectDetail.class) + private String serviceProjectId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectRecordFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectRecordFormDTO.java new file mode 100644 index 0000000000..59d86bfac5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectRecordFormDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.form; + +import com.epmet.dto.result.IcServiceScopeDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +@Data +public class ServiceProjectRecordFormDTO { + + /** + * 发起服务 + */ + public interface Initiate {} + + @NotBlank(message = "服务类别key不能为空", groups = { Initiate.class }) + private String serviceCategoryKey; + + @NotBlank(message = "服务项目Id不能为空", groups = { Initiate.class }) + private String serviceProjectId; + + private String serviceProjectName; + + @NotBlank(message = "服务组织Id不能为空", groups = { Initiate.class }) + private String serviceOrgId; + + private String serviceOrgName; + + @NotEmpty(message = "发布范围不能为空", groups = { Initiate.class }) + private List serviceScope; + + @NotNull(message = "服务起始时间不能为空", groups = { Initiate.class }) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceTimeStart; + + @NotNull(message = "服务结束时间不能为空", groups = { Initiate.class }) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceTimeEnd; + private String serviceStatus; + private String satisfaction; + + private String principalName; + + private String principalContact; + + /** + * 备注 + */ + private String remark; + + @Valid + private ServiceProjectFeedbackFormDTO feedback; + + private Integer pageNo = 1; + private Integer pageSize = 20; + +} 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/IcServiceFeedbackResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceFeedbackResDTO.java new file mode 100644 index 0000000000..394b5b6b40 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceFeedbackResDTO.java @@ -0,0 +1,64 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 服务记录反馈 + */ +@Data +public class IcServiceFeedbackResDTO implements Serializable { + + /** + * 反馈记录id + */ + private String feedBackId; + + /** + * 服务目标 + */ + private String serviceGoal; + + /** + * 服务效果 + */ + private String serviceEffect; + + /** + * 服务人数 + */ + // private Integer servicePeopleNumber; + + /** + * 满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + + /** + * 地址经度 + */ + private String longitude; + + /** + * 地址纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + private List attachmentList; + + @Data + public static class Attachment { + private String attachmentName; + private String attachmentFormat; + private String attachmentType; + private String attachmentUrl; + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgListResultDTO.java new file mode 100644 index 0000000000..30164b69c4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgListResultDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 【组织】服务组织列表--接口返参 + * @Author sun + */ +@Data +public class IcServiceOrgListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 服务组织Id + */ + private String icServiceOrgId; + /** + * 组织Id + */ + private String agencyId; + /** + * 服务类别 + */ + private List serviceTypeList; + /** + * 服务类别,多个值逗号分隔 + */ + private String serviceType; + /** + * 服务类别,多个值顿号分隔 + */ + private String serviceTypeName; + /** + * 服务组织名称 + */ + private String orgName; + /** + * 组织描述 + */ + private String orgDescribe; + /** + * 负责人名称 + */ + private String principalName; + /** + * 负责人电话 + */ + private String principalMobile; + /** + * 经度 + */ + private String longitude; + /** + * 纬度 + */ + private String latitude; + /** + * 地址 + */ + private String address; + /** + * 备注 + */ + private String remark; + + @Data + public static class ServiceType { + /** + * 服务类别值 + */ + private String value; + /** + * 服务类别名 + */ + private String name; + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgSelectListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgSelectListResultDTO.java new file mode 100644 index 0000000000..30f5ef457b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgSelectListResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【组织】服务组织列表_下拉框使用--接口返参 + * @Author sun + */ +@Data +public class IcServiceOrgSelectListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 服务组织Id + */ + private String icServiceOrgId; + /** + * 服务组织名称 + */ + private String orgName; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceRecDetailRes.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceRecDetailRes.java new file mode 100644 index 0000000000..d1ef78ab5f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceRecDetailRes.java @@ -0,0 +1,90 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@Data +public class IcServiceRecDetailRes implements Serializable { + + + /** + * 联系方式 + */ + private String principalContact; + + /** + * 经办人姓名 + */ + private String principalName; + + /** + * 备注 + */ + private String remark; + + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务类别ID + */ + private String serviceCategoryName; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务组织名称 + */ + private String serviceOrgName; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务项目名称 + */ + private String serviceProjectName; + + /** + * 服务时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeEnd; + + /** + * in_service服务中;completed:已完成 + */ + private String serviceStatus; + + /** + * 发布范围 + */ + private List serviceScope; + + /** + * 服务人数 + */ + private Integer servicePeopleNumber; + + /** + * 反馈详情 + */ + private IcServiceFeedbackResDTO feedBack; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceScopeDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceScopeDTO.java new file mode 100644 index 0000000000..1a2be3dca0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceScopeDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result; + + +import lombok.Data; + +@Data +public class IcServiceScopeDTO { + private String objectId; + private String objectName; + private String objectType; + /** + * 发布范围的组织ID PATH + */ + private String objectIdPath; +} 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/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/ServiceProjectListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectListResultDTO.java new file mode 100644 index 0000000000..eadf11a78a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectListResultDTO.java @@ -0,0 +1,63 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/27 16:42 + * @DESC + */ +@Data +public class ServiceProjectListResultDTO implements Serializable { + + private static final long serialVersionUID = -6508966695564469113L; + + /** + * 服务类别 + */ + private String serviceCategory; + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 服务内容 + */ + private String serviceContent; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 政策级别 + */ + private String policyLevel; + private String policyLevelName; + + private List attachmentList; + + public ServiceProjectListResultDTO() { + this.serviceCategory = ""; + this.serviceProjectId = ""; + this.serviceName = ""; + this.serviceContent = ""; + this.policyGround = ""; + this.policyLevel = ""; + this.policyLevelName = ""; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectRecordResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectRecordResultDTO.java new file mode 100644 index 0000000000..940a8ae9f1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectRecordResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class ServiceProjectRecordResultDTO { + private String serviceRecordId; + private String serviceCategoryKey; + private String serviceCategoryName; + private String serviceProjectId; + private String serviceProjectName; + private String serviceOrgId; + private String serviceOrgName; + private String serviceTimeStart; + private String serviceTimeEnd; + private String serviceStatus; + private String servicePeopleNumber; +} 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 e87c9f78f8..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 @@ -8,9 +8,14 @@ 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; @@ -110,6 +115,28 @@ 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); + + /** * 获取客户下志愿者列表 * 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 bdf7bee595..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 @@ -9,9 +9,14 @@ 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; @@ -111,6 +116,21 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli 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); + } + /** * 获取客户下志愿者列表 * diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index bc2955d8b7..af7bb32c5d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -132,6 +132,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + ${project.basedir}/src/main/java 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 c3f5d3c4ab..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; @@ -33,11 +16,16 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.constants.ImportTaskConstants; 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; @@ -58,6 +46,7 @@ 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; @@ -300,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/IcServiceOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceOrgController.java new file mode 100644 index 0000000000..2232830346 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceOrgController.java @@ -0,0 +1,91 @@ +package com.epmet.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.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.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcServiceOrgDTO; +import com.epmet.dto.form.IcServiceOrgAddEditFormDTO; +import com.epmet.dto.form.IcServiceOrgListFormDTO; +import com.epmet.dto.result.IcServiceOrgListResultDTO; +import com.epmet.dto.result.IcServiceOrgSelectListResultDTO; +import com.epmet.service.IcServiceOrgService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@RestController +@RequestMapping("icServiceOrg") +public class IcServiceOrgController { + + @Autowired + private IcServiceOrgService icServiceOrgService; + + @RequestMapping("list") + public Result> list(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgListFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icServiceOrgService.list(formDTO)); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceOrgDTO data = icServiceOrgService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("add") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgAddEditFormDTO dto) { + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + icServiceOrgService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgAddEditFormDTO dto){ + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + icServiceOrgService.update(dto); + return new Result(); + } + + @PostMapping("del") + public Result delete(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgAddEditFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, IcServiceOrgAddEditFormDTO.Del.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icServiceOrgService.delete(formDTO); + return new Result(); + } + + @RequestMapping("detail") + public Result detail(@RequestBody IcServiceOrgListFormDTO formDTO) { + return new Result().ok(icServiceOrgService.detail(formDTO)); + } + + @RequestMapping("selectlist") + public Result> selectList(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgListFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icServiceOrgService.selectList(formDTO)); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectAttachmentController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectAttachmentController.java new file mode 100644 index 0000000000..07e07b0d92 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectAttachmentController.java @@ -0,0 +1,72 @@ +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.IcServiceProjectAttachmentDTO; +import com.epmet.service.IcServiceProjectAttachmentService; +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("icServiceProjectAttachment") +public class IcServiceProjectAttachmentController { + + @Autowired + private IcServiceProjectAttachmentService icServiceProjectAttachmentService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icServiceProjectAttachmentService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceProjectAttachmentDTO data = icServiceProjectAttachmentService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcServiceProjectAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icServiceProjectAttachmentService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcServiceProjectAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icServiceProjectAttachmentService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icServiceProjectAttachmentService.delete(ids); + return new Result(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java new file mode 100644 index 0000000000..abcf757f89 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java @@ -0,0 +1,244 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +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.IcServiceProjectDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.IcServiceRecDetailRes; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.IcServiceRecordEntity; +import com.epmet.service.IcServiceProjectService; +import com.epmet.service.IcServiceRecordService; +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-27 + */ +@RestController +@RequestMapping("icServiceProject") +public class IcServiceProjectController { + + @Autowired + private IcServiceProjectService icServiceProjectService; + @Autowired + private IcServiceRecordService icServiceRecordService; + + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icServiceProjectService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceProjectDTO data = icServiceProjectService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcServiceProjectDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icServiceProjectService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcServiceProjectDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icServiceProjectService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icServiceProjectService.delete(ids); + return new Result(); + } + + /** + * Desc: 服务项目新增 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/5/27 16:04 + */ + @PostMapping("serviceProjectAdd") + public Result serviceProjectAdd(@LoginUser TokenDto tokenDto,@RequestBody ServiceProjectFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ServiceProjectFormDTO.ServiceProjectAddForm.class); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + icServiceProjectService.serviceProjectAdd(formDTO); + return new Result(); + } + + /** + * Desc: 服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:46 + */ + @PostMapping("serviceProjectList") + public Result serviceProjectList(@LoginUser TokenDto tokenDto,@RequestBody ServiceProjectListFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(icServiceProjectService.serviceProjectList(formDTO)); + } + + /** + * Desc: 服务项目详情 + * @param formDTO + * @author zxc + * @date 2022/5/30 15:46 + */ + @PostMapping("serviceProjectDetail") + public Result serviceProjectDetail(@RequestBody ServiceProjectListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ServiceProjectListFormDTO.ServiceProjectDetail.class); + return new Result().ok(icServiceProjectService.serviceProjectDetail(formDTO)); + } + + /** + * Desc: 修改【服务项目】 + * @param formDTO + * @author zxc + * @date 2022/5/30 09:36 + */ + @PostMapping("serviceProjectEdit") + public Result serviceProjectEdit(@RequestBody ServiceProjectFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, ServiceProjectFormDTO.ServiceProjectUpdateForm.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + icServiceProjectService.serviceProjectEdit(formDTO); + return new Result(); + } + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + @PostMapping("serviceProjectEnabled") + public Result serviceProjectEnabled(@RequestBody List ids){ + icServiceProjectService.serviceProjectEnabled(ids); + return new Result(); + } + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7820 + * + * @param serviceId + * @return 【服务项目记录】取消:进行中的项目可以取消。删除该记录 + */ + @PostMapping("service/cancel/{service-id}") + public Result cancelService(@PathVariable("service-id") String serviceId) { + icServiceRecordService.cancelService(serviceId, "yzm"); + return new Result(); + } + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7821 + * @param serviceId + * @return 【服务项目记录】详情 + */ + @PostMapping("service/detail/{service-id}") + public Result queryServiceDetail(@PathVariable("service-id") String serviceId) { + return new Result().ok(icServiceRecordService.queryServiceDetail(serviceId)); + } + + /** + * 【服务项目记录】修改 + * + * @param formDTO + * @return + */ + @PostMapping("service/update") + public Result updateServiceRecord(@RequestBody IcServiceEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcServiceEditFormDTO.AddUserShowGroup.class, IcServiceEditFormDTO.AddUserInternalGroup.class); + icServiceRecordService.updateServiceRecord(formDTO); + return new Result(); + } + + /** + * 服务列表 + * @param input + * @return + */ + @PostMapping("/service/recordList") + public Result listServiceRecords(@RequestBody ServiceProjectRecordFormDTO input) { + + PageData page = icServiceRecordService.listServiceRecords( + input.getServiceCategoryKey(), input.getServiceProjectName(), input.getServiceOrgName(), input.getServiceTimeStart(), + input.getServiceTimeEnd(), input.getServiceStatus(), input.getSatisfaction(), input.getPageNo(), input.getPageSize()); + + return new Result().ok(page); + } + + /** + * 发起服务 + * @param input + * @return + */ + @PostMapping("/service/initiate") + public Result initiateService(@RequestBody ServiceProjectRecordFormDTO input) { + + ValidatorUtils.validateEntity(input, ServiceProjectRecordFormDTO.Initiate.class, ServiceProjectFeedbackFormDTO.InitiateGroup.class); + icServiceRecordService.initiateService(input); + + return new Result(); + } + + /** + * 反馈 + * @param input + * @return + */ + @PostMapping("/service/feedback") + public Result serviceFeedback(@RequestBody ServiceProjectFeedbackFormDTO input) { + ValidatorUtils.validateEntity(input, ServiceProjectFeedbackFormDTO.FeedbackGroup.class); + String serviceRecordId = input.getServiceRecordId(); + + // 做状态检查,未反馈的,服务状态为服务中的才可以反馈 + IcServiceRecordEntity serviceRecord = icServiceRecordService.selectById(serviceRecordId); + if (serviceRecord == null) { + String msg = "未找到服务记录"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + + if ("completed".equals(serviceRecord.getServiceStatus())) { + String msg = "服务已完成,不能再次反馈"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + + icServiceRecordService.serviceFeedback(serviceRecord.getServiceCategoryKey(), + serviceRecord.getServiceOrgId(), + serviceRecord.getServiceProjectId(), + serviceRecord.getId(), + input); + return new Result(); + } +} 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/dao/IcCommunitySelfOrganizationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java index e8fc375773..3ba576777b 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,12 @@ 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); + + List selectByIds(@Param("communityOrgIds") List communityOrgIds); } \ 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 2d4886bf60..0c02e737b7 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,10 +19,10 @@ 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; @@ -73,6 +73,30 @@ public interface IcPartyUnitDao extends BaseDao { int updateSatisfaction(@Param("partyUnitId") String serverId, @Param("satisfaction") BigDecimal satisfaction); + /** + * 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); + /** * 联建单位-简要信息列表 * @@ -90,4 +114,6 @@ public interface IcPartyUnitDao extends BaseDao { */ List getTypepercent(@Param("agencyId") String agencyId, @Param("customerId") String customerId); -} \ No newline at end of file + + List selectByIds(@Param("partyUnitIds") List partyUnitIds); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackDao.java new file mode 100755 index 0000000000..301a261fb1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackDao.java @@ -0,0 +1,33 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IcServiceFeedbackResDTO; +import com.epmet.entity.IcServiceFeedbackEntity; +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-30 + */ +@Mapper +public interface IcServiceFeedbackDao extends BaseDao { + + /** + * 根据服务记录id,查询反馈记录 + * @param serviceRecordId + * @return + */ + IcServiceFeedbackResDTO selectByRecId(@Param("serviceRecordId") String serviceRecordId); + + /** + * 根据服务反馈id,查询附件列表 + * @param feedBackId + * @return + */ + List getAttachmentList(String feedBackId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceOrgDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceOrgDao.java new file mode 100644 index 0000000000..5407d8f10b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceOrgDao.java @@ -0,0 +1,34 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcServiceOrgListFormDTO; +import com.epmet.dto.result.IcServiceOrgListResultDTO; +import com.epmet.dto.result.IcServiceOrgSelectListResultDTO; +import com.epmet.entity.IcServiceOrgEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Mapper +public interface IcServiceOrgDao extends BaseDao { + + /** + * @Author sun + * @Description 服务组织-列表查询 + **/ + List selectServiceOrgList(IcServiceOrgListFormDTO formDTO); + + /** + * @Author sun + * @Description 服务组织列表_下拉框 + **/ + List selectServiceOrgSelectList(IcServiceOrgListFormDTO formDTO); + + void del(IcServiceOrgEntity entity); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectAttachmentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectAttachmentDao.java new file mode 100644 index 0000000000..17eddc6215 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectAttachmentDao.java @@ -0,0 +1,27 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcServiceProjectAttachmentEntity; +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-27 + */ +@Mapper +public interface IcServiceProjectAttachmentDao extends BaseDao { + + /** + * Desc: 根据服务项目ID删除附件 + * @param id + * @author zxc + * @date 2022/5/30 09:50 + */ + void delAttachmentByServiceProjectId(@Param("id")String id); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectDao.java new file mode 100644 index 0000000000..528e9a06a5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectDao.java @@ -0,0 +1,37 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ServiceProjectListFormDTO; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.entity.IcServiceProjectEntity; +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-27 + */ +@Mapper +public interface IcServiceProjectDao extends BaseDao { + + /** + * Desc: 查询服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 17:13 + */ + List getServiceProjectList(ServiceProjectListFormDTO formDTO); + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + void serviceProjectEnabled(@Param("ids") List ids); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordDao.java new file mode 100644 index 0000000000..5a51a14a76 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordDao.java @@ -0,0 +1,29 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.IcServiceRecordEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Mapper +public interface IcServiceRecordDao extends BaseDao { + + List listServiceRecords( + @Param("serviceCategoryKey") String serviceCategoryKey, + @Param("serviceProjectName") String serviceProjectName, + @Param("serviceOrgName") String serviceOrgName, + @Param("serviceTimeStart") Date serviceTimeStart, + @Param("serviceTimeEnd") Date serviceTimeEnd, + @Param("serviceStatus") String serviceStatus, + @Param("satisfaction") String satisfaction); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java new file mode 100644 index 0000000000..c2fc96cfd9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java @@ -0,0 +1,23 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IcServiceScopeDTO; +import com.epmet.entity.IcServiceScopeEntity; +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-30 + */ +@Mapper +public interface IcServiceScopeDao extends BaseDao { + + int update(@Param("serviceId") String serviceId, @Param("userId") String userId); + + List selectList(String serviceRecordId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index f3781ceea6..f3ac1eb80b 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,13 @@ 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); + + /** + * 根据服务方id查询已派单的服务记录数 + * @param serverId + * @return + */ + Integer selectCountByServerId(String serverId); } \ 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/IcServiceFeedbackEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackEntity.java new file mode 100755 index 0000000000..df89735b5b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackEntity.java @@ -0,0 +1,83 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +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-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_feedback") +public class IcServiceFeedbackEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + @TableField(fill = FieldFill.INSERT) + private String customerId; + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务目标 + */ + private String serviceGoal; + + /** + * 服务效果 + */ + private String serviceEffect; + + /** + * 服务人数 + */ + //private Integer servicePeopleNumber; + + /** + * 满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + + /** + * 地址经度 + */ + private String longitude; + + /** + * 地址纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * + */ + private String serviceRecordId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceOrgEntity.java new file mode 100644 index 0000000000..9b9da6dd7c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceOrgEntity.java @@ -0,0 +1,81 @@ +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-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_org") +public class IcServiceOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 服务类别【字典表 ic_service_type】多个值逗号分隔 + */ + private String serviceType; + + /** + * 服务组织名称 + */ + private String orgName; + + /** + * 组织描述 + */ + private String orgDescribe; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalMobile; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java new file mode 100644 index 0000000000..966b5a6d94 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java @@ -0,0 +1,88 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +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("ic_service_project_attachment") +public class IcServiceProjectAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 事件Id + */ + private String icServiceId; + + /** + * 隶属于。feedback:反馈;service:服务本身 + */ + private String attachTo; + + /** + * 附件名 + */ + 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/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectEntity.java new file mode 100644 index 0000000000..b8a09e67cf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectEntity.java @@ -0,0 +1,74 @@ +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-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_project") +public class IcServiceProjectEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织ID的上级 + */ + private String pid; + + /** + * 组织ID的所有上级[包括自己] + */ + private String agencyIdPath; + + /** + * 服务类别值 + */ + private String serviceCategoryKey; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 服务内容 + */ + private String serviceContent; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevel; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 启用状态,0启用,1禁用 + */ + private Integer enabled; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordEntity.java new file mode 100644 index 0000000000..4156c60604 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordEntity.java @@ -0,0 +1,89 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +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-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_record") +public class IcServiceRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务项目名称 + */ + private String serviceProjectName; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务组织名称 + */ + private String serviceOrgName; + + /** + * 经办人姓名 + */ + private String principalName; + + /** + * 联系方式 + */ + private String principalContact; + + /** + * 服务时间 + */ + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + private Date serviceTimeEnd; + + /** + * in_service服务中;completed:已完成 + */ + private String serviceStatus; + + /** + * 备注 + */ + private String remark; + + /** + * 服务人数 + */ + private Integer servicePeopleNumber; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeEntity.java new file mode 100644 index 0000000000..1826e26df1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeEntity.java @@ -0,0 +1,75 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_scope") +public class IcServiceScopeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务记录的ID + */ + private String serviceRecordId; + + /** + * agency单位;grid网格;neighborhood小区 + */ + private String objectType; + + /** + * 选中的组织的ID + */ + private String objectId; + + /** + * 发布范围的组织ID PATH + */ + private String objectIdPath; + + /** + * + */ + private String objectName; + + /** + * 备注 + */ + private String remark; + +} 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/IcServiceOrgExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcServiceOrgExcel.java new file mode 100644 index 0000000000..79c052a9f8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcServiceOrgExcel.java @@ -0,0 +1,75 @@ +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 IcServiceOrgExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "所属组织机构Id") + private String agencyId; + + @Excel(name = "agencyId的所有上级,包含自己") + private String agencyIdPath; + + @Excel(name = "服务类别【字典表 ic_service_type】多个值逗号分隔") + private String serviceType; + + @Excel(name = "服务组织名称") + private String orgName; + + @Excel(name = "组织描述") + private String orgDescribe; + + @Excel(name = "负责人姓名") + private String principalName; + + @Excel(name = "负责人电话") + private String principalMobile; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "地址") + private String address; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file 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 73b35af7bd..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; @@ -26,10 +9,12 @@ 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; @@ -38,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; /** * 联建单位 @@ -166,6 +152,23 @@ public interface IcPartyUnitService extends BaseService { List queryListById(List partyUnitIds); + /** + * 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); + + /** * 联建单位-简要信息列表 * @@ -179,4 +182,4 @@ public interface IcPartyUnitService extends BaseService { * @param form */ List getTypepercent(PartyTypepercentFormDTO form); -} \ No newline at end of file +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceOrgService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceOrgService.java new file mode 100644 index 0000000000..3115e08d8a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceOrgService.java @@ -0,0 +1,68 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcServiceOrgDTO; +import com.epmet.dto.form.IcServiceOrgAddEditFormDTO; +import com.epmet.dto.form.IcServiceOrgListFormDTO; +import com.epmet.dto.result.IcServiceOrgListResultDTO; +import com.epmet.dto.result.IcServiceOrgSelectListResultDTO; +import com.epmet.entity.IcServiceOrgEntity; + +import java.util.List; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface IcServiceOrgService extends BaseService { + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + PageData list(IcServiceOrgListFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcServiceOrgDTO + * @author generator + * @date 2022-05-27 + */ + IcServiceOrgDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(IcServiceOrgAddEditFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(IcServiceOrgAddEditFormDTO dto); + + void delete(IcServiceOrgAddEditFormDTO formDTO); + + IcServiceOrgListResultDTO detail(IcServiceOrgListFormDTO formDTO); + + List selectList(IcServiceOrgListFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectAttachmentService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectAttachmentService.java new file mode 100644 index 0000000000..afc94ec748 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectAttachmentService.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.IcServiceProjectAttachmentDTO; +import com.epmet.entity.IcServiceProjectAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface IcServiceProjectAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcServiceProjectAttachmentDTO + * @author generator + * @date 2022-05-27 + */ + IcServiceProjectAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(IcServiceProjectAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(IcServiceProjectAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-27 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java new file mode 100644 index 0000000000..aa02487cab --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java @@ -0,0 +1,122 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcServiceProjectDTO; +import com.epmet.dto.form.ServiceProjectFormDTO; +import com.epmet.dto.form.ServiceProjectListFormDTO; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.entity.IcServiceProjectEntity; + +import java.util.List; +import java.util.Map; + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface IcServiceProjectService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcServiceProjectDTO + * @author generator + * @date 2022-05-27 + */ + IcServiceProjectDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(IcServiceProjectDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(IcServiceProjectDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-27 + */ + void delete(String[] ids); + + /** + * Desc: 服务项目新增 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:04 + */ + void serviceProjectAdd(ServiceProjectFormDTO formDTO); + + /** + * Desc: 服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:46 + */ + PageData serviceProjectList(ServiceProjectListFormDTO formDTO); + + /** + * Desc: 服务项目详情 + * @param formDTO + * @author zxc + * @date 2022/5/30 15:46 + */ + ServiceProjectListResultDTO serviceProjectDetail(ServiceProjectListFormDTO formDTO); + + /** + * Desc: 修改【服务项目】 + * @param formDTO + * @author zxc + * @date 2022/5/30 09:36 + */ + void serviceProjectEdit(ServiceProjectFormDTO formDTO); + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + void serviceProjectEnabled(List ids); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordService.java new file mode 100644 index 0000000000..1fe7cb518a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordService.java @@ -0,0 +1,56 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.IcServiceEditFormDTO; +import com.epmet.dto.form.ServiceProjectFeedbackFormDTO; +import com.epmet.dto.form.ServiceProjectRecordFormDTO; +import com.epmet.dto.result.IcServiceRecDetailRes; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.IcServiceRecordEntity; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +public interface IcServiceRecordService extends BaseService { + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7820 + * @param serviceId + * 【服务项目记录】取消:进行中的项目可以取消。删除该记录 + */ + void cancelService(String serviceId,String userId); + + /** + * 【服务项目记录】详情 + * @param serviceId + * @return + */ + IcServiceRecDetailRes queryServiceDetail(String serviceId); + + /** + * 【服务项目记录】修改 + * @param formDTO + */ + void updateServiceRecord(IcServiceEditFormDTO formDTO); + + PageData listServiceRecords(String serviceCategoryKey, String serviceProjectName, String serviceOrgName, + Date serviceTimeStart, Date serviceTimeEnd, String serviceStatus, + String satisfaction, Integer pageNo, Integer pageSize); + + /** + * 发起服务 + * @param input + */ + void initiateService(ServiceProjectRecordFormDTO input); + + /** + * 服务反馈 + */ + void serviceFeedback(String serviceCategoryKey, String serviceOrgId, String serviceProjectId, String serviceRecordId, ServiceProjectFeedbackFormDTO feedbackDto); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeService.java new file mode 100644 index 0000000000..00603de5c3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeService.java @@ -0,0 +1,14 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.IcServiceScopeEntity; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +public interface IcServiceScopeService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index 5e86b438ed..1824e1feb3 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,19 @@ 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); + + Integer selectCountByServerId(String serverId); } \ No newline at end of file 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..8546add25e 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) { @@ -178,7 +182,6 @@ 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 +331,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl NumConstant.ZERO) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除"); + } baseDao.deleteById(formDTO.getOrgId()); personnelService.deleteByOrgId(formDTO.getOrgId()); } @@ -538,7 +556,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 +566,13 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl persons = new ArrayList<>(); AtomicReference bl = new AtomicReference<>(false); StringBuffer msg = new StringBuffer(""); @@ -683,9 +708,81 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl queryListById(List communityOrgIds) { if(CollectionUtils.isNotEmpty(communityOrgIds)){ - return baseDao.selectBatchIds(communityOrgIds); + return baseDao.selectByIds(communityOrgIds); } return Collections.EMPTY_LIST; } + /** + * 多元主体分析-各分类下的社区自组织数量饼图 + * + * @param customerId + * @param staffId + * @return + */ + @Override + public List 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 8b0ee7e390..5d7f450672 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 @@ -41,7 +41,7 @@ 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; @@ -52,10 +52,7 @@ import com.epmet.dao.IcPartyUnitDao; import com.epmet.dto.IcPartyUnitDTO; 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.PartyUnitListbrieResultDTO; -import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceStatDTO; import com.epmet.entity.IcPartyUnitEntity; @@ -236,6 +233,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl NumConstant.ZERO) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除"); + } // 逻辑删除(@TableLogic 注解) baseDao.deleteById(id); } @@ -593,11 +594,48 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl queryListById(List partyUnitIds) { if (CollectionUtils.isNotEmpty(partyUnitIds)) { - return baseDao.selectBatchIds(partyUnitIds); + return baseDao.selectByIds(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()); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceOrgServiceImpl.java new file mode 100644 index 0000000000..6697510040 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceOrgServiceImpl.java @@ -0,0 +1,202 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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.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.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcServiceOrgDao; +import com.epmet.dto.IcServiceOrgDTO; +import com.epmet.dto.form.IcServiceOrgAddEditFormDTO; +import com.epmet.dto.form.IcServiceOrgListFormDTO; +import com.epmet.dto.result.IcServiceOrgListResultDTO; +import com.epmet.dto.result.IcServiceOrgSelectListResultDTO; +import com.epmet.entity.IcServiceOrgEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcServiceOrgService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.MapUtils; +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.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class IcServiceOrgServiceImpl extends BaseServiceImpl implements IcServiceOrgService { + @Autowired + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + + + @Override + public PageData list(IcServiceOrgListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + //查询当前组织及下级数据 + formDTO.setAgencyId(staffInfo.getAgencyId()); + //列表/导出查询 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectServiceOrgList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + + //封装服务类别数据 + if (!CollectionUtils.isEmpty(list)) { + //服务类别字典表数据 + Result> statusRes = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List stList = null; + IcServiceOrgListResultDTO.ServiceType st = null; + StringBuffer buffer = null; + for (IcServiceOrgListResultDTO dto : list) { + stList = new ArrayList<>(); + buffer = new StringBuffer(""); + for (String str : dto.getServiceType().split(",")) { + st = new IcServiceOrgListResultDTO.ServiceType(); + st.setValue(str); + st.setName(null != statusMap.get(str) ? statusMap.get(str) : ""); + stList.add(st); + buffer.append(buffer.length() > NumConstant.ZERO ? "、" : "").append(st.getName()); + } + dto.setServiceTypeList(stList); + dto.setServiceTypeName(buffer.toString()); + } + } + + return new PageData<>(list, pageInfo.getTotal()); + } + + 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 IcServiceOrgDTO get(String id) { + IcServiceOrgEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceOrgDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceOrgAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcServiceOrgEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.eq(IcServiceOrgEntity::getOrgName, formDTO.getOrgName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的服务组织"); + } + //3.新增服务组织数据 + IcServiceOrgEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceOrgEntity.class); + entity.setAgencyId(staffInfo.getAgencyId()); + entity.setAgencyIdPath(StringUtils.isEmpty(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId()); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceOrgAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcServiceOrgEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.ne(IcServiceOrgEntity::getId, formDTO.getIcServiceOrgId()); + tWrapper.eq(IcServiceOrgEntity::getOrgName, formDTO.getOrgName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的服务组织"); + } + //3.更新服务组织数据 + IcServiceOrgEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceOrgEntity.class); + entity.setId(formDTO.getIcServiceOrgId()); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(IcServiceOrgAddEditFormDTO formDTO) { + IcServiceOrgEntity entity = new IcServiceOrgEntity(); + entity.setId(formDTO.getIcServiceOrgId()); + entity.setUpdatedBy(formDTO.getUserId()); + baseDao.del(entity); + } + + @Override + public IcServiceOrgListResultDTO detail(IcServiceOrgListFormDTO formDTO) { + IcServiceOrgListResultDTO resultDTO = new IcServiceOrgListResultDTO(); + //1.查询服务组织信息 + List list = baseDao.selectServiceOrgList(formDTO); + + //封装服务类别数据 + if (!CollectionUtils.isEmpty(list)) { + resultDTO = list.get(NumConstant.ZERO); + //服务类别字典表数据 + Result> statusRes = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List stList = new ArrayList<>(); + IcServiceOrgListResultDTO.ServiceType st = null; + StringBuffer buffer = new StringBuffer(""); + for (String str : resultDTO.getServiceType().split(",")) { + st = new IcServiceOrgListResultDTO.ServiceType(); + st.setValue(str); + st.setName(null != statusMap.get(str) ? statusMap.get(str) : ""); + stList.add(st); + buffer.append(buffer.length() > NumConstant.ZERO ? "、" : "").append(st.getName()); + } + resultDTO.setServiceTypeList(stList); + resultDTO.setServiceTypeName(buffer.toString()); + } + + return resultDTO; + } + + @Override + public List selectList(IcServiceOrgListFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getStaffId())); + } + //2.按条件查询当前组织及下级服务组织数据 + List resultList = baseDao.selectServiceOrgSelectList(formDTO); + + return resultList; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectAttachmentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectAttachmentServiceImpl.java new file mode 100644 index 0000000000..13610ad374 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectAttachmentServiceImpl.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcServiceProjectAttachmentDao; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import com.epmet.entity.IcServiceProjectAttachmentEntity; +import com.epmet.service.IcServiceProjectAttachmentService; +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 IcServiceProjectAttachmentServiceImpl extends BaseServiceImpl implements IcServiceProjectAttachmentService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcServiceProjectAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcServiceProjectAttachmentDTO.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 IcServiceProjectAttachmentDTO get(String id) { + IcServiceProjectAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceProjectAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceProjectAttachmentDTO dto) { + IcServiceProjectAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceProjectAttachmentDTO dto) { + IcServiceProjectAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectAttachmentEntity.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/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java new file mode 100644 index 0000000000..ecc399cfb3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java @@ -0,0 +1,259 @@ +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.NumConstant; +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.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.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcServiceProjectAttachmentDao; +import com.epmet.dao.IcServiceProjectDao; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import com.epmet.dto.IcServiceProjectDTO; +import com.epmet.dto.form.ServiceProjectFormDTO; +import com.epmet.dto.form.ServiceProjectListFormDTO; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.entity.IcServiceProjectAttachmentEntity; +import com.epmet.entity.IcServiceProjectEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcServiceProjectAttachmentService; +import com.epmet.service.IcServiceProjectService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class IcServiceProjectServiceImpl extends BaseServiceImpl implements IcServiceProjectService { + + @Autowired + private IcServiceProjectAttachmentService attachmentService; + @Autowired + private IcServiceProjectAttachmentDao attachmentDao; + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcServiceProjectDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcServiceProjectDTO.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 IcServiceProjectDTO get(String id) { + IcServiceProjectEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceProjectDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceProjectDTO dto) { + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceProjectDTO dto) { + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * Desc: 服务项目新增 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:04 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void serviceProjectAdd(ServiceProjectFormDTO formDTO) { + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceProjectEntity.class); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员"+formDTO.getUserId()); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new EpmetException("未查询到此组织信息"+staffInfo.getStaffId()); + } + entity.setEnabled(NumConstant.ZERO); + entity.setAgencyId(staffInfo.getAgencyId()); + entity.setPid(agencyInfo.getPid()); + entity.setAgencyIdPath((StringUtils.isBlank(agencyInfo.getPids()) || agencyInfo.getPids().equals(NumConstant.ZERO_STR)) ? staffInfo.getAgencyId() : agencyInfo.getPids().concat(":").concat(staffInfo.getAgencyId())); + baseDao.insert(entity); + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())){ + disposeAttachment(formDTO.getAttachmentList(), formDTO.getCustomerId(), entity.getId()); + } + } + + /** + * Desc: 服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:46 + */ + @Override + public PageData> serviceProjectList(ServiceProjectListFormDTO formDTO) { + PageData result = new PageData(new ArrayList(),NumConstant.ZERO); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员"+formDTO.getUserId()); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getServiceProjectList(formDTO)); + if (CollectionUtils.isNotEmpty(pageInfo.getList())){ + DictListFormDTO dictListFormDTO = new DictListFormDTO(); + dictListFormDTO.setDictType("ic_service_type"); + Result> listResult = adminOpenFeignClient.dictList(dictListFormDTO); + if (!listResult.success()){ + throw new EpmetException("获取字典表数据失败,类型为:ic_service_type"); + } + if (CollectionUtils.isNotEmpty(listResult.getData())){ + pageInfo.getList().forEach(p -> listResult.getData().stream().filter(l -> l.getValue().equals(p.getServiceCategoryKey())).forEach(l -> p.setServiceCategory(l.getLabel()))); + } + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + result.setList(pageInfo.getList()); + } + return result; + } + + /** + * Desc: 服务项目详情 + * @param formDTO + * @author zxc + * @date 2022/5/30 15:46 + */ + @Override + public ServiceProjectListResultDTO serviceProjectDetail(ServiceProjectListFormDTO formDTO) { + List serviceProjectList = baseDao.getServiceProjectList(formDTO); + if (CollectionUtils.isNotEmpty(serviceProjectList)){ + DictListFormDTO dictListFormDTO = new DictListFormDTO(); + dictListFormDTO.setDictType("ic_service_type"); + Result> listResult = adminOpenFeignClient.dictList(dictListFormDTO); + if (!listResult.success()){ + throw new EpmetException("获取字典表数据失败,类型为:ic_service_type"); + } + if (CollectionUtils.isNotEmpty(listResult.getData())){ + serviceProjectList.forEach(p -> listResult.getData().stream().filter(l -> l.getValue().equals(p.getServiceCategoryKey())).forEach(l -> p.setServiceCategory(l.getLabel()))); + } + return serviceProjectList.get(NumConstant.ZERO); + } + return new ServiceProjectListResultDTO(); + } + + /** + * Desc: 修改【服务项目】 + * @param formDTO + * @author zxc + * @date 2022/5/30 09:36 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void serviceProjectEdit(ServiceProjectFormDTO formDTO) { + LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); + qw.eq(IcServiceProjectEntity::getId,formDTO.getServiceProjectId()); + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceProjectEntity.class); + baseDao.update(entity,qw); + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())){ + // 先删后增 + attachmentDao.delAttachmentByServiceProjectId(formDTO.getServiceProjectId()); + disposeAttachment(formDTO.getAttachmentList(), formDTO.getCustomerId(), formDTO.getServiceProjectId()); + }else { + attachmentDao.delAttachmentByServiceProjectId(formDTO.getServiceProjectId()); + } + } + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void serviceProjectEnabled(List ids) { + if (CollectionUtils.isNotEmpty(ids)){ + baseDao.serviceProjectEnabled(ids); + } + } + + /** + * Desc: 附件处理 + * @param attachmentList + * @param customerId + * @param serviceId + * @author zxc + * @date 2022/5/30 10:17 + */ + public void disposeAttachment(List attachmentList,String customerId,String serviceId){ + attachmentList.forEach(a -> { + a.setAttachmentName(a.getName()); + a.setAttachmentFormat(a.getFormat()); + a.setAttachmentType(a.getType()); + a.setAttachmentUrl(a.getUrl()); + }); + List entities = ConvertUtils.sourceToTarget(attachmentList, IcServiceProjectAttachmentEntity.class); + Integer sort = NumConstant.ZERO; + for (IcServiceProjectAttachmentEntity e : entities) { + e.setCustomerId(customerId); + e.setStatus("auto_passed"); + e.setSort(sort); + e.setIcServiceId(serviceId); + e.setAttachTo("service"); + sort++; + } + attachmentService.insertBatch(entities); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java new file mode 100644 index 0000000000..214b762cfc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java @@ -0,0 +1,324 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.ServiceConstant; +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.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; +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.GridInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.*; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.form.IcServiceEditFormDTO; +import com.epmet.dto.form.ServiceProjectFeedbackFormDTO; +import com.epmet.dto.form.ServiceProjectRecordFormDTO; +import com.epmet.dto.result.IcServiceRecDetailRes; +import com.epmet.dto.result.IcServiceScopeDTO; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.*; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.IcServiceRecordService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +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.Date; +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Service +public class IcServiceRecordServiceImpl extends BaseServiceImpl implements IcServiceRecordService, ResultDataResolver { + @Autowired + private IcServiceScopeDao icServiceScopeDao; + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + @Autowired + private IcServiceProjectDao serviceProjectDao; + @Autowired + private IcServiceOrgDao serviceOrgDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcServiceFeedbackDao serviceFeedbackDao; + @Autowired + private IcServiceProjectAttachmentDao serviceProjectAttachmentDao; + @Autowired + private IcServiceRecordDao serviceRecordDao; + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7820 + * + * @param serviceId 【服务项目记录】取消:进行中的项目可以取消。删除该记录 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void cancelService(String serviceId,String userId) { + IcServiceRecordEntity icServiceRecordEntity = baseDao.selectById(serviceId); + if (null == icServiceRecordEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),String.format("服务记录不存在,serviceId:%s",serviceId),"服务记录不存在"); + } + if (!"in_service".equals(icServiceRecordEntity.getServiceStatus())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("服务状态:%s", icServiceRecordEntity.getServiceStatus()), "只有服务中的项目可以取消"); + } + baseDao.deleteById(serviceId); + icServiceScopeDao.update(serviceId,userId); + } + + /** + * 【服务项目记录】详情 + * + * @param serviceId + * @return + */ + @Override + public IcServiceRecDetailRes queryServiceDetail(String serviceId) { + IcServiceRecordEntity icServiceRecordEntity = baseDao.selectById(serviceId); + IcServiceRecDetailRes res = ConvertUtils.sourceToTarget(icServiceRecordEntity, IcServiceRecDetailRes.class); + if (null != res) { + res.setServiceScope(icServiceScopeDao.selectList(serviceId)); + //服务分类名称 + Result> icServiceTypeMapRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()); + if (!icServiceTypeMapRes.success() || MapUtils.isEmpty(icServiceTypeMapRes.getData())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务分类字典查询异常"); + } + res.setServiceCategoryName(icServiceTypeMapRes.getData().get(res.getServiceCategoryKey())); + res.setFeedBack(serviceFeedbackDao.selectByRecId(icServiceRecordEntity.getId())); + } + return res; + } + + /** + * 【服务项目记录】修改 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void updateServiceRecord(IcServiceEditFormDTO formDTO) { + IcServiceRecordEntity icServiceRecordEntity = baseDao.selectById(formDTO.getServiceRecordId()); + if (null == icServiceRecordEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),String.format("服务记录不存在,serviceRecordId:%s",formDTO.getServiceRecordId()),"服务记录不存在"); + } + icServiceRecordEntity.setServiceTimeStart(formDTO.getServiceTimeStart()); + icServiceRecordEntity.setServiceTimeEnd(formDTO.getServiceTimeEnd()); + if(StringUtils.isNotBlank(formDTO.getPrincipalContact())){ + icServiceRecordEntity.setPrincipalContact(formDTO.getPrincipalContact()); + } + if(StringUtils.isNotBlank(formDTO.getPrincipalName())){ + icServiceRecordEntity.setPrincipalName(formDTO.getPrincipalName()); + } + if(StringUtils.isNotBlank(formDTO.getRemark())){ + icServiceRecordEntity.setRemark(formDTO.getRemark()); + } + baseDao.updateById(icServiceRecordEntity); + } + + + @Override + public PageData listServiceRecords(String serviceCategoryKey, String serviceProjectName, + String serviceOrgName, Date serviceTimeStart, + Date serviceTimeEnd, String serviceStatus, + String satisfaction, Integer pageNo, + Integer pageSize) { + + String msg = "【服务列表】查询服务类别失败"; + Map categories = getResultDataOrThrowsException(adminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()), + ServiceConstant.EPMET_ADMIN_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); + + if (categories == null || categories.size() == 0) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); + } + + PageHelper.startPage(pageNo, pageSize); + List records = baseDao.listServiceRecords(serviceCategoryKey, serviceProjectName, serviceOrgName, serviceTimeStart, serviceTimeEnd, serviceStatus, satisfaction); + PageInfo pi = new PageInfo<>(records); + + // 补充信息 + records.forEach(r->{ + String categoryKey = r.getServiceCategoryKey(); + r.setServiceCategoryName(categories.get(categoryKey)); + }); + + return new PageData<>(records, pi.getTotal()); + } + + @Transactional(rollbackFor = Throwable.class) + public void initiateService(ServiceProjectRecordFormDTO input) { + + // 同一个项目暂时不做服务次数限制 + //LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + //query.eq(IcServiceRecordEntity::getServiceProjectId, input.getServiceProjectId()); + // + //if (serviceRecordDao.selectCount(query) > 0) { + // String msg = "该项目已经发起服务,不能重复发起"; + // throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + //} + + IcServiceProjectEntity serviceProject = serviceProjectDao.selectById(input.getServiceProjectId()); + IcServiceOrgEntity serviceOrg = serviceOrgDao.selectById(input.getServiceOrgId()); + + ServiceProjectFeedbackFormDTO feedbackDto = input.getFeedback(); + + // 1.服务记录 + IcServiceRecordEntity serviceRecord = new IcServiceRecordEntity(); + serviceRecord.setServiceCategoryKey(input.getServiceCategoryKey()); + serviceRecord.setServiceProjectId(input.getServiceProjectId()); + serviceRecord.setServiceProjectName(serviceProject.getServiceName()); + serviceRecord.setServiceOrgId(input.getServiceOrgId()); + serviceRecord.setServiceOrgName(serviceOrg.getOrgName()); + serviceRecord.setPrincipalName(input.getPrincipalName()); + serviceRecord.setPrincipalContact(input.getPrincipalContact()); + serviceRecord.setServiceTimeStart(input.getServiceTimeStart()); + serviceRecord.setServiceTimeEnd(input.getServiceTimeEnd()); + if (feedbackDto == null) { + // 没写反馈,给一个服务中 + serviceRecord.setServiceStatus("in_service"); + } else { + // 写了反馈,按照反馈的来 + serviceRecord.setServiceStatus(feedbackDto.getServiceStatus()); + serviceRecord.setServicePeopleNumber(feedbackDto.getServicePeopleNumber()); + } + serviceRecord.setRemark(input.getRemark()); + + baseDao.insert(serviceRecord); + + // 2.服务范围列表 + List serviceScope = input.getServiceScope(); + + serviceScope.stream().forEach(s -> { + String[] scopeObjectIdPathAndName = getScopeObjectIdPath(s.getObjectType(), s.getObjectId()); + IcServiceScopeEntity scope = new IcServiceScopeEntity(); + scope.setServiceCategoryKey(input.getServiceCategoryKey()); + scope.setServiceProjectId(input.getServiceProjectId()); + scope.setServiceOrgId(input.getServiceOrgId()); + scope.setServiceRecordId(serviceRecord.getId()); + scope.setObjectType(s.getObjectType()); + scope.setObjectId(s.getObjectId()); + scope.setObjectIdPath(scopeObjectIdPathAndName[0]); + scope.setObjectName(scopeObjectIdPathAndName[1]); + icServiceScopeDao.insert(scope); + //scope.setRemark(); 为什么会有这个字段?? + }); + + // 3.反馈 + if (feedbackDto == null) { + return; + } + + serviceFeedback(input.getServiceCategoryKey(), input.getServiceOrgId(), input.getServiceProjectId(), serviceRecord.getId(), feedbackDto); + } + + /** + * 查询服务范围的对象的Id path + * @param scopeObjectType + * @param scopeObjectId + * @return + */ + private String[] getScopeObjectIdPath(String scopeObjectType, String scopeObjectId) { + if ("neighborhood".equals(scopeObjectType)) { + + String msg = String.format("【服务项目】-发起服务-根据范围id查询小区信息失败。scopeObjectType:%s, scopeObjectId:%s", + scopeObjectType, scopeObjectId); + + IcNeighborHoodDTO neighborHoodDTO = getResultDataOrThrowsException(govOrgOpenFeignClient.getIcNeighbordhoodById(scopeObjectId), + ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + msg, msg); + + GridInfoCache gridOfNeighborhood = CustomerOrgRedis.getGridInfo(neighborHoodDTO.getGridId()); + + String agencyPids = neighborHoodDTO.getAgencyPids(); + String agencyId = neighborHoodDTO.getAgencyId(); + String gridId = gridOfNeighborhood.getId(); + + return new String[]{ agencyPids.concat(":") + .concat(agencyId).concat(":") + .concat(gridId).concat(":") + .concat(neighborHoodDTO.getId()), + neighborHoodDTO.getNeighborHoodName() }; + } else if ("agency".equals(scopeObjectType)) { + // 组织的pids是到父级组织 + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(scopeObjectId); + if ("0".equals(agencyInfo.getPid())) { + return new String[]{ agencyInfo.getId(), agencyInfo.getOrganizationName() }; + } + return new String[]{ agencyInfo.getPids().concat(":").concat(agencyInfo.getPid()), agencyInfo.getOrganizationName() }; + } else if ("grid".equals(scopeObjectType)) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(scopeObjectId); + // 网格的pids是到社区的 + return new String[]{ gridInfo.getPids().concat(":").concat(gridInfo.getId()), gridInfo.getGridName() }; + } else { + String msg = String.format("【服务项目】-发起服务-范围type未知:scopeObjectType:%s,scopeObjectId:%s", scopeObjectType, scopeObjectId); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + } + + @Transactional(rollbackFor = Throwable.class) + @Override + public void serviceFeedback(String serviceCategoryKey, String serviceOrgId, String serviceProjectId, String serviceRecordId, ServiceProjectFeedbackFormDTO feedbackDto) { + + // 如果还在服务中,那么需要改为已结束 + IcServiceRecordEntity serviceRecord = serviceRecordDao.selectById(serviceRecordId); + if ("in_service".equals(serviceRecord.getServiceStatus())) { + serviceRecord.setServiceStatus("completed"); + serviceRecord.setServicePeopleNumber(feedbackDto.getServicePeopleNumber()); + serviceRecordDao.updateById(serviceRecord); + } + + // 反馈信息 + IcServiceFeedbackEntity feedbackEntity = new IcServiceFeedbackEntity(); + feedbackEntity.setServiceCategoryKey(serviceCategoryKey); + feedbackEntity.setServiceProjectId(serviceProjectId); + feedbackEntity.setServiceOrgId(serviceOrgId); + feedbackEntity.setServiceGoal(feedbackDto.getServiceGoal()); + feedbackEntity.setServiceEffect(feedbackDto.getServiceEffect()); + //feedbackEntity.setServicePeopleNumber(feedbackDto.getServicePeopleNumber()); + feedbackEntity.setSatisfaction(feedbackDto.getSatisfaction()); + feedbackEntity.setLongitude(feedbackDto.getLongitude()); + feedbackEntity.setLatitude(feedbackDto.getLatitude()); + feedbackEntity.setAddress(feedbackDto.getAddress()); + feedbackEntity.setServiceRecordId(serviceRecordId); + serviceFeedbackDao.insert(feedbackEntity); + + // 反馈附件列表 + List attachmentList = feedbackDto.getAttachmentList(); + if (CollectionUtils.isNotEmpty(attachmentList)) { + for (int i = 0; i < attachmentList.size(); i++) { + ServiceProjectFeedbackFormDTO.Attachment a = attachmentList.get(i); + + IcServiceProjectAttachmentEntity at = new IcServiceProjectAttachmentEntity(); + at.setAttachmentFormat(a.getAttachmentFormat()); + at.setAttachmentName(a.getAttachmentName()); + at.setAttachmentType(a.getAttachmentType()); + at.setAttachmentUrl(a.getAttachmentUrl()); + // feedback:反馈,service:服务本身 + at.setAttachTo("feedback"); + at.setDuration(0); + at.setIcServiceId(feedbackEntity.getId()); + // 根本不需要审核,逗你玩 + at.setReason(null); + at.setStatus("auto_passed"); + at.setSort(i); + serviceProjectAttachmentDao.insert(at); + } + } + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeServiceImpl.java new file mode 100644 index 0000000000..8324f297d3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeServiceImpl.java @@ -0,0 +1,19 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.IcServiceScopeDao; +import com.epmet.entity.IcServiceScopeEntity; +import com.epmet.service.IcServiceScopeService; +import org.springframework.stereotype.Service; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Service +public class IcServiceScopeServiceImpl extends BaseServiceImpl implements IcServiceScopeService { + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 433f118f42..2d04bec434 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); + } + + @Override + public Integer selectCountByServerId(String serverId) { + return baseDao.selectCountByServerId(serverId); + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index ee3924bdb5..7c4f924e20 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -162,9 +162,9 @@ public class WorkActServiceImpl implements WorkActService { //校验参数 //校验 活动报名截止时间应该大于当前时间 - if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){ - throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg()); - } + // if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){ + // throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg()); + // } this.checkPublishFormDTO(actInfoEntity); PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); //内容审核(活动标题、招募要求、活动内容图文) @@ -202,10 +202,10 @@ public class WorkActServiceImpl implements WorkActService { ActInfoEntity actInfoEntity=this.constructActInfo(formDTO); //校验参数 - //校验 活动报名截止时间应该大于当前时间 - if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){ - throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg()); - } + // //校验 活动报名截止时间应该大于当前时间 + // if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){ + // throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg()); + // } this.checkPublishFormDTO(actInfoEntity); PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); //内容审核(活动标题、招募要求、活动内容图文) 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/db/migration/V0.0.17__ic_service_project.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.17__ic_service_project.sql new file mode 100644 index 0000000000..8882e7c143 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.17__ic_service_project.sql @@ -0,0 +1,137 @@ + +CREATE TABLE `ic_service_project` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID', + `PID` varchar(64) NOT NULL COMMENT '组织ID的上级', + `AGENCY_ID_PATH` varchar(255) NOT NULL COMMENT '组织ID的所有上级[包括自己]', + `SERVICE_CATEGORY_KEY` varchar(10) NOT NULL COMMENT '服务类别值', + `SERVICE_NAME` varchar(2000) NOT NULL COMMENT '服务名称', + `SERVICE_CONTENT` varchar(2000) NOT NULL COMMENT '服务内容', + `POLICY_LEVEL` varchar(1) DEFAULT '' COMMENT '政策级别,0市级;1区级;2街道级', + `POLICY_GROUND` varchar(2000) DEFAULT NULL COMMENT '政策依据', + `ENABLED` int(1) NOT NULL COMMENT '启用状态,0启用,1禁用', + `DEL_FLAG` int(1) NOT NULL, + `REVISION` int(1) 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务项目管理表'; + + +CREATE TABLE `ic_service_project_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_SERVICE_ID` varchar(64) NOT NULL COMMENT '服务记录id,服务项目id', + `ATTACH_TO` varchar(32) DEFAULT NULL COMMENT '隶属于。feedback:反馈;service:服务本身', + `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 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件附件表'; + +CREATE TABLE `ic_service_org` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '所属组织机构Id', + `AGENCY_ID_PATH` varchar(256) NOT NULL COMMENT 'agencyId的所有上级,包含自己', + `SERVICE_TYPE` varchar(64) NOT NULL COMMENT '服务类别【字典表 ic_service_type】多个值逗号分隔', + `ORG_NAME` varchar(64) NOT NULL COMMENT '服务组织名称', + `ORG_DESCRIBE` varchar(512) DEFAULT NULL COMMENT '组织描述', + `PRINCIPAL_NAME` varchar(64) NOT NULL COMMENT '负责人姓名', + `PRINCIPAL_MOBILE` varchar(11) NOT NULL COMMENT '负责人电话', + `LONGITUDE` varchar(64) DEFAULT NULL COMMENT '经度', + `LATITUDE` varchar(64) DEFAULT NULL COMMENT '纬度', + `ADDRESS` varchar(256) DEFAULT NULL COMMENT '地址', + `REMARK` varchar(512) DEFAULT NULL COMMENT '备注', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(10) 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_pid` (`AGENCY_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='服务组织表'; + + +CREATE TABLE `ic_service_record` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `SERVICE_PROJECT_ID` varchar(64) NOT NULL COMMENT '服务项目ID', + `SERVICE_PROJECT_NAME` varchar(255) NOT NULL COMMENT '服务项目名称', + `SERVICE_ORG_ID` varchar(64) NOT NULL COMMENT '服务组织ID', + `SERVICE_ORG_NAME` varchar(255) NOT NULL COMMENT '服务组织名称', + `PRINCIPAL_NAME` varchar(32) DEFAULT NULL COMMENT '经办人姓名', + `PRINCIPAL_CONTACT` varchar(64) DEFAULT NULL COMMENT '联系方式', + `SERVICE_TIME_START` datetime NOT NULL COMMENT '服务时间', + `SERVICE_TIME_END` datetime NOT NULL COMMENT '服务截止时间', + `SERVICE_STATUS` varchar(32) NOT NULL COMMENT 'in_service服务中;completed:已完成', + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注', + `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 '更新时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `SERVICE_CATEGORY_KEY` varchar(64) NOT NULL COMMENT '服务类别ID', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '服务项目记录表'; + +CREATE TABLE `ic_service_feedback` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `SERVICE_PROJECT_ID` varchar(64) NOT NULL COMMENT '服务项目ID', + `SERVICE_ORG_ID` varchar(64) NOT NULL COMMENT '服务组织ID', + `SERVICE_GOAL` varchar(255) DEFAULT NULL COMMENT '服务目标', + `SERVICE_EFFECT` varchar(255) DEFAULT NULL COMMENT '服务效果', + `SERVICE_PEOPLE_NUMBER` int(10) DEFAULT NULL COMMENT '服务人数', + `SATISFACTION` varchar(30) DEFAULT NULL COMMENT '满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect', + `LONGITUDE` varchar(255) DEFAULT NULL COMMENT '地址经度', + `LATITUDE` varchar(255) DEFAULT NULL COMMENT '地址纬度', + `address` varchar(64) DEFAULT NULL COMMENT '地址', + `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 '更新时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `SERVICE_RECORD_ID` varchar(64) NOT NULL, + `SERVICE_CATEGORY_KEY` varchar(64) NOT NULL COMMENT '服务类别ID', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '服务项目反馈信息'; + + +CREATE TABLE `ic_service_scope` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `SERVICE_PROJECT_ID` varchar(64) NOT NULL COMMENT '服务项目ID', + `SERVICE_ORG_ID` varchar(64) NOT NULL COMMENT '服务组织ID', + `SERVICE_RECORD_ID` varchar(64) NOT NULL COMMENT '服务记录的ID', + `OBJECT_TYPE` varchar(32) NOT NULL COMMENT 'agency单位;grid网格;neighborhood小区', + `OBJECT_ID` varchar(64) NOT NULL COMMENT '选中的组织的ID', + `OBJECT_ID_PATH` varchar(255) NOT NULL COMMENT '发布范围的组织ID PATH', + `OBJECT_NAME` varchar(32) DEFAULT NULL, + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注', + `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 '更新时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `SERVICE_CATEGORY_KEY` varchar(64) NOT NULL COMMENT '服务类别ID', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '服务范围表' \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.18__alter_service_org.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.18__alter_service_org.sql new file mode 100644 index 0000000000..32cb514da9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.18__alter_service_org.sql @@ -0,0 +1,6 @@ +ALTER TABLE `ic_service_org` +MODIFY COLUMN `ORG_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '服务组织名称' AFTER `SERVICE_TYPE`, +MODIFY COLUMN `ORG_DESCRIBE` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组织描述' AFTER `ORG_NAME`, +MODIFY COLUMN `PRINCIPAL_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '负责人姓名' AFTER `ORG_DESCRIBE`, +MODIFY COLUMN `PRINCIPAL_MOBILE` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '负责人电话' AFTER `PRINCIPAL_NAME`; + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.19__service_move_people_to_record.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.19__service_move_people_to_record.sql new file mode 100644 index 0000000000..703651cf09 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.19__service_move_people_to_record.sql @@ -0,0 +1,2 @@ +alter table ic_service_record + add SERVICE_PEOPLE_NUMBER int(10) comment '服务人数' after SERVICE_STATUS; \ 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..d7b90133a4 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,70 @@ 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 d5d5f01079..c1800190cb 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 @@ -126,10 +126,71 @@ a.type + + + + + + + + + update ic_party_unit set SATISFACTION=#{satisfaction},UPDATED_TIME=NOW() where del_flag='0' and id=#{partyUnitId} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackDao.xml new file mode 100755 index 0000000000..2f58637231 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackDao.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceOrgDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceOrgDao.xml new file mode 100644 index 0000000000..18c6dbe981 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceOrgDao.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + UPDATE ic_service_org + SET del_flag = '1', + updated_by = #{updatedBy}, + updated_time = NOW() + WHERE + id = #{id} + AND del_flag = '0' + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectAttachmentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectAttachmentDao.xml new file mode 100644 index 0000000000..e33c5a3958 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectAttachmentDao.xml @@ -0,0 +1,11 @@ + + + + + + + + DELETE FROM ic_service_project_attachment + WHERE IC_SERVICE_ID = #{id} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml new file mode 100644 index 0000000000..17f4de965a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml @@ -0,0 +1,72 @@ + + + + + + + + UPDATE ic_service_project + SET ENABLED = 1, + UPDATED_TIME = NOW() + WHERE ID IN ( + #{id} + ) + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordDao.xml new file mode 100644 index 0000000000..ad5df068ef --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordDao.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml new file mode 100644 index 0000000000..026d8c6ac4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + update ic_service_scope set del_flag='1',UPDATED_TIME=now(),UPDATED_BY=#{userId} + where SERVICE_RECORD_ID=#{serviceId} + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index 02432b91c5..158dcb1b7d 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,36 @@ 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 b0a4d6f1e5..1e0d00c9ba 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..7a1537bdd1 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserHouseService.java @@ -0,0 +1,37 @@ +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); + + /** + * 人房信息统计 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/30 10:25 + */ + Result execUserHouseNeighborhoodStatistical(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..653c0ae7e8 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserHouseServiceImpl.java @@ -0,0 +1,35 @@ +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); + } + + @Override + public Result execUserHouseNeighborhoodStatistical(FactUserHouseFormDTO formDTO) { + return dataStatisticalOpenFeignClient.userHouseStatNeighborhood(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..9925ed4391 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserHouseTask.java @@ -0,0 +1,55 @@ +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()); + } + + result = statsUserHouseService.execUserHouseNeighborhoodStatistical(formDTO); + if (result.success()) { + logger.info("StatsUserHouseTask-neighborhood定时任务执行成功"); + } else { + logger.error("StatsUserHouseTask-neighborhood定时任务执行失败:" + result.getMsg()); + } + } +} 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-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..e913c9442b 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,27 @@ 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; + + private String selectType; } 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/ServiceProjectScopeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ServiceProjectScopeResultDTO.java new file mode 100644 index 0000000000..a727b2dae8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ServiceProjectScopeResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ServiceProjectScopeResultDTO { + + private String objectId; + private String objectName; + private String objectType; + + private List children; + +} 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/dto/result/UserHouseScopeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UserHouseScopeResultDTO.java new file mode 100644 index 0000000000..b36cace1e1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UserHouseScopeResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class UserHouseScopeResultDTO { + + private String objectId; + private String objectName; + private String objectType; + + private List children; + +} 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/deploy/docker-compose-prod.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml index c0ee252ff0..d93a6203ca 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml @@ -9,10 +9,10 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-org.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx1024m -jar ./gov-org.jar" restart: "unless-stopped" deploy: resources: limits: cpus: '0.1' - memory: 600M + memory: 1100M 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 307271c01e..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 @@ -429,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 5fb5deae73..297a4c9e7a 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,7 +30,9 @@ 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; @@ -39,13 +41,17 @@ 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.ExcelFillCellMergeStrategy; +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; @@ -61,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; @@ -90,14 +99,21 @@ 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所在组织信息失败"); formDTO.setAgencyId(loginUserDetail.getAgencyId()); ValidatorUtils.validateEntity(formDTO); + formDTO.setSelectType("id"); return new Result().ok(houseService.getHouseList(formDTO)); } @@ -144,12 +160,13 @@ public class HouseController implements ResultDataResolver { formDTO.setAgencyId(loginUserDetail.getAgencyId()); formDTO.setBuildingName(buildingName); formDTO.setNeighborHoodName(neighborhoodName); + formDTO.setSelectType("agency"); return new Result>().ok(houseService.getHouseList(formDTO)); } @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(); @@ -321,12 +338,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(); } @@ -344,12 +362,14 @@ public class HouseController implements ResultDataResolver { @NoRepeatSubmit @RequestMapping(value = "/exportHouseUser") public void exportHouseUser(@LoginUser TokenDto tokenDto, @RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception { + long startTime = System.currentTimeMillis(); 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()); + formDTO.setSelectType("agency"); } ValidatorUtils.validateEntity(formDTO); @@ -367,28 +387,35 @@ 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); + //ExcelFillCellMergeStrategy mergeStrategy = new ExcelFillCellMergeStrategy(2,mergeRowArr,false); + ExcelFillRowMergeStrategy mergeStrategy2 = new ExcelFillRowMergeStrategy(mergeRowArr, false); WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1") .head(HouseMemberResultDTO.class) - .registerWriteHandler(mergeStrategy) + .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); excelWriter.write(dataList.getList(), writeSheet); - 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(); } catch (EpmetException e) { @@ -396,14 +423,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); } } + /** + * @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.getCustomerId()); + + } + + /** + * @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/controller/ServiceProjectController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/ServiceProjectController.java new file mode 100644 index 0000000000..6bae4e8f2f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/ServiceProjectController.java @@ -0,0 +1,35 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.result.ServiceProjectScopeResultDTO; +import com.epmet.service.ServiceProjectService; +import com.epmet.service.impl.ServiceProjectServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 服务项目 + */ +@RestController +@RequestMapping("icServiceProject") +public class ServiceProjectController { + + @Autowired + public ServiceProjectService serviceProjectService; + + + /** + * 服务范围树查询 + * @return + */ + @RequestMapping("service/serviceScopeTree") + public Result getServiceScopeTree(@LoginUser TokenDto loginInfo) { + ServiceProjectScopeResultDTO r = serviceProjectService.getServiceScopeTree(loginInfo.getUserId()); + return new Result().ok(r); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/UserHouseScopeController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/UserHouseScopeController.java new file mode 100644 index 0000000000..3a5e67704f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/UserHouseScopeController.java @@ -0,0 +1,32 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.UserHouseScopeResultDTO; +import com.epmet.service.UserHouseScopeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 服务项目 + */ +@RestController +@RequestMapping("userhouse") +public class UserHouseScopeController { + + @Autowired + public UserHouseScopeService userHouseScopeService; + + + /** + * 服务范围树查询 + * @return + */ + @RequestMapping("service/serviceScopeTree") + public Result getServiceScopeTree(@LoginUser TokenDto loginInfo) { + UserHouseScopeResultDTO r = userHouseScopeService.getServiceScopeTree(loginInfo.getUserId()); + return new Result().ok(r); + } +} 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 36e69c50a9..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 @@ -296,34 +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); /** - * @describe: 通过用户所属的行政组织和行政类型,查询下级的组织树 - * @author wangtong - * @date 2022/5/18 17:23 - * @params [formDto] - * @return java.util.List - */ + * @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 10aaebfc1a..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 @@ -289,6 +289,13 @@ public interface CustomerAgencyService extends BaseService **/ AgencyTreeResultDTO rootAgencyGridTree(String agencyId); + /** + * 当前agencyId的下一级组织+直属网格 + * @param agencyId + * @return + */ + List subOrgList(String agencyId); + /** * @describe: 通过用户所属的行政组织和行政类型,查询下级的组织树 * @author wangtong @@ -297,4 +304,10 @@ public interface CustomerAgencyService extends BaseService * @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..6316690b89 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(String customerId); } 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/ServiceProjectService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/ServiceProjectService.java new file mode 100644 index 0000000000..22058470de --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/ServiceProjectService.java @@ -0,0 +1,9 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.result.ServiceProjectScopeResultDTO; +import com.epmet.entity.IcPlaceOrgEntity; + +public interface ServiceProjectService { + ServiceProjectScopeResultDTO getServiceScopeTree(String staffId); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/UserHouseScopeService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/UserHouseScopeService.java new file mode 100644 index 0000000000..31fb3be5b8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/UserHouseScopeService.java @@ -0,0 +1,7 @@ +package com.epmet.service; + +import com.epmet.dto.result.UserHouseScopeResultDTO; + +public interface UserHouseScopeService { + UserHouseScopeResultDTO getServiceScopeTree(String staffId); +} 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..6a95c20596 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 @@ -19,18 +19,18 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.CustomerAgencyConstant; import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.*; import com.epmet.dto.BuildingTreeLevelDTO; import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.BuildingResultDTO; -import com.epmet.dto.result.BuildingResultPagedDTO; -import com.epmet.dto.result.IcBuildingListResultDTO; -import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.enums.BuildingTypeEnums; import com.epmet.excel.IcBuildingExcel; @@ -264,6 +264,14 @@ public class BuildingServiceImpl implements BuildingService { } + /** + * Desc: + * 2022-06-06 需求变动,只返回当前组织下级ID + * @param customerId + * @param staffId + * @author zxc + * @date 2022/6/6 09:19 + */ @Override public List treeIds(String customerId, String staffId) { List result = new ArrayList<>(); @@ -272,34 +280,25 @@ public class BuildingServiceImpl implements BuildingService { log.error("com.epmet.service.impl.BuildingServiceImpl.treeIds,没有找到工作人员所属的机关信息,用户Id:{}", staffId); return new ArrayList<>(); } - //1.获取所在组织及下级组织 - CustomerAgencyEntity customerAgency = customerAgencyDao.selectById(agency.getAgencyId()); - List customerAgencyList = icBuildingDao.selectAgencyChildrenList(agency.getAgencyId()); - customerAgencyList.add(customerAgency); - if (CollectionUtils.isEmpty(customerAgencyList)) { - return new ArrayList<>(); + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agency.getAgencyId()); + if (null == agencyInfo){ + throw new EpmetException("未查询到组织信息"+agency.getAgencyId()); } - result.addAll(customerAgencyList.stream().map(m -> m.getId()).collect(Collectors.toList())); - List agencyList = customerAgencyList.stream().map(item -> { - BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); - buildingTreeLevelDTO.setId(item.getId()); - buildingTreeLevelDTO.setPId(item.getPid()); - buildingTreeLevelDTO.setLabel(item.getOrganizationName()); - buildingTreeLevelDTO.setLevel(item.getLevel()); - buildingTreeLevelDTO.setLongitude(item.getLongitude()); - buildingTreeLevelDTO.setLatitude(item.getLatitude()); - buildingTreeLevelDTO.setChildren(new ArrayList<>()); - //当前组织有几个下级组织 - buildingTreeLevelDTO.setShowNum(StrConstant.EPMETY_STR); - return buildingTreeLevelDTO; - }).collect(Collectors.toList()); - //2.获取组织所在网格 - List agencyIdList = customerAgencyList.stream().map(BaseEpmetEntity::getId).collect(Collectors.toList()); - List customerGridList = customerGridDao.selectList(new QueryWrapper().lambda().in(CustomerGridEntity::getPid, agencyIdList)); - if (CollectionUtils.isEmpty(customerGridList)) { - return result; + if (agencyInfo.getLevel().equals(CustomerAgencyConstant.COMMUNITY_LEVEL)){ + // 查询所属组织的下级网格 + List agencyGridListResultDTOS = customerGridDao.selectAgencyGridList(agency.getAgencyId()); + if (!CollectionUtils.isEmpty(agencyGridListResultDTOS)){ + result.addAll(agencyGridListResultDTOS.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + result.add(agency.getAgencyId()); + } + }else { + // 查询组织下的组织 + List sonAgencyId = customerAgencyDao.getSonAgencyId(agency.getAgencyId()); + if (!CollectionUtils.isEmpty(sonAgencyId)){ + result.addAll(sonAgencyId.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); + result.add(agency.getAgencyId()); + } } - result.addAll(customerGridList.stream().map(m -> m.getId()).collect(Collectors.toList())); return result; } @@ -454,7 +453,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 30ce0e3394..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 @@ -1515,4 +1515,31 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl 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 451d9e262d..b98c0bcf3b 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(10, TimeUnit.SECONDS).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); @@ -275,30 +314,33 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { @Override public PageData getHouseList(IcHouseListFormDTO formDTO) { - // 查询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()); + if (StringUtils.isNotBlank(formDTO.getSelectType()) && formDTO.getSelectType().equals("agency")){ + if (StringUtils.isNotBlank(formDTO.getAgencyId())){ + pids = getPids(formDTO.getAgencyId()); + } + }else if (StringUtils.isNotBlank(formDTO.getSelectType()) && formDTO.getSelectType().equals("id")){ + if (StringUtils.isNotBlank(formDTO.getLevel()) && OrgTypeEnum.AGENCY.getCode().equals(formDTO.getLevel())){ + pids = getPids(formDTO.getId()); + } } 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 +361,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 +402,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 +423,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 +507,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 +618,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { /** * Desc: 根据类型更新排序 + * * @param formDTO * @author zxc * @date 2022/5/6 08:50 @@ -582,10 +626,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); } @@ -597,52 +641,60 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { resiParam.setCustomerId(tokenDto.getCustomerId()); resiParam.setAgencyId(formDTO.getAgencyId()); resiParam.setGridId(formDTO.getGridId()); - resiParam.setPageSize(NumConstant.ONE_THOUSAND); + resiParam.setPageSize(NumConstant.TEN_THOUSAND); resiParam.setIsPage(false); - //查询级别 默认按照小区去查 + //查询级别 默认按照房屋的组织去查 int searchLevel = 0; - //如果楼宇id不为空 则直接查询楼宇内的居民 - if (StringUtils.isNotEmpty(formDTO.getBuildingId())){ + //如果小区id不为空 则直接查询小区内的居民 + if (StringUtils.isNotEmpty(formDTO.getNeighborHoodId())) { searchLevel = 1; } - //如果有具体的查询套件 则直接降级为2 按照房屋Id 来查 - if (StringUtils.isNotEmpty(formDTO.getOwnerName()) || StringUtils.isNotEmpty(formDTO.getOwnerPhone()) || StringUtils.isNotEmpty(formDTO.getRentFlag())){ + //如果楼宇id不为空 则直接查询楼宇内的居民 + if (StringUtils.isNotEmpty(formDTO.getBuildingId())) { searchLevel = 2; } - + //如果有具体的查询套件 则直接按照房屋Id 来查 + if (StringUtils.isNotEmpty(formDTO.getOwnerName()) || StringUtils.isNotEmpty(formDTO.getOwnerPhone()) || StringUtils.isNotEmpty(formDTO.getRentFlag())) { + searchLevel = 3; + } + long start = System.currentTimeMillis(); PageData houseData = this.getHouseList(formDTO); + 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()); - - houseData.getList().forEach(o ->{ + AtomicInteger num = new AtomicInteger((formDTO.getPageNo() - 1) * formDTO.getPageSize()); - resiParam.setNeighborHoodId(o.getNeighborHoodId()); - if (finalSearchLevel == 1){ + houseData.getList().forEach(o -> { + resiParam.setAgencyId(o.getAgencyId()); + if (finalSearchLevel == 1) { + resiParam.setNeighborHoodId(o.getNeighborHoodId()); + } + if (finalSearchLevel == 2) { resiParam.setBuildingId(o.getBuildingId()); } - if (finalSearchLevel == 2){ + 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()); @@ -665,34 +717,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.getAgencyId(); + String searchKey = resiParam.getHouseId() + resiParam.getBuildingId() + resiParam.getNeighborHoodId() + resiParam.getGridId() + resiParam.getAgencyId(); Boolean haveSearch = haveSearchCache.getIfPresent(searchKey); - if (haveSearch!= null && haveSearch){ + //log.info("getHouseUser getHouseMembers searchKey:"+searchKey); + if (haveSearch != null && haveSearch) { return; } - haveSearchCache.put(searchKey,true); + long startT = System.currentTimeMillis(); + 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); - memberListTemp.parallelStream().forEach(h -> memberMap.put(h.getHomeId(), h.getHouseMemberList())); + 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)); } /** @@ -749,4 +805,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(String customerId) { + List houseList = icHouseDao.selectBatchHouseCodeAndUrl(customerId); + 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/service/impl/NeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java index 627af897fb..a053e7b183 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java @@ -2,8 +2,10 @@ package com.epmet.service.impl; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.enums.OrgTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; @@ -17,11 +19,13 @@ import com.epmet.dto.IcNeighborHoodPropertyDTO; import com.epmet.dto.form.IcHouseListFormDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.IcNeighborHoodListFormDTO; +import com.epmet.dto.form.IcUserBelongToChangedFormDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.entity.IcHouseEntity; import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.entity.IcNeighborHoodPropertyEntity; import com.epmet.excel.IcNeighborHoodExcel; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.IcNeighborHoodPropertyService; import com.epmet.service.IcNeighborHoodService; @@ -44,7 +48,7 @@ import java.util.Optional; @Slf4j @Service -public class NeighborHoodServiceImpl implements NeighborHoodService { +public class NeighborHoodServiceImpl extends BaseServiceImpl implements NeighborHoodService { @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; @@ -56,6 +60,8 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao; @Resource private IcNeighborHoodDao icNeighborHoodDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Override @@ -132,11 +138,28 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { if (!customerAgencyResult.success()) { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } + IcNeighborHoodEntity icNeighborHoodEntity = baseDao.selectById(formDTO.getNeighborHoodId()); + if (icNeighborHoodEntity == null){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"小区信息不存在","小区信息不存在"); + } + CustomerAgencyDTO customerAgencyDTO = Optional.ofNullable(customerAgencyResult.getData()).orElse(new CustomerAgencyDTO()); icNeighborHoodDTO.setParentAgencyId(customerAgencyDTO.getPid()); icNeighborHoodDTO.setAgencyPids(customerAgencyDTO.getPids()); icNeighborHoodService.update(icNeighborHoodDTO); + //如果更新了网格 则需要更新网格下的居民所属关系 + if (!icNeighborHoodEntity.getGridId().equals(icNeighborHoodDTO.getGridId())){ + IcUserBelongToChangedFormDTO userForm = new IcUserBelongToChangedFormDTO(); + userForm.setSourceGridId(icNeighborHoodEntity.getGridId()); + userForm.setTargetGridId(icNeighborHoodDTO.getGridId()); + Result updateResult = epmetUserOpenFeignClient.changeIcResiUserBelongTo(userForm); + if (updateResult == null || !updateResult.success()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"更新居民信息失败,请稍后重试!","更新居民信息失败,请稍后重试!"); + } + } + + //设置物业关联 String propertyId = formDTO.getPropertyId(); String neighborHoodId = icNeighborHoodDTO.getId(); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/ServiceProjectServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/ServiceProjectServiceImpl.java new file mode 100644 index 0000000000..3e4fc139d5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/ServiceProjectServiceImpl.java @@ -0,0 +1,107 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dao.CustomerAgencyDao; +import com.epmet.dao.CustomerGridDao; +import com.epmet.dao.IcNeighborHoodDao; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.result.AgencyTreeResultDTO; +import com.epmet.dto.result.ServiceProjectScopeResultDTO; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.entity.IcPlaceOrgEntity; +import com.epmet.service.CustomerAgencyService; +import com.epmet.service.NeighborHoodService; +import com.epmet.service.ServiceProjectService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class ServiceProjectServiceImpl implements ServiceProjectService { + + @Autowired + private CustomerAgencyDao agencyDao; + + @Autowired + private CustomerGridDao gridDao; + + @Autowired + private IcNeighborHoodDao neighborHoodDao; + + @Autowired + private CustomerAgencyService customerAgencyService; + + public ServiceProjectServiceImpl() { + System.out.println(6); + } + + @Override + public ServiceProjectScopeResultDTO getServiceScopeTree(String staffId) { + AgencyTreeResultDTO orgTreeData = customerAgencyService.getOrgTreeData(staffId); + + ServiceProjectScopeResultDTO rootScope = new ServiceProjectScopeResultDTO(); + rootScope.setObjectId(orgTreeData.getAgencyId()); + rootScope.setObjectType(orgTreeData.getLevel()); + rootScope.setObjectName(orgTreeData.getAgencyName()); + rootScope.setChildren(convert2ServiceProjectScope(orgTreeData.getSubAgencyList())); + + return rootScope; + } + + private List convert2ServiceProjectScope(List oldChildren) { + + ArrayList scopes = new ArrayList<>(); + + for (AgencyTreeResultDTO oldChild : oldChildren) { + ServiceProjectScopeResultDTO scope = new ServiceProjectScopeResultDTO(); + scope.setObjectId(oldChild.getAgencyId()); + scope.setObjectType(oldChild.getLevel()); + scope.setObjectName(oldChild.getAgencyName()); + if ("grid".equals(oldChild.getLevel())) { + // 如果是网格,那么还要查询网格下的小区 + List neighborhoods = neighborHoodDao.selectNeighborList(oldChild.getAgencyId()); + + List neighborhoodScopes = neighborhoods.stream().map(n -> new ServiceProjectScopeResultDTO(n.getId(), + n.getNeighborHoodName(), + "neighborhood", + null)).collect(Collectors.toList()); + + scope.setChildren(neighborhoodScopes); + } else { + // 递归处理子级 + List subAgencyList = oldChild.getSubAgencyList(); + if (subAgencyList != null && !CollectionUtils.isEmpty(subAgencyList)) { + List subOrgScope = convert2ServiceProjectScope(subAgencyList); + scope.setChildren(subOrgScope); + } + } + + scopes.add(scope); + } + + return scopes; + } + + //public void recursiveFillChildren(ServiceProjectScopeResultDTO parentObject) { + // String parentObjectType = parentObject.getObjectType(); + // if ("grid".equals(parentObjectType)) { + // // 如果父级是网格,那么查询子级小区 + // neighborHoodService.listNeighborhood() + // } else if ("agency".equals(parentObjectType)) { + // // 如果父级是单位,那么查询子级单位或者网格 + // String parentObjectId = parentObject.getObjectId(); + // if ("community".equals(parentObject)) { + // gridDao.get + // } else { + // agencyDao.getSubAgencyList() + // } + // } + // + //} +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/UserHouseScopeServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/UserHouseScopeServiceImpl.java new file mode 100644 index 0000000000..8ccaa5a32a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/UserHouseScopeServiceImpl.java @@ -0,0 +1,79 @@ +package com.epmet.service.impl; + +import com.epmet.dao.IcNeighborHoodDao; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.result.AgencyTreeResultDTO; +import com.epmet.dto.result.UserHouseScopeResultDTO; +import com.epmet.service.CustomerAgencyService; +import com.epmet.service.UserHouseScopeService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class UserHouseScopeServiceImpl implements UserHouseScopeService { + + @Autowired + private IcNeighborHoodDao neighborHoodDao; + + @Autowired + private CustomerAgencyService customerAgencyService; + + public UserHouseScopeServiceImpl() { + System.out.println(6); + } + + @Override + public UserHouseScopeResultDTO getServiceScopeTree(String staffId) { + AgencyTreeResultDTO orgTreeData = customerAgencyService.getOrgTreeData(staffId); + + UserHouseScopeResultDTO rootScope = new UserHouseScopeResultDTO(); + rootScope.setObjectId(orgTreeData.getAgencyId()); + rootScope.setObjectType(orgTreeData.getLevel()); + rootScope.setObjectName(orgTreeData.getAgencyName()); + rootScope.setChildren(convert2ServiceProjectScope(orgTreeData.getSubAgencyList())); + + return rootScope; + } + + private List convert2ServiceProjectScope(List oldChildren) { + + ArrayList scopes = new ArrayList<>(); + + for (AgencyTreeResultDTO oldChild : oldChildren) { + UserHouseScopeResultDTO scope = new UserHouseScopeResultDTO(); + scope.setObjectId(oldChild.getAgencyId()); + scope.setObjectType(oldChild.getLevel()); + scope.setObjectName(oldChild.getAgencyName()); + if ("grid".equals(oldChild.getLevel())) { + // 如果是网格,那么还要查询网格下的小区 + List neighborhoods = neighborHoodDao.selectNeighborList(oldChild.getAgencyId()); + + List neighborhoodScopes = neighborhoods.stream().map(n -> new UserHouseScopeResultDTO(n.getId(), + n.getNeighborHoodName(), + "neighborhood", + null)).collect(Collectors.toList()); + + scope.setChildren(neighborhoodScopes); + } else { + // 递归处理子级 + List subAgencyList = oldChild.getSubAgencyList(); + if (subAgencyList != null && !CollectionUtils.isEmpty(subAgencyList)) { + List subOrgScope = convert2ServiceProjectScope(subAgencyList); + scope.setChildren(subOrgScope); + } + } + + scopes.add(scope); + } + + return scopes; + } + +} 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 200c91c25b..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,6 +811,32 @@ 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..b357632bf8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java @@ -0,0 +1,205 @@ +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-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; + + /** + * 工作端的红点:展示1;不展示:0;【居民报事、回复更新为1】 + */ + private Integer govRedDot; + + /** + * 最近一次操作时间(回复、立项、转需求、办结更新此列) + */ + 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; + + /** + * 创建时间 + */ + 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..7d8187c110 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java @@ -0,0 +1,78 @@ +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 { + } + public interface GovRedDot extends CustomerClientShowGroup { + } + + /** + * 事件ID + */ + @NotBlank(message = "事件ID不能为空", groups = {Detail.class, GovRedDot.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..3daaf0de18 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java @@ -0,0 +1,219 @@ +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; + /** + * 工作端的红点:展示1;不展示:0;【居民报事、回复更新为1】 + */ + private Integer govRedDot; + /** + * 最近一次操作时间(回复、立项、转需求、办结更新此列) + */ + @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 5b54fd759d..375daa8dd2 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..ac46560dc7 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java @@ -0,0 +1,463 @@ +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(); + } + } + } + + /** + * @Author sun + * @Description 工作端事件红点消除 + **/ + @PostMapping("govRedDot") + public Result govRedDot(@RequestBody IcEventListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.GovRedDot.class); + icEventService.govRedDot(formDTO.getIcEventId()); + return new Result(); + } + +} 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..a8e83bcf7c --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java @@ -0,0 +1,174 @@ +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; + + /** + * 工作端的红点:展示1;不展示:0;【居民报事、回复更新为1】 + */ + private Integer govRedDot; + + /** + * 最近一次操作时间(回复、立项、转需求、办结更新此列) + */ + 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..2a3545fc9c --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java @@ -0,0 +1,223 @@ +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); + + /** + * @Description 工作端事件红点消除 + **/ + void govRedDot(String icEventId); +} \ 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..7a43bf8e82 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -0,0 +1,1533 @@ +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); + //居民端上报的事件,工作端默认展示红点 + entity.setGovRedDot(NumConstant.ONE); + 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); + //居民有了新回复,工作端的红点置为展示 + entity.setGovRedDot(NumConstant.ONE); + 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; + } + + @Override + public void govRedDot(String icEventId) { + IcEventEntity entity = new IcEventEntity(); + entity.setId(icEventId); + entity.setGovRedDot(NumConstant.ZERO); + baseDao.updateById(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/db/migration/V0.0.24__alter_ic_event.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.24__alter_ic_event.sql new file mode 100644 index 0000000000..3a23f48456 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.24__alter_ic_event.sql @@ -0,0 +1,6 @@ +ALTER TABLE `ic_event` +ADD COLUMN `GOV_RED_DOT` tinyint(1) NOT NULL DEFAULT 0 COMMENT '工作端的红点:展示1;不展示:0;【居民报事、回复更新为1】' AFTER `RED_DOT`; + +ALTER TABLE `ic_event` +MODIFY COLUMN `CREATED_TIME` datetime NOT NULL COMMENT '创建时间' AFTER `CREATED_BY`; + 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..b03c73efaf --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml @@ -0,0 +1,378 @@ + + + + + + + + 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..d5d87db881 --- /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); + + int deleteAll(); +} 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..ad48accf01 --- /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); + + int deleteAll(); + + /** + * 平房详情 + * + * @param buildingId + * @return + */ + CaPingFangDetailsResultDTO getPingFangDetails(@Param("buildingId") String buildingId); +} 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..67ecfe2cbd --- /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); + + int deleteAll(); + + /** + * 出租房详情 + * + * @param rentalId + * @return + */ + CaRentalDetailsResultDTO getRentalDetails(@Param("rentalId") String rentalId); +} 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..5c83b1e4d0 --- /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); + + int deleteAll(); + + /** + * 人口基本信息详情 + * + * @param idCard + * @return + */ + CaResidentDetailsResultDTO getResidentDetails(@Param("idCard") String idCard); +} 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..8a8787171d --- /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); + + int deleteAll(); + + /** + * 流动人口详情 + * + * @param idCard + * @return + */ + CaRotatorsDetailsResultDTO getRotatorsDetails(@Param("idCard") String idCard); +} 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..a5e55fa6c6 --- /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,205 @@ +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) { + int i = baseDao.deleteAll(); + if (i >= 0) { + 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,building_id 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; + } + } + +} 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..dcb8823872 --- /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,190 @@ +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) { + int i = baseDao.deleteAll(); + if (i >= 0) { + 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,building_id 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; + } + } + +} 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..7104457494 --- /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,197 @@ +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) { + int i = baseDao.deleteAll(); + + if (i >= 0) { + 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,rental_id 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; + } + } + + +} 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..8a6648b5fc --- /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,207 @@ +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) { + int i = baseDao.deleteAll(); + if (i >= 0) { + 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,resident_id 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; + } + } + +} 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..1007be5e6c --- /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,223 @@ +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) { + int i = baseDao.deleteAll(); + if (i >= 0) { + 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,rotators_id 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; + } + } + +} 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..a29a8929a0 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaLoudongDao.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from ca_loudong + + + + + + + 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..99c8195b49 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaPingfangDao.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from ca_pingfang + + + + + + 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..280159ef30 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRentalDao.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from ca_rental + + + + + + 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..bf5c94b4c6 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentDao.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from ca_resident + + + + + + + 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..77146469c5 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRotatorsDao.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from ca_rotators + + + + + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java index 6002398fbd..0523b83600 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java @@ -175,6 +175,7 @@ public class IcFormServiceImpl extends BaseServiceImpl if (CollectionUtils.isEmpty(itemList)) { return "默认配置错误"; } + String defaultBaseInfoGroupId = "default_0"; //设置ic_form_item itemList.forEach(item -> { item.setId(newPrefixed + item.getId()); @@ -183,7 +184,10 @@ public class IcFormServiceImpl extends BaseServiceImpl item.setAreaCode(areaCode); item.setParentItemId(newPrefixed + item.getParentItemId()); //分组Id 为0 说明不村子分组 则直接不设置 仍然为0 - if (!NumConstant.ZERO_STR.equals(item.getItemGroupId())){ + //基础信息分组id:default_0;默认是客户id_0 + if (defaultBaseInfoGroupId.equals(item.getItemGroupId())) { + item.setItemGroupId(customerId.concat("_0")); + } else { item.setItemGroupId(newPrefixed + item.getItemGroupId()); } String optionSourceValue = item.getOptionSourceValue(); @@ -227,7 +231,12 @@ public class IcFormServiceImpl extends BaseServiceImpl wrapperGroup.eq(IcFormItemGroupEntity::getFormCode, formCode); List groupList = icFormItemGroupDao.selectList(wrapperGroup); groupList.forEach(item -> { - item.setId(newPrefixed + item.getId()); + if (defaultBaseInfoGroupId.equals(item.getId())) { + //基础信息分组id默认客户id_0 + item.setId(customerId.concat("_0")); + } else { + item.setId(newPrefixed + item.getId()); + } item.setCustomerId(customerId); item.setFormId(newFormId); item.setCreatedBy("init_user"); 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.29__radio_default.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.29__radio_default.sql new file mode 100644 index 0000000000..f23b014497 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.29__radio_default.sql @@ -0,0 +1,6 @@ +UPDATE ic_form_item +SET DEFAULT_VALUE = '0',UPDATED_TIME=NOW() +WHERE + ITEM_TYPE = 'radio' + AND DEL_FLAG = '0' + AND ( DEFAULT_VALUE IS NULL OR DEFAULT_VALUE = '' ); 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-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/feign/ResiPartyMemberOpenFeignClient.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java index ba6e36ecb3..0098acd036 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,11 @@ 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; @@ -48,18 +52,18 @@ public interface ResiPartyMemberOpenFeignClient { Result addPartyMemberBaseInfo(@RequestBody PartyMemberBaseInfoAddFormDTO formDTO); /** - * @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/18 10:12 **/ @GetMapping(value = "/resi/partymember/partymemberbaseinfo/listPartyMemberBaseInfo/{partyBranchId}") Result> listPartyMemberBaseInfo(@PathVariable("partyBranchId") String partyBranchId); /** - * @return com.epmet.commons.tools.utils.Result * @param partyMemberId 党员库id主键 + * @return com.epmet.commons.tools.utils.Result * @author yinzuomei * @description 根据党员id查询党员信息 * @Date 2020/6/18 15:30 @@ -68,8 +72,8 @@ public interface ResiPartyMemberOpenFeignClient { Result queryPartyMemberBaseInfoById(@PathVariable("partyMemberId") String partyMemberId); /** - * @return com.epmet.commons.tools.utils.Result * @param formDTO + * @return com.epmet.commons.tools.utils.Result * @author yinzuomei * @description 删除党员 * @Date 2020/6/18 17:57 @@ -78,8 +82,8 @@ public interface ResiPartyMemberOpenFeignClient { Result deltePartyMemberBaseInfo(@RequestBody DelPartyMemberBaseInfoFormDTO formDTO); /** - * @return com.epmet.commons.tools.utils.Result> * @param userIdList + * @return com.epmet.commons.tools.utils.Result> * @author yinzuomei * @description 根据用户id查询认证通过的党员信息 * @Date 2020/7/22 12:14 @@ -88,8 +92,8 @@ public interface ResiPartyMemberOpenFeignClient { Result> queryPartymemberInfoByUserId(@RequestBody List userIdList); /** - * @return com.epmet.commons.tools.utils.Result> * @param gridIdList + * @return com.epmet.commons.tools.utils.Result> * @author zy * @description 根据网格id查询认证通过的党员信息 * @Date 2020/7/22 12:14 @@ -98,22 +102,23 @@ public interface ResiPartyMemberOpenFeignClient { Result> getPartymemberInfoByGridId(@RequestBody List gridIdList); /** - * @Description 根据客户ID查询党员 + * @Description 根据客户ID查询党员 * @Param customerId * @author zxc * @date 2021/9/6 3:54 下午 */ @PostMapping(value = "/resi/partymember/partymemberinfo/getpartymemberinfobycustomerid") - Result> getPartyMemberInfoByCustomerId(@RequestParam("customerId")String customerId); + Result> getPartyMemberInfoByCustomerId(@RequestParam("customerId") String customerId); /** * Desc: 查询网格下是否存在党员审核 true:存在,false:不存在 + * * @param gridId * @author zxc * @date 2022/3/15 4:19 下午 */ @PostMapping("/resi/partymember/partymemberconfirmmanual/audit-reset") - Result partyMemberAuditReset(@RequestParam("gridId")String gridId); + Result partyMemberAuditReset(@RequestParam("gridId") String gridId); /** * @Description 同步党员信息 @@ -127,4 +132,7 @@ public interface ResiPartyMemberOpenFeignClient { @PostMapping("/resi/partymember/icPartyMember/getPartyMemberByIdCard") Result getPartyMemberByIdCard(@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 f4545ee638..57ce87c1e4 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,11 @@ 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; @@ -93,4 +96,9 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp public Result getPartyMemberByIdCard(IcPartyMemberDTO dto) { return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartyMemberByIdCard", dto); } + + @Override + public Result> branchlist() { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "branchlist", null); + } } 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/UserResiInfoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java index d8b5c10495..9ebc12d681 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java @@ -142,5 +142,7 @@ public class UserResiInfoDTO implements Serializable { */ private String mobileCode; + private String nickname; + } 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/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/IcUserBelongToChangedFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserBelongToChangedFormDTO.java new file mode 100644 index 0000000000..da773e7266 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserBelongToChangedFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * desc: 居民所属关系调整参数类 + * + * @author LiuJanJun + * @date 2022/5/22 9:41 下午 + */ +@Data +public class IcUserBelongToChangedFormDTO implements Serializable { + + private static final long serialVersionUID = 6572482888379744011L; + /** + * 客户Id + */ + private String customerId; + /** + * 原网格Id + */ + @NotBlank(message = "网格ID不能为空") + private String sourceGridId; + /** + * 新网格Id + */ + @NotBlank(message = "网格ID不能为空") + private String targetGridId; + +} 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/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/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/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index d9e7cb008c..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 @@ -750,6 +750,57 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/icresiuser/getResiUserGroupHomeId") Result> getHouseMemberList(@RequestBody RentTenantDataFormDTO formDTO); + /** + * desc:更新居民所属 eg:所属网格等等 + * @param formDTO + * @return + */ + @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); 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 29ebbd5c9d..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 @@ -549,6 +549,42 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHouseMemberList", formDTO); } + @Override + public Result changeIcResiUserBelongTo(IcUserBelongToChangedFormDTO formDTO) { + 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); diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index 3e494ca6df..665f7108cd 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -10,10 +10,10 @@ services: - "/opt/epmet-cloud-logs/prod:/logs" - "/opt/epmet_files/:/opt/epmet_files" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx1024m -jar ./epmet-user.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx1524m -jar ./epmet-user.jar" restart: "unless-stopped" deploy: resources: limits: cpus: '0.1' - memory: 1100M + memory: 1600M 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 c80c481876..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 @@ -252,6 +252,28 @@ public class IcResiUserController implements ResultDataResolver { return new Result(); } + /** + * 更新居民的所属网格-》来源于小区更改所属网格 目前只有网格, + * + * @param formDTO + * @return + * @remark:后续如果有其他的变动需要调用的话 可以丰富参数 修改方法名 + */ + @NoRepeatSubmit + @PostMapping("changeIcResiUserBelongTo") + Result changeIcResiUserBelongTo(@LoginUser TokenDto tokenDto, @RequestBody IcUserBelongToChangedFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO); + List changedUserIds = icResiUserService.changeIcResiUserBelongTo(tokenDto,formDTO); + //推送MQ事件 + if (CollectionUtils.isNotEmpty(changedUserIds)){ + changedUserIds.forEach(resiUserId->editResiMq(tokenDto.getCustomerId(), resiUserId)); + + } + return new Result().ok(true); + } + + /** * 租客房东根据身份证更新头像 * @@ -703,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)); } @@ -1058,6 +1082,40 @@ public class IcResiUserController implements ResultDataResolver { 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); + } + /** * 党员信息同步 * 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/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 8948369dcc..f6a69e9694 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,6 +19,7 @@ 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; @@ -50,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 更新或新增居民信息各表数据 @@ -134,7 +141,7 @@ public interface IcResiUserDao extends BaseDao { @Param("level")String level, @Param("id")String id, @Param("agencyId") String agencyId, - @Param("pageNo") Integer pageNo); + @Param("pageNo") Integer pageNo,@Param("customerId") String customerId); Set selectUserDemandCode(String icResiUserId); @@ -259,8 +266,6 @@ public interface IcResiUserDao extends BaseDao { List icUserCustomerIds(); - List> getIcUserList(@Param("customerId") String customerId); - /** * desc: 获取数据分析列中的 各类居民数据 * @@ -302,7 +307,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:根据维度获取居民信息表的数据[正常状态的居民] @@ -311,6 +316,17 @@ public interface IcResiUserDao extends BaseDao { */ List getResiUserGroupHomeId(RentTenantDataFormDTO formDTO); + /** + * desc:条件获取居民Id列表 所有状态的包含死亡等状态 + * + * @param customerId + * @param gridId + * @return + */ + List listUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId); + + List getAllUserIds(@Param("idCard") String idCard, @Param("customerId")String customerId); + /** * 获取客户下志愿者信息 * @Param customerId @@ -319,4 +335,13 @@ public interface IcResiUserDao extends BaseDao { * @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/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/IcResiUserEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java index 8b3b5ad283..5b70e7a653 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java @@ -215,6 +215,16 @@ public class IcResiUserEntity extends BaseEpmetEntity { */ private String isSpecial; + /** + * 是否租户【是:1 否:0】 + */ + private String isTenant; + + /** + * 是否流动人口【是:1 否:0】 + */ + private String isFloating; + /** * 文化程度【字典表】 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java index 3a4e561c77..7ae5d5d706 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java @@ -24,18 +24,18 @@ public enum IcResiUserTableEnum { IC_SPECIAL("ic_special","特殊人群信息录入表", 8, 3, "IS_SPECIAL", true), // 下面的是:没有实际数据库表,在ic_resi_user中有一个标记,但是导入的时候是有单独的sheet的 - IC_DBH("ic_resi_user","低保人员信息录入表", null, 2, "IS_DBH", false), - IC_YLFN("ic_resi_user","育龄妇女信息录入表", null, 2, "IS_YLFN", false), - IC_XFRY("ic_resi_user","信访人员信息录入表", null, 2, "IS_XFRY", false), - IC_KC("ic_resi_user","空巢老人信息录入表", null, 2, "IS_KC", false), - IC_SD("ic_resi_user","失独人员信息录入表", null, 2, "IS_SD", false), - IC_SN("ic_resi_user","失能人员信息录入表", null, 2, "IS_SN", false), - IC_SZ("ic_resi_user","失智人员信息录入表", null, 2, "IS_SZ", false), - IC_CJ("ic_resi_user","残疾人员信息录入表", null, 2, "IS_CJ", false), - IC_DB("ic_resi_user","大病人员信息录入表", null, 2, "IS_DB", false), - IC_MB("ic_resi_user","慢病人员信息录入表", null, 2, "IS_MB", false), - IC_TENANT("ic_resi_user","租户信息录入表", null, 2, "IS_TENANT", false), - IC_FLOATING("ic_resi_user","流动人口信息录入表", null, 2, "IS_FLOATING", false); + IC_DBH("virtual_dbh","低保人员信息录入表", null, 2, "IS_DBH", false), + IC_YLFN("virtual_ylfn","育龄妇女信息录入表", null, 2, "IS_YLFN", false), + IC_XFRY("virtual_xfry","信访人员信息录入表", null, 2, "IS_XFRY", false), + IC_KC("virtual_kc","空巢老人信息录入表", null, 2, "IS_KC", false), + IC_SD("virtual_sd","失独人员信息录入表", null, 2, "IS_SD", false), + IC_SN("virtual_sn","失能人员信息录入表", null, 2, "IS_SN", false), + IC_SZ("virtual_sz","失智人员信息录入表", null, 2, "IS_SZ", false), + IC_CJ("virtual_cj","残疾人员信息录入表", null, 2, "IS_CJ", false), + IC_DB("virtual_db","大病人员信息录入表", null, 2, "IS_DB", false), + IC_MB("virtual_mb","慢病人员信息录入表", null, 2, "IS_MB", false), + IC_TENANT("virtual_tenant","租户信息录入表", null, 2, "IS_TENANT", false), + IC_FLOATING("virtual_floating","流动人口信息录入表", null, 2, "IS_FLOATING", false); private String tableName; /** @@ -64,6 +64,20 @@ public enum IcResiUserTableEnum { return null; } + /** + * 根据表comment(sheet名称)获取枚举对象 + * @param tableComment + * @return + */ + public static IcResiUserTableEnum getObjectByTableComment(String tableComment) { + for (IcResiUserTableEnum i : IcResiUserTableEnum.values()) { + if (i.tableComment.equals(tableComment)) { + return i; + } + } + return null; + } + /** * 判断是否有这一列 * @param columnName 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/IcResiVirtualSheetImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcResiVirtualSheetImportListener.java index 79ddbea5a9..ce17a6610e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcResiVirtualSheetImportListener.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcResiVirtualSheetImportListener.java @@ -4,11 +4,13 @@ import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; import com.epmet.enums.IcResiUserTableEnum; import com.epmet.service.impl.IcResiUserImportServiceImpl; +import lombok.extern.slf4j.Slf4j; import java.util.ArrayList; import java.util.List; import java.util.Map; +@Slf4j public class IcResiVirtualSheetImportListener extends AnalysisEventListener> { private IcResiUserImportServiceImpl importService; @@ -18,7 +20,7 @@ public class IcResiVirtualSheetImportListener extends AnalysisEventListener> resiInfo = new ArrayList<>(); + //private List> resiInfo = new ArrayList<>(); public IcResiVirtualSheetImportListener(IcResiUserImportServiceImpl importService, IcResiUserTableEnum sheetEnumObject) { this.importService = importService; @@ -28,17 +30,18 @@ public class IcResiVirtualSheetImportListener extends AnalysisEventListener data, AnalysisContext context) { if (data != null && data.size() > 0) { - resiInfo.add(data); + //resiInfo.add(data); + importService.singlePersistResiVirtualSheetExtraInfo(data, sheetEnumObject); } } @Override public void doAfterAllAnalysed(AnalysisContext context) { - try { - importService.persistIcResiVirtualSheetExtraInfo(resiInfo, sheetEnumObject); - } finally { - // 清空数据 - resiInfo.clear(); - } + //try { + // importService.batchPersistIcResiVirtualSheetExtraInfo(resiInfo, sheetEnumObject); + //} finally { + // // 清空数据 + // resiInfo.clear(); + //} } } 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 d503cd7534..407e9e614e 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,6 +21,7 @@ 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.*; @@ -89,17 +90,17 @@ public interface IcResiUserService extends BaseService { String staffOrgPath); /** - * @Description 查询个人数据 * @param formDTO + * @Description 查询个人数据 * @author zxc * @date 2021/11/3 9:21 上午 */ PersonDataResultDTO personData(PersonDataFormDTO formDTO); /** - * @Description 根据名字搜索 * @param formDTO * @Description 根据名字搜索 + * @Description 根据名字搜索 * @author zxc * @date 2021/11/3 1:42 下午 */ @@ -278,7 +279,7 @@ public interface IcResiUserService extends BaseService { */ List listHomeUserBrief(String houseId, String customerId); - 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); /** * 租客房东黑名单查询个人数据 @@ -302,6 +303,8 @@ public interface IcResiUserService extends BaseService { /** * 租客房东根据身份证更新头像 + * 5.17更新头像的同时更新居民状态是租客 + * 5.18同时更新居民状态是流动 * * @param formDTO * @return com.epmet.commons.tools.utils.Result @@ -329,13 +332,31 @@ public interface IcResiUserService extends BaseService { * @return */ SyncResiResDTO checkUser(String customerId, String idCard, String agencyId); + /** * desc:条件获取居民基础信息 + * * @param formDTO * @return */ List getResiUserGroupHomeId(RentTenantDataFormDTO formDTO); + /** + * desc:更新居民信息的所属 eg:所属网格等等 + * + * @param tokenDto + * @param formDTO + * @return + */ + List changeIcResiUserBelongTo(TokenDto tokenDto, IcUserBelongToChangedFormDTO formDTO); + + + IcResiUserBriefDTO findFamilyMemByIdCard(String idCard); + + IcResiUserDTO getByResiId(String idCard); + + List getAllUserIds(String idCard, String customerId); + /** * 党员信息同步 @@ -366,4 +387,22 @@ public interface IcResiUserService extends BaseService { * @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/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 0d768140d9..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,153 +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()); - 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); - } - - /** - * 根据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..dcd75a7d99 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java @@ -0,0 +1,178 @@ +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.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(""); + } + 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 4fcaee8202..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; /** * 子表中不需要的列。因为主表中需要身份证号,网格等信息,但子表中不需要这些列必填,只要有身份证号即可,因此字表判断的时候需要排除这些列 @@ -504,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); @@ -562,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 @@ -740,38 +758,53 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res * 虚拟(不对应实际的数据库表)sheet的数据导入持久化 * @param sheetEnumObject */ - public void persistIcResiVirtualSheetExtraInfo(List> resiInfo, IcResiUserTableEnum sheetEnumObject) { - for (Map columnAndValues : resiInfo) { - String idCard = columnAndValues.get(ID_CARD_COLUMN_NO); - try { - Map resiInfoMap = icResiUserDao.selectResiInfoMap(idCard, null); + public void batchPersistIcResiVirtualSheetExtraInfo(List> resiInfos, IcResiUserTableEnum sheetEnumObject) { + for (Map columnAndValues : resiInfos) { + singlePersistResiVirtualSheetExtraInfo(columnAndValues, sheetEnumObject); + } + } - if (resiInfoMap == null || resiInfoMap.size() == 0) { - throw new RenException(EpmetErrorCode.RESI_NOT_FOUND.getCode(), String.format("身份证号为【%s】的居民信息未找到,请确认该居民信息存在", idCard)); - } - String icResiId = resiInfoMap.get("ID"); + /** + * 单条处理 虚拟(不对应实际的数据库表)sheet的数据导入持久化 + * @param columnAndValues + * @param sheetEnumObject + */ + public void singlePersistResiVirtualSheetExtraInfo(Map columnAndValues, IcResiUserTableEnum sheetEnumObject) { + String idCard = columnAndValues.get(ID_CARD_COLUMN_NO); + try { + if (StringUtils.isBlank(idCard)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "身份证号未填写", + "身份证号未填写"); + } - // 更新主表中该居民类型字段为true - updateMainTableResiTypeFlag(sheetEnumObject, icResiId); + Map resiInfoMap = icResiUserDao.selectResiInfoMap(idCard, null); - // 保存类别变更信息 - saveSubTableInfoToCategoryChangedResiCache(icResiId, sheetEnumObject.getMainTableFlagColumnName(), resiInfoMap); - } catch (Exception e) { - String errorMsg; - if (e instanceof RenException || e instanceof EpmetException) { - errorMsg = e.getMessage(); - } else { - errorMsg = "未知系统错误"; - log.error(ExceptionUtils.getErrorStackTrace(e)); - } + if (resiInfoMap == null || resiInfoMap.size() == 0) { + throw new RenException(EpmetErrorCode.RESI_NOT_FOUND.getCode(), String.format("身份证号为【%s】的居民信息未找到,请确认该居民信息存在", idCard)); + } + String icResiId = resiInfoMap.get("ID"); - ErrorRow errorRow = new ErrorRow(); - errorRow.setName(columnAndValues.get("NAME")); - errorRow.setIdCard(idCard); - errorRow.setErrorInfo(errorMsg); - errorRow.setTableName(sheetEnumObject.getTableName()); - errorRows.get().get(sheetEnumObject.getTableName()).add(errorRow); + // 更新主表中该居民类型字段为true + updateMainTableResiTypeFlag(sheetEnumObject, icResiId); + + // 保存类别变更信息 + saveSubTableInfoToCategoryChangedResiCache(icResiId, sheetEnumObject.getMainTableFlagColumnName(), resiInfoMap); + } catch (Exception e) { + String errorMsg; + if (e instanceof RenException || e instanceof EpmetException) { + errorMsg = e.getMessage(); + } else { + errorMsg = "未知系统错误"; + log.error(ExceptionUtils.getErrorStackTrace(e)); } + + ErrorRow errorRow = new ErrorRow(); + errorRow.setName(columnAndValues.get("NAME")); + errorRow.setIdCard(idCard); + errorRow.setErrorInfo(errorMsg); + errorRow.setTableName(sheetEnumObject.getTableName()); + errorRows.get().get(sheetEnumObject.getTableName()).add(errorRow); } } @@ -1311,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"); @@ -1353,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; @@ -1368,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 07cf788fbc..4f1e856899 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 @@ -43,10 +43,7 @@ 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; @@ -457,11 +454,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getCustomerId, tokenDto.getCustomerId()); + wrapper.eq(IcResiUserEntity::getIdCard, map.get("ID_CARD")); + wrapper.ne(IcResiUserEntity::getId, map.get("ID")); + List entityList = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(entityList)) { String errorMsg = "修改居民信息失败,身份证号已存在!"; throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); } @@ -573,6 +571,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl tableMap = new HashMap<>(); formDTO.forEach(d -> { if (!"ic_resi_user".equals(d.getTableName())) { for (LinkedHashMap hash : d.getList()) { @@ -582,6 +582,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl result = pageInfo.getList(); if (CollectionUtils.isEmpty(result)) { return new PageData<>(new ArrayList<>(), pageInfo.getTotal()); @@ -1358,6 +1363,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()); } @@ -1856,19 +1869,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()); @@ -1898,6 +1926,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, @@ -1954,16 +1983,26 @@ public class IcResiUserServiceImpl extends BaseServiceImpl images = formDTO.getImages(); images.forEach(item -> item.setUserId(userDTO.getId())); - images.forEach(item-> icResiUserAttachmentService.save(item)); + images.forEach(item -> icResiUserAttachmentService.save(item)); + // 如果是已经存在的居民,并且是租客状态,需要更新原本的状态 + if (NumConstant.ONE_STR.equals(formDTO.getType())) { + IcResiUserEntity entity = new IcResiUserEntity(); + entity.setId(resiUserId); + entity.setIsTenant(NumConstant.ONE_STR); + entity.setIsFloating(NumConstant.ONE_STR); + updateById(entity); + } } else if (NumConstant.ONE_STR.equals(formDTO.getType())) { // 如果是新增的租客,需要新增一条信息,不存在的房东就不管了 IcResiUserEntity entity = ConvertUtils.sourceToTarget(formDTO.getUser(), IcResiUserEntity.class); + entity.setIsTenant(NumConstant.ONE_STR); + entity.setIsFloating(NumConstant.ONE_STR); insert(entity); resiUserId = entity.getId(); // 变更记录表和变更记录明细表新增数据 LinkedHashMap map = new LinkedHashMap(); - map.put("AGENCY_ID",entity.getAgencyId()); - saveUserChangeRecord(tokenDto,map,resiUserId,entity.getName()); + map.put("AGENCY_ID", entity.getAgencyId()); + saveUserChangeRecord(tokenDto, map, resiUserId, entity.getName()); // 新增用户后保存头像信息 List images = formDTO.getImages(); images.forEach(item -> item.setUserId(entity.getId())); @@ -2107,6 +2146,32 @@ public class IcResiUserServiceImpl extends BaseServiceImpl changeIcResiUserBelongTo(TokenDto tokenDto, IcUserBelongToChangedFormDTO formDTO) { + List resiUserIdList = baseDao.listUserIds(formDTO.getCustomerId(),formDTO.getSourceGridId()); + if (CollectionUtils.isEmpty(resiUserIdList)){ + return null; + } + List icResiUserFormDTOS = new ArrayList<>(); + IcResiUserFormDTO e = new IcResiUserFormDTO(); + e.setTableName(IcResiUserConstant.IC_RESI_USER); + LinkedHashMap map = new LinkedHashMap(); + + map.put(FieldConstant.GRID_ID, formDTO.getTargetGridId()); + List> list = new ArrayList<>(); + list.add(map); + e.setList(list); + icResiUserFormDTOS.add(e); + + resiUserIdList.forEach(userId->{ + map.put(FieldConstant.ID, userId); + this.edit(tokenDto,icResiUserFormDTOS); + }); + + return resiUserIdList; + } + /** * 党员信息同步 * @@ -2251,6 +2316,74 @@ public class IcResiUserServiceImpl extends BaseServiceImpl 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("修改成功"); + } + /** * 根据身份证获取居民角色(目前只有是否是志愿者) * @@ -2327,4 +2460,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/MyHomeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java new file mode 100644 index 0000000000..6fb98f8b7a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java @@ -0,0 +1,191 @@ +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.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.MISMATCH.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); + userBaseInfoEntity.setNickname(formDTO.getNickname()); + 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); + } + } + + /** + * 获取用户绑定的房屋信息 + * + * @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/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/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 5336362932..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 @@ -294,6 +302,7 @@ IFNULL(REMARKS,'') AS REMARKS FROM ic_resi_user WHERE DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} AND (AGENCY_ID = #{id} OR PIDS LIKE CONCAT('%',#{id},'%')) @@ -398,7 +407,9 @@ id, `name`, id_card, - mobile + mobile, + agency_id, + grid_id FROM ic_resi_user WHERE @@ -426,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} @@ -481,7 +494,9 @@ + + + + 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} + + +