|
|
|
@ -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<IcEventDao, IcEventEntit |
|
|
|
private OperCrmOpenFeignClient crmOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private ResiEventServiceImpl resiEventService; |
|
|
|
@Autowired |
|
|
|
private EpmetMessageOpenFeignClient messageOpenFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -580,8 +585,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
"【事件研判分析】查询分类字典失败"); |
|
|
|
|
|
|
|
// 上报人信息
|
|
|
|
IcEventYpAnalysisResultDTO r = new IcEventYpAnalysisResultDTO(); |
|
|
|
String idCard = event.getIdCard(); |
|
|
|
String icResiId = null; |
|
|
|
List<IcEventYpAnalysisResultDTO.Dependent> dependents = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotBlank(idCard)) { |
|
|
|
IcResiUserDTO resiInfo = getResultDataOrThrowsException(userOpenFeignClient.getByResiIdCard(idCard), |
|
|
|
@ -590,14 +595,14 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
"【事件研判分析】根据身份证号查找居民信息失败", |
|
|
|
"【事件研判分析】根据身份证号查找居民信息失败"); |
|
|
|
if (resiInfo != null) { |
|
|
|
icResiId = resiInfo.getId(); |
|
|
|
r.setReportorResiId(resiInfo.getId()); |
|
|
|
r.setReportorAgencyId(resiInfo.getAgencyId()); |
|
|
|
r.setReportorGridId(resiInfo.getGridId()); |
|
|
|
} |
|
|
|
|
|
|
|
dependents = getDependents(event.getIdCard()); |
|
|
|
} |
|
|
|
|
|
|
|
IcEventYpAnalysisResultDTO r = new IcEventYpAnalysisResultDTO(); |
|
|
|
r.setReportorResiId(icResiId); |
|
|
|
r.setReportorName(event.getName()); |
|
|
|
r.setSourceTypeName(sourceTypeMap.get(event.getSourceType())); |
|
|
|
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<>(); |
|
|
|
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<IcEventDao, IcEventEntit |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复"); |
|
|
|
} |
|
|
|
//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.setCloseCaseTime(new Date()); |
|
|
|
} |
|
|
|
@ -889,7 +896,6 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
resultDTO.setCategoryCode(ca.getCategoryCode()); |
|
|
|
resultDTO.setParentCategoryName(ca.getParentCategoryName()); |
|
|
|
resultDTO.setCategoryName(ca.getCategoryName()); |
|
|
|
resultDTO.setCategoryName(ca.getParentCategoryName()+"-"+ca.getCategoryName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -992,14 +998,15 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
//2.查询事件回复信息
|
|
|
|
LinkedList<IcEventProcessListResultDTO> event = icEventReplyService.getByEventId(formDTO.getIcEventId()); |
|
|
|
|
|
|
|
|
|
|
|
//3.判断查询事件项目进展或需求进展信息
|
|
|
|
//项目进展
|
|
|
|
if ("1".equals(entity.getOperationType())) { |
|
|
|
ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO(); |
|
|
|
processListV2FormDTO.setProjectId(entity.getOperationId()); |
|
|
|
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())) { |
|
|
|
@ -1076,11 +1083,13 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
throw new EpmetException("查询用户信息失败"+formDTO.getUserId()); |
|
|
|
} |
|
|
|
entity.setReportUserId(formDTO.getUserId()); |
|
|
|
AtomicReference<String> 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<IcEventDao, IcEventEntit |
|
|
|
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){ |
|
|
|
int sort = NumConstant.ZERO; |
|
|
|
for (FileCommonDTO a : list) { |
|
|
|
|