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/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-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index 6375462f14..a813af8152 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -23,6 +23,8 @@ public enum DictTypeEnum { PATROL_WORK_TYPE("patrol_work_type", "例行工作分类", 13), GRID_TYPE("grid_type", "网格类型", 12), ITEM_TYPE_QUERY("item_type_query","居民信息组件查询方式",14), + SELF_ORG_CATEGORY("self_org_category","社区自组织分类",15), + IC_EVENT_SOURCE_TYPE("ic_event_source_type","事件管理",19), ; private final String code; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/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..ed274b2c28 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -255,6 +255,7 @@ public enum EpmetErrorCode { IC_NAT(8924,"平台已存在记录,请去修改原有记录"), RESI_IC_NAT(8925,"已存在记录,请联系社区工作人员修改"), IC_MOVE_IN(8926,"居民信息中房屋信息与当前选择房屋不一致,是否更新?"), + NOT_REGEIST_RESI(8927,"未注册居民"), //通用错误码 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-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java index 1a7f37a932..7eae78be1d 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java @@ -50,6 +50,8 @@ public class ProjectDTO implements Serializable { */ private String agencyId; + private String gridId; + /** * 来源:议题issue */ diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.java index 8d566b72ef..1b8f73993b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.java @@ -109,6 +109,16 @@ public class ProjectProcessDTO implements Serializable { */ private String costWorkdays; + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; + /** * 删除标识:0.未删除 1.已删除 */ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java index a0dc4073d4..0f7a9e2cb7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java @@ -187,5 +187,13 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { * 18、当前组织内:来源于工作人员上报事件的项目:结案无需解决数 */ private Integer workEventUnResolvedCount; + /** + * 19、当前组织内:来源于事件管理的项目:结案已解决数 + */ + private Integer icEventResolvedCount; + /** + * 20、当前组织内:来源于事件管理的项目:结案无需解决数 + */ + private Integer icEventUnResolvedCount; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index cd77750bee..8682ec5876 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1201,9 +1201,12 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve Integer eventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getEventUnResolvedCount).sum(); Integer workEventResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getWorkEventResolvedCount).sum(); Integer workEventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getWorkEventUnResolvedCount).sum(); + Integer icEventResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getIcEventResolvedCount).sum(); + Integer icEventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getIcEventUnResolvedCount).sum(); Integer closedProjectTotal = issueResolvedCount + issueUnResolvedCount+projectResolvedCount + projectUnResolvedCount + eventResolvedCount + eventUnResolvedCount - + workEventResolvedCount + workEventUnResolvedCount; + + workEventResolvedCount + workEventUnResolvedCount + +icEventResolvedCount + icEventUnResolvedCount; resultDTO.setProblemResolvedCount(closedProjectTotal); resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, closedProjectTotal)); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 051bffb00c..330f564b25 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -631,7 +631,8 @@ ISSUE_PROJECT_RESOLVED_COUNT+ISSUE_PROJECT_UN_RESOLVED_COUNT +APPROVAL_PROJECT_RESOLVED_COUNT+APPROVAL_PROJECT_UN_RESOLVED_COUNT +EVENT_RESOLVED_COUNT+EVENT_UN_RESOLVED_COUNT - +WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, + +WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT + +IC_EVENT_RESOLVED_COUNT+IC_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio, concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio, concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio, @@ -654,7 +655,8 @@ ISSUE_PROJECT_RESOLVED_COUNT+ISSUE_PROJECT_UN_RESOLVED_COUNT +APPROVAL_PROJECT_RESOLVED_COUNT+APPROVAL_PROJECT_UN_RESOLVED_COUNT +EVENT_RESOLVED_COUNT+EVENT_UN_RESOLVED_COUNT - +WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, + +WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT + +IC_EVENT_RESOLVED_COUNT+IC_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio, concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio, concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio, @@ -693,7 +695,9 @@ EVENT_RESOLVED_COUNT, EVENT_UN_RESOLVED_COUNT, WORK_EVENT_RESOLVED_COUNT, - WORK_EVENT_UN_RESOLVED_COUNT + WORK_EVENT_UN_RESOLVED_COUNT, + IC_EVENT_RESOLVED_COUNT, + IC_EVENT_UN_RESOLVED_COUNT FROM fact_agency_govern_daily WHERE diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java index 5767491aa3..2f438b7bb8 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java @@ -147,6 +147,16 @@ public class FactAgencyGovernDailyDTO implements Serializable { */ private Integer workEventUnResolvedCount; + /** + * 19、当前组织内:来源于事件管理的项目:结案已解决数 + */ + private Integer icEventResolvedCount; + + /** + * 20、当前组织内:来源于事件管理的项目:结案无需解决数 + */ + private Integer icEventUnResolvedCount; + /** * 未出当前网格的,结案项目数 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java index e1122d933b..55dad7ab07 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java @@ -158,6 +158,16 @@ public class FactGridGovernDailyDTO implements Serializable { */ private Integer workEventUnResolvedCount; + /** + * 19、当前组织内:来源于事件管理的项目:结案已解决数 + */ + private Integer icEventResolvedCount; + + /** + * 20、当前组织内:来源于事件管理的项目:结案无需解决数 + */ + private Integer icEventUnResolvedCount; + /** * 15、未出当前网格的,结案项目数=11+12+13+14 */ diff --git a/epmet-module/data-statistical/data-statistical-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/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/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 #{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/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java index f74f2697e9..95ad773777 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java @@ -17,6 +17,7 @@ package com.epmet.dto; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -42,6 +43,7 @@ public class IcCommunitySelfOrganizationPersonnelDTO implements Serializable { /** * 客户ID */ + @JsonIgnore private String customerId; /** @@ -62,31 +64,37 @@ public class IcCommunitySelfOrganizationPersonnelDTO implements Serializable { /** * */ + @JsonIgnore private Integer delFlag; /** * 乐观锁 */ + @JsonIgnore private String revision; /** * 创建人 */ + @JsonIgnore private String createdBy; /** * 创建时间 */ + @JsonIgnore private Date createdTime; /** * 更新人 */ + @JsonIgnore private String updatedBy; /** * 更新时间 */ + @JsonIgnore private Date updatedTime; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java index 30b24a8498..79168ae29e 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java @@ -150,6 +150,15 @@ public class IcUserDemandRecDTO implements Serializable { */ private Integer awardPoint; + /** + * 来源[需求录入:demand 事件管理:ic_event] + */ + private String origin; + /** + * 来源Id[目前只有来源事件管理的有值] + */ + private String originId; + /** * 删除标识:0.未删除 1.已删除 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java index 3a931390b8..29a338232f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; import lombok.Data; +import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -18,36 +20,40 @@ public class AddCommunitySelfOrganizationFormDTO implements Serializable { private static final long serialVersionUID = -4996925380900678065L; - public interface AddCommunitySelfOrganizationForm{} + public interface AddCommunitySelfOrganizationForm extends CustomerClientShowGroup {} /** * 组织名称 */ - @NotBlank(message = "organizationName不能为空",groups = AddCommunitySelfOrganizationForm.class) + @NotBlank(message = "组织名称不能为空",groups = AddCommunitySelfOrganizationForm.class) + @Length(max = 50,message = "组织名称最多输入50字",groups = AddCommunitySelfOrganizationForm.class) private String organizationName; + @NotBlank(message = "分类不能为空", groups = AddCommunitySelfOrganizationForm.class) + private String categoryCode; + /** * 组织人数 */ - @NotNull(message = "organizationPersonCount不能为空",groups = AddCommunitySelfOrganizationForm.class) + @NotNull(message = "组织人数不能为空",groups = AddCommunitySelfOrganizationForm.class) private Integer organizationPersonCount; /** * 负责人姓名 */ - @NotBlank(message = "principalName不能为空",groups = AddCommunitySelfOrganizationForm.class) + @NotBlank(message = "负责人不能为空",groups = AddCommunitySelfOrganizationForm.class) private String principalName; /** * 负责人电话 */ - @NotBlank(message = "principalPhone不能为空",groups = AddCommunitySelfOrganizationForm.class) + @NotBlank(message = "联系电话",groups = AddCommunitySelfOrganizationForm.class) private String principalPhone; /** * 服务事项 */ - @NotBlank(message = "serviceItem不能为空",groups = AddCommunitySelfOrganizationForm.class) + @NotBlank(message = "服务事项不能为空",groups = AddCommunitySelfOrganizationForm.class) private String serviceItem; /** @@ -63,6 +69,7 @@ public class AddCommunitySelfOrganizationFormDTO implements Serializable { /** * 经度 */ + @NotBlank(message = "位置坐标不能为空",groups = AddCommunitySelfOrganizationForm.class) private String longitude; /** diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CategorySelfOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CategorySelfOrgFormDTO.java new file mode 100644 index 0000000000..bdfa1825f6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CategorySelfOrgFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +@Data +public class CategorySelfOrgFormDTO extends PageFormDTO implements Serializable { + /** + * 默认展示全部,此列可空 + */ + private String categoryCode; + + /** + * token中获取 + */ + @NotBlank(message = "customerId不能为空",groups = PageFormDTO.AddUserInternalGroup.class) + private String customerId; + /** + * token中获取 + */ + @NotBlank(message = "staffId不能为空",groups = PageFormDTO.AddUserInternalGroup.class) + private String staffId; + + /** + * 当前登录用户所属组织id + */ + private String agencyId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java index 5d634afaa3..7a8fba0899 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java @@ -48,4 +48,6 @@ public class CommunitySelfOrganizationListFormDTO implements Serializable { private Integer ranking; private String remark; + + private String categoryCode; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java index 32556b2c27..6c8eb94baa 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java @@ -26,6 +26,12 @@ public class EditCommunitySelfOrganizationFormDTO implements Serializable { @NotBlank(message = "organizationName不能为空",groups = EditCommunitySelfOrganizationForm.class) private String organizationName; + /** + * 分类编码 + */ + @NotBlank(message = "categoryCode不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String categoryCode; + /** * 组织人数 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/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/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/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/demand/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java index c235915430..bbf2c8f3ff 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java @@ -139,4 +139,13 @@ public class DemandRecResultDTO implements Serializable { private String longitude; // 纬度,需求人是ic的居民时,取所住楼栋的中心点位 private String latitude; + + /** + * 来源[需求录入:demand 事件管理:ic_event] + */ + private String origin; + /** + * 来源Id[目前只有来源事件管理的有值] + */ + private String originId; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index 133cb6200c..8c9c514a47 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 @@ -7,8 +7,13 @@ import com.epmet.dto.ActInfoDTO; 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.VolunteerCommonFormDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory; @@ -107,4 +112,26 @@ 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 a0af921435..de7669bba9 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 @@ -8,8 +8,13 @@ import com.epmet.dto.ActInfoDTO; 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.VolunteerCommonFormDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.EpmetHeartOpenFeignClient; @@ -108,4 +113,19 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli public Result> getDemandOptions() { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getDemandOptions", null); } + + @Override + public Result> getPartyUnitList(PartyUnitListFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getPartyUnitList", formDTO); + } + + @Override + public Result icEventToDemand(IcDemandFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "icEventToDemand", formDTO); + } + + @Override + public Result icEventComment(IcEventCommentToDemandFromDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "icEventComment", formDTO); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java index 9df5db60c2..399e9c7e81 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java @@ -34,8 +34,10 @@ import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcCommunitySelfOrganizationDTO; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListDTO; import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.SelfOrgCategoryTotalResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.excel.ExportCommunitySelfOrganizationExcel; import com.epmet.excel.IcCommunitySelfOrganizationExcel; @@ -281,4 +283,45 @@ public class IcCommunitySelfOrganizationController { ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class); return new Result>().ok(icCommunitySelfOrganizationService.queryServiceList(formDTO)); } + + /** + * 多元主体分析-各分类下的社区自组织数量饼图 + * + * @param tokenDto + * @return + */ + @PostMapping("/total-pie") + public Result> totalPie(@LoginUser TokenDto tokenDto) { + return new Result>().ok(icCommunitySelfOrganizationService.querySelfOrgCategoryTotal(tokenDto.getCustomerId(), tokenDto.getUserId())); + } + + /** + * 多元主体分析-分类下的社区自组织列表 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("/category-list") + public Result> queryCategoryList(@LoginUser TokenDto tokenDto, @RequestBody CategorySelfOrgFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(true); + return new Result>().ok(icCommunitySelfOrganizationService.queryCategoryList(formDTO)); + } + + /** + * 003、多元主题分析-地图(详情信息已包含) + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("/coordinate-list") + public Result> queryCoordinateList(@LoginUser TokenDto tokenDto, @RequestBody CategorySelfOrgFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); + return new Result>().ok(icCommunitySelfOrganizationService.queryCoordinateList(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index 2d9ae33d75..e4e507ee25 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -1,20 +1,3 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

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

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

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package com.epmet.controller; import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; @@ -36,9 +19,11 @@ 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.demand.ServiceQueryFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.excel.IcPartyUnitExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; @@ -57,6 +42,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; @@ -267,4 +253,27 @@ public class IcPartyUnitController { } } } + + /** + * Desc: 获取联建单位名字 + * @param formDTO + * @author zxc + * @date 2022/5/17 17:53 + */ + @PostMapping("/getPartyUnitList") + public Result> getPartyUnitList(@RequestBody PartyUnitListFormDTO formDTO){ + return new Result>().ok(icPartyUnitService.getPartyUnitList(formDTO)); + } + + /** + * Desc: 协办单位列表 + * @param tokenDto + * @author zxc + * @date 2022/5/18 13:37 + */ + @PostMapping("assistanceUnitList") + public Result> getAssistanceUnitList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icPartyUnitService.getAssistanceUnitList(tokenDto)); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 1d14501080..9c53742254 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -380,5 +380,15 @@ public class IcUserDemandRecController implements ResultDataResolver { return new Result().ok(result); } + /** + * @Author sun + * @Description 事件评价时同步=评价结果到需求 + **/ + @PostMapping("iceventcomment") + public Result icEventComment(@RequestBody IcEventCommentToDemandFromDTO formDTO) { + icUserDemandRecService.icEventComment(formDTO); + return new Result(); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java index b798d0fe0c..1bb797aa61 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java @@ -10,12 +10,15 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; import com.epmet.commons.tools.enums.EventEnum; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.SystemMessageType; import com.epmet.constant.UserDemandConstant; import com.epmet.dto.form.AutoEvaluateDemandFormDTO; +import com.epmet.dto.form.IcDemandFormDTO; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.demand.*; @@ -267,4 +270,29 @@ public class ResiDemandController { demandSatisfactionService.evaluateDemandAuto(formDTO); return new Result(); } + + /** + * 事件管理-转需求 + * + * @return + */ + @PostMapping("iceventtodemand") + public Result icEventToDemand(@RequestBody IcDemandFormDTO formDTO) { + ReportDemandFormDTO dto = ConvertUtils.sourceToTarget(formDTO, ReportDemandFormDTO.class); + return new Result().ok(icUserDemandRecService.saveOrUpdateDemand(dto)); + } + + /** + * 根据服务方id查询,服务过的需求列表 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("service-list") + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(icUserDemandRecService.queryServiceList(formDTO)); + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java index e8fc375773..5899abc96f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java @@ -19,8 +19,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcCommunitySelfOrganizationDTO; +import com.epmet.dto.form.CategorySelfOrgFormDTO; import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; import com.epmet.dto.result.CommunitySelfOrganizationListDTO; +import com.epmet.dto.result.SelfOrgCategoryTotalResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcCommunitySelfOrganizationEntity; import org.apache.ibatis.annotations.Mapper; @@ -65,4 +67,10 @@ public interface IcCommunitySelfOrganizationDao extends BaseDao selectOrgByOrgName(@Param("names")List names, @Param("customerId") String customerId); List selectOrgByCustomerId(@Param("customerId") String customerId); + + List selectCountGroupByCategory(@Param("customerId") String customerId,@Param("agencyId") String agencyId); + + List queryCategoryList(CategorySelfOrgFormDTO formDTO); + + List queryCoordinateList(CategorySelfOrgFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java index faddda7644..a144e3f69d 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 @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyUnitEntity; import org.apache.ibatis.annotations.Mapper; @@ -27,6 +28,7 @@ import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; import java.util.List; +import java.util.Map; /** * 联建单位 @@ -66,4 +68,28 @@ public interface IcPartyUnitDao extends BaseDao { List getDistribution(@Param("agencyId")String agencyId); 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); } \ 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..01ab0ad96d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -20,9 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.PointRecordFormDTO; -import com.epmet.dto.form.demand.IcResiUserDemandFromDTO; -import com.epmet.dto.form.demand.PageListAnalysisFormDTO; -import com.epmet.dto.form.demand.UserDemandPageFormDTO; +import com.epmet.dto.form.demand.*; import com.epmet.dto.result.PointRecordDTO; import com.epmet.dto.result.ServicePointDTO; import com.epmet.dto.result.demand.*; @@ -140,4 +138,6 @@ public interface IcUserDemandRecDao extends BaseDao { * @Date 2022/1/21 15:53 */ List getServicePoint(@Param("customerId")String customerId, @Param("serviceType")String serviceType); + + List queryServiceList(ServiceListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java index 01db2e7108..0268a247fb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java @@ -67,6 +67,11 @@ public class IcCommunitySelfOrganizationEntity extends BaseEpmetEntity { */ private String organizationName; + /** + * 分类,来源于字典表dictType=self_org_category; + */ + private String categoryCode; + /** * 组织人数 */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java index 0d54cd6184..a07bc2d161 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java @@ -149,7 +149,7 @@ public class IcUserDemandRecEntity extends BaseEpmetEntity { private Integer awardPoint; /** - * 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择 + * 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择 */ private String serviceLocation; @@ -171,4 +171,12 @@ public class IcUserDemandRecEntity extends BaseEpmetEntity { * 需求人是ic的居民时,记录下住的房屋id */ private String demandUserHouseId; + /** + * 来源[需求录入:demand 事件管理:ic_event] + */ + private String origin; + /** + * 来源Id[目前只有来源事件管理的有值] + */ + private String originId; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java index 140d821022..73e0747958 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java @@ -15,6 +15,9 @@ public class ExportCommunitySelfOrganizationExcel { @Excel(name = "组织名称", width = 40, needMerge = true) private String organizationName; + @Excel(name = "分类", width = 40, needMerge = true) + private String categoryName; + @Excel(name = "组织人数", width = 20, needMerge = true) private Integer organizationPersonCount; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java index 10a10f21ad..a0e4133890 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java @@ -20,6 +20,10 @@ public class ImportCommunitySelfOrganization extends ExcelVerifyInfo { @NotBlank(message = "不能为空") private String organizationName; + @Excel(name = "分类", needMerge = true) + @NotBlank(message = "不能为空") + private String categoryCode; + @Excel(name = "组织人数", needMerge = true) //@NotNull(message = "不能为空") private Integer organizationPersonCount; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java index 6a61e4a199..14008a7ce2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java @@ -21,12 +21,11 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcCommunitySelfOrganizationDTO; -import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; -import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; -import com.epmet.dto.form.DelCommunitySelfOrganizationFormDTO; -import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListDTO; import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; +import com.epmet.dto.result.SelfOrgCategoryTotalResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcCommunitySelfOrganizationEntity; @@ -160,4 +159,26 @@ public interface IcCommunitySelfOrganizationService extends BaseService queryListById(List communityOrgIds); + + /** + * 多元主体分析-各分类下的社区自组织数量饼图 + * @param customerId + * @param userId + * @return + */ + List querySelfOrgCategoryTotal(String customerId, String userId); + + /** + * 多元主体分析-分类下的社区自组织列表 + * @param formDTO + * @return + */ + PageData queryCategoryList(CategorySelfOrgFormDTO formDTO); + + /** + * 多元主体分析-地图坐标,及详情 + * @param formDTO + * @return + */ + PageData queryCoordinateList(CategorySelfOrgFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java index d8e5285297..0507b31209 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; @@ -25,8 +8,10 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.PartyUnitListFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyUnitEntity; import org.springframework.web.multipart.MultipartFile; @@ -34,6 +19,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; +import java.util.Map; /** * 联建单位 @@ -158,4 +144,21 @@ public interface IcPartyUnitService extends BaseService { void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO); 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); + } \ 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..eb5f2f89fc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -247,4 +247,17 @@ public interface IcUserDemandRecService extends BaseService getServicePoint(String customerId, String serviceType); + + /** + * 根据服务方id查询,服务过的需求列表 + * @param formDTO + * @return + */ + PageData queryServiceList(ServiceListFormDTO formDTO); + + /** + * @Author sun + * @Description 事件评价时同步=评价结果到需求 + **/ + void icEventComment(IcEventCommentToDemandFromDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java index 1443592a16..833f93d900 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java @@ -12,6 +12,8 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.enums.SelfOrgCategoryEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -32,17 +34,16 @@ import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcCommunitySelfOrganizationDao; import com.epmet.dao.IcUserDemandRecDao; import com.epmet.dto.IcCommunitySelfOrganizationDTO; +import com.epmet.dto.SysDictDataDTO; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; -import com.epmet.dto.result.CommunitySelfOrganizationListDTO; -import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; -import com.epmet.dto.result.ServicePointDTO; -import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcCommunitySelfOrganizationEntity; import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; import com.epmet.excel.CommunitySelfOrgImportExcel; import com.epmet.excel.ImportCommunitySelfOrganization; +import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.OssFeignClient; import com.epmet.service.IcCommunitySelfOrganizationPersonnelService; @@ -51,6 +52,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory; @@ -93,6 +95,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl page(Map params) { @@ -313,6 +317,11 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl> dictMapRes=adminOpenFeignClient.dictMap(DictTypeEnum.SELF_ORG_CATEGORY.getCode()); + Map dictMap = dictMapRes.success() && MapUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData() : new HashMap<>(); + if (formDTO.getIsPage()){ PageInfo objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectCommunitySelfOrganizationList(formDTO)); result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal()))); @@ -321,6 +330,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl> dictMapRes = adminOpenFeignClient.dictMap(DictTypeEnum.SELF_ORG_CATEGORY.getCode()); + Map categoryMap = dictMapRes.success() && MapUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData() : new HashMap<>(); list.forEach(l -> { IcCommunitySelfOrganizationEntity e = ConvertUtils.sourceToTarget(l, IcCommunitySelfOrganizationEntity.class); e.setCustomerId(tokenDto.getCustomerId()); @@ -547,7 +561,13 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl persons = new ArrayList<>(); AtomicReference bl = new AtomicReference<>(false); StringBuffer msg = new StringBuffer(""); @@ -688,4 +708,78 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl querySelfOrgCategoryTotal(String customerId, String staffId) { + Result> dictDataListRes = adminOpenFeignClient.dictDataList(DictTypeEnum.SELF_ORG_CATEGORY.getCode()); + if (!dictDataListRes.success() || CollectionUtils.isEmpty(dictDataListRes.getData())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区自组织分类查询异常"); + } + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(customerId, staffId); + List list = baseDao.selectCountGroupByCategory(customerId, staffInfo.getAgencyId()); + Map map = list.stream().collect(Collectors.toMap(SelfOrgCategoryTotalResDTO::getCategoryCode, SelfOrgCategoryTotalResDTO::getTotal, (key1, key2) -> key2)); + List resultList = new ArrayList<>(); + for (SysDictDataDTO dict : dictDataListRes.getData()) { + SelfOrgCategoryTotalResDTO resDTO = new SelfOrgCategoryTotalResDTO(); + resDTO.setCategoryCode(dict.getDictValue()); + resDTO.setCategoryName(dict.getDictLabel()); + resDTO.setTotal(map.containsKey(dict.getDictValue()) ? map.get(dict.getDictValue()) : NumConstant.ZERO); + resDTO.setColor(SelfOrgCategoryEnum.getEnum(dict.getDictValue()).getColor()); + resultList.add(resDTO); + } + return resultList; + } + + private CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId); + if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前工作人员信息异常"); + } + return staffInfo; + } + + /** + * 多元主体分析-分类下的社区自组织列表 + * + * @param formDTO + * @return + */ + @Override + public PageData queryCategoryList(CategorySelfOrgFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo=getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageInfo pageInfo= PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.queryCategoryList(formDTO)); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } + + /** + * 多元主体分析-地图坐标,及详情 + * + * @param formDTO + * @return + */ + @Override + public PageData queryCoordinateList(CategorySelfOrgFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo=getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageInfo pageInfo= PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.queryCoordinateList(formDTO)); + List list=pageInfo.getList(); + 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, pageInfo.getTotal()); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 3924261510..c878b8f14d 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 @@ -51,8 +51,10 @@ 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.demand.ServiceQueryFormDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceStatDTO; @@ -594,6 +596,39 @@ public class IcPartyUnitServiceImpl extends BaseServiceImplgetPartyUnitList(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()); + } + return baseDao.getAssistanceUnitList(staffInfo.getAgencyId()); + } + private String getServiceMatter(Map map, String matter) { List matters = Arrays.asList(matter.split(StrConstant.COLON)); List list = matters.stream().map(map::get).collect(Collectors.toList()); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 433f118f42..b552251007 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -36,6 +36,7 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ReadFlagConstant; @@ -51,10 +52,7 @@ import com.epmet.dto.form.demand.*; import com.epmet.dto.result.*; import com.epmet.dto.result.demand.*; import com.epmet.entity.*; -import com.epmet.feign.EpmetAdminOpenFeignClient; -import com.epmet.feign.EpmetMessageOpenFeignClient; -import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.*; import com.epmet.service.*; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -67,6 +65,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -108,6 +107,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); + Map serviceTypeMap=serviceTypeRes.success()&& MapUtils.isNotEmpty(serviceTypeRes.getData())?serviceTypeRes.getData():new HashMap<>(); + //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + String str = serviceTypeMap.containsKey(serviceEntity.getServiceType())?serviceEntity.getServerName().concat("(").concat(serviceTypeMap.get(serviceEntity.getServiceType())).concat(")"):StrConstant.EPMETY_STR; + + ColseProjectOrDemandFormDTO dto = new ColseProjectOrDemandFormDTO(); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setUserId(formDTO.getUserId()); + dto.setIcEventId(entity.getOriginId()); + dto.setType("demand"); + dto.setServiceParty(str); + dto.setActualServiceTime(DateUtils.format(formDTO.getServiceStartTime(), DateUtils.DATE_TIME_PATTERN)+"至"+DateUtils.format(formDTO.getServiceEndTime(), DateUtils.DATE_TIME_PATTERN)); + Result result = govProjectOpenFeignClient.closeProjectOrDemand(dto); + if (!result.success()) { + throw new RenException("需求完成,修改事件管理数据失败..."); + } + } + //2022-5-19 sun end return finishResultDTO; } @@ -1375,6 +1397,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl queryServiceList(ServiceListFormDTO formDTO) { + List serverIds = new ArrayList<>(); + if ("community_org".equals(formDTO.getType())) { + serverIds.add(formDTO.getServerId()); + } else if ("volunteer".equals(formDTO.getType())) { + // 根据身份证号查询ic_resi_user.id+epmetUserId + Result> userIdRes = epmetUserOpenFeignClient.getAllUserIds(formDTO.getIdCard(), formDTO.getCustomerId()); + if (!userIdRes.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据身份证号查询用户id异常", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } + if (CollectionUtils.isNotEmpty(userIdRes.getData())) { + serverIds.addAll(userIdRes.getData()); + } + } + formDTO.setServerIds(serverIds); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.queryServiceList(formDTO)); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } + + /** + * @Author sun + * @Description 事件评价时同步=评价结果到需求 + **/ + @Override + public void icEventComment(IcEventCommentToDemandFromDTO formDTO) { + //1.校验需求是否存在且是否已评价 + IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); + if (null == entity || NumConstant.ONE_STR.equals(entity.getEvaluateFlag())) { + log.warn(String.format("需求不存在或已完成评价,需求Id->%s", formDTO.getDemandRecId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在或评价"); + } + + //2.新增评价记录 + IcUserDemandSatisfactionEntity satisfactionEntity = new IcUserDemandSatisfactionEntity(); + satisfactionEntity.setCustomerId(formDTO.getCustomerId()); + satisfactionEntity.setDemandRecId(formDTO.getDemandRecId()); + satisfactionEntity.setUserType("staff"); + satisfactionEntity.setUserId(formDTO.getStaffId()); + satisfactionEntity.setEvaluateTime(new Date()); + satisfactionEntity.setScore(("perfect".equals(formDTO.getSatisfaction()) ? new BigDecimal(5) : ("good".equals(formDTO.getSatisfaction()) ? new BigDecimal(3) : ("bad".equals(formDTO.getSatisfaction()) ? BigDecimal.ONE : BigDecimal.ZERO)))); + demandSatisfactionDao.insert(satisfactionEntity); + + //3.新增操作日志记录 + IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setDemandRecId(formDTO.getDemandRecId()); + logEntity.setUserType("staff"); + logEntity.setUserId(formDTO.getStaffId()); + logEntity.setActionCode(""); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + + //4.更新需求主表数据状态 + entity.setStatus("finished"); + entity.setFinishResult("resolved"); + entity.setEvaluateFlag(true); + baseDao.updateById(entity); + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.15__self_org_category.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.15__self_org_category.sql new file mode 100644 index 0000000000..928b038945 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.15__self_org_category.sql @@ -0,0 +1,8 @@ +alter table ic_community_self_organization +add COLUMN CATEGORY_CODE VARCHAR(32) DEFAULT NULL COMMENT '分类,来源于字典表dictType=self_org_category;'; + + + +ALTER TABLE `ic_user_demand_rec` +ADD COLUMN `ORIGIN` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'demand' COMMENT '来源[需求录入:demand 事件管理:ic_event]' AFTER `DEMAND_USER_HOUSE_ID`, +ADD COLUMN `ORIGIN_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '来源Id[目前只有来源事件管理的有值]' AFTER `ORIGIN`; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.16__self_org_categorydefaultother.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.16__self_org_categorydefaultother.sql new file mode 100644 index 0000000000..64a82e8c86 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.16__self_org_categorydefaultother.sql @@ -0,0 +1,4 @@ +update ic_community_self_organization set CATEGORY_CODE='other' +where DEL_FLAG='0' +and CATEGORY_CODE is not null +and CATEGORY_CODE !=''; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml index 0903571a1a..4293f65f43 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml @@ -16,7 +16,8 @@ ORGANIZATION_CREATED_TIME = #{organizationCreatedTime}, REMARK = #{remark}, UPDATED_TIME = NOW(), - UPDATED_BY = #{updatedBy} + UPDATED_BY = #{updatedBy}, + CATEGORY_CODE =#{categoryCode} WHERE DEL_FLAG = 0 AND ID = #{orgId} @@ -38,7 +39,10 @@ SELECT so.ORGANIZATION_NAME AS organizationName, + so.CATEGORY_CODE AS categoryCode, so.ORGANIZATION_PERSON_COUNT AS organizationPersonCount, IFNULL(DATE_FORMAT(so.ORGANIZATION_CREATED_TIME,'%Y-%m-%d'),DATE_FORMAT(so.CREATED_TIME,'%Y-%m-%d')) AS organizationCreatedTime, so.PRINCIPAL_NAME AS principalName, @@ -116,4 +121,61 @@ AND customer_id = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index d7f02b7109..c3e86c3964 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 @@ -74,6 +74,57 @@ ID + + + + + + + + + update ic_party_unit set SATISFACTION=#{satisfaction},UPDATED_TIME=NOW() 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..4d215c16d9 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,22 @@ 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/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-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/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java index b89917e0d7..fd18bc5569 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java @@ -118,5 +118,8 @@ public class IssueProjectCategoryDictDTO implements Serializable { * 颜色 */ private String colour; - + /** + * 颜色 + */ + private String color; } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectFormDTO.java index adb4ed7409..e136ff04fa 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectFormDTO.java @@ -57,5 +57,17 @@ public class ShiftProjectFormDTO implements Serializable { */ private String customerId; + private String gridId; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; + } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 221a23af53..2392e4d2fa 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -385,4 +385,14 @@ public interface GovIssueOpenFeignClient { */ @PostMapping("/gov/issue/issue/audit-reset") Result issueAuditReset(@RequestParam("gridId")String gridId); + + /** + * 根据categoryId查询分类信息 + * @return + */ + @PostMapping("/gov/issue/issueprojectcategorydict/getByCategoryCode/{category-code}") + Result getByCategoryCode(@PathVariable("category-code") String categoryCode); + + @PostMapping(value = "/gov/issue/issueprojectcategorydict/first/{customerId}") + Result> queryFirstCategory(@PathVariable("customerId") String customerId); } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java index b9db284194..be2f187945 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -321,4 +321,16 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient public Result issueAuditReset(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "issueAuditReset", gridId); } + + @Override + public Result getByCategoryCode(String categoryCode) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getByCategoryCode", categoryCode); + } + + @Override + public Result> queryFirstCategory(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryFirstCategory", customerId); + } + + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java index 51b04c93f3..c7d6039772 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java @@ -299,5 +299,22 @@ public class IssueProjectCategoryDictController { return new Result>().ok(issueProjectCategoryDictService.getCategoryMap(customerId)); } + /** + * 根据categoryId查询分类信息 + * @return + */ + @PostMapping("getByCategoryCode/{category-code}") + public Result getByCategoryCode(@PathVariable("category-code") String categoryCode) { + IssueProjectCategoryDictDTO r = issueProjectCategoryDictService.getByCategoryCode(categoryCode); + return new Result().ok(r); + } + + @PostMapping("first/{customerId}") + public Result> queryFirstCategory(@PathVariable("customerId") String customerId) { + List list = issueProjectCategoryDictService.queryFirstCategory(customerId); + return new Result>().ok(list); + } + + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java index 204fba3743..61fa63044b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java @@ -231,4 +231,12 @@ public interface IssueProjectCategoryDictService extends BaseService getCategoryMap(String customerId); + /** + * 根据分类code查询分类信息 + * @param categoryCode + * @return + */ + IssueProjectCategoryDictDTO getByCategoryCode(String categoryCode); + + List queryFirstCategory(String customerId); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java index 08adcb5860..e9df87bdfc 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java @@ -17,9 +17,11 @@ 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.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -27,6 +29,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IssueCategoryDao; import com.epmet.dao.IssueProjectCategoryDictDao; @@ -540,4 +543,38 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl query = new LambdaQueryWrapper<>(); + query.eq(IssueProjectCategoryDictEntity::getCategoryCode, categoryCode); + query.eq(IssueProjectCategoryDictEntity::getCustomerId, customerId); + IssueProjectCategoryDictEntity entity = baseDao.selectOne(query); + + if (entity == null) { + return null; + } + + IssueProjectCategoryDictDTO r = ConvertUtils.sourceToTarget(entity, IssueProjectCategoryDictDTO.class); + + LambdaQueryWrapper pquery = new LambdaQueryWrapper<>(); + pquery.eq(IssueProjectCategoryDictEntity::getId, r.getPid()); + pquery.eq(IssueProjectCategoryDictEntity::getCustomerId, customerId); + IssueProjectCategoryDictEntity pgEntity = baseDao.selectOne(pquery); + if (pgEntity != null) { + r.setParentCategoryName(pgEntity.getCategoryName()); + } + return r; + } + + @Override + public List queryFirstCategory(String customerId) { + List list=baseDao.selectCategoryOneLevelListByCustomerId(customerId); + if(CollectionUtils.isEmpty(list)){ + return new ArrayList<>(); + } + return ConvertUtils.sourceToTarget(list,IssueProjectCategoryDictDTO.class); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index fd4f54a866..8722a0c027 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1014,6 +1014,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp //3:调用gov-project服务,新增项目各业务表初始数据 formDTO.setCategoryList(categoryList); + formDTO.setGridId(entity.getGridId()); List tagList = issueTagsService.getTagsByIssue(formDTO.getIssueId()); formDTO.setTagList(tagList); Result resultDTO = govProjectFeignClient.issueShiftProject(formDTO); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index f67db1aaa1..c1d52f8ea5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -215,19 +215,25 @@ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubOrgResDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubOrgResDTO.java new file mode 100644 index 0000000000..8bc06550a1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubOrgResDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 当前组织的直属下级(下级组织+直属网格) + */ +@Data +public class SubOrgResDTO implements Serializable { + private String orgId; + /** + * agency + * grid + */ + private String orgType; + private String orgName; + private String pid; + private String pids; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index e2c0ae2359..7e21d51a83 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 @@ -624,4 +624,12 @@ public interface GovOrgOpenFeignClient { */ @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); } 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..adac11545a 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 @@ -403,4 +403,15 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { 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); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index e097d3b38d..0cd507876d 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 @@ -415,4 +415,16 @@ 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); + } + + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 5e7cd8713a..d81fcd8367 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 @@ -316,5 +316,6 @@ public interface CustomerAgencyDao extends BaseDao { */ List getCommunityList(@Param("customerId")String customerId, @Param("agencyId")String agencyId); + List selectSubOrg(String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 855fae6038..a8c661d76b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -288,4 +288,11 @@ public interface CustomerAgencyService extends BaseService * @author sun **/ AgencyTreeResultDTO rootAgencyGridTree(String agencyId); + + /** + * 当前agencyId的下一级组织+直属网格 + * @param agencyId + * @return + */ + List subOrgList(String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index ceb47e21f9..3206792b9b 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 @@ -1442,4 +1442,15 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl subOrgList(String agencyId) { + return baseDao.selectSubOrg(agencyId); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index d8314ee8b5..50fbf27003 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 @@ -756,4 +756,30 @@ AND CUSTOMER_ID = #{customerId} AND pids LIKE concat('%',#{agencyId}, '%' ) + + diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventAttachmentDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventAttachmentDTO.java new file mode 100644 index 0000000000..9d1abdb1b7 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventAttachmentDTO.java @@ -0,0 +1,110 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventCategoryDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventCategoryDTO.java new file mode 100644 index 0000000000..1d79e0e415 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventCategoryDTO.java @@ -0,0 +1,79 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + + /** + * 分类编码,分类编码+customer_id唯一 + */ + private String categoryCode; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java new file mode 100644 index 0000000000..fb86222967 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java @@ -0,0 +1,199 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,事件id + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件所属的网格Id + */ + private String gridId; + + /** + * 网格的所属组织 + */ + private String agencyId; + + /** + * 网格的所有组织Id + */ + private String gridPids; + + /** + * 报事的人【居民端/pc端居民Id】可为空 + */ + private String reportUserId; + + /** + * 报事人姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 反映渠道【字典表】 + */ + private String sourceType; + + /** + * 发生时间 + */ + private Date happenTime; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 地址 + */ + private String address; + + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + + /** + * 办结时间 + */ + private Date closeCaseTime; + + /** + * 0:已回复 1:已转项目 1:已转需求 + */ + private String operationType; + + /** + * 项目、需求ID + */ + private String operationId; + + /** + * 事件是否被阅读过;1已读;针对报事人待处理列表 + */ + private Integer readFlag; + + /** + * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/转需求/办结更新为1; + */ + private Integer redDot; + + /** + * 最近一次操作时间(回复、立项、转需求、办结更新此列) + */ + private Date latestOperatedTime; + + /** + * 是否解决:已解决 resolved,未解决 un_solved + */ + private String resolveStatus; + + /** + * 结案说明 + */ + private String closeRemark; + + /** + * 评论人 + */ + private String commentUserId; + + /** + * 评论内容 + */ + private String satisfaction; + + /** + * 评论时间 + */ + private Date commentTime; + + /** + * 事件审核状态[涉及附件审核需要加的状态](审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 展示红点:visible;隐藏:invisible;人大回复、工作人员回复/立项更新为visible; 插入数据默认不展示 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventOperationLogDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventOperationLogDTO.java new file mode 100644 index 0000000000..a70e211c41 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventOperationLogDTO.java @@ -0,0 +1,111 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventOperationLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 事件id + */ + private String icEventId; + + /** + * 操作用户Id + */ + private String userId; + + /** + * 操作用户类型【居民端用户:resi_user;工作人员:staff;】 + */ + private String userIdentity; + + /** + * 1、发布事件:add + * 2、复:reply; + * 3、立项:shift_project; + * 4、转需求:shift_demand + * 5、办结:close_case; + * 6、需求办结:close_demand + */ + private String actionCode; + + /** + * 1、发布事件:publish; + * 2、撤回事件:recall; + * 3、复:reply; + * 4、立项:shift_project; + * 5、转需求: shift_demand; + * 6、办结:close_case; + * 7、需求办结:close_demand; + * 8、选择是否已解决:choose_resolve; + * 9、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中; + */ + private String actionDesc; + + /** + * 操作时间 + */ + private Date operateTime; + + /** + * 服务方【事件被转需求,需求在办结时的服务方名称】 + */ + private String serviceParty; + /** + * 实际服务时间【事件被转需求,需求在办结时填写的实际服务时间 xx至xx】 + */ + private String actualServiceTime; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventReplyDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventReplyDTO.java new file mode 100644 index 0000000000..9830330fc6 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventReplyDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 事件回复表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventReplyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 回复人用户Id[工作人员ID] + */ + private String fromUserId; + + /** + * 内容 + */ + private String content; + + /** + * 报事人:组织-人名 + */ + private String userShowName; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventScanTaskDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventScanTaskDTO.java new file mode 100644 index 0000000000..d8433ce7a4 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventScanTaskDTO.java @@ -0,0 +1,87 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventScanTaskDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 事件附件表主键,对应dataId + */ + private String icEventAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice 文件 - doc) + */ + private String attachmentType; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 操作人,API审核结果,存储为SCAN_USER或者APP_USER + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AddEventFromResiFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AddEventFromResiFormDTO.java new file mode 100644 index 0000000000..28f5296c5b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AddEventFromResiFormDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/19 11:14 + * @DESC + */ +@Data +public class AddEventFromResiFormDTO implements Serializable { + + private static final long serialVersionUID = -2238068041964629750L; + + public interface AddEventFromResiForm{} + + private String content; + private String address; + + @NotBlank(message = "gridId不能为空",groups = AddEventFromResiForm.class) + private String gridId; + + + /** + * 图片附件列表 + */ + private List attachmentList; + + + /** + * 语音附件列表 + */ + private List voiceList; + + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + private String customerId; + + private String userId; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AutoEvaluationFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AutoEvaluationFormDTO.java new file mode 100644 index 0000000000..d6a5420fd0 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AutoEvaluationFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/5/18 16:33 + * @DESC + */ +@Data +public class AutoEvaluationFormDTO implements Serializable { + + private static final long serialVersionUID = -8871508029242477452L; + + private String customerId; + private String dateId; + private String startDate; + private String endDate; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java new file mode 100644 index 0000000000..19e7d38344 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 需求完成/项目结案时 修改事件数据 + */ +@Data +public class ColseProjectOrDemandFormDTO implements Serializable { + private static final long serialVersionUID = -590440160577071133L; + //事件管理Id + private String icEventId; + //类型 需求:demand 项目:project + private String type; + //服务方【事件被转需求,需求在办结时的服务方名称】 + private String serviceParty; + //实际服务时间【事件被转需求,需求在办结时填写的实际服务时间 xx至xx】 + private String actualServiceTime; + + private String customerId; + private String userId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventProcessAnalysisCommonFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventProcessAnalysisCommonFormDTO.java new file mode 100644 index 0000000000..4a8ffb9f3b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventProcessAnalysisCommonFormDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 事件处理分析通用 + */ +@Data +public class EventProcessAnalysisCommonFormDTO { + + /** + * 处理状态比例查询 + */ + public interface ProcessStatusRatioQuery {} + + /** + * 月度新增 + */ + public interface MonthlyIncrementAnalysis {} + + /** + * 同类事件列表 + */ + public interface SameCategoryEvents {} + + /** + * 要查询的组织ID + */ + @NotBlank(message = "组织ID为必填项", groups = { ProcessStatusRatioQuery.class, MonthlyIncrementAnalysis.class, SameCategoryEvents.class }) + private String orgId; + + /** + * 组织类型。grid,agency + */ + @NotBlank(message = "组织类型为必填项", groups = { ProcessStatusRatioQuery.class, MonthlyIncrementAnalysis.class, SameCategoryEvents.class }) + private String orgType; + + /** + * 查询起始时间 yyyy-MM-dd + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项", groups = { ProcessStatusRatioQuery.class, MonthlyIncrementAnalysis.class }) + private Date queryStartTime; + + /** + * 查询截止时间 yyyy-MM-dd + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项", groups = { ProcessStatusRatioQuery.class, MonthlyIncrementAnalysis.class }) + private Date queryEndTime; + + @NotBlank(message = "分类Id不能为空", groups = { SameCategoryEvents.class }) + private String categoryPids; + + private Integer pageNo = 1; + + private Integer pageSize = 20; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java index 560ebfe2d8..39e4f6f06e 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java @@ -94,4 +94,19 @@ public class EventToProjectFormDTO implements Serializable { private String app; private String client; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; + + /** + * 网格ID + */ + private String gridId; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java new file mode 100644 index 0000000000..0e2bc16a97 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java @@ -0,0 +1,174 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民端-上报需求,或者修改需求 + */ +@Data +public class IcDemandFormDTO implements Serializable { + + private static final long serialVersionUID = 1589287946950749226L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + public interface UpdateInternalGroup { + } + + @NotBlank(message = "事件id不能为空",groups = AddUserInternalGroup.class) + private String icEventId; + + @NotBlank(message = "需求id不能为空",groups = UpdateInternalGroup.class) + private String demandRecId; + + private String customerId; + private String currentUserId; + + + /** + * 网格id + */ + @NotBlank(message = "所属网格不能为空",groups = AddUserShowGroup.class) + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 网格的所有上级id + */ + private String gridPids; + + + + + /** + * 二级需求分类编码 + */ + @NotBlank(message = "需求类别不能为空",groups = AddUserShowGroup.class) + private String categoryCode; + + /** + * 父级需求分类编码 + */ + @NotBlank(message = "需求类别不能为空",groups = AddUserShowGroup.class) + private String parentCode; + + /** + * 需求内容1000字 + */ + @NotBlank(message = "需求内容不能为空",groups = AddUserShowGroup.class) + @Length(max = 1000,message = "需求内容至多输入1000字",groups = AddUserShowGroup.class) + private String content; + + /** + * 社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + */ + @NotBlank(message = "上报类型不能为空",groups = AddUserShowGroup.class) + private String reportType; + + /** + * 上报人姓名 + */ + @NotBlank(message = "上报人不能为空",groups = AddUserShowGroup.class) + private String reportUserName; + + /** + * 上报人联系方式。自身上报时存储注册居民的手机号 + */ + @NotBlank(message = "上报人联系方式不能为空",groups = AddUserShowGroup.class) + private String reportUserMobile; + + /** + * 上报时间 + */ + @NotNull(message = "上报时间不能为空",groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date reportTime; + + /** + * 需求人:user.id或者ic_resi_user.id + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserId; + + /** + * 需求人姓名 + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserName; + + /** + * 需求人联系电话 + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserMobile; + + /** + * 希望服务时间 + */ + @NotNull(message = "服务时间不能为空",groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date wantServiceTime; + + /** + * 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择 + */ + private String serviceLocation; + + /** + * 门牌号详细地址 + */ + private String locationDetail; + + /** + * 经度,需求人是ic的居民时,取所住楼栋的中心点位 + */ + private String longitude; + + /** + * 纬度,需求人是ic的居民时,取所住楼栋的中心点位 + */ + private String latitude; + + /** + * 来源[需求录入:demand 事件管理:ic_event] + */ + private String origin; + /** + * 来源Id[目前只有来源事件管理的有值] + */ + private String originId; + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + /** + * 志愿者:居民端爱心互助的志愿者userId; + */ + private String serverId; + /** + * 服务方名称 + */ + private String serverName; + /** + * 二级分类Id + */ + @NotBlank(message = "分类id不能为空",groups = AddUserInternalGroup.class) + private String categoryId; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java new file mode 100644 index 0000000000..6774329890 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java @@ -0,0 +1,116 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Description 事件管理新增 + * @Author sun + */ +@Data +public class IcEventAddEditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格ID + */ + @NotBlank(message = "网格ID不能为空", groups = {AddGroup.class}) + private String gridId; + /** + * 报事人Id + */ + private String reportUserId; + /** + * 报事人姓名 + */ + @NotBlank(message = "报事人不能为空", groups = {AddGroup.class}) + private String name; + /** + * 手机号 + */ + @Length(max = 11, message = "手机号位数不能超过11位", groups = AddGroup.class) + private String mobile; + /** + * 身份证号 + */ + // @NotBlank(message = "身份证号不能为空", groups = {AddGroup.class}) + @Length(max = 18, message = "身份证号位数不正确", groups = AddGroup.class) + private String idCard; + /** + * 反映渠道 + */ + @NotBlank(message = "反映渠道不能为空", groups = {AddGroup.class}) + private String sourceType; + /** + * 发生时间 + */ + @NotNull(message = "发生时间不能为空", groups = {AddGroup.class}) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date happenTime; + /** + * 事件内容 + */ + @NotBlank(message = "事件内容不能为空", groups = {AddGroup.class}) + private String eventContent; + /** + * 图片集合 + */ + private List imageList; + /** + * 二类分类Id + */ + private List categoryList; + /** + * 事件地址 + */ + //@NotBlank(message = "事件地址不能为空", groups = {AddGroup.class}) + private String address; + /** + * 经度 + */ + private String latitude; + /** + * 维度 + */ + private String longitude; + /** + * 处理方式[0:已回复 1:已转项目 2:已转需求] + */ + private String operationType; + /** + * 项目、需求ID + */ + private String operationId; + /** + * 回复内容 + */ + private String content; + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + /** + * 立项接口入参对象 + */ + private IcEventToProjectFormDTO project; + /** + * 转需求接口入参对象 + */ + private IcDemandFormDTO demand; + + + private String customerId; + private String userId; + private String app; + private String client; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventCategoryAnalysisFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventCategoryAnalysisFormDTO.java new file mode 100644 index 0000000000..e2dc625e6d --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventCategoryAnalysisFormDTO.java @@ -0,0 +1,75 @@ +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 社区治理可视化分析 + * 事件分类分析-饼1入参 + */ +@Data +public class IcEventCategoryAnalysisFormDTO { + + /** + * 处理状态比例查询 + */ + public interface TotalPie { + } + + public interface OrgTotalPie { + } + /** + * 要查询的组织ID + */ + @NotBlank(message = "组织ID为必填项", groups = {TotalPie.class,OrgTotalPie.class}) + private String orgId; + + /** + * 组织类型。grid,agency + */ + @NotBlank(message = "组织类型为必填项", groups = {TotalPie.class,OrgTotalPie.class}) + private String orgType; + + /** + * 查询起始时间 yyyy-MM-dd + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项", groups = {TotalPie.class,OrgTotalPie.class}) + private Date queryStartTime; + + /** + * 查询截止时间 yyyy-MM-dd + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项", groups = {TotalPie.class,OrgTotalPie.class}) + private Date queryEndTime; + + + private String categoryCode; + + /** + * 一级分类 code长度 + */ + private Integer categoryOneLength; + + private String gridPids; + + //以下参数从token中获取 + /** + * 当前登录用户 + */ + private String staffId; + + /** + * 当前客户id + */ + private String customerId; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java new file mode 100644 index 0000000000..ad88c1ce36 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java @@ -0,0 +1,76 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 【迁入管理】列表--接口入参 + * @Author sun + */ +@Data +public class IcEventListFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + public interface Detail extends CustomerClientShowGroup { + } + + /** + * 事件ID + */ + @NotBlank(message = "事件ID不能为空", groups = Detail.class) + private String icEventId; + /** + * 所属组织 + */ + private String agencyId; + /** + * 所属网格 + */ + private String gridId; + /** + * 上报渠道 + */ + private String sourceType; + /** + * 事件内容 + */ + private String eventContent; + /** + * 报事人 + */ + private String name; + /** + * 手机号 + */ + private String mobile; + /** + * 起始上报时间yyyy-MM-dd HH:mm:ss + */ + private String startTime; + /** + * 终止上报时间yyyy-MM-dd HH:mm:ss + */ + private String endTime; + /** + * 状态【处理中:processing;已办结:closed_case】】 + */ + private String status; + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + + private Boolean isPage = true; + + private String customerId; + private String staffId; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventReplyFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventReplyFormDTO.java new file mode 100644 index 0000000000..6c9bacafa8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventReplyFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 事件管理_回复 + * @Author sun + */ +@Data +public class IcEventReplyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface Comment extends CustomerClientShowGroup { + } + public interface Process extends CustomerClientShowGroup { + } + + /** + * 事件ID + */ + @NotBlank(message = "事件ID不能为空", groups = {UpdateGroup.class, Comment.class, Process.class}) + private String icEventId; + /** + * 二类分类Id + */ + private String categoryId; + /** + * 回复内容 + */ + @NotBlank(message = "回复内容不能为空", groups = {UpdateGroup.class}) + private String content; + /** + * 处理方式[0:已回复 1:已转项目 1:已转需求] + */ + @NotBlank(message = "处理方式不能为空", groups = {UpdateGroup.class}) + private String operationType; + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + + /** + * 满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + @NotBlank(message = "满意度不能为空", groups = {Comment.class}) + private String satisfaction; + + private String customerId; + private String userId; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java new file mode 100644 index 0000000000..7c5bf3fc6c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java @@ -0,0 +1,110 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 事件管理-立项 + * + * @author sun + */ +@Data +public class IcEventToProjectFormDTO implements Serializable { + private static final long serialVersionUID = 3392008990676159012L; + + public interface AddUserInternalGroup { + } + + public interface ApprovalCategory extends CustomerClientShowGroup { + } + + /** + * 事件id + */ + @NotBlank(message = "事件id不能为空", groups = AddUserInternalGroup.class) + private String icEventId; + /** + * 项目方案 1000 + */ + @Length(min = 1, max = 1000, message = "项目方案1000字", groups = {ApprovalCategory.class}) + private String publicReply; + /** + * 内部备注 1000 + * 21.08.09 直接立项的内部备注是必填的,然后议题转项目和我要直报转项目的都是非必填的 + */ + //@Length(min = 1, max = 1000, message = "内部备注1000字", groups = {ApprovalCategory.class}) + private String internalRemark; + + /** + * 吹哨勾选的工作人员信息集合,不可为空 + */ + @Valid + private List staffList; + /** + * 项目所选分类集合,不可为空 + */ + @Valid + private List categoryList; + /** + * 项目所选标签集合 + */ + private List tagList; + + @Length(min = 1, max = 20, message = "项目标题不能超过20位", groups = {ApprovalCategory.class}) + private String title; + + /** + * 公开答复对应文件集合 + */ + private List publicFile; + /** + * 内部备注对应文件集合 + */ + private List internalFile; + + //定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置] + private String locateAddress; + //定位经度 + private String locateLongitude; + //定位纬度 + private String locateDimension; + + + + //以下参数从token中获取 + /** + * 当前用户id + */ + @NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class) + private String userId; + + /** + * 当前客户id + */ + @NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; + + private String app; + private String client; + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空", groups = AddUserInternalGroup.class) + private String gridId; + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportIcEvFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportIcEvFormDTO.java new file mode 100644 index 0000000000..032a0c5b65 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportIcEvFormDTO.java @@ -0,0 +1,34 @@ +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 { + } + @NotBlank(message = "事件id不能为空", groups = {ReplyListGroup.class,RemoveRedGroup.class}) + private String icEventId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProcessAnalysisEventListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProcessAnalysisEventListFormDTO.java new file mode 100644 index 0000000000..5a4b1800ef --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProcessAnalysisEventListFormDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +@Data +public class ProcessAnalysisEventListFormDTO { + + /** + * 组织id + */ + @NotBlank(message = "组织ID为必填项") + private String orgId; + /** + * 组织类型grid,agency + */ + @NotBlank(message = "组织类型为必填项") + private String orgType; + /** + * 查询起始时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项") + private Date queryStartTime; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "查询时间为必填项") + private Date queryEndTime; + + /** + * 处理状态processing, closed_case + */ + private String processStatus; + /** + * 事件分类code + */ + private String categoryCode; + private Integer pageNo; + private Integer pageSize; + + /** + * 业务: + * 1.eventProcessAnalysis 事件处理分析 + * 2.eventCategoryAnalysis 事件分类分析 + */ + private String biz; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java index 0ce775f1ad..3b2fe63a12 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java @@ -75,5 +75,15 @@ public class ProjectApprovalFormDTO implements Serializable { */ @NotBlank(message = "网格ID不能为空",groups = {AddGroup.class}) private String gridId; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java index 75cf13e64e..0bcd5405fb 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java @@ -55,4 +55,16 @@ public class ProjectClosedFromDTO implements Serializable { * 内部备注对应文件集合 */ private List internalFile; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; + + private String customerId; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java new file mode 100644 index 0000000000..54d327354c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/5/17 14:14 + * @DESC + */ +@Data +public class ProjectManageListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -3317804468566708838L; + + /** + * 标题 + */ + private String title; + + /** + * 转项目开始日期,eg:20220505 + */ + private String startDate; + + /** + * 转项目结束日期,eg:20220505 + */ + private String endDate; + + /** + * null就是全部,closed:已关闭,pending:待处理 + */ + private String status; + + private String userId; + + private String customerId; + + private String agencyId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java index 3f7f2a1c13..1562997afa 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java @@ -55,4 +55,14 @@ public class ProjectResponseFormDTO implements Serializable { */ private List internalFile; + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiReplyIcEventFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiReplyIcEventFormDTO.java new file mode 100644 index 0000000000..0e4b423f0c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiReplyIcEventFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 居民端我上报的事件回复 + * ic_event + */ +@Data +public class ResiReplyIcEventFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "事件id不能为空", groups = {AddUserInternalGroup.class}) + private String icEventId; + + @NotBlank(message = "内容不能为空", groups = AddUserShowGroup.class) + @Length(max = 200, message = "内容最多输入200字", groups = AddUserShowGroup.class) + private String content; + + + //以下参数从token中获取 + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/SatisfactionEvaluationListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/SatisfactionEvaluationListFormDTO.java new file mode 100644 index 0000000000..3309a89426 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/SatisfactionEvaluationListFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/5/18 09:57 + * @DESC + */ +@Data +public class SatisfactionEvaluationListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 1790517675681175478L; + + public interface SatisfactionEvaluationListForm{} + + @NotBlank(message = "projectId不能为空",groups = SatisfactionEvaluationListForm.class) + private String projectId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java index 4b9718122c..da8e7b8f3d 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java @@ -40,5 +40,15 @@ public class TransferFormDTO implements Serializable { * 内部备注对应文件集合 */ private List internalFile; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java index 4ade8603df..15359f851d 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java @@ -8,4 +8,6 @@ import java.io.Serializable; public class HouseUserDTO implements Serializable { private String icResiUserId; private String icUserName; + private String agencyId; + private String gridId; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventAnalysisOrgResDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventAnalysisOrgResDTO.java new file mode 100644 index 0000000000..cc6d31f72c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventAnalysisOrgResDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + + +@Data +public class IcEventAnalysisOrgResDTO implements Serializable { + private String orgId; + private String orgType; + private String orgName; + private Integer total = 0; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventCategoryAnalysisResDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventCategoryAnalysisResDTO.java new file mode 100644 index 0000000000..62609af451 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventCategoryAnalysisResDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 社区治理可视化分析 + * 事件分类分析-饼1 + */ +@Data +public class IcEventCategoryAnalysisResDTO implements Serializable { + //一级分类Code + private String categoryCode; + //一级分类名称 + private String categoryName; + //一级分类颜色 + private String color = ""; + //分类下项目总数 + private Integer total = 0; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java new file mode 100644 index 0000000000..19bb9b55df --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java @@ -0,0 +1,215 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * @Description 【迁入管理】列表--接口返参 + * @Author sun + */ +@Data +public class IcEventListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 事件Id + */ + private String icEventId; + /** + * 网格ID + */ + private String gridId; + /** + * 所属网格 + */ + private String gridName; + /** + * 网格的所属组织 + */ + private String agencyId; + /** + * 报事的人【居民端/pc端居民Id】可为空 + */ + private String reportUserId; + /** + * 图片[url集合] + */ + private List imageList; + /** + * 音频[url集合] + */ + private List voiceList; + /** + * 上报渠道 + */ + private String sourceTypeName; + /** + * 纬度 + */ + private String latitude; + /** + * 经度 + */ + private String longitude; + /** + * 地址 + */ + private String address; + /** + * 报事人 + */ + private String name; + /** + * 手机号 + */ + private String mobile; + /** + * 身份证号 + */ + private String idCard; + /** + * 上报渠道[字典表] + */ + private String sourceType; + /** + * 发生时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date happenTime; + /** + * 事件内容 + */ + private String eventContent; + /** + * 群众满意度[满意度 - 不满意:bad、基本满意:good、非常满意:perfect] + */ + private String satisfaction; + /** + * 群众满意度[满意度 - 不满意:bad、基本满意:good、非常满意:perfect] + */ + private String satisfactionName; + /** + * 上报时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; + /** + * 状态【处理中:processing;已办结:closed_case】】 + */ + private String status; + /** + * 状态【处理中:processing;已办结:closed_case】】 + */ + private String statusName; + /** + * 事件创建人 + */ + private String createdUserId; + /** + * 办结时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date closeCaseTime; + /** + * 0:已回复 1:已转项目 1:已转需求 + */ + private String operationType; + /** + * 0:已回复 1:已转项目 1:已转需求 + */ + private String operationTypeName; + /** + * 项目、需求ID + */ + private String operationId; + /** + * 事件是否被阅读过;1已读;针对报事人待处理列表 + */ + private Integer readFlag; + /** + * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/转需求/办结更新为1; + */ + private Integer redDot; + /** + * 最近一次操作时间(回复、立项、转需求、办结更新此列) + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date latestOperatedTime; + /** + * 是否解决:已解决 resolved,未解决 un_solved + */ + private String resolveStatus; + /** + * 结案说明 + */ + private String closeRemark; + /** + * 评论人 + */ + private String commentUserId; + /** + * 评论时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date commentTime; + /** + * 上级分类ID 顶级此列存储0 + */ + private String parentCategoryId; + /** + * 分类Id + */ + private String categoryId; + /** + * 上级分类编码 + */ + private String parentCategoryCode; + + /** + * 分类编码 + */ + private String categoryCode; + /** + * 上级分类名称 + */ + private String parentCategoryName; + /** + * 分类名称 + */ + private String categoryName; + /** + * 第一章图片url + */ + private String imageUrl; + + /** + * 事件附件 + */ + @JsonIgnore + private List attachmentList; + @Data + public static class Attachment { + /** + * url + */ + private String url; + + /** + * 附件类型 + */ + private String type; + + /** + * 附件类型 + */ + private Integer duration; + } + + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyCountResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyCountResultDTO.java new file mode 100644 index 0000000000..724a39a79b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyCountResultDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result; + +import jdk.nashorn.internal.ir.debug.PrintVisitor; +import lombok.Data; + +import java.util.Date; + +@Data +public class IcEventMonthlyCountResultDTO { + + private String monthName; + + private Integer eventCount; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyIncrementResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyIncrementResultDTO.java new file mode 100644 index 0000000000..18cebe0622 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyIncrementResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 事件阅读增量dto + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class IcEventMonthlyIncrementResultDTO { + private String monthName; + private Integer increment; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java new file mode 100644 index 0000000000..65d28e6501 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/21 下午3:31 + */ +@Data +public class IcEventProcessListResultDTO implements Serializable { + + private static final long serialVersionUID = 5762152044573235897L; + + /** + * 进展Id + */ + private String processId; + + /** + * 处理进展名称 + */ + private String processName; + + /** + * 处理进展时间 + */ + private Long processTime; + + /** + * 处理部门 + */ + private String departmentName; + /** + * 公开答复 + */ + private String publicReply; + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + @JsonIgnore + private String assistanceUnitType; + /** + * 协办单位ID + */ + private String assistanceUnitId; + /** + * 协办单位名字 + */ + private String assistanceUnitName; + /** + * 回复event 项目project 需求demand + */ + private String type; + /** + * 服务方【事件被转需求,需求在办结时的服务方名称】 + */ + private String serviceParty; + /** + * 服务时间 + */ + private String serviceTime; + /** + * 实际服务时间【事件被转需求,需求在办结时填写的实际服务时间 xx至xx】 + */ + private String actualServiceTime; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java new file mode 100644 index 0000000000..0408211603 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class IcEventResultDTO { + private String eventId; + private String eventContent; + private String gridId; + private String gridName; + private String sourceType; + private String sourceTypeName; + private String processStatus; + private String processStatusName; + private String reportUserId; + private String reportUserName; + private String mobile; + private String address; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventYpAnalysisResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventYpAnalysisResultDTO.java new file mode 100644 index 0000000000..934833d09c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventYpAnalysisResultDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 研判分析 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class IcEventYpAnalysisResultDTO { + + /** + * 家属 + */ + private List dependents; + /** + * 上报人居民端小程序id + */ + //private String reportorUserId; + /** + * 上报人居民信息id + */ + private String reportorResiId; + /** + * 上报人姓名 + */ + private String reportorName; + /** + * 上报人手机号 + */ + private String reportorMobile; + /** + * 上报人身份证号 + */ + private String reportorIdCard; + + private String reportorAgencyId; + + private String reportorGridId; + /** + * 上报渠道名称 + */ + private String sourceTypeName; + /** + * 事件分类名称(目前是一级) + */ + private String categoryName; + /** + * 事件分类编码(目前是一级) + */ + private String categoryCode; + + /** + * 事件分类ID path + */ + private String categoryPids; + + /** + * 居民上报的事件的总和 + */ + private Integer resiReportEventCount; + /** + * 家属 + */ + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class Dependent { + private String id; + private String name; + private String agencyId; + private String gridId; + } + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportIcEvResDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportIcEvResDTO.java new file mode 100644 index 0000000000..d2652ce3a3 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportIcEvResDTO.java @@ -0,0 +1,109 @@ +package com.epmet.dto.result; + +import com.epmet.dto.IcEventAttachmentDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 居民端我上报的事件列表+详情 + */ +@Data +public class MyReportIcEvResDTO implements Serializable { + /** + * 事件Id + */ + private String icEventId; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 发生时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date happenTime; + + /** + * 图片[url集合] + */ + private List imageList; + /** + * 音频[url集合] + */ + private List voiceList; + + /** + * 地址 + */ + private String address; + + /** + * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/转需求/办结更新为1; + */ + private Boolean redDot; + + /** + * true:可以回复 + * false:不可以回复 + * todo + */ + private Boolean replyFlag; + + /** + * 状态【处理中:processing;已办结:closed_case】】 + */ + private String status; + /** + * 状态【处理中:processing;已办结:closed_case】】 + */ + private String statusName; + /** + * 0:已回复 1:已转项目 1:已转需求 + */ + private String operationType; + /** + * 项目、需求ID + */ + private String operationId; + + /** + * 最近一次操作时间(回复、立项、转需求、办结更新此列) + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date latestOperatedTime; + + /** + * 群众满意度[满意度 - 不满意:bad、基本满意:good、非常满意:perfect] + */ + private String satisfaction; + /** + * 群众满意度[满意度 - 不满意:bad、基本满意:good、非常满意:perfect] + */ + private String satisfactionName; + + /** + * 分类Id + */ + // @JsonIgnore + private String categoryId; + + /** + * 分类名称 + */ + private String categoryName; + + + /** + * 事件附件 + */ + @JsonIgnore + private List attachmentList; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java index cea1ce6288..25d9dcebf7 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -53,6 +54,23 @@ public class ProcessListV2ResultDTO implements Serializable { * 内部备注 */ private String internalRemark; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + @JsonIgnore + private String assistanceUnitType; + + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位名字 + */ + private String assistanceUnitName; + /** * 子节点 */ @@ -76,6 +94,8 @@ public class ProcessListV2ResultDTO implements Serializable { this.departmentName = ""; this.publicReply = ""; this.internalRemark = ""; + this.assistanceUnitName = ""; + this.assistanceUnitId = ""; this.publicFile = new ArrayList<>(); this.internalFile = new ArrayList<>(); this.subProcess = new ArrayList<>(); diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessStatusRatioResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessStatusRatioResultDTO.java new file mode 100644 index 0000000000..2028c30671 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessStatusRatioResultDTO.java @@ -0,0 +1,11 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class ProcessStatusRatioResultDTO { + private Long processingCount = 0l; + private Long closedCount = 0l; + private Double processingRatio = 0d; + private Double closedRatio = 0d; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java new file mode 100644 index 0000000000..7c9bb481e8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java @@ -0,0 +1,90 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/17 14:27 + * @DESC + */ +@Data +public class ProjectManageListResultDTO implements Serializable { + + private static final long serialVersionUID = 2374701362057175388L; + + /** + * 所顺网格 + */ + private String gridName; + private String gridId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目标题 + */ + private String title; + + /** + * 转项目时间 + */ + private String shiftProjectTime; + + /** + * 项目方案 + */ + private String projectScheme; + + /** + * 内部备注 + */ + private String internalRemark; + + /** + * 滞留天数 + */ + private String detentionDays; + + /** + * 状态 + */ + private String status; + private String statusValue; + + /** + * 处理部门 + */ + private List departmentNameList; + + @JsonIgnore + private Date updatedTime; + + @JsonIgnore + private String isHandle; + + private Boolean processable; + + private Boolean returnable; + + public ProjectManageListResultDTO() { + this.gridName = ""; + this.title = ""; + this.shiftProjectTime = ""; + this.projectScheme = ""; + this.internalRemark = ""; + this.detentionDays = NumConstant.ZERO_STR; + this.status = ""; + this.departmentNameList = new ArrayList<>(); + this.projectId = ""; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/SatisfactionEvaluationListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/SatisfactionEvaluationListResultDTO.java new file mode 100644 index 0000000000..613449a6cf --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/SatisfactionEvaluationListResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/5/18 09:58 + * @DESC + */ +@Data +public class SatisfactionEvaluationListResultDTO implements Serializable { + + private static final long serialVersionUID = 4086193179665858119L; + + /** + * 评价人 + */ + private String evaluationUser; + + @JsonIgnore + private String userId; + + /** + * 评价时间 + */ + private String time; + + /** + * 评价内容 + */ + private String content; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/enums/EcEventProcessStatusEnum.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/enums/EcEventProcessStatusEnum.java new file mode 100644 index 0000000000..b0878ded9c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/enums/EcEventProcessStatusEnum.java @@ -0,0 +1,40 @@ +package com.epmet.enums; + +/** + * ic事件状态枚举 + */ +public enum EcEventProcessStatusEnum { + + PROCESSING("processing", "处理中"), + CLOSED_CASE("closed_case", "已完成"); + + private String processStatus; + private String processStatusName; + + EcEventProcessStatusEnum(String processStatus, String processStatusName) { + this.processStatus = processStatus; + this.processStatusName = processStatusName; + } + + /** + * 根据sourceType查询对应的枚举对象 + * @param processStatus + * @return + */ + public static EcEventProcessStatusEnum getObjectBySourceType(String processStatus) { + for (EcEventProcessStatusEnum e : EcEventProcessStatusEnum.values()) { + if (e.getProcessStatus().equals(processStatus)) { + return e; + } + } + return null; + } + + public String getProcessStatus() { + return processStatus; + } + + public String getProcessStatusName() { + return processStatusName; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index 70abf989e9..1242d3064b 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -158,4 +158,22 @@ public interface GovProjectOpenFeignClient { */ @PostMapping("gov/project/project/audit-reset") Result eventAuditReset(@RequestParam("gridId")String gridId); + + /** + * Desc: 定时任务自动评价 + * @param formDTO + * @author zxc + * @date 2022/5/18 16:35 + */ + @PostMapping("gov/project/icEvent/auto-evaluation") + Result autoEvaluation(@RequestBody AutoEvaluationFormDTO formDTO); + + /** + * Desc: 需求完成/项目结案时 修改事件数据 + * @author sun + */ + @PostMapping("gov/project/icEvent/closeprojectordemand") + Result closeProjectOrDemand(@RequestBody ColseProjectOrDemandFormDTO formDTO); + + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index 8136ac1432..49a969f91e 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -159,4 +159,14 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result eventAuditReset(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "eventAuditReset",gridId); } + + @Override + public Result autoEvaluation(AutoEvaluationFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "autoEvaluation",formDTO); + } + + @Override + public Result closeProjectOrDemand(ColseProjectOrDemandFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "closeProjectOrDemand",formDTO); + } } diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 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..24e4fc16f4 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java @@ -0,0 +1,440 @@ +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.dto.result.CustomerStaffInfoCacheResult; +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.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()); + } + + /** + * 居民端小程序我上报的事件详情页面-回复列表 + * http://yapi.elinkservice.cn/project/102/interface/api/7783 + * @param formDTO + * @return + */ + @PostMapping("reply-list") + public Result> replyList(@LoginUser TokenDto tokenDto,@RequestBody MyReportIcEvFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, MyReportIcEvFormDTO.ReplyListGroup.class); + return new Result>().ok(icEventReplyService.replyList(formDTO.getIcEventId(),formDTO.getUserId())); + } + + /** + * 居民端小程序我上报的事件-处理中 + * 点击事件进入详情页时调用此接口,消除红点 + * yapi:http://yapi.elinkservice.cn/project/102/interface/api/7790 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("remove-red") + public Result removeRed(@LoginUser TokenDto tokenDto, @RequestBody MyReportIcEvFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, MyReportIcEvFormDTO.RemoveRedGroup.class); + icEventService.removeRed(formDTO.getUserId(), formDTO.getIcEventId()); + return new Result(); + } + + /** + * 居民端我上报的事件-回复 + * http://yapi.elinkservice.cn/project/102/interface/api/7789 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("resi-reply") + public Result resiReply(@LoginUser TokenDto tokenDto, @RequestBody ResiReplyIcEventFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, ResiReplyIcEventFormDTO.AddUserShowGroup.class,ResiReplyIcEventFormDTO.AddUserInternalGroup.class); + icEventService.resiReply(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 数字平台-事件导出 + **/ + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "事件管理" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcEventExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = icEventService.list(formDTO); + data.getList().forEach(d->{ + if(!org.springframework.util.CollectionUtils.isEmpty(d.getImageList())){ + d.setImageUrl(d.getImageList().get(NumConstant.ZERO)); + } + }); + list = ConvertUtils.sourceToTarget(data.getList(), IcEventExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index 372ff5fb5c..03bb218bd1 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -336,4 +337,46 @@ public class ProjectController { public Result eventAuditReset(@RequestParam("gridId")String gridId){ return new Result().ok(projectService.eventAuditReset(gridId)); } + + /** + * Desc: 列表【项目管理】 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/5/17 14:19 + */ + @PostMapping("project-list") + public Result projectList(@LoginUser TokenDto tokenDto,@RequestBody ProjectManageListFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(projectService.projectList(formDTO)); + } + + /** + * Desc: 项目管理导出 + * @param response + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/5/24 15:22 + */ + @PostMapping("project-list-export") + public void projectListExport(HttpServletResponse response,@LoginUser TokenDto tokenDto,@RequestBody ProjectManageListFormDTO formDTO) throws IOException { + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setIsPage(false); + projectService.projectListExport(response,formDTO); + } + + /** + * Desc: 满意度评价列表 + * @param formDTO + * @author zxc + * @date 2022/5/18 10:03 + */ + @PostMapping("satisfaction-evaluation-list") + public Result satisfactionEvaluationList(@RequestBody SatisfactionEvaluationListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SatisfactionEvaluationListFormDTO.SatisfactionEvaluationListForm.class); + return new Result().ok(projectService.satisfactionEvaluationList(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventAttachmentDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventAttachmentDao.java new file mode 100644 index 0000000000..2da1ab32f9 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventAttachmentDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcEventAttachmentDTO; +import com.epmet.entity.IcEventAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventAttachmentDao extends BaseDao { + List selectByIcEventId(@Param("icEventId") String icEventId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java new file mode 100644 index 0000000000..e8829fda7a --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java @@ -0,0 +1,19 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcEventCategoryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 事件所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventCategoryDao extends BaseDao { + + IcEventCategoryEntity selectByEventId(@Param("icEventId") String icEventId); + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java new file mode 100644 index 0000000000..386225e922 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java @@ -0,0 +1,139 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcEventCategoryAnalysisFormDTO; +import com.epmet.dto.form.IcEventListFormDTO; +import com.epmet.dto.form.MyReportIcEvFormDTO; +import com.epmet.dto.result.*; +import com.epmet.entity.IcEventEntity; +import org.apache.ibatis.annotations.MapKey; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventDao extends BaseDao { + + List icEventList(IcEventListFormDTO formDTO); + + /** + * 查询事件处理状态比例 + * @param gridPids + * @param queryStartTime + * @param queryEndTime + * @return List[Map<状态key:事件数量>] + */ + @MapKey("status") + List> getProcessStatusRatio(@Param("customerId") String customerId, + @Param("orgType") String orgType, + @Param("orgId") String orgId, + @Param("gridPids") String gridPids, + @Param("queryStartTime") Date queryStartTime, + @Param("queryEndTime") Date queryEndTime); + + /** + * 事件处理分析-时间列表 + * @param customerId + * @param gridPids + * @param categoryCode + * @param processStatus + * @param queryStartTime 包含 + * @param queryEndTime 包含 + * @return + */ + List listProcessAnalysisEvents(@Param("customerId") String customerId, + @Param("orgType") String orgType, + @Param("orgId") String orgId, + @Param("gridPids") String gridPids, + @Param("categoryCode") String categoryCode, + @Param("processStatus") String processStatus, + @Param("queryStartTime") Date queryStartTime, + @Param("queryEndTime") Date queryEndTime, + @Param("biz") String biz); + + /** + * 月度事件数统计查询 + * @param orgType + * @param orgId + * @param gridPids + * @param queryStartTime + * @param queryEndTime + * @return + */ + List listMonthlyEventCount( + @Param("orgType") String orgType, + @Param("orgId") String orgId, + @Param("gridPids") String gridPids, + @Param("queryStartTime") Date queryStartTime, + @Param("queryEndTime") Date queryEndTime); + + /** + * 按父级分类查询组织下的事件列表 + * @param orgId + * @param orgType + * @param categoryPids + * @return + */ + List listEventsByPCategoryInOrg(@Param("orgId") String orgId, + @Param("gridPids") String gridPids, + @Param("orgType") String orgType, + @Param("categoryPids") String categoryPids); + + /** + * + * @param formDTO + * @return + */ + List selectFirstCategoryTotal(IcEventCategoryAnalysisFormDTO formDTO); + + /** + * Desc: 查询客户下可以自动评价事件的ID + * @param customerId + * @param no + * @param size + * @author zxc + * @date 2022/5/18 17:20 + */ + List getAutoEvaluationIds(@Param("customerId") String customerId,@Param("no")Integer no,@Param("size")Integer size); + + /** + * Desc: 更新评价,默认 perfect + * @param ids + * @author zxc + * @date 2022/5/18 17:26 + */ + void updateAutoEvaluation(@Param("ids")List ids); + + /** + * + * @param formDTO + * @return + */ + Integer selectOrgTotal(IcEventCategoryAnalysisFormDTO formDTO); + + /** + * 居民端小程序我上报的事件-列表+详情 + * + * @param formDTO + * @return + */ + List selectMyReport(MyReportIcEvFormDTO formDTO); + + int updateRedDot(@Param("userId") String userId, @Param("icEventId")String icEventId); + + /** + * 查询居民上报的时间数量 + * @param reportorIdCard 上报人的身份证号 + * @return + */ + Integer getResiReportEventCount(@Param("reportorIdCard") String reportorIdCard); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventOperationLogDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventOperationLogDao.java new file mode 100644 index 0000000000..50f87e388b --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventOperationLogDao.java @@ -0,0 +1,22 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IcEventProcessListResultDTO; +import com.epmet.entity.IcEventOperationLogEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.LinkedList; + +/** + * 事件操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventOperationLogDao extends BaseDao { + + LinkedList selectByEventId(@Param("icEventId") String icEventId); + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventReplyDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventReplyDao.java new file mode 100644 index 0000000000..efdc25830a --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventReplyDao.java @@ -0,0 +1,25 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcEventReplyDTO; +import com.epmet.dto.result.IcEventProcessListResultDTO; +import com.epmet.entity.IcEventReplyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.LinkedList; +import java.util.List; + +/** + * 事件回复表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventReplyDao extends BaseDao { + + LinkedList selectByEventId(@Param("icEventId") String icEventId); + + List selectReplyList(@Param("icEventId") String icEventId, @Param("userId")String userId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventScanTaskDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventScanTaskDao.java new file mode 100644 index 0000000000..0666a818a0 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventScanTaskDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcEventScanTaskEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcEventScanTaskDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index 5d1a7d578e..6c5e253e06 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.EventProjectInfoDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.ProjectStaffDTO; -import com.epmet.dto.form.LatestListFormDTO; -import com.epmet.dto.form.PatrolProjectFormDTO; -import com.epmet.dto.form.ProjectListFromDTO; -import com.epmet.dto.form.ShiftProjectsFromDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.ProjectEntity; import org.apache.ibatis.annotations.Mapper; @@ -300,4 +297,6 @@ public interface ProjectDao extends BaseDao { */ Integer selectEventStatus(@Param("gridId") String gridId); + List getProjectManageList(ProjectManageListFormDTO formDTO); + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionDetailDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionDetailDao.java index ca0c2a492e..a8f03be57e 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionDetailDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionDetailDao.java @@ -20,10 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.ProjectEvaluationListFormDTO; import com.epmet.dto.form.ProjectInitEvaluationFormDTO; -import com.epmet.dto.result.EvaluationListResultDTO; -import com.epmet.dto.result.ProjectEvaluateDetailResultDTO; -import com.epmet.dto.result.ProjectEvaluateInfoResultDTO; -import com.epmet.dto.result.ProjectEvaluationListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.ProjectSatisfactionDetailEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -69,4 +66,12 @@ public interface ProjectSatisfactionDetailDao extends BaseDao selectProjectEvaluateDetail(@Param("projectIds")List projectIds); + /** + * Desc: 满意度评价列表 + * @param projectId + * @author zxc + * @date 2022/5/18 10:03 + */ + List satisfactionEvaluationList(@Param("projectId")String projectId); + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventAttachmentEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventAttachmentEntity.java new file mode 100644 index 0000000000..a5efd1f853 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventAttachmentEntity.java @@ -0,0 +1,80 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event_attachment") +public class IcEventAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventCategoryEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventCategoryEntity.java new file mode 100644 index 0000000000..7e96695161 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventCategoryEntity.java @@ -0,0 +1,49 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event_category") +public class IcEventCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + + /** + * 分类编码,分类编码+customer_id唯一 + */ + private String categoryCode; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java new file mode 100644 index 0000000000..db3fc54536 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java @@ -0,0 +1,169 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event") +public class IcEventEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件所属的网格Id + */ + private String gridId; + + /** + * 网格的所属组织 + */ + private String agencyId; + + /** + * 网格的所有组织Id + */ + private String gridPids; + + /** + * 报事的人【居民端/pc端居民Id】可为空 + */ + private String reportUserId; + + /** + * 报事人姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 反映渠道【字典表】 + */ + private String sourceType; + + /** + * 发生时间 + */ + private Date happenTime; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 地址 + */ + private String address; + + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + + /** + * 办结时间 + */ + private Date closeCaseTime; + + /** + * 0:已回复 1:已转项目 2:已转需求 + */ + private String operationType; + + /** + * 项目、需求ID + */ + private String operationId; + + /** + * 事件是否被阅读过;1已读;针对报事人待处理列表 + */ + private Integer readFlag; + + /** + * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/转需求/办结更新为1; + */ + private Integer redDot; + + /** + * 最近一次操作时间(回复、立项、转需求、办结更新此列) + */ + private Date latestOperatedTime; + + /** + * 是否解决:已解决 resolved,未解决 un_solved + */ + private String resolveStatus; + + /** + * 结案说明 + */ + private String closeRemark; + + /** + * 评论人 + */ + private String commentUserId; + + /** + * 评论内容 + */ + private String satisfaction; + + /** + * 评论时间 + */ + private Date commentTime; + + /** + * 事件审核状态[涉及附件审核需要加的状态](审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java new file mode 100644 index 0000000000..209d70d4f3 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java @@ -0,0 +1,80 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event_operation_log") +public class IcEventOperationLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 事件id + */ + private String icEventId; + + /** + * 操作用户Id + */ + private String userId; + + /** + * 操作用户类型【居民端用户:resi_user;工作人员:staff;】 + */ + private String userIdentity; + + /** + * 1、发布事件:add + * 2、复:reply; + * 3、立项:shift_project; + * 4、转需求:shift_demand + * 5、办结:close_case; + * 6、需求办结:close_demand + */ + private String actionCode; + + /** + * 1、发布事件:publish; + * 2、撤回事件:recall; + * 3、复:reply; + * 4、立项:shift_project; + * 5、转需求: shift_demand; + * 6、办结:close_case; + * 7、需求办结:close_demand; + * 8、选择是否已解决:choose_resolve; + * 9、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中; + */ + private String actionDesc; + + /** + * 操作时间 + */ + private Date operateTime; + /** + * 服务方【事件被转需求,需求在办结时的服务方名称】 + */ + private String serviceParty; + /** + * 实际服务时间【事件被转需求,需求在办结时填写的实际服务时间 xx至xx】 + */ + private String actualServiceTime; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventReplyEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventReplyEntity.java new file mode 100644 index 0000000000..e477a9cb2a --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventReplyEntity.java @@ -0,0 +1,49 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件回复表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event_reply") +public class IcEventReplyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 回复人用户Id[工作人员ID] + */ + private String fromUserId; + + /** + * 内容 + */ + private String content; + + /** + * 报事人:组织-人名 + */ + private String userShowName; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventScanTaskEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventScanTaskEntity.java new file mode 100644 index 0000000000..bc51c9a0df --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventScanTaskEntity.java @@ -0,0 +1,57 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_event_scan_task") +public class IcEventScanTaskEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icEventId; + + /** + * 事件附件表主键,对应dataId + */ + private String icEventAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice 文件 - doc) + */ + private String attachmentType; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java index 64ea885f2c..b5199a8392 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java @@ -45,6 +45,8 @@ public class ProjectEntity extends BaseEpmetEntity { */ private String agencyId; + private String gridId; + /** * 来源:议题issue 项目立项:agency */ diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessEntity.java index a67f6b7eee..78599eb5bf 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessEntity.java @@ -112,4 +112,14 @@ public class ProjectProcessEntity extends BaseEpmetEntity { */ private Integer isSend; + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java new file mode 100644 index 0000000000..5bfc88d274 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java @@ -0,0 +1,65 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.format.DateTimeFormat; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.util.Date; + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcEventExcel { + + @ExcelProperty(value = "所属网格") + @ColumnWidth(20) + private String gridName; + + @ExcelProperty(value = "事件内容") + @ColumnWidth(25) + private String eventContent; + + @ExcelProperty(value = "图片") + @ColumnWidth(25) + private String imageUrl; + + @ExcelProperty(value = "上报渠道") + @ColumnWidth(20) + private String sourceTypeName; + + @ExcelProperty(value = "地址") + @ColumnWidth(25) + private String address; + + @ExcelProperty(value = "报事人") + @ColumnWidth(20) + private String name; + + @ExcelProperty(value = "手机号") + @ColumnWidth(20) + private String mobile; + + @ExcelProperty(value = "满意度") + @ColumnWidth(20) + private String commentContent; + + @ExcelProperty(value = "上报时间") + @ColumnWidth(20) + @DateTimeFormat("yyyy-MM-dd HH:mm:ss") + private Date createdTime; + + @ExcelProperty(value = "结点") + @ColumnWidth(20) + private String operationTypeName; + + @ExcelProperty(value = "状态") + @ColumnWidth(20) + private String statusName; + + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectListExportExcel.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectListExportExcel.java new file mode 100644 index 0000000000..5edd25b643 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectListExportExcel.java @@ -0,0 +1,40 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/24 15:24 + * @DESC + */ +@Data +public class ProjectListExportExcel extends ExcelVerifyInfo implements Serializable { + + @Excel(name = "所属网格",needMerge = true) + private String gridName = ""; + + @Excel(name = "项目标题",needMerge = true) + private String title = ""; + + @Excel(name = "转项目时间",needMerge = true) + private String shiftProjectTime; + + @Excel(name = "项目方案",needMerge = true) + private String projectScheme = ""; + + @Excel(name = "内部备注",needMerge = true) + private String internalRemark = ""; + + @Excel(name = "滞留工作日",needMerge = true) + private String detentionDays = ""; + + @ExcelCollection(name = "当前处理部门") + private List departmentNameList; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventAttachmentService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventAttachmentService.java new file mode 100644 index 0000000000..2827802377 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventAttachmentService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEventAttachmentDTO; +import com.epmet.entity.IcEventAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcEventAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEventAttachmentDTO + * @author generator + * @date 2022-05-17 + */ + IcEventAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcEventAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcEventAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java new file mode 100644 index 0000000000..90c9fd9524 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java @@ -0,0 +1,85 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEventCategoryDTO; +import com.epmet.entity.IcEventCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事件所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcEventCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEventCategoryDTO + * @author generator + * @date 2022-05-17 + */ + IcEventCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcEventCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcEventCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); + + /** + * 根据事件id查询事件对应的分类 + * @param eventId + * @return + */ + IcEventCategoryEntity getByEventId(String eventId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventOperationLogService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventOperationLogService.java new file mode 100644 index 0000000000..9b811b09cd --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventOperationLogService.java @@ -0,0 +1,82 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEventOperationLogDTO; +import com.epmet.dto.result.IcEventProcessListResultDTO; +import com.epmet.entity.IcEventOperationLogEntity; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * 事件操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcEventOperationLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEventOperationLogDTO + * @author generator + * @date 2022-05-17 + */ + IcEventOperationLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcEventOperationLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcEventOperationLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); + + LinkedList getByEventId(String icEventId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventReplyService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventReplyService.java new file mode 100644 index 0000000000..c2b3da8830 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventReplyService.java @@ -0,0 +1,90 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEventReplyDTO; +import com.epmet.dto.result.IcEventProcessListResultDTO; +import com.epmet.entity.IcEventReplyEntity; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * 事件回复表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcEventReplyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEventReplyDTO + * @author generator + * @date 2022-05-17 + */ + IcEventReplyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcEventReplyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcEventReplyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); + + LinkedList getByEventId(String icEventId); + + /** + * 居民端小程序我上报的事件详情页面-回复列表 + * + * @param icEventId + * @return + */ + List replyList(String icEventId,String userId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventScanTaskService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventScanTaskService.java new file mode 100644 index 0000000000..593e0b3438 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventScanTaskService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEventScanTaskDTO; +import com.epmet.entity.IcEventScanTaskEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事件附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcEventScanTaskService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEventScanTaskDTO + * @author generator + * @date 2022-05-17 + */ + IcEventScanTaskDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcEventScanTaskDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcEventScanTaskDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java new file mode 100644 index 0000000000..acffa5765c --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java @@ -0,0 +1,211 @@ +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); +} \ 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..a05d3d731d --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -0,0 +1,1470 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.*; +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.utils.*; +import com.epmet.constant.*; +import com.epmet.dao.IcEventDao; +import com.epmet.dto.*; +import com.epmet.dto.form.*; +import com.epmet.dto.form.demand.DemandRecId; +import com.epmet.dto.form.demand.IcEventCommentToDemandFromDTO; +import com.epmet.dto.result.*; +import com.epmet.entity.*; +import com.epmet.enums.EcEventProcessStatusEnum; +import com.epmet.feign.*; +import com.epmet.resi.group.constant.TopicConstant; +import com.epmet.service.*; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 事件管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Slf4j +@Service + +public class IcEventServiceImpl extends BaseServiceImpl implements IcEventService, ResultDataResolver { + + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + @Autowired + private ProjectTraceService projectTraceService; + @Autowired + private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; + @Autowired + private GovIssueOpenFeignClient govIssueOpenFeignClient; + @Autowired + private IcEventAttachmentService icEventAttachmentService; + @Autowired + private IcEventCategoryService icEventCategoryService; + @Autowired + private IcEventReplyService icEventReplyService; + @Autowired + private IcEventOperationLogService icEventOperationLogService; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; + @Autowired + private OperCrmOpenFeignClient crmOpenFeignClient; + @Autowired + private ResiEventServiceImpl resiEventService; + @Autowired + private EpmetMessageOpenFeignClient messageOpenFeignClient; + @Autowired + private ProjectSatisfactionDetailService projectSatisfactionDetailService; + + public CustomerStaffInfoCacheResult getStaffInfo(String customerId,String staffId){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", staffId)); + } + return staffInfo; + } + + @Override + public PageData list(IcEventListFormDTO formDTO) { + //获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + + //分页查询当前组织下网格内事件数据 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.icEventList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + if (!CollectionUtils.isEmpty(list)) { + //查询网格名称(组织-网格) + List gridIds = list.stream().map(IcEventListResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); + Result> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2)); + + //事件管理字典表数据 + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + + //封装数据 + for (IcEventListResultDTO dto : list) { + if (gridInfoMap.containsKey(dto.getGridId())) { + dto.setGridName(gridInfoMap.get(dto.getGridId())); + } + if (StringUtils.isNotBlank(dto.getSourceType())) { + dto.setSourceTypeName(statusMap.get(dto.getSourceType())); + } + //每个事件对应的图片数据 + if(!CollectionUtils.isEmpty(dto.getAttachmentList())){ + List imageList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + for(IcEventListResultDTO.Attachment file: dto.getAttachmentList()){ + if ("image".equals(file.getType())) { + imageList.add(file.getUrl()); + } else if ("voice".equals(file.getType())) { + voiceList.add(file.getUrl()); + } + } + dto.setImageList(imageList); + dto.setVoiceList(voiceList); + } + + } + } + return new PageData<>(list, pageInfo.getTotal()); + } + + + @Override + public IcEventDTO get(String id) { + IcEventEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcEventDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcEventAddEditFormDTO formDTO) { + //获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + //获取网格缓存信息 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); + if (null == gridInfo) { + throw new EpmetException(String.format("未查询到网格{%s}信息", formDTO.getGridId())); + } + //1.参数校验,安全校验 + //1-1.判断是否勾选处理方式,勾选了则分类不能为空 + //勾选了立项或转需求或已完成时分类必须传 + if (((StringUtils.isNotBlank(formDTO.getOperationType()) && !"0".equals(formDTO.getOperationType())) + || (StringUtils.isNotBlank(formDTO.getStatus()) && "closed_case".equals(formDTO.getStatus()))) && CollectionUtils.isEmpty(formDTO.getCategoryList())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件分类不能为空"); + } + //1-2.判断勾选已完成则处理方式不能选择立项或转需求 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus()) + && StringUtils.isNotBlank(formDTO.getOperationType()) && (NumConstant.ONE_STR.equals(formDTO.getOperationType()) || NumConstant.TWO_STR.equals(formDTO.getOperationType()))) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件勾选已完成则不允许立项或转需求"); + } + //1-3.安全校验事件内容、图片内容 + //事件内容 + if (StringUtils.isNotBlank(formDTO.getEventContent())) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskDTO.setContent(formDTO.getEventContent()); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + //图片内容 + if (!CollectionUtils.isEmpty(formDTO.getImageList())) { + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + formDTO.getImageList().forEach(imgUrl -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(imgUrl); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg()); + } + } + } + + //事件Id + String icEventId = IdWorker.getIdStr(); + //事件表红点,回复、立项、转服务、办结展示红点【0不展示 1展示】 + int redDot = NumConstant.ZERO; + String operationType = ""; + //2.判断是否立项或转需求 + //2-1.项目立项 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.ONE_STR.equals(formDTO.getOperationType())) { + redDot = NumConstant.ONE; + operationType = NumConstant.ONE_STR; + IcEventToProjectFormDTO toProject = formDTO.getProject(); + toProject.setCustomerId(formDTO.getCustomerId()); + toProject.setUserId(formDTO.getUserId()); + toProject.setApp(formDTO.getApp()); + toProject.setClient(formDTO.getClient()); + toProject.setIcEventId(icEventId); + EventToProjectResultDTO project = projectTraceService.icEventToProject(toProject); + formDTO.setOperationId(project.getProjectId()); + } + //2-2.转需求 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.TWO_STR.equals(formDTO.getOperationType())) { + redDot = NumConstant.ONE; + operationType = NumConstant.TWO_STR; + IcDemandFormDTO dto = formDTO.getDemand(); + //需求人默认是当前用户id + dto.setDemandUserId(formDTO.getUserId()); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setOrigin("ic_event"); + dto.setOriginId(icEventId); + Result recIdResult = epmetHeartOpenFeignClient.icEventToDemand(dto); + if (!recIdResult.success() || recIdResult.getData() == null) { + throw new RenException(recIdResult.getCode(), recIdResult.getMsg()); + } + formDTO.setOperationId(recIdResult.getData().getDemandRecId()); + } + + //3.新增事件数据、附件数据、分类数据、回复数据、操作记录数据 + //3-1.事件数据保存 + IcEventEntity entity = ConvertUtils.sourceToTarget(formDTO, IcEventEntity.class); + entity.setId(icEventId); + entity.setAgencyId(gridInfo.getPid()); + entity.setGridPids(gridInfo.getPids()); + entity.setLatestOperatedTime(new Date()); + entity.setAuditStatus(TopicConstant.AUTO_PASSED); + if("closed_case".equals(formDTO.getStatus())){ + entity.setCloseCaseTime(new Date()); + } + //insert(entity); + //3-2.附件数据保存 + List imageEntityList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(formDTO.getImageList())) { + int sort = 0; + for (String url : formDTO.getImageList()) { + IcEventAttachmentEntity attachment = new IcEventAttachmentEntity(); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setAttachmentUrl(url); + attachment.setIcEventId(entity.getId()); + attachment.setCreatedBy(formDTO.getUserId()); + attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase()); + attachment.setSort(sort++); + attachment.setAttachmentType("image"); + attachment.setStatus(TopicConstant.AUTO_PASSED); + imageEntityList.add(attachment); + } + icEventAttachmentService.insertBatch(imageEntityList); + } + + //3-3.分类数据保存 + if (!CollectionUtils.isEmpty(formDTO.getCategoryList())) { + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), formDTO.getCategoryList()); + IcEventCategoryEntity categoryEntity = null; + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(formDTO.getCategoryList().get(NumConstant.ZERO))) { + categoryEntity = new IcEventCategoryEntity(); + categoryEntity.setCustomerId(formDTO.getCustomerId()); + categoryEntity.setIcEventId(entity.getId()); + categoryEntity.setCategoryId(ca.getId()); + categoryEntity.setCategoryPids(ca.getPids()); + categoryEntity.setCategoryCode(ca.getCategoryCode()); + } + } + if (categoryEntity != null) { + icEventCategoryService.insert(categoryEntity); + } + } + //3-4.操作记录数据保存 + List logList = new ArrayList<>(); + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), new Date(), "add", "publish")); + + Date date = new Date(); + //3-5.回复数据保存 + if (StringUtils.isNotBlank(formDTO.getContent())) { + if(StringUtils.isEmpty(operationType)){ + operationType = NumConstant.ZERO_STR; + } + redDot = NumConstant.ONE; + IcEventReplyEntity replyEntity = new IcEventReplyEntity(); + replyEntity.setCustomerId(formDTO.getCustomerId()); + replyEntity.setIcEventId(entity.getId()); + replyEntity.setFromUserId(formDTO.getUserId()); + replyEntity.setContent(formDTO.getContent()); + replyEntity.setUserShowName(staffInfo.getAgencyName() + "-" + staffInfo.getRealName()); + icEventReplyService.insert(replyEntity); + //回复对应的操作记录 + date.setTime(date.getTime() + 6000 * 1); + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "reply", "reply")); + } + //立项对应的操作记录 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.ONE_STR.equals(formDTO.getOperationType())) { + date.setTime(date.getTime() + 6000 * 1); + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "shift_project", "shift_project")); + } + //转需求对应的操作记录 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.TWO_STR.equals(formDTO.getOperationType())) { + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), formDTO.getDemand().getWantServiceTime(), "shift_demand", "shift_demand")); + } + //选择了已完成 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())) { + redDot = NumConstant.ONE; + date.setTime(date.getTime() + 6000 * 1); + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "close_case", "close_case")); + } + icEventOperationLogService.insertBatch(logList); + + entity.setRedDot(redDot); + entity.setOperationType(operationType); + insert(entity); + } + + /** + * 根据分类Id集合查询对应数据信息 + * + * @return + */ + private CategoryTagResultDTO queryCategory(String customerId, List categoryIdList) { + CategoryTagListFormDTO categoryTag = new CategoryTagListFormDTO(); + categoryTag.setCustomerId(customerId); + categoryTag.setCategoryIdList(categoryIdList); + Result resultDTOResult = govIssueOpenFeignClient.getCategoryTagList(categoryTag); + if (!resultDTOResult.success()) { + throw new RenException("项目立项,调用issue服务查询分类、标签基础信息失败"); + } + return resultDTOResult.getData(); + } + + /** + * 事件管理操作日志记录 + * + * @return + */ + private IcEventOperationLogEntity logEntity(String customerId, String icEventId, String userId, Date date, String actionCode, String actionDesc) { + IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity(); + logEntity.setCustomerId(customerId); + logEntity.setIcEventId(icEventId); + logEntity.setUserId(userId); + logEntity.setUserIdentity("staff"); + logEntity.setActionCode(actionCode); + logEntity.setActionDesc(actionDesc); + logEntity.setOperateTime(date); + return logEntity; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcEventDTO dto) { + IcEventEntity entity = ConvertUtils.sourceToTarget(dto, IcEventEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 查询时间的grid_pids + * + * @param agencyId + * @return + */ + public String getEventGridPids(String agencyId) { + String gridPids; + String errorMsg = "查询组织信息失败"; + CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(agencyId), + ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + errorMsg, + errorMsg); + if (agencyInfo == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组织信息未找到", "网格信息未找到"); + } + String purePids = agencyInfo.getPids(); + if ("0".equals(purePids) || StringUtils.isBlank(purePids)) { + gridPids = agencyInfo.getId(); + } else { + gridPids = purePids.concat(":").concat(agencyInfo.getId()); + } + + return gridPids; + } + + @Override + public ProcessStatusRatioResultDTO getProcessStatusRatio(String orgId, String orgType, Date queryStartTime, Date queryEndTime) { + + AgencyInfoFormDTO form = new AgencyInfoFormDTO(); + form.setOrgId(orgId); + form.setOrgType(orgType); + + String gridPids = null; + if ("agency".equals(orgType)) { + gridPids = getEventGridPids(orgId); + } + + List> m = baseDao.getProcessStatusRatio( + EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID), orgType, orgId, gridPids, queryStartTime, queryEndTime); + + ProcessStatusRatioResultDTO r = new ProcessStatusRatioResultDTO(); + + if (CollectionUtils.isEmpty(m)) { + return r; + } + + BigDecimal processingCount = new BigDecimal(0); + BigDecimal closedCount = new BigDecimal(0); + ; + BigDecimal processingRatio = null; + BigDecimal closedRatio = null; + + for (Map entry : m) { + if ("processing".equals(entry.get("status"))) { + processingCount = new BigDecimal(entry.get("eventCount")); + } else if ("closed_case".equals(entry.get("status"))) { + closedCount = new BigDecimal(entry.get("eventCount")); + } + } + + // 根据个数,计算比例 + BigDecimal total = processingCount.add(closedCount); + processingRatio = processingCount.divide(total, 2, BigDecimal.ROUND_HALF_UP); + closedRatio = new BigDecimal(1).subtract(processingRatio); + + r.setProcessingCount(processingCount.longValue()); + r.setClosedCount(closedCount.longValue()); + r.setProcessingRatio(processingRatio.doubleValue()); + r.setClosedRatio(closedRatio.doubleValue()); + + return r; + } + + @Override + public PageData listProcessAnalysisEvents(String orgId, String orgType, String categoryCode, String processStatus, + Date queryStartTime, Date queryEndTime, Integer pageNo, + Integer pageSize, String biz) { + + // 1.分类字典 + Map eventSourceTypeDict = getResultDataOrThrowsException(adminOpenFeignClient.dictMap("ic_event_source_type"), + ServiceConstant.EPMET_ADMIN_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【IC事件分析】查询上报渠道字典失败", + "【IC事件分析】查询上报渠道字典失败"); + + String gridPids = null; + if ("agency".equals(orgType)) { + gridPids = getEventGridPids(orgId); + } + + // 2.分页查询 + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.listProcessAnalysisEvents( + EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID), orgType, orgId, gridPids, categoryCode, processStatus, queryStartTime + , queryEndTime, biz); + + // 3.补充数据 + for (IcEventResultDTO event : list) { + // 网格信息 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(event.getGridId()); + if (gridInfo != null) { + event.setGridName(gridInfo.getGridName()); + } else { + logger.error("【IC事件分析】网格ID[{}]查询网格信息失败", event.getGridId()); + } + + // 上报渠道 + event.setSourceTypeName(eventSourceTypeDict.get(event.getSourceType())); + + // 状态 + EcEventProcessStatusEnum sourceTypeEnum = EcEventProcessStatusEnum.getObjectBySourceType(event.getProcessStatus()); + if (sourceTypeEnum != null) { + event.setProcessStatusName(sourceTypeEnum.getProcessStatusName()); + } + } + + PageInfo pageInfo = new PageInfo<>(list); + + return new PageData<>(list, pageInfo.getTotal()); + } + + @Override + public List listMonthlyIncrement(String orgType, String orgId, Date queryStartTime, Date queryEndTime) { + List resultList = new ArrayList<>(); + + String gridPids = null; + if ("agency".equals(orgType)) { + gridPids = getEventGridPids(orgId); + } + + // 从输入开始月份上一个月的开始查 + queryEndTime = DateUtils.addDateMonths(queryEndTime, 1); + + // 查询分组统计后的结果,此时月份数据不全,如果数量是0的月份不会在这里面 + List eventCountDataList = baseDao.listMonthlyEventCount(orgType, orgId, gridPids, queryStartTime, queryEndTime); + Map monthAndCount = eventCountDataList.stream().collect(Collectors.toMap((e) -> e.getMonthName(), (e) -> e.getEventCount())); + + Date tempMonth = DateUtils.integrate(queryStartTime, DateUtils.DATE_PATTERN_YYYY_MM); + Date endMonth = DateUtils.integrate(queryEndTime, DateUtils.DATE_PATTERN_YYYY_MM); + + // 按照开始和结束时间,对比数据库查出来的,没有数据的填0 + while (true) { + Integer increment = 0; + + if (tempMonth.equals(endMonth)) { + break; + } + + String tempMonthString = DateUtils.format(tempMonth, DateUtils.DATE_PATTERN_YYYY_MM); + Integer eventCountOfMonth = monthAndCount.get(tempMonthString); + if (eventCountOfMonth != null) { + increment = eventCountOfMonth; + } + + tempMonth = DateUtils.addDateMonths(tempMonth, 1); + + resultList.add(new IcEventMonthlyIncrementResultDTO(tempMonthString, increment)); + } + + + return resultList; + } + + @Override + public IcEventYpAnalysisResultDTO getYpAnalysis(String eventId) { + + // 事件上报渠道字典 + Map sourceTypeMap = getResultDataOrThrowsException( + adminOpenFeignClient.dictMap("ic_event_source_type"), + ServiceConstant.EPMET_ADMIN_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【事件研判分析】查询事件上报渠道字典失败", + "【事件研判分析】查询事件上报渠道字典失败"); + + // 事件信息 + IcEventEntity event = baseDao.selectById(eventId); + if (event == null) { + return null; + } + + // 上报人信息 + IcEventYpAnalysisResultDTO r = new IcEventYpAnalysisResultDTO(); + String idCard = event.getIdCard(); + List dependents = new ArrayList<>(); + if (StringUtils.isNotBlank(idCard)) { + IcResiUserDTO resiInfo = getResultDataOrThrowsException(userOpenFeignClient.getByResiIdCard(idCard), + ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【事件研判分析】根据身份证号查找居民信息失败", + "【事件研判分析】根据身份证号查找居民信息失败"); + if (resiInfo != null) { + r.setReportorResiId(resiInfo.getId()); + r.setReportorAgencyId(resiInfo.getAgencyId()); + r.setReportorGridId(resiInfo.getGridId()); + } + + dependents = getDependents(event.getIdCard()); + } + + // 该居民上报事件总数 + Integer resiReportEventCount = baseDao.getResiReportEventCount(event.getIdCard()); + + r.setReportorName(event.getName()); + r.setSourceTypeName(sourceTypeMap.get(event.getSourceType())); + r.setDependents(dependents); + r.setReportorMobile(event.getMobile()); + r.setReportorIdCard(idCard); + r.setResiReportEventCount(resiReportEventCount); + + // 事件分类 + IcEventCategoryEntity eventCategory = icEventCategoryService.getByEventId(eventId); + + // 有的事件刚创建,可能没有分类 + if (eventCategory != null) { + // 分类字典 + IssueProjectCategoryDictDTO categoryDictItem = getResultDataOrThrowsException(govIssueOpenFeignClient.getByCategoryCode(eventCategory.getCategoryCode()), + ServiceConstant.GOV_ISSUE_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【事件研判分析】查询分类字典失败", + "【事件研判分析】查询分类字典失败"); + + r.setCategoryCode(categoryDictItem.getParentCategoryCode()); + r.setCategoryPids(eventCategory.getCategoryPids()); + r.setCategoryName(categoryDictItem.getParentCategoryName()); + } + + return r; + } + + /** + * 查询家属 + * @param idCard + * @return + */ + private List getDependents(String idCard) { + IcResiUserBriefDTO familyInfo = getResultDataOrThrowsException(userOpenFeignClient.findFamilyMemByIdCard(idCard), + ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【事件研判分析】查找家属失败", + "【事件研判分析】查找家属失败"); + + List houseUserList = familyInfo.getHouseUserList(); + + ArrayList dependents = new ArrayList<>(); + if (CollectionUtils.isEmpty(houseUserList)) { + return dependents; + } + for (HouseUserDTO u : houseUserList) { + dependents.add(new IcEventYpAnalysisResultDTO.Dependent(u.getIcResiUserId(), u.getIcUserName(), u.getAgencyId(), u.getGridId())); + } + return dependents; + } + + @Override + public PageData getSameCategoryEvents(String orgId, String orgType, String categoryPids, Integer pageNo, Integer pageSize) { + String gridPids = null; + if ("agency".equals(orgType)) { + gridPids = getEventGridPids(orgId); + } + + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.listEventsByPCategoryInOrg(orgId, gridPids, orgType, categoryPids); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * @Author sun + * @Description 事件管理-回复 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void reply(IcEventReplyFormDTO formDTO) { + //1.查询事件数据 判断是否允许回复 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity || "1".equals(entity.getOperationType()) || "2".equals(entity.getOperationType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复"); + } + //2.修改事件数据 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && StringUtils.isNotBlank(formDTO.getStatus()) && "closed_case".equals(formDTO.getStatus())){ + entity.setStatus(formDTO.getStatus()); + entity.setCloseCaseTime(new Date()); + } + entity.setOperationType(NumConstant.ZERO_STR); + entity.setLatestOperatedTime(new Date()); + //工作端回复了,居民端那要展示红点。 + entity.setRedDot(NumConstant.ONE); + baseDao.updateById(entity); + + //3.新增回复数据 + //获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + IcEventReplyEntity replyEntity = new IcEventReplyEntity(); + replyEntity.setCustomerId(formDTO.getCustomerId()); + replyEntity.setIcEventId(formDTO.getIcEventId()); + replyEntity.setFromUserId(formDTO.getUserId()); + replyEntity.setContent(formDTO.getContent()); + replyEntity.setUserShowName(staffInfo.getAgencyName() + "-" + staffInfo.getRealName()); + icEventReplyService.insert(replyEntity); + + //4.判断新增或修改分类数据 + if (StringUtils.isNotBlank(formDTO.getCategoryId())) { + //查询分类信息 + List categoryList = new ArrayList<>(); + categoryList.add(formDTO.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + IcEventCategoryEntity categoryEntity = null; + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(formDTO.getCategoryId())) { + categoryEntity = new IcEventCategoryEntity(); + categoryEntity.setCustomerId(formDTO.getCustomerId()); + categoryEntity.setIcEventId(entity.getId()); + categoryEntity.setCategoryId(ca.getId()); + categoryEntity.setCategoryPids(ca.getPids()); + categoryEntity.setCategoryCode(ca.getCategoryCode()); + } + } + + IcEventCategoryEntity icEventCategory = icEventCategoryService.getByEventId(formDTO.getIcEventId()); + if (null == icEventCategory || StringUtils.isEmpty(icEventCategory.getId())) { + icEventCategoryService.insert(categoryEntity); + } else { + categoryEntity.setId(icEventCategory.getId()); + icEventCategoryService.updateById(categoryEntity); + } + } + //4.判断来源居民端的事件,回复、办结了给居民推送站内信 + List msgList = new ArrayList<>(); + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(formDTO.getCustomerId()); + messageFormDTO.setApp(ProjectConstant.RESI); + messageFormDTO.setGridId(entity.getGridId()); + messageFormDTO.setUserId(entity.getCreatedBy()); + messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); + messageFormDTO.setMessageContent(String.format("%s对您上报的事件进行了回复,请查看。", (staffInfo.getAgencyName() + "-" + staffInfo.getRealName()))); + messageFormDTO.setReadFlag(Constant.UNREAD); + messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); + messageFormDTO.setTargetId(entity.getId()); + msgList.add(messageFormDTO); + + //5.新增操作记录数据 + Date date = new Date(); + List logList = new ArrayList<>(); + logList.add(logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), date, ResiEventAction.REPLY.getCode(), ResiEventAction.REPLY.getCode())); + //回复时选择了已完成 + if (StringUtils.isNotBlank(formDTO.getOperationType()) && ResiEventAction.CLOSE_CASE.getCode().equals(formDTO.getStatus())) { + date.setTime(date.getTime() + 6000 * 1); + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, ResiEventAction.CLOSE_CASE.getCode(), ResiEventAction.CLOSE_CASE.getCode())); + + UserMessageFormDTO close = ConvertUtils.sourceToTarget(messageFormDTO, UserMessageFormDTO.class); + close.setMessageContent(String.format("您上报的事件已完成,请查看。")); + msgList.add(close); + } + icEventOperationLogService.insertBatch(logList); + Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList); + if (!sendMessageRes.success()) { + log.warn(String.format("事件回复,给居民端用户发送站内信异常,事件Id->%s", entity.getId())); + } + + + } + + /** + * @Author sun + * @Description 事件管理-立项 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void icEventToProject(IcEventToProjectFormDTO formDTO) { + //1.查询事件数据 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity || "1".equals(entity.getOperationType()) || "2".equals(entity.getOperationType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许立项"); + } + //2.调用事件立项接口 + EventToProjectResultDTO project = projectTraceService.icEventToProject(formDTO); + + //3.更新事件数据 + entity.setOperationType(NumConstant.ONE_STR); + entity.setOperationId(project.getProjectId()); + entity.setLatestOperatedTime(new Date()); + //工作端回复了,居民端那要展示红点。 + entity.setRedDot(NumConstant.ONE); + baseDao.updateById(entity); + + //4.判断新增或修改分类数据 + if (!CollectionUtils.isEmpty(formDTO.getCategoryList())) { + String categoryId = formDTO.getCategoryList().get(NumConstant.ZERO).getId(); + //查询分类信息 + List categoryList = new ArrayList<>(); + categoryList.add(categoryId); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + IcEventCategoryEntity categoryEntity = null; + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(categoryId)) { + categoryEntity = new IcEventCategoryEntity(); + categoryEntity.setCustomerId(formDTO.getCustomerId()); + categoryEntity.setIcEventId(entity.getId()); + categoryEntity.setCategoryId(ca.getId()); + categoryEntity.setCategoryPids(ca.getPids()); + categoryEntity.setCategoryCode(ca.getCategoryCode()); + } + } + + IcEventCategoryEntity icEventCategory = icEventCategoryService.getByEventId(formDTO.getIcEventId()); + if (null == icEventCategory || StringUtils.isEmpty(icEventCategory.getId())) { + icEventCategoryService.insert(categoryEntity); + } else { + categoryEntity.setId(icEventCategory.getId()); + icEventCategoryService.updateById(categoryEntity); + } + } + + //5.新增操作记录 + IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), new Date(), "shift_project", "shift_project"); + icEventOperationLogService.insert(logEntity); + + //6.判断来源居民端的事件,转了项目给居民推送站内信 + if ("0".equals(entity.getSourceType())) { + //通知 + List msgList = new ArrayList<>(); + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(formDTO.getCustomerId()); + messageFormDTO.setApp(ProjectConstant.RESI); + messageFormDTO.setGridId(entity.getGridId()); + messageFormDTO.setUserId(entity.getCreatedBy()); + messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); + //获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + messageFormDTO.setMessageContent(String.format("%s将您上报的事件转为项目,请查看。", staffInfo.getAgencyName())); + messageFormDTO.setReadFlag(Constant.UNREAD); + messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); + messageFormDTO.setTargetId(entity.getId()); + msgList.add(messageFormDTO); + Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList); + if (!sendMessageRes.success()) { + log.warn(String.format("事件立项,给居民端用户发送站内信异常,事件Id->%s", entity.getId())); + } + } + } + + /** + * @Author sun + * @Description 事件管理-转需求 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void icEventToDemand(IcDemandFormDTO formDTO) { + //1.查询事件数据 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity || "1".equals(entity.getOperationType()) || "2".equals(entity.getOperationType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许转需求"); + } + //2.调用转需求接口 + formDTO.setOrigin("ic_event"); + formDTO.setOriginId(formDTO.getIcEventId()); + Result recIdResult = epmetHeartOpenFeignClient.icEventToDemand(formDTO); + if (!recIdResult.success() || recIdResult.getData() == null) { + throw new RenException(recIdResult.getCode(), recIdResult.getMsg()); + } + + //3.更新事件数据 + entity.setOperationType(NumConstant.TWO_STR); + entity.setOperationId(recIdResult.getData().getDemandRecId()); + entity.setLatestOperatedTime(new Date()); + //工作端回复了,居民端那要展示红点。 + entity.setRedDot(NumConstant.ONE); + baseDao.updateById(entity); + + //4.判断新增或修改分类数据 + if (StringUtils.isNotBlank(formDTO.getCategoryId())) { + //查询分类信息 + List categoryList = new ArrayList<>(); + categoryList.add(formDTO.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + IcEventCategoryEntity categoryEntity = null; + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(formDTO.getCategoryId())) { + categoryEntity = new IcEventCategoryEntity(); + categoryEntity.setCustomerId(formDTO.getCustomerId()); + categoryEntity.setIcEventId(entity.getId()); + categoryEntity.setCategoryId(ca.getId()); + categoryEntity.setCategoryPids(ca.getPids()); + categoryEntity.setCategoryCode(ca.getCategoryCode()); + } + } + + IcEventCategoryEntity icEventCategory = icEventCategoryService.getByEventId(formDTO.getIcEventId()); + if (null == icEventCategory || StringUtils.isEmpty(icEventCategory.getId())) { + icEventCategoryService.insert(categoryEntity); + } else { + categoryEntity.setId(icEventCategory.getId()); + icEventCategoryService.updateById(categoryEntity); + } + } + + //5.新增操作记录 + IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getDemandUserId(), new Date(), "shift_demand", "shift_demand"); + icEventOperationLogService.insert(logEntity); + + //6.判断来源居民端的事件,转了项目给居民推送站内信 + if ("0".equals(entity.getSourceType())) { + //通知 + List msgList = new ArrayList<>(); + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(formDTO.getCustomerId()); + messageFormDTO.setApp(ProjectConstant.RESI); + messageFormDTO.setGridId(entity.getGridId()); + messageFormDTO.setUserId(entity.getCreatedBy()); + messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getDemandUserId()); + messageFormDTO.setMessageContent(String.format("%s将您上报的事件转为服务,请查看。", staffInfo.getAgencyName())); + messageFormDTO.setReadFlag(Constant.UNREAD); + messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); + messageFormDTO.setTargetId(entity.getId()); + msgList.add(messageFormDTO); + Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList); + if (!sendMessageRes.success()) { + log.warn(String.format("事件转需求,给居民端用户发送站内信异常,事件Id->%s", entity.getId())); + } + } + + } + + /** + * 事件分类分析-一级分类下事件数量 + * + * @param formDTO + * @return + */ + @Override + public List categoryAnalysisTotal(IcEventCategoryAnalysisFormDTO formDTO) { + Result> res = govIssueOpenFeignClient.queryFirstCategory(formDTO.getCustomerId()); + if (!res.success() || CollectionUtils.isEmpty(res.getData())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前客户下未配置事件分类"); + } + int length = res.getData().get(NumConstant.ZERO).getCategoryCode().length(); + formDTO.setCategoryOneLength(length); + if ("agency".equals(formDTO.getOrgType())) { + formDTO.setGridPids(getEventGridPids(formDTO.getOrgId())); + } + + List resList = baseDao.selectFirstCategoryTotal(formDTO); + Map resMap = resList.stream().collect(Collectors.toMap(IcEventCategoryAnalysisResDTO::getCategoryCode, Function.identity())); + List result = new ArrayList<>(); + for (IssueProjectCategoryDictDTO dict : res.getData()) { + IcEventCategoryAnalysisResDTO resultDto = ConvertUtils.sourceToTarget(dict, IcEventCategoryAnalysisResDTO.class); + resultDto.setTotal(MapUtils.isNotEmpty(resMap) && resMap.containsKey(dict.getCategoryCode()) ? resMap.get(dict.getCategoryCode()).getTotal() : NumConstant.ZERO); + result.add(resultDto); + } + return result; + } + + /** + * @Author sun + * @Description 事件管理-评价 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void comment(IcEventReplyFormDTO formDTO) { + //1.查询事件是否存在 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity || !"closed_case".equals(entity.getStatus()) || StringUtils.isNotBlank(entity.getSatisfaction())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "不允许评价,事件不存在或还未办结"); + } + + //2.判断当前评价人是否是事件创建人 + if (!formDTO.getUserId().equals(entity.getCreatedBy())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "不允许评价,当前评价人不是事件创建人"); + } + + //3.修改事件数据 + entity.setCommentUserId(formDTO.getUserId()); + entity.setSatisfaction(formDTO.getSatisfaction()); + entity.setCommentTime(new Date()); + baseDao.updateById(entity); + + //4.判断已转项目或已转需求的对应的增加评价记录 + if (NumConstant.ONE_STR.equals(entity.getOperationType())) { + //立项 + projectSatisfactionDetailService.comment(entity.getCustomerId(), entity.getOperationId(), formDTO.getSatisfaction()); + } else if (NumConstant.TWO_STR.equals(entity.getOperationType())) { + //转需求 + IcEventCommentToDemandFromDTO dto = new IcEventCommentToDemandFromDTO(); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setDemandRecId(entity.getOperationId()); + dto.setSatisfaction(formDTO.getSatisfaction()); + dto.setStaffId(formDTO.getUserId()); + Result result = epmetHeartOpenFeignClient.icEventComment(dto); + if (!result.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "评价事件同步服务评价结果失败"); + } + } + + } + + /** + * @Author sun + * @Description 事件管理-评价 + **/ + @Override + public IcEventListResultDTO detail(IcEventListFormDTO formDTO) { + IcEventListResultDTO resultDTO = new IcEventListResultDTO(); + //1.获取事件基本信息 + List list = baseDao.icEventList(formDTO); + if (!CollectionUtils.isEmpty(list)) { + resultDTO = list.get(0); + //查询网格名称(组织-网格) + List gridIds = list.stream().map(IcEventListResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); + Result> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2)); + + //事件管理字典表数据 + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + + //封装数据 + if (gridInfoMap.containsKey(resultDTO.getGridId())) { + resultDTO.setGridName(gridInfoMap.get(resultDTO.getGridId())); + } + if (StringUtils.isNotBlank(resultDTO.getSourceType())) { + resultDTO.setSourceTypeName(statusMap.get(resultDTO.getSourceType())); + } + //每个事件对应的图片数据 + if(!CollectionUtils.isEmpty(resultDTO.getAttachmentList())){ + List imageList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + resultDTO.getAttachmentList().forEach(file -> { + if ("image".equals(file.getType())) { + imageList.add(file.getUrl()); + } else if ("voice".equals(file.getType())) { + voiceList.add(file.getUrl()); + } + }); + resultDTO.setImageList(imageList); + resultDTO.setVoiceList(voiceList); + } + + //分类信息 + if(StringUtils.isNotBlank(resultDTO.getCategoryId())){ + List categoryList = new ArrayList<>(); + categoryList.add(resultDTO.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(resultDTO.getCategoryId())) { + resultDTO.setParentCategoryId(ca.getPid()); + resultDTO.setCategoryId(ca.getId()); + resultDTO.setParentCategoryCode(ca.getParentCategoryCode()); + resultDTO.setCategoryCode(ca.getCategoryCode()); + resultDTO.setParentCategoryName(ca.getParentCategoryName()); + resultDTO.setCategoryName(ca.getCategoryName()); + } + } + } + } + + return resultDTO; + } + + /** + * 事件分类分析- 饼图2,直属下级 事件数量 + * + * @param formDTO + * @return + */ + @Override + public List analysisOrgTotal(IcEventCategoryAnalysisFormDTO formDTO) { + List list = new ArrayList<>(); + if ("grid".equals(formDTO.getOrgType())) { + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(formDTO.getOrgId()); + if (null == gridInfoCache) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常"); + } + IcEventAnalysisOrgResDTO grid = ConvertUtils.sourceToTarget(formDTO,IcEventAnalysisOrgResDTO.class); + grid.setOrgName(gridInfoCache.getGridName()); + grid.setTotal(baseDao.selectOrgTotal(formDTO)); + list.add(grid); + return list; + } + Result> subOrgListRes = govOrgOpenFeignClient.subOrgList(formDTO.getOrgId()); + if (!subOrgListRes.success() || CollectionUtils.isEmpty(subOrgListRes.getData())) { + return list; + } + for (SubOrgResDTO org : subOrgListRes.getData()) { + IcEventAnalysisOrgResDTO resultDto = ConvertUtils.sourceToTarget(org, IcEventAnalysisOrgResDTO.class); + formDTO.setOrgId(org.getOrgId()); + formDTO.setOrgType(org.getOrgType()); + if("agency".equals(org.getOrgType())){ + String purePids = org.getPids(); + if ("0".equals(purePids) || StringUtils.isBlank(purePids)) { + formDTO.setGridPids(org.getOrgId()); + } else { + formDTO.setGridPids(purePids.concat(":").concat(org.getOrgId())); + } + } + resultDto.setTotal(baseDao.selectOrgTotal(formDTO)); + list.add(resultDto); + } + return list; + } + + /** + * Desc: 定时任务自动评价 + * @param formDTO + * @author zxc + * @date 2022/5/18 16:35 + */ + @Override + public void autoEvaluation(AutoEvaluationFormDTO formDTO) { + List customerIds = new ArrayList<>(); + if (StringUtils.isBlank(formDTO.getCustomerId())){ + Result> allCustomerList = crmOpenFeignClient.getAllCustomerList(); + if (!allCustomerList.success()){ + throw new EpmetException("查询所有客户失败"); + } + List data = allCustomerList.getData(); + customerIds.addAll(data.stream().map(m -> m.getId()).collect(Collectors.toList())); + }else { + customerIds.add(formDTO.getCustomerId()); + } + customerIds.forEach(c -> { + autoEvaluationDispose(c); + }); + } + + /** + * Desc: 处理未评价的icEvent + * @param customerId + * @author zxc + * @date 2022/5/18 16:52 + */ + @Transactional(rollbackFor = Exception.class) + public void autoEvaluationDispose(String customerId){ + Integer no = NumConstant.ONE; + Integer size = NumConstant.ONE_HUNDRED; + List ids = new ArrayList<>(); + do { + int start = (no - NumConstant.ONE) * size; + ids = baseDao.getAutoEvaluationIds(customerId,start,size); + // 批量更新 + if (!CollectionUtils.isEmpty(ids)){ + baseDao.updateAutoEvaluation(ids); + } + no++; + }while (ids.size() == size); + } + + /** + * @Author sun + * @Description 事件管理-处理进展 + **/ + @Override + public LinkedList process(IcEventReplyFormDTO formDTO) { + LinkedList resultList = new LinkedList(); + //1.查询事件基础信息 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件不存在"); + } + + //2.查询事件回复信息 + LinkedList event = icEventReplyService.getByEventId(formDTO.getIcEventId()); + + //3.判断查询事件项目进展或需求进展信息 + //项目进展 + if ("1".equals(entity.getOperationType())) { + ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO(); + processListV2FormDTO.setProjectId(entity.getOperationId()); + List project = projectTraceService.processListV2(processListV2FormDTO); + List projectList = ConvertUtils.sourceToTarget(project, IcEventProcessListResultDTO.class); + projectList.forEach(p->p.setType("project")); + resultList.addAll(projectList); + } + //需求进展 + if ("2".equals(entity.getOperationType())) { + LinkedList demand = icEventOperationLogService.getByEventId(formDTO.getIcEventId()); + resultList.addAll(demand); + } + resultList.addAll(event); + + return resultList; + } + + /** + * @Author sun + * @Description 需求完成/项目结案时 修改事件数据 + **/ + @Override + public void closeProjectOrDemand(ColseProjectOrDemandFormDTO formDTO) { + //1.查询事件数据 + IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); + if (null == entity || "closed_case".equals(entity.getStatus())) { + logger.error(String.format("事件不存在或已办结不允许修改,事件Id->%s", formDTO.getIcEventId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件不存在或已办结不允许修改"); + } + + //2.修改事件数据 + entity.setStatus("closed_case"); + entity.setCloseCaseTime(new Date()); + entity.setLatestOperatedTime(new Date()); + baseDao.updateById(entity); + + //3.判断新增操作记录 + if ("demand".equals(formDTO.getType())) { + IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity(); + logEntity.setIcEventId(formDTO.getIcEventId()); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setUserId(formDTO.getUserId()); + logEntity.setUserIdentity("staff"); + logEntity.setActionCode("close_demand"); + logEntity.setActionDesc("close_demand"); + logEntity.setOperateTime(new Date()); + logEntity.setServiceParty(formDTO.getServiceParty()); + logEntity.setActualServiceTime(formDTO.getActualServiceTime()); + icEventOperationLogService.insert(logEntity); + } + } + + /** + * Desc: 新增【随手拍、讲】 + * @param formDTO + * @author zxc + * @date 2022/5/19 13:38 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void addEventFromResi(AddEventFromResiFormDTO formDTO) { + // 判断是否注册居民 + Result isResiFlag = userOpenFeignClient.getIsResiFlag(formDTO.getUserId()); + if (!isResiFlag.success()){ + throw new EpmetException("查询是否注册居民失败..."); + } + if (!isResiFlag.getData()){ + throw new EpmetException(EpmetErrorCode.NOT_REGEIST_RESI.getCode()); + } + if(StringUtils.isBlank(formDTO.getContent()) && CollectionUtils.isEmpty(formDTO.getVoiceList())) { + //话题内容和语音不能同时为空 + log.error("事件内容和语音不能同时为空"); + throw new RenException(EpmetErrorCode.RESI_EVENT_SUBMIT.getCode(), EpmetErrorCode.RESI_EVENT_SUBMIT.getMsg()); + } + if (!CollectionUtils.isEmpty(formDTO.getVoiceList()) && StringUtils.isBlank(formDTO.getContent())) { + formDTO.setContent("语音事件"); + } + resiEventService.scanContent(formDTO.getContent(), formDTO.getAttachmentList()); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); + if (null == gridInfo){ + throw new EpmetException("未查询到此网格信息"+formDTO.getGridId()); + } + IcEventEntity entity = ConvertUtils.sourceToTarget(formDTO,IcEventEntity.class); + entity.setAgencyId(gridInfo.getPid()); + entity.setGridPids(gridInfo.getPids()); + Result> userResult = userOpenFeignClient.queryUserBaseInfo(Arrays.asList(formDTO.getUserId())); + if (!userResult.success() && CollectionUtils.isEmpty(userResult.getData())){ + throw new EpmetException("查询用户信息失败"+formDTO.getUserId()); + } + entity.setReportUserId(formDTO.getUserId()); + AtomicReference userShowName = new AtomicReference<>(""); + userResult.getData().forEach(u -> { + if (u.getUserId().equals(formDTO.getUserId())){ + entity.setName(u.getRealName()); + entity.setMobile(u.getMobile()); + entity.setIdCard(u.getIdNum()); + userShowName.set(u.getUserShowName()); + } + }); + // 0代表 随手拍和随时讲 + entity.setSourceType(NumConstant.ZERO_STR); + entity.setHappenTime(new Date()); + entity.setEventContent(formDTO.getContent()); + entity.setStatus("processing"); + entity.setReadFlag(0); + entity.setRedDot(0); + entity.setLatestOperatedTime(new Date()); + entity.setAuditStatus(TopicConstant.AUTO_PASSED); + baseDao.insert(entity); + //3-2.附件数据保存 + List attachmentEntityList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(formDTO.getAttachmentList())) { + disposeAttachment(formDTO.getAttachmentList(), attachmentEntityList,entity.getId(),formDTO.getCustomerId(),formDTO.getUserId()); + } + if (!CollectionUtils.isEmpty(formDTO.getVoiceList())) { + disposeAttachment(formDTO.getVoiceList(), attachmentEntityList,entity.getId(),formDTO.getCustomerId(),formDTO.getUserId()); + } + if (!CollectionUtils.isEmpty(attachmentEntityList)){ + icEventAttachmentService.insertBatch(attachmentEntityList); + } + // 站内信发送给社区每个工作人员 + disposeMessage(gridInfo.getPid(), formDTO.getCustomerId(), userShowName.get(), entity.getId()); + } + + /** + * Desc: 给工作人员发送站内信 + * @param agencyId + * @param customerId + * @param showName + * @param icEventId + * @author zxc + * @date 2022/5/20 10:22 + */ + public void disposeMessage(String agencyId,String customerId,String showName,String icEventId){ + // 查询组织下的所有工作人员 + AgencyIdFormDTO formDTO = new AgencyIdFormDTO(); + formDTO.setAgencyId(agencyId); + Result> agencyStaffsResult = govOrgOpenFeignClient.getAgencyStaffs(formDTO); + if (!agencyStaffsResult.success()){ + throw new EpmetException("查询组织下工作人员失败..."); + } + if (!CollectionUtils.isEmpty(agencyStaffsResult.getData())){ + List msgList = new ArrayList<>(); + agencyStaffsResult.getData().forEach(u -> { + UserMessageFormDTO msg = new UserMessageFormDTO(); + msg.setUserId(u); + msg.setCustomerId(customerId); + msg.setTargetId(icEventId); + msg.setGridId("*"); + msg.setApp(AppClientConstant.APP_GOV); + msg.setMessageType(UserMessageTypeConstant.IC_EVENT); + msg.setReadFlag(ReadFlagConstant.UN_READ); + msg.setTitle("您有一条事件消息"); + msg.setMessageContent(showName+"上报一条事件,请查看。"); + msgList.add(msg); + }); + messageOpenFeignClient.saveUserMessageList(msgList); + } + } + + /** + * Desc: 附件处理 + * @param list + * @param attachmentEntityList + * @param id + * @param customerId + * @param userId + * @author zxc + * @date 2022/5/20 09:50 + */ + public void disposeAttachment(List list,List attachmentEntityList,String id,String customerId,String userId){ + int sort = NumConstant.ZERO; + for (FileCommonDTO a : list) { + IcEventAttachmentEntity attachment = new IcEventAttachmentEntity(); + attachment.setCustomerId(customerId); + attachment.setIcEventId(id); + attachment.setCreatedBy(userId); + attachment.setAttachmentFormat(a.getFormat()); + attachment.setAttachmentType(a.getType()); + attachment.setAttachmentUrl(a.getUrl()); + attachment.setDuration(a.getDuration()); + attachment.setStatus(TopicConstant.AUTO_PASSED); + attachment.setSort(sort++); + attachmentEntityList.add(attachment); + } + } + + + /** + * 居民端小程序我上报的事件-列表+详情 + * yapi: http://yapi.elinkservice.cn/project/102/interface/api/7781 + * + * @param formDTO + * @return + */ + @Override + public PageData myReport(MyReportIcEvFormDTO formDTO) { + // 1.分页查询 + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectMyReport(formDTO)); + List list = pageInfo.getList(); + if (!CollectionUtils.isEmpty(list)) { + //封装数据 + for (MyReportIcEvResDTO dto : list) { + //每个事件对应的图片数据 + if (!CollectionUtils.isEmpty(dto.getAttachmentList())) { + List imageList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + for (IcEventAttachmentDTO file : dto.getAttachmentList()) { + if ("image".equals(file.getAttachmentType())) { + imageList.add(file.getAttachmentUrl()); + } else if ("voice".equals(file.getAttachmentType())) { + voiceList.add(file); + } + } + dto.setImageList(imageList); + dto.setVoiceList(voiceList); + } + + //分类信息 + if(StringUtils.isNotBlank(dto.getCategoryId())){ + List categoryList = new ArrayList<>(); + categoryList.add(dto.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(dto.getCategoryId())) { + if(StringUtils.isNotBlank(ca.getParentCategoryName())){ + //大类-子类 + dto.setCategoryName(ca.getParentCategoryName().concat(StrConstant.HYPHEN).concat(ca.getCategoryName())); + }else{ + dto.setCategoryName(ca.getCategoryName()); + } + } + } + } + + } + } + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 居民端小程序我上报的事件-处理中 + * 点击事件进入详情页时调用此接口,消除红点 + * + * @param userId + * @param icEventId + * @return + */ + @Override + public void removeRed(String userId, String icEventId) { + baseDao.updateRedDot(userId,icEventId); + } + + /** + * 居民端我上报的事件-回复 + * + * @param formDTO + */ + @Override + public void resiReply(ResiReplyIcEventFormDTO formDTO) { + //1.查询事件数据 判断是否允许回复 + IcEventEntity entity=checkReply(formDTO.getIcEventId()); + entity.setLatestOperatedTime(new Date()); + entity.setRedDot(NumConstant.ZERO); + baseDao.updateById(entity); + + //2.新增回复数据 + IcEventReplyEntity replyEntity = new IcEventReplyEntity(); + replyEntity.setCustomerId(formDTO.getCustomerId()); + replyEntity.setIcEventId(formDTO.getIcEventId()); + replyEntity.setFromUserId(formDTO.getUserId()); + replyEntity.setContent(formDTO.getContent()); + // 查询当前用户的显示昵称 应该是xxx街道-姓/女士or先生 如果没有街道和姓,显示的微信昵称 + List userIdList =new ArrayList<>(); + userIdList.add(formDTO.getUserId()); + Result> userResult=userOpenFeignClient.queryUserBaseInfo(userIdList); + if (!userResult.success() || CollectionUtils.isEmpty(userResult.getData())) { + throw new RenException("查询当前用户信息异常"); + } + replyEntity.setUserShowName(userResult.getData().get(NumConstant.ZERO).getUserShowName()); + icEventReplyService.insert(replyEntity); + + //3.新增操作记录数据 + IcEventOperationLogEntity logEntity =ConvertUtils.sourceToTarget(formDTO,IcEventOperationLogEntity.class); + logEntity.setUserIdentity(EventConstant.RESI_USER); + logEntity.setActionCode(ResiEventAction.REPLY.getCode()); + logEntity.setActionDesc(ResiEventAction.REPLY.getDesc()); + logEntity.setOperateTime(new Date()); + icEventOperationLogService.insert(logEntity); + } + + private IcEventEntity checkReply(String icEventId) { + //:0:已回复 1:已转项目 1:已转需求 + IcEventEntity entity = baseDao.selectById(icEventId); + if (null == entity || NumConstant.ONE_STR.equals(entity.getOperationType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复", "事件已转项目"); + } + if (null == entity || NumConstant.TWO_STR.equals(entity.getOperationType())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复", "事件已转需求"); + } + return entity; + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index 902fb92e6f..2b51ec32ce 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -646,6 +646,8 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl NumConstant.ZERO) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java index c1e07bf6bf..0df33e275a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java @@ -356,4 +356,29 @@ public class ProjectSatisfactionDetailServiceImpl extends BaseServiceImpl implements ProjectService { private Logger logger = LogManager.getLogger(ProjectServiceImpl.class); - @Autowired - private ProjectRedis projectRedis; + @Autowired private CustomerProjectParameterService parameterService; @Autowired @@ -149,6 +154,10 @@ public class ProjectServiceImpl extends BaseServiceImpl { if (issueDTO.getOrgId().equals(agency.getId())) { processEntity.setDepartmentName(agency.getOrganizationName()); @@ -2281,6 +2307,8 @@ public class ProjectServiceImpl extends BaseServiceImpl projectList(ProjectManageListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员信息"+formDTO.getUserId()); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageData result = new PageData<>(new ArrayList<>(),NumConstant.ZERO); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getProjectManageList(formDTO)); + List projectManageList = pageInfo.getList(); + if (CollectionUtils.isNotEmpty(projectManageList)){ + // 获取滞留天数 + Integer days = getDays(ConvertUtils.sourceToTarget(formDTO, ProjectListFromDTO.class)); + projectManageList.forEach(p -> { + // 所属网格赋值 + if (StringUtils.isNotBlank(p.getGridId())){ + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(p.getGridId()); + if (null == gridInfo){ + throw new EpmetException("未查询到网格信息"+p.getGridId()); + } + p.setGridName(gridInfo.getGridNamePath()); + } + // 获取当前处理部门 + List departmentNameList = new ArrayList<>(); + if (ProjectConstant.CLOSED.equals(p.getStatus())) { + p.setDepartmentNameList(departmentNameList); + p.setDetentionDays(NumConstant.ZERO_STR); + p.setProcessable(false); + p.setReturnable(false); + } else { + ProjectDTO projectDTO = ConvertUtils.sourceToTarget(p, ProjectDTO.class); + projectDTO.setId(p.getProjectId()); + if (p.getIsHandle().equals("unhandled")){ + String detentionDays = getDetentionDays(projectDTO); + if (!ONE_DAY.equals(detentionDays) && Integer.parseInt(detentionDays) > days) { + p.setDetentionDays(detentionDays); + } else { + p.setDetentionDays(detentionDays); + } + } + departmentNameList = baseDao.selectDepartmentNameList(projectDTO); + p.setDepartmentNameList(departmentNameList); + ProjectStaffDTO projectStaffDTO = new ProjectStaffDTO(); + projectStaffDTO.setProjectId(p.getProjectId()); + projectStaffDTO.setStaffId(formDTO.getUserId()); + List departmentList = projectStaffService.getDepartmentNameList(projectStaffDTO); + if (null != departmentList && departmentList.size() > NumConstant.ZERO) { + //TODO external_system值为1时,根据departmentList里的projectStaffId在project_sub_process表找最新的一条记录, + // 如果没有记录或者INTERNAL_STATUS是closed,processable的值为true + CustomerProjectParameterDTO customerProjectParameterDTO = new CustomerProjectParameterDTO(); + customerProjectParameterDTO.setCustomerId(formDTO.getCustomerId()); + customerProjectParameterDTO.setParameterKey(ProjectConstant.EXTERNAL_SYSTEM); + String parameterValue = parameterService.getParameterValueByKey(customerProjectParameterDTO); + if (StringUtils.isNotEmpty(parameterValue)){ + if (parameterValue.equals(NumConstant.ONE_STR)) { + List projectStaffIds = departmentList.stream().map(m -> m.getProjectStaffId()).distinct().collect(Collectors.toList()); + // 根据departmentList里的projectStaffId在project_sub_process表找最新的一条记录 + ProjectSubProcessDTO projectSubProcessDTO = projectSubProcessService.selectSubProcess(projectStaffIds); + if (null == projectSubProcessDTO || projectSubProcessDTO.getInternalStatus().equals(ProjectConstant.CLOSED)) { + p.setProcessable(true); + } else { + p.setProcessable(false); + } + } else { + p.setProcessable(true); + } + } else { + p.setProcessable(true); + } + } else { + p.setProcessable(false); + } + ReturnListFromDTO returnListFromDTO = new ReturnListFromDTO(); + returnListFromDTO.setProjectId(p.getProjectId()); + List returnableList = projectProcessService.getReturnableList(returnListFromDTO); + if (null != returnableList && returnableList.size() > NumConstant.ZERO) { + p.setReturnable(true); + } else { + p.setReturnable(false); + } + } + }); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + result.setList(projectManageList); + } + return result; + } + + /** + * Desc: 满意度评价列表 + * @param formDTO + * @author zxc + * @date 2022/5/18 10:03 + */ + @Override + public PageData satisfactionEvaluationList(SatisfactionEvaluationListFormDTO formDTO) { + PageData data = new PageData<>(new ArrayList<>(),NumConstant.ZERO); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> satisfactionDetailDao.satisfactionEvaluationList(formDTO.getProjectId())); + List result = pageInfo.getList(); + if (CollectionUtils.isNotEmpty(result)){ + Result> listResult = epmetUserOpenFeignClient.getStaffAndResi(result.stream().map(m -> m.getUserId()).distinct().collect(Collectors.toList())); + if (!listResult.success()){ + throw new EpmetException("查询user信息失败..."); + } + listResult.getData().forEach(u -> result.stream().filter(r -> r.getUserId().equals(u.getUserId())).forEach(r -> r.setEvaluationUser(u.getRealName()))); + data.setList(result); + data.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + } + return data; + } + + /** + * Desc: 项目管理导出 + * @param response + * @param formDTO + * @author zxc + * @date 2022/5/24 15:22 + */ + @Override + public void projectListExport(HttpServletResponse response, ProjectManageListFormDTO formDTO) throws IOException { + List list = this.projectList(formDTO).getList(); + List projectListExportExcels = ConvertUtils.sourceToTarget(list, ProjectListExportExcel.class); + TemplateExportParams templatePath = new TemplateExportParams("excel/project_list_export.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",projectListExportExcels); + ExcelPoiUtils.exportExcel(templatePath ,map,"项目管理导出表",response); + } + /** * @Description 区间项目分类数量处理 * 查询的是时间段内的分类项目数,查询的时间 是传入一个日期,拼上时间,在进行比较大小 diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java index 7bf5b6e4df..3007780212 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java @@ -111,6 +111,8 @@ public class ProjectTraceServiceImpl implements ProjectTraceS private BlockChainUploadService blockChainUploadService; @Autowired private YuShanSysApiService yuShanSysApiService; + @Autowired + private EpmetHeartOpenFeignClient heartOpenFeignClient; @Override @@ -156,6 +158,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS @Override public void closedV2(TokenDto tokenDto, ProjectClosedFromDTO fromDTO) { fromDTO.setUserId(tokenDto.getUserId()); + fromDTO.setCustomerId(tokenDto.getCustomerId()); projectService.closedV2(fromDTO); } @@ -240,6 +243,30 @@ public class ProjectTraceServiceImpl implements ProjectTraceS processList.forEach(p -> internalFiles.stream().filter(f -> p.getProcessId().equals(f.getProcessId())).forEach(f -> p.getInternalFile().add(f))); } } + // 协办单位名字赋值 协办单位类型,1社区自组织,2联建单位 + Map> groupByType = processList.stream().filter(p -> StringUtils.isNotBlank(p.getAssistanceUnitType())).collect(Collectors.groupingBy(ProcessListV2ResultDTO::getAssistanceUnitType)); + List oneType = groupByType.get(NumConstant.ONE_STR); + List twoType = groupByType.get(NumConstant.TWO_STR); + PartyUnitListFormDTO partyUnitListFormDTO = new PartyUnitListFormDTO(); + if (CollectionUtils.isNotEmpty(oneType)){ + partyUnitListFormDTO.setCommunitySelfIds(oneType.stream().map(m -> m.getAssistanceUnitId()).collect(Collectors.toList())); + } + if (CollectionUtils.isNotEmpty(twoType)){ + partyUnitListFormDTO.setPartyUnitIds(twoType.stream().map(m -> m.getAssistanceUnitId()).collect(Collectors.toList())); + } + Result> partyUnitListResult = heartOpenFeignClient.getPartyUnitList(partyUnitListFormDTO); + if (!partyUnitListResult.success()){ + throw new EpmetException("查询协办单位失败"); + } + if (CollectionUtils.isNotEmpty(partyUnitListResult.getData())){ + partyUnitListResult.getData().forEach(u -> { + processList.forEach(p -> { + if (u.getAssistanceUnitId().equals(p.getAssistanceUnitId())){ + p.setAssistanceUnitName(u.getAssistanceUnitName()); + } + }); + }); + } return processList; } @@ -382,6 +409,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setCustomerId(formDTO.getCustomerId()); projectEntity.setAgencyId(loginUser.getAgencyId()); + projectEntity.setGridId(formDTO.getGridId()); if (ProjectConstant.WORK_EVENT.equals(formDTO.getType())) { projectEntity.setOrigin(ProjectConstant.WORK_EVENT); projectEntity.setOriginId(formDTO.getGridId()); @@ -407,6 +435,8 @@ public class ProjectTraceServiceImpl implements ProjectTraceS processEntity.setOperationName(ProjectConstant.OPERATION_PROJECT_APPROVAL); processEntity.setPublicReply(formDTO.getPublicReply()); processEntity.setInternalRemark(formDTO.getInternalRemark()); + processEntity.setAssistanceUnitType(formDTO.getAssistanceUnitType()); + processEntity.setAssistanceUnitId(formDTO.getAssistanceUnitId()); agencyDeptGrid.getAgencyList().forEach(agency -> { if (loginUser.getAgencyId().equals(agency.getId())) { processEntity.setDepartmentName(agency.getOrganizationName()); @@ -675,6 +705,8 @@ public class ProjectTraceServiceImpl implements ProjectTraceS public EventToProjectResultDTO eventToProject(EventToProjectFormDTO formDTO) { //事件已经立项,不能重复操作 ResiEventEntity resiEventEntity=resiEventService.getById(formDTO.getEventId()); + //TODO 兼容新事件表 + String gridId = formDTO.getGridId(); if(null==resiEventEntity||resiEventEntity.getShiftProject()){ throw new RenException(EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getCode(),EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getMsg()); } @@ -719,6 +751,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS projectEntity.setOriginId(formDTO.getEventId()); projectEntity.setTitle(formDTO.getTitle()); projectEntity.setBackGround(formDTO.getPublicReply()); + projectEntity.setGridId(gridId); projectEntity.setStatus(ProjectConstant.PENDING); projectEntity.setOrgIdPath(loginUser.getOrgIdPath()); projectEntity.setLocateAddress(null == formDTO.getLocateAddress() ? "" : formDTO.getLocateAddress()); @@ -735,6 +768,8 @@ public class ProjectTraceServiceImpl implements ProjectTraceS processEntity.setOperationName(ProjectConstant.OPERATION_PROJECT_APPROVAL); processEntity.setPublicReply(formDTO.getPublicReply()); processEntity.setInternalRemark(formDTO.getInternalRemark()); + processEntity.setAssistanceUnitId(formDTO.getAssistanceUnitId()); + processEntity.setAssistanceUnitType(formDTO.getAssistanceUnitType()); agencyDeptGrid.getAgencyList().forEach(agency -> { if (loginUser.getAgencyId().equals(agency.getId())) { processEntity.setDepartmentName(agency.getOrganizationName()); @@ -1191,4 +1226,234 @@ public class ProjectTraceServiceImpl implements ProjectTraceS epmetMessageOpenFeignClient.saveUserMessage(userMessage); } + + /** + * 事件管理-事件立项【赶时间没空兼容】 + * @author sun + */ + @Override + public EventToProjectResultDTO icEventToProject(IcEventToProjectFormDTO formDTO) { + //判断是否存在已立项 + List projectEntityList = projectService.getByOriginId(formDTO.getIcEventId()); + if (!CollectionUtils.isEmpty(projectEntityList)) { + throw new RenException(EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getCode(), EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getMsg()); + } + List staffList = formDTO.getStaffList(); + //1.文字内容安全校验 + List list = new ArrayList<>(); + list.add(formDTO.getTitle()); + list.add(formDTO.getPublicReply()); + list.add(formDTO.getPublicReply()); + list.add(formDTO.getInternalRemark()); + safetyCheck(list); + //2.数据准备 + //2-1获取当前工作人员基本信息 + EventToProjectFormDTO eventToProjectFormDTO = ConvertUtils.sourceToTarget(formDTO, EventToProjectFormDTO.class); + LoginUserDetailsResultDTO loginUser = queryLoginUserInfo(eventToProjectFormDTO); + + //2-2.调用gov-org服务,获取所有勾选人员以及议题数据对应的组织信息、部门信息、网格信息用于对处理部门和ORG_ID_PATH字段的赋值使用 + AgencyDeptGridResultDTO agencyDeptGrid = getAgencyDeptGridRes(formDTO.getStaffList(), loginUser.getAgencyId()); + + //2-3.调用issue服务,查询分类、标签数据信息 + CategoryTagResultDTO categoryTagResultDTO = queryCategoryTagRes(eventToProjectFormDTO); + List categoryList = categoryTagResultDTO.getCategoryList(); + List tagList = categoryTagResultDTO.getTagList(); + + //2-4.批量查询被勾选工作人员基础信息 + List staffInfoList = queryStaffListRes(formDTO.getStaffList(), formDTO.getUserId()); + + //3.封装保存业务数据 + //3-1.项目主表新增数据 + ProjectEntity projectEntity = new ProjectEntity(); + projectEntity.setCustomerId(formDTO.getCustomerId()); + //立项人的所属组织id + projectEntity.setAgencyId(loginUser.getAgencyId()); + projectEntity.setOrigin("ic_event"); + projectEntity.setOriginId(formDTO.getIcEventId()); + projectEntity.setTitle(formDTO.getTitle()); + projectEntity.setBackGround(formDTO.getPublicReply()); + projectEntity.setGridId(formDTO.getGridId()); + projectEntity.setStatus(ProjectConstant.PENDING); + projectEntity.setOrgIdPath(loginUser.getOrgIdPath()); + projectEntity.setLocateAddress(null == formDTO.getLocateAddress() ? "" : formDTO.getLocateAddress()); + projectEntity.setLocateLongitude(null == formDTO.getLocateLongitude() ? "" : formDTO.getLocateLongitude()); + projectEntity.setLocateDimension(null == formDTO.getLocateDimension() ? "" : formDTO.getLocateDimension()); + projectService.insert(projectEntity); + + //3-2.项目进展表新增第一个节点数据 + ProjectProcessEntity processEntity = new ProjectProcessEntity(); + processEntity.setProjectId(projectEntity.getId()); + processEntity.setCustomerId(formDTO.getCustomerId()); + processEntity.setStaffId(formDTO.getUserId()); + processEntity.setOperation(ProjectConstant.OPERATION_CREATED); + processEntity.setOperationName(ProjectConstant.OPERATION_PROJECT_APPROVAL); + processEntity.setPublicReply(formDTO.getPublicReply()); + processEntity.setInternalRemark(formDTO.getInternalRemark()); + processEntity.setAssistanceUnitId(formDTO.getAssistanceUnitId()); + processEntity.setAssistanceUnitType(formDTO.getAssistanceUnitType()); + agencyDeptGrid.getAgencyList().forEach(agency -> { + if (loginUser.getAgencyId().equals(agency.getId())) { + processEntity.setDepartmentName(agency.getOrganizationName()); + processEntity.setAgencyId(agency.getId()); + if (org.apache.commons.lang3.StringUtils.isBlank(agency.getPids()) || org.apache.commons.lang3.StringUtils.equals(NumConstant.ZERO_STR, agency.getPids().trim()) || "".equals(agency.getPids().trim())) { + processEntity.setOrgIdPath(agency.getId()); + } else { + processEntity.setOrgIdPath(agency.getPids().concat(":").concat(agency.getId())); + } + } + }); + projectProcessService.insert(processEntity); + + //3-3.项目人员表批量新增数据 + List entityList = new ArrayList<>(); + staffList.forEach(ts -> { + ProjectStaffEntity entity = ConvertUtils.sourceToTarget(ts, ProjectStaffEntity.class); + entity.setOrgId(ts.getAgencyId()); + entity.setProjectId(projectEntity.getId()); + entity.setProcessId(processEntity.getId()); + entity.setIsHandle(ProjectConstant.UNHANDLED); + agencyDeptGrid.getAgencyList().forEach(agency -> { + if (ts.getAgencyId().equals(agency.getId())) { + entity.setCustomerId(agency.getCustomerId()); + entity.setOrgIdPath(("".equals(agency.getPids()) ? "" : agency.getPids() + ":") + agency.getId()); + entity.setDepartmentName(agency.getOrganizationName()); + } + }); + if (org.apache.commons.lang3.StringUtils.isNotBlank(ts.getDepartmentId())) { + agencyDeptGrid.getDeptList().forEach(dept -> { + if (ts.getDepartmentId().equals(dept.getId())) { + entity.setDepartmentName(entity.getDepartmentName() + "-" + dept.getDepartmentName()); + } + }); + } + if (org.apache.commons.lang3.StringUtils.isNotBlank(ts.getGridId())) { + agencyDeptGrid.getGridList().forEach(grid -> { + if (ts.getGridId().equals(grid.getId())) { + entity.setDepartmentName(entity.getDepartmentName() + "-" + grid.getGridName()); + } + }); + } + entityList.add(entity); + }); + projectStaffService.insertBatch(entityList); + + //3-4.项目附件表新增数据 + if ((null != formDTO.getPublicFile() && formDTO.getPublicFile().size() > NumConstant.ZERO) + || (null != formDTO.getInternalFile() && formDTO.getInternalFile().size() > NumConstant.ZERO)) { + projectService.saveFile(formDTO.getPublicFile(), formDTO.getInternalFile(), formDTO.getCustomerId(), projectEntity.getId(), processEntity.getId()); + } + + //3-5.项目分类表新增数据 + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getCategoryList())) { + List categoryEntityList = new ArrayList<>(); + formDTO.getCategoryList().forEach(item -> { + categoryList.forEach(ca -> { + if (item.getId().equals(ca.getId())) { + ProjectCategoryEntity entity = new ProjectCategoryEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setProjectId(projectEntity.getId()); + entity.setCategoryId(item.getId()); + entity.setCategoryPids(ca.getPids()); + entity.setCategoryCode(ca.getCategoryCode()); + entity.setGridId(formDTO.getGridId()); + categoryEntityList.add(entity); + } + }); + }); + projectCategoryService.insertBatch(categoryEntityList); + } + + //3-6.项目标签表新增数据 + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getTagList())) { + List tagEntityList = new ArrayList<>(); + formDTO.getTagList().forEach(item -> { + tagList.forEach(ta -> { + if (item.getId().equals(ta.getId())) { + ProjectTagsEntity entity = new ProjectTagsEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setProjectId(projectEntity.getId()); + entity.setTagId(item.getId()); + entity.setTagName(ta.getTagName()); + tagEntityList.add(entity); + } + }); + }); + projectTagsService.insertBatch(tagEntityList); + } + + //3-7:初始化机关-项目时间关联数据 + Date current = new Date(); + List projectStaffIds = entityList.stream().map(ProjectStaffEntity::getId).distinct().collect(Collectors.toList()); + if (!org.apache.commons.collections4.CollectionUtils.isEmpty(projectStaffIds)) { + List container = new LinkedList<>(); + projectStaffIds.forEach(o -> { + ProjectOrgRelationEntity period = new ProjectOrgRelationEntity(); + period.setProjectStaffId(o); + period.setInformedDate(current); + period.setSourceOperation(ProjectConstant.OPERATION_CREATED); + period.setCreatedBy(formDTO.getUserId()); + container.add(period); + }); + relationDao.insertBatch(container); + } + + //4.推送站内信、微信、短信消息 + //4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息 + if (!shiftProjectMessage(formDTO.getStaffList(), formDTO.getCustomerId(), formDTO.getTitle(), projectEntity.getId()).success()) { + throw new RenException("事件转为项目,推送站内信失败"); + } + + //4-2.以及政府端调用epmet-message服务,给工作端工作人员推送微信订阅消息 + if (!wxmpShiftProjectMessage(formDTO.getStaffList(), formDTO.getCustomerId(), formDTO.getTitle()).success()) { + logger.error("事件转为项目,推送微信订阅消息失败!"); + } + + //4-3.吹哨短信消息 + List smsList = new ArrayList<>(); + staffList.forEach(staff -> { + staffInfoList.forEach(st -> { + if (staff.getStaffId().equals(st.getStaffId())) { + ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); + sms.setCustomerId(st.getCustomerId()); + sms.setMobile(st.getMobile()); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER); + sms.setParameterKey("send_msg"); + smsList.add(sms); + } + }); + }); + Result result = epmetMessageOpenFeignClient.projectSendMsg(smsList); + if (!result.success()) { + logger.error("项目吹哨,发送手机短信失败" + JSON.toJSONString(result)); + } + + //5.项目实时统计消息 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String mqMsgBrief = String.format("创建了\"%s\"的项目", formDTO.getTitle()); + ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_CREATED, + projectEntity.getId(), + formDTO.getUserId(), + new Date(), + mqMsgBrief, + IpUtils.getIpAddr(request), + loginUserUtil.getLoginUserApp(), + loginUserUtil.getLoginUserClient()); + boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(mqMsg); + if (!msgResult) { + log.error("项目实时统计消息发送失败"); + } + // 数据上链 + try { + blockChainUploadService.send2BlockChain(projectEntity, processEntity, entityList, null); + } catch (Exception e) { + String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); + log.error("【项目流转】上链失败,错误信息:{}", errorMsg); + } + + EventToProjectResultDTO resultDTO = new EventToProjectResultDTO(); + resultDTO.setProjectId(projectEntity.getId()); + return resultDTO; + } + + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java index 3c5b66a824..eb336fe63e 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java @@ -484,7 +484,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl attachmentList) { + public void scanContent(String eventContent, List attachmentList) { //事件内容 if (StringUtils.isNotBlank(eventContent)) { TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); @@ -502,9 +502,11 @@ public class ResiEventServiceImpl extends BaseServiceImpl imgList=new ArrayList<>(); - for(FileCommonDTO fileCommonDTO:attachmentList){ - if("image".equals(fileCommonDTO.getType())){ - imgList.add(fileCommonDTO.getUrl()); + if(!CollectionUtils.isEmpty(attachmentList)){ + for(FileCommonDTO fileCommonDTO:attachmentList){ + if("image".equals(fileCommonDTO.getType())){ + imgList.add(fileCommonDTO.getUrl()); + } } } //事件图片 diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.22__add_project_and_process.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.22__add_project_and_process.sql new file mode 100644 index 0000000000..aa58e9f0ae --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.22__add_project_and_process.sql @@ -0,0 +1,6 @@ + + +ALTER TABLE `project_process` ADD COLUMN `ASSISTANCE_UNIT_ID` VARCHAR(32) COMMENT '协办单位ID' AFTER `staff_id`; +ALTER TABLE `project_process` ADD COLUMN `ASSISTANCE_UNIT_TYPE` VARCHAR(1) COMMENT '协办单位类型,1社区自组织,2联建单位' AFTER `ASSISTANCE_UNIT_ID`; +ALTER TABLE `project` ADD COLUMN `GRID_ID` VARCHAR(32) DEFAULT'' COMMENT '网格ID' AFTER `AGENCY_ID`; + diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.23__add_ic_event.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.23__add_ic_event.sql new file mode 100644 index 0000000000..6ccf4c6343 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.23__add_ic_event.sql @@ -0,0 +1,153 @@ + +CREATE TABLE `ic_event` ( + `ID` varchar(64) NOT NULL COMMENT '主键,事件id', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '事件所属的网格Id。不包含网格的id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '网格的所属组织', + `GRID_PIDS` varchar(255) NOT NULL COMMENT '网格的所有组织Id', + `REPORT_USER_ID` varchar(64) NOT NULL COMMENT '报事的人【居民端/pc端居民Id】可为空', + `NAME` varchar(64) DEFAULT NULL COMMENT '报事人姓名', + `MOBILE` varchar(11) NOT NULL COMMENT '手机号', + `ID_CARD` varchar(18) DEFAULT NULL COMMENT '身份证号', + `SOURCE_TYPE` char(1) DEFAULT NULL COMMENT '反映渠道【字典表】', + `HAPPEN_TIME` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '发生时间', + `EVENT_CONTENT` varchar(1024) NOT NULL COMMENT '事件内容', + `LATITUDE` varchar(32) DEFAULT NULL COMMENT '纬度', + `LONGITUDE` varchar(32) DEFAULT NULL COMMENT '经度', + `ADDRESS` varchar(255) NOT NULL COMMENT '地址', + `STATUS` varchar(32) NOT NULL DEFAULT 'processing' COMMENT '处理中:processing;已办结:closed_case', + `CLOSE_CASE_TIME` datetime DEFAULT NULL COMMENT '办结时间', + `OPERATION_TYPE` char(1) DEFAULT NULL COMMENT '0:已回复 1:已转项目 2:已转需求', + `OPERATION_ID` varchar(32) DEFAULT NULL COMMENT '项目、需求ID', + `READ_FLAG` tinyint(1) NOT NULL DEFAULT '0' COMMENT '事件是否被阅读过;1已读;针对报事人待处理列表', + `RED_DOT` tinyint(1) NOT NULL DEFAULT '0' COMMENT '报事人的红点:展示1;不展示:0;【工作人员回复/立项/转需求/办结更新为1】', + `LATEST_OPERATED_TIME` datetime NOT NULL COMMENT '最近一次操作时间(回复、立项、转需求、办结更新此列)', + `RESOLVE_STATUS` varchar(32) DEFAULT 'resolved' COMMENT '是否解决:已解决 resolved,未解决 un_solved', + `CLOSE_REMARK` varchar(255) DEFAULT NULL COMMENT '结案说明', + `COMMENT_USER_ID` varchar(32) DEFAULT NULL COMMENT '评价人', + `SATISFACTION` varchar(300) DEFAULT NULL COMMENT '满意度 - 不满意:bad、基本满意:good、非常满意:perfect', + `COMMENT_TIME` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '满意度评价时间', + `AUDIT_STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '事件审核状态[涉及附件审核需要加的状态](审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)', + `AUDIT_REASON` varchar(128) DEFAULT NULL COMMENT '审核理由', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '展示红点:visible;隐藏:invisible;人大回复、工作人员回复/立项更新为visible; 插入数据默认不展示', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_gid` (`GRID_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件管理表'; + +-- ---------------------------- +-- Table structure for ic_event_attachment +-- ---------------------------- + +CREATE TABLE `ic_event_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '附件状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态', + `REASON` varchar(255) DEFAULT NULL COMMENT '失败原因', + `DURATION` int(11) DEFAULT NULL COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_eid` (`IC_EVENT_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件附件表'; + +-- ---------------------------- +-- Table structure for ic_event_category +-- ---------------------------- + +CREATE TABLE `ic_event_category` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id', + `CATEGORY_ID` varchar(64) NOT NULL COMMENT '分类id', + `CATEGORY_PIDS` varchar(512) NOT NULL COMMENT '分类对应的所有上级,英文逗号隔开', + `CATEGORY_CODE` varchar(50) CHARACTER SET utf8 NOT NULL COMMENT '分类编码,分类编码+customer_id唯一', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_pid` (`IC_EVENT_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件所属分类表'; + +-- ---------------------------- +-- Table structure for ic_event_operation_log +-- ---------------------------- + +CREATE TABLE `ic_event_operation_log` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id', + `USER_ID` varchar(64) NOT NULL COMMENT '操作用户Id', + `USER_IDENTITY` varchar(32) NOT NULL COMMENT ' 操作用户类型【居民端用户:resi_user;工作人员:staff;】', + `ACTION_CODE` varchar(32) NOT NULL COMMENT '1、发布事件:add\r\n2、复:reply;\r\n3、立项:shift_project;\r\n4、转需求:shift_demand\r\n5、办结:close_case;\r\n6、需求办结:close_demand\r\n\r\n', + `ACTION_DESC` varchar(32) NOT NULL COMMENT '1、发布事件:publish;\r\n2、撤回事件:recall;\r\n3、复:reply;\r\n4、立项:shift_project;\r\n5、转需求: shift_demand;\r\n6、办结:close_case;\r\n7、需求办结:close_demand;\r\n8、选择是否已解决:choose_resolve;\r\n9、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中;', + `OPERATE_TIME` datetime NOT NULL COMMENT '操作时间', + `SERVICE_PARTY` varchar(64) DEFAULT NULL COMMENT '服务方【事件被转需求,需求在办结时的服务方名称】', + `ACTUAL_SERVICE_TIME` varchar(64) DEFAULT NULL COMMENT '实际服务时间【事件被转需求,需求在办结时填写的实际服务时间 xx至xx】', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件操作日志表'; + +-- ---------------------------- +-- Table structure for ic_event_reply +-- ---------------------------- + +CREATE TABLE `ic_event_reply` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id', + `FROM_USER_ID` varchar(64) NOT NULL COMMENT '回复人用户Id[工作人员ID]', + `CONTENT` varchar(1024) NOT NULL COMMENT '内容', + `USER_SHOW_NAME` varchar(64) NOT NULL COMMENT '报事人:组织-人名', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_eid` (`IC_EVENT_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件回复表'; + +-- ---------------------------- +-- Table structure for ic_event_scan_task +-- ---------------------------- + +CREATE TABLE `ic_event_scan_task` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id', + `IC_EVENT_ATTACHMENT_ID` varchar(64) NOT NULL COMMENT '事件附件表主键,对应dataId', + `TASK_ID` varchar(64) NOT NULL COMMENT '阿里云审核任务Id', + `STATUS` varchar(32) NOT NULL COMMENT '审核状态【auditing: 审核中;\r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;】', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型(视频 - video、 语音 - voice 文件 - doc)', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '操作人,API审核结果,存储为SCAN_USER或者APP_USER', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='事件附件安全校验任务表'; diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/excel/project_list_export.xlsx b/epmet-module/gov-project/gov-project-server/src/main/resources/excel/project_list_export.xlsx new file mode 100644 index 0000000000..2844847108 Binary files /dev/null and b/epmet-module/gov-project/gov-project-server/src/main/resources/excel/project_list_export.xlsx differ diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventAttachmentDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventAttachmentDao.xml new file mode 100644 index 0000000000..42b0c0dd12 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventAttachmentDao.xml @@ -0,0 +1,17 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml new file mode 100644 index 0000000000..afb3965750 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml new file mode 100644 index 0000000000..d2035f274a --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml @@ -0,0 +1,376 @@ + + + + + + + + UPDATE ic_event + SET SATISFACTION = 'perfect', + COMMENT_USER_ID = 'APP_USER', + COMMENT_TIME = NOW(), + LATEST_OPERATED_TIME = NOW(), + UPDATED_TIME = NOW() + WHERE ID IN ( + + #{id} + + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE ic_event + SET UPDATED_BY = #{userId}, + UPDATED_TIME = NOW(), + RED_DOT = '0' + WHERE + id = #{icEventId} + AND DEL_FLAG = '0' + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventOperationLogDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventOperationLogDao.xml new file mode 100644 index 0000000000..76994c7fc8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventOperationLogDao.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventReplyDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventReplyDao.xml new file mode 100644 index 0000000000..60dadc46aa --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventReplyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventScanTaskDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventScanTaskDao.xml new file mode 100644 index 0000000000..8e73ee8fee --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventScanTaskDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index bef089e81f..493f8bbf72 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -564,4 +564,60 @@ AND p.status = 'pending' ORDER BY psp.created_time, p.created_time ASC + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml index 0e2a2e5b3d..8a774f3c21 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml @@ -95,7 +95,9 @@ DEPARTMENT_NAME, PUBLIC_REPLY, INTERNAL_REMARK, - IS_SEND + IS_SEND, + ASSISTANCE_UNIT_TYPE, + ASSISTANCE_UNIT_ID FROM project_process WHERE DEL_FLAG = '0' AND PROJECT_ID = #{projectId} diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionDetailDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionDetailDao.xml index 595060968d..7bfae0a648 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionDetailDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionDetailDao.xml @@ -75,4 +75,16 @@ ) + + + \ No newline at end of file diff --git a/epmet-module/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-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/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 6ad96ff185..cdeb0adf8c 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 @@ -756,4 +756,47 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/icresiuser/changeIcResiUserBelongTo") Result changeIcResiUserBelongTo(@RequestBody IcUserBelongToChangedFormDTO formDTO); + + /** + * 使用身份证号查询家属信息 + * @param idCard + * @return + */ + @GetMapping("/epmetuser/icresiuser/findFamilyMemByIdCard/{id-card}") + Result findFamilyMemByIdCard(@PathVariable("id-card") String idCard); + + /** + * 身份证号查询居民信息 + * @param idCard + * @return + */ + @PostMapping("/epmetuser/icresiuser/getByResiIdCard/{idcard}") + Result getByResiIdCard(@PathVariable("idcard") String idCard); + + /** + * 根据身份证号查询ic_resi_user.id+居民端用户id + * + * @param idCard + * @return + */ + @PostMapping("/epmetuser/icresiuser/getAllUserIds") + Result> getAllUserIds(@RequestParam("idcard") String idCard, @RequestParam("customerId") String customerId); + + /** + * Desc: 获取是否注册居民标志,true:已注册,false:未注册 + * @param userId + * @author zxc + * @date 2022/5/23 13:52 + */ + @PostMapping("/epmetuser/userresiinfo/isResiFlag") + Result getIsResiFlag(@RequestParam("userId") String userId); + + /** + * Desc: 在不确定userId是工作人员还是居民时,使用此接口查询信息 + * @param userIds + * @author zxc + * @date 2022/5/25 09:17 + */ + @PostMapping("/epmetuser/userresiinfo/getStaffAndResi") + Result> getStaffAndResi(@RequestBody List userIds); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index a170b1e617..11c7e36c52 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 @@ -553,4 +553,35 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "changeIcResiUserBelongTo", formDTO); } + @Override + public Result findFamilyMemByIdCard(String idCard) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "findFamilyMemByIdCard", idCard); + } + + @Override + public Result getByResiIdCard(String idCard) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getByResiIdCard", idCard); + } + + /** + * 根据身份证号查询ic_resi_user.id+居民端用户id + * + * @param idCard + * @param customerId + * @return + */ + @Override + public Result> getAllUserIds(String idCard, String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getAllUserIds", idCard,customerId); + } + + @Override + public Result getIsResiFlag(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getIsResiFlag", userId); + } + + @Override + public Result> getStaffAndResi(List userIds) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffAndResi", userIds); + } } 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/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 97660e7ac9..8f783f39c8 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 @@ -705,7 +705,9 @@ public class IcResiUserController implements ResultDataResolver { * 新增需求,需求人列表:展示当前工作人员所属组织+页面已选择所属网格 下的居民列 */ @PostMapping("demandusers") - public Result> queryDemandUsers(@RequestBody DemandUserFormDTO formDTO) { + public Result> queryDemandUsers(@LoginUser TokenDto tokenDto,@RequestBody DemandUserFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, DemandUserFormDTO.InternalGroup.class); return new Result>().ok(icResiUserService.queryDemandUsers(formDTO)); } @@ -1059,4 +1061,38 @@ public class IcResiUserController implements ResultDataResolver { Result> getResiUserGroupHomeId(@RequestBody RentTenantDataFormDTO formDTO) { return new Result().ok(icResiUserService.getResiUserGroupHomeId(formDTO)); } + + /** + * 使用身份证号查询家属信息 + * @param idCard + * @return + */ + @GetMapping("findFamilyMemByIdCard/{id-card}") + public Result findFamilyMemByIdCard(@PathVariable("id-card") String idCard) { + IcResiUserBriefDTO r = icResiUserService.findFamilyMemByIdCard(idCard); + return new Result().ok(r); + } + + /** + * 身份证号查询居民信息 + * @param idCard + * @return + */ + @PostMapping("getByResiIdCard/{idcard}") + public Result getByResiIdCard(@PathVariable("idcard") String idCard) { + IcResiUserDTO resi = icResiUserService.getByResiId(idCard); + return new Result().ok(resi); + } + + /** + * 根据身份证号查询ic_resi_user.id+居民端用户id + * + * @param idCard + * @return + */ + @PostMapping("getAllUserIds") + public Result> getAllUserIds(@RequestParam("idcard") String idCard, @RequestParam("customerId") String customerId) { + List list = icResiUserService.getAllUserIds(idCard, customerId); + return new Result>().ok(list); + } } 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/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 317c9aeb49..225892faa8 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 @@ -316,4 +316,6 @@ public interface IcResiUserDao extends BaseDao { * @return */ List listUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId); + + List getAllUserIds(@Param("idCard") String idCard, @Param("customerId")String customerId); } 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/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 0de9ef4928..acd91e77b7 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 @@ -346,4 +346,10 @@ public interface IcResiUserService extends BaseService { */ List changeIcResiUserBelongTo(TokenDto tokenDto, IcUserBelongToChangedFormDTO formDTO); + + IcResiUserBriefDTO findFamilyMemByIdCard(String idCard); + + IcResiUserDTO getByResiId(String idCard); + + List getAllUserIds(String idCard, String customerId); } 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/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 1c5e9c9bcd..a9482f0a3e 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 @@ -41,10 +41,7 @@ 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.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; @@ -1161,6 +1158,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()); } @@ -1965,4 +1970,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/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/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 9010d5f559..26f6df3e3d 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 @@ -399,7 +399,9 @@ id, `name`, id_card, - mobile + mobile, + agency_id, + grid_id FROM ic_resi_user WHERE @@ -427,7 +429,9 @@ ic_resi_user ir WHERE ir.DEL_FLAG = '0' - AND ir.AGENCY_ID = #{agencyId} + + AND ir.AGENCY_ID = #{agencyId} + AND ir.GRID_ID = #{gridId} @@ -482,7 +486,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} + + +