Browse Source

Merge remote-tracking branch 'origin/dev_zhili' into dev_zhili

dev
yinzuomei 4 years ago
parent
commit
820051b996
  1. 9
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.17__add_dict.sql
  2. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.15__self_org_category.sql
  3. 5
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java
  4. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventReplyFormDTO.java
  5. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java
  6. 7
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventYpAnalysisResultDTO.java
  7. 77
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  8. 2
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml
  9. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java
  10. 8
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

9
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');

8
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 alter table ic_community_self_organization
add COLUMN CATEGORY_CODE VARCHAR(32) DEFAULT NULL COMMENT '分类,来源于字典表dictType=self_org_category;'; 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`;

5
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 * ic_user_demand_rec.id
*/ */
String DEMAND="demand"; String DEMAND="demand";
/**
* ic_event新事件
*/
String IC_EVENT="ic_event";
} }

2
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; private String content;
/** /**
* 处理方式[0:已回复 1:已转项目 1:已转需求] * 处理方式[0:已回复 1:已转项目 1:已转需求]
*/ */
@NotBlank(message = "处理方式不能为空", groups = {UpdateGroup.class})
private String operationType; private String operationType;
/** /**
* 处理中processing已办结closed_case * 处理中processing已办结closed_case

2
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 { public class HouseUserDTO implements Serializable {
private String icResiUserId; private String icResiUserId;
private String icUserName; private String icUserName;
private String agencyId;
private String gridId;
} }

7
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 reportorIdCard;
private String reportorAgencyId;
private String reportorGridId;
/** /**
* 上报渠道名称 * 上报渠道名称
*/ */
@ -56,7 +60,6 @@ public class IcEventYpAnalysisResultDTO {
*/ */
private String categoryPids; private String categoryPids;
/** /**
* 家属 * 家属
*/ */
@ -66,6 +69,8 @@ public class IcEventYpAnalysisResultDTO {
public static class Dependent { public static class Dependent {
private String id; private String id;
private String name; private String name;
private String agencyId;
private String gridId;
} }
} }

77
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.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.*;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.IcEventDao; import com.epmet.dao.IcEventDao;
import com.epmet.dto.*; import com.epmet.dto.*;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
@ -47,6 +49,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -91,6 +94,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
private OperCrmOpenFeignClient crmOpenFeignClient; private OperCrmOpenFeignClient crmOpenFeignClient;
@Autowired @Autowired
private ResiEventServiceImpl resiEventService; private ResiEventServiceImpl resiEventService;
@Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Override @Override
@ -580,8 +585,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
"【事件研判分析】查询分类字典失败"); "【事件研判分析】查询分类字典失败");
// 上报人信息 // 上报人信息
IcEventYpAnalysisResultDTO r = new IcEventYpAnalysisResultDTO();
String idCard = event.getIdCard(); String idCard = event.getIdCard();
String icResiId = null;
List<IcEventYpAnalysisResultDTO.Dependent> dependents = new ArrayList<>(); List<IcEventYpAnalysisResultDTO.Dependent> dependents = new ArrayList<>();
if (StringUtils.isNotBlank(idCard)) { if (StringUtils.isNotBlank(idCard)) {
IcResiUserDTO resiInfo = getResultDataOrThrowsException(userOpenFeignClient.getByResiIdCard(idCard), IcResiUserDTO resiInfo = getResultDataOrThrowsException(userOpenFeignClient.getByResiIdCard(idCard),
@ -590,14 +595,14 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
"【事件研判分析】根据身份证号查找居民信息失败", "【事件研判分析】根据身份证号查找居民信息失败",
"【事件研判分析】根据身份证号查找居民信息失败"); "【事件研判分析】根据身份证号查找居民信息失败");
if (resiInfo != null) { if (resiInfo != null) {
icResiId = resiInfo.getId(); r.setReportorResiId(resiInfo.getId());
r.setReportorAgencyId(resiInfo.getAgencyId());
r.setReportorGridId(resiInfo.getGridId());
} }
dependents = getDependents(event.getIdCard()); dependents = getDependents(event.getIdCard());
} }
IcEventYpAnalysisResultDTO r = new IcEventYpAnalysisResultDTO();
r.setReportorResiId(icResiId);
r.setReportorName(event.getName()); r.setReportorName(event.getName());
r.setSourceTypeName(sourceTypeMap.get(event.getSourceType())); r.setSourceTypeName(sourceTypeMap.get(event.getSourceType()));
r.setDependents(dependents); r.setDependents(dependents);
@ -624,12 +629,14 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
"【事件研判分析】查找家属失败", "【事件研判分析】查找家属失败",
"【事件研判分析】查找家属失败"); "【事件研判分析】查找家属失败");
List<HouseUserDTO> houseUserList = familyInfo.getHouseUserList();
ArrayList<IcEventYpAnalysisResultDTO.Dependent> dependents = new ArrayList<>(); ArrayList<IcEventYpAnalysisResultDTO.Dependent> dependents = new ArrayList<>();
if (CollectionUtils.isEmpty(dependents)) { if (CollectionUtils.isEmpty(houseUserList)) {
return dependents; return dependents;
} }
for (HouseUserDTO u : familyInfo.getHouseUserList()) { for (HouseUserDTO u : houseUserList) {
dependents.add(new IcEventYpAnalysisResultDTO.Dependent(u.getIcResiUserId(), u.getIcUserName())); dependents.add(new IcEventYpAnalysisResultDTO.Dependent(u.getIcResiUserId(), u.getIcUserName(), u.getAgencyId(), u.getGridId()));
} }
return dependents; return dependents;
} }
@ -660,7 +667,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复");
} }
//2.修改事件数据 //2.修改事件数据
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())){ if (StringUtils.isNotBlank(formDTO.getOperationType()) && StringUtils.isNotBlank(formDTO.getStatus()) && "closed_case".equals(formDTO.getStatus())){
entity.setStatus(formDTO.getStatus()); entity.setStatus(formDTO.getStatus());
entity.setCloseCaseTime(new Date()); entity.setCloseCaseTime(new Date());
} }
@ -889,7 +896,6 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
resultDTO.setCategoryCode(ca.getCategoryCode()); resultDTO.setCategoryCode(ca.getCategoryCode());
resultDTO.setParentCategoryName(ca.getParentCategoryName()); resultDTO.setParentCategoryName(ca.getParentCategoryName());
resultDTO.setCategoryName(ca.getCategoryName()); resultDTO.setCategoryName(ca.getCategoryName());
resultDTO.setCategoryName(ca.getParentCategoryName()+"-"+ca.getCategoryName());
} }
} }
} }
@ -992,14 +998,15 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//2.查询事件回复信息 //2.查询事件回复信息
LinkedList<IcEventProcessListResultDTO> event = icEventReplyService.getByEventId(formDTO.getIcEventId()); LinkedList<IcEventProcessListResultDTO> event = icEventReplyService.getByEventId(formDTO.getIcEventId());
//3.判断查询事件项目进展或需求进展信息 //3.判断查询事件项目进展或需求进展信息
//项目进展 //项目进展
if ("1".equals(entity.getOperationType())) { if ("1".equals(entity.getOperationType())) {
ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO(); ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO();
processListV2FormDTO.setProjectId(entity.getOperationId()); processListV2FormDTO.setProjectId(entity.getOperationId());
List<ProcessListV2ResultDTO> project = projectTraceService.processListV2(processListV2FormDTO); List<ProcessListV2ResultDTO> project = projectTraceService.processListV2(processListV2FormDTO);
resultList.addAll(ConvertUtils.sourceToTarget(project, IcEventProcessListResultDTO.class)); List<IcEventProcessListResultDTO> projectList = ConvertUtils.sourceToTarget(project, IcEventProcessListResultDTO.class);
projectList.forEach(p->p.setType("project"));
resultList.addAll(projectList);
} }
//需求进展 //需求进展
if ("2".equals(entity.getOperationType())) { if ("2".equals(entity.getOperationType())) {
@ -1076,11 +1083,13 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
throw new EpmetException("查询用户信息失败"+formDTO.getUserId()); throw new EpmetException("查询用户信息失败"+formDTO.getUserId());
} }
entity.setReportUserId(formDTO.getUserId()); entity.setReportUserId(formDTO.getUserId());
AtomicReference<String> userShowName = new AtomicReference<>("");
userResult.getData().forEach(u -> { userResult.getData().forEach(u -> {
if (u.getUserId().equals(formDTO.getUserId())){ if (u.getUserId().equals(formDTO.getUserId())){
entity.setName(u.getRealName()); entity.setName(u.getRealName());
entity.setMobile(u.getMobile()); entity.setMobile(u.getMobile());
entity.setIdCard(u.getIdNum()); entity.setIdCard(u.getIdNum());
userShowName.set(u.getUserShowName());
} }
}); });
// 0代表 随手拍和随时讲 // 0代表 随手拍和随时讲
@ -1105,9 +1114,55 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
icEventAttachmentService.insertBatch(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<List<String>> agencyStaffsResult = govOrgOpenFeignClient.getAgencyStaffs(formDTO);
if (!agencyStaffsResult.success()){
throw new EpmetException("查询组织下工作人员失败...");
}
if (!CollectionUtils.isEmpty(agencyStaffsResult.getData())){
List<UserMessageFormDTO> 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<FileCommonDTO> list,List<IcEventAttachmentEntity> attachmentEntityList,String id,String customerId,String userId){ public void disposeAttachment(List<FileCommonDTO> list,List<IcEventAttachmentEntity> attachmentEntityList,String id,String customerId,String userId){
int sort = NumConstant.ZERO; int sort = NumConstant.ZERO;
for (FileCommonDTO a : list) { for (FileCommonDTO a : list) {

2
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

@ -60,7 +60,7 @@
and e.STATUS = #{processStatus} and e.STATUS = #{processStatus}
</if> </if>
<if test="categoryCode != null and categoryCode != ''"> <if test="categoryCode != null and categoryCode != ''">
and c.CATEGORY_CODE = #{categoryCode} and c.CATEGORY_CODE like CONCAT(#{categoryCode},'%')
</if> </if>
</where> </where>
order by e.CREATED_TIME desc order by e.CREATED_TIME desc

2
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 icResiUserId;
private String icUserName; private String icUserName;
private String agencyId;
private String gridId;
} }

8
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -398,7 +398,9 @@
id, id,
`name`, `name`,
id_card, id_card,
mobile mobile,
agency_id,
grid_id
FROM FROM
ic_resi_user ic_resi_user
WHERE WHERE
@ -483,7 +485,9 @@
<select id="selectListFamilyMember" parameterType="map" resultType="com.epmet.dto.result.HouseUserDTO"> <select id="selectListFamilyMember" parameterType="map" resultType="com.epmet.dto.result.HouseUserDTO">
SELECT SELECT
m.ID AS icResiUserId, m.ID AS icResiUserId,
m.`NAME` AS icUserName m.`NAME` AS icUserName,
m.AGENCY_ID AS agencyId,
m.GRID_ID AS gridId
FROM FROM
ic_resi_user m ic_resi_user m
WHERE WHERE

Loading…
Cancel
Save