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-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 index 4b02bfcfd2..928b038945 100644 --- 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 @@ -1,2 +1,8 @@ alter table ic_community_self_organization -add COLUMN CATEGORY_CODE VARCHAR(32) DEFAULT NULL COMMENT '分类,来源于字典表dictType=self_org_category;'; \ No newline at end of file +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-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-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 index bdcb68045c..6c9bacafa8 100644 --- 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 @@ -32,10 +32,12 @@ public class IcEventReplyFormDTO implements Serializable { /** * 回复内容 */ + @NotBlank(message = "回复内容不能为空", groups = {UpdateGroup.class}) private String content; /** * 处理方式[0:已回复 1:已转项目 1:已转需求] */ + @NotBlank(message = "处理方式不能为空", groups = {UpdateGroup.class}) private String operationType; /** * 处理中:processing;已办结:closed_case 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/IcEventYpAnalysisResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventYpAnalysisResultDTO.java index dd1796ebde..1bf3e0ce99 100644 --- 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 @@ -38,6 +38,10 @@ public class IcEventYpAnalysisResultDTO { * 上报人身份证号 */ private String reportorIdCard; + + private String reportorAgencyId; + + private String reportorGridId; /** * 上报渠道名称 */ @@ -56,7 +60,6 @@ public class IcEventYpAnalysisResultDTO { */ private String categoryPids; - /** * 家属 */ @@ -66,6 +69,8 @@ public class IcEventYpAnalysisResultDTO { 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-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 index 461486ae2b..b736dfcc5b 100644 --- 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 @@ -24,6 +24,8 @@ 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.ReadFlagConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.IcEventDao; import com.epmet.dto.*; import com.epmet.dto.form.*; @@ -47,6 +49,7 @@ 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; @@ -91,6 +94,8 @@ public class IcEventServiceImpl extends BaseServiceImpl dependents = new ArrayList<>(); if (StringUtils.isNotBlank(idCard)) { IcResiUserDTO resiInfo = getResultDataOrThrowsException(userOpenFeignClient.getByResiIdCard(idCard), @@ -590,14 +595,14 @@ public class IcEventServiceImpl extends BaseServiceImpl houseUserList = familyInfo.getHouseUserList(); + ArrayList dependents = new ArrayList<>(); - if (CollectionUtils.isEmpty(dependents)) { + if (CollectionUtils.isEmpty(houseUserList)) { return dependents; } - for (HouseUserDTO u : familyInfo.getHouseUserList()) { - dependents.add(new IcEventYpAnalysisResultDTO.Dependent(u.getIcResiUserId(), u.getIcUserName())); + for (HouseUserDTO u : houseUserList) { + dependents.add(new IcEventYpAnalysisResultDTO.Dependent(u.getIcResiUserId(), u.getIcUserName(), u.getAgencyId(), u.getGridId())); } return dependents; } @@ -660,7 +667,7 @@ public class IcEventServiceImpl extends BaseServiceImpl event = icEventReplyService.getByEventId(formDTO.getIcEventId()); - //3.判断查询事件项目进展或需求进展信息 //项目进展 if ("1".equals(entity.getOperationType())) { ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO(); processListV2FormDTO.setProjectId(entity.getOperationId()); List project = projectTraceService.processListV2(processListV2FormDTO); - resultList.addAll(ConvertUtils.sourceToTarget(project, IcEventProcessListResultDTO.class)); + List projectList = ConvertUtils.sourceToTarget(project, IcEventProcessListResultDTO.class); + projectList.forEach(p->p.setType("project")); + resultList.addAll(projectList); } //需求进展 if ("2".equals(entity.getOperationType())) { @@ -1076,11 +1083,13 @@ public class IcEventServiceImpl extends BaseServiceImpl 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代表 随手拍和随时讲 @@ -1105,9 +1114,55 @@ public class IcEventServiceImpl extends BaseServiceImpl> 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) { 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 index e4e5316014..a596aef481 100644 --- 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 @@ -60,7 +60,7 @@ and e.STATUS = #{processStatus} - and c.CATEGORY_CODE = #{categoryCode} + and c.CATEGORY_CODE like CONCAT(#{categoryCode},'%') order by e.CREATED_TIME desc 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-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 2001d71a0a..1b27e999ad 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 @@ -398,7 +398,9 @@ id, `name`, id_card, - mobile + mobile, + agency_id, + grid_id FROM ic_resi_user WHERE @@ -483,7 +485,9 @@