|
|
@ -18,24 +18,28 @@ |
|
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
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.Result; |
|
|
|
import com.epmet.commons.tools.utils.ScanContentUtils; |
|
|
|
import com.epmet.constant.EventConstant; |
|
|
|
import com.epmet.constant.ResiEventAction; |
|
|
|
import com.epmet.constant.*; |
|
|
|
import com.epmet.dao.*; |
|
|
|
import com.epmet.dto.CustomerAgencyDTO; |
|
|
|
import com.epmet.dto.form.ReplyFormDTO; |
|
|
|
import com.epmet.dto.form.ReplyListFormDTO; |
|
|
|
import com.epmet.dto.form.UserMessageFormDTO; |
|
|
|
import com.epmet.dto.result.GridInfoResultDTO; |
|
|
|
import com.epmet.dto.result.ReplyListResultDTO; |
|
|
|
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|
|
|
import com.epmet.entity.ResiEventEntity; |
|
|
|
import com.epmet.entity.ResiEventOperationLogEntity; |
|
|
|
import com.epmet.entity.ResiEventReplyEntity; |
|
|
|
import com.epmet.entity.*; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
import com.epmet.service.ResiEventReplyService; |
|
|
@ -71,6 +75,8 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao |
|
|
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
|
|
|
|
|
@Value("${openapi.scan.server.url}") |
|
|
|
private String scanApiUrl; |
|
|
@ -140,6 +146,32 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao |
|
|
|
eventEntity.setLatestOperatedTime(resiEventReplyEntity.getCreatedTime()); |
|
|
|
resiEventDao.updateById(eventEntity); |
|
|
|
// 3、组织改为不显示已经在查看详情中操作了 ,目前只有一个组织,如果后面可以报给多个组织,这里入参要增加orgId todo
|
|
|
|
|
|
|
|
//2021.12.21 给报事人推送站内信 sun start
|
|
|
|
//查询事件上报给网格还是组织信息
|
|
|
|
ResiEventReportOrgEntity reportOrgEntity = resiEventReportOrgDao.getByEventId(eventEntity.getId()); |
|
|
|
String name = staffResult.getData().getOrganizationName(); |
|
|
|
if ("grid".equals(reportOrgEntity.getOrgType())) { |
|
|
|
Result<GridInfoResultDTO> gridInfoRes = govOrgOpenFeignClient.queryGridInfo(reportOrgEntity.getOrgId()); |
|
|
|
if (!gridInfoRes.success() || null == gridInfoRes.getData()) { |
|
|
|
throw new RenException("网格信息查询异常"); |
|
|
|
} |
|
|
|
name = gridInfoRes.getData().getGridName(); |
|
|
|
} |
|
|
|
UserMessageFormDTO userMessage = new UserMessageFormDTO(); |
|
|
|
userMessage.setApp(AppClientConstant.APP_RESI); |
|
|
|
userMessage.setCustomerId(replyFormDTO.getCustomerId()); |
|
|
|
userMessage.setGridId(eventEntity.getGridId()); |
|
|
|
String messageContent = String.format(UserMessageConstant.REPLY_EVENT, name); |
|
|
|
userMessage.setMessageContent(messageContent); |
|
|
|
userMessage.setReadFlag(ReadFlagConstant.UN_READ); |
|
|
|
userMessage.setTitle(UserMessageConstant.EVENT_TITILE); |
|
|
|
userMessage.setMessageType(UserMessageTypeConstant.EVENT); |
|
|
|
userMessage.setTargetId(eventEntity.getId()); |
|
|
|
//通知事件上报人
|
|
|
|
userMessage.setUserId(eventEntity.getReportUserId()); |
|
|
|
epmetMessageOpenFeignClient.saveUserMessage(userMessage); |
|
|
|
//2021.12.21 给报事人推送站内信 sun end
|
|
|
|
} |
|
|
|
|
|
|
|
private ResiEventEntity queryResiEntity(String resiEventId) { |
|
|
@ -254,6 +286,25 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao |
|
|
|
resiEventDao.updateById(eventEntity); |
|
|
|
// 3、组织改为显示
|
|
|
|
resiEventReportOrgDao.updateRedDotShow(replyFormDTO.getResiEventId()); |
|
|
|
|
|
|
|
//2021.12.21 给报事人推送站内信 sun start
|
|
|
|
//查询被@的人大代表信息
|
|
|
|
ResiEventMentionEntity eventMentionEntity = resiEventMentionDao.selectUser(replyFormDTO.getResiEventId(), replyFormDTO.getUserId()); |
|
|
|
String name = "人大代表" + eventMentionEntity.getUserShowName(); |
|
|
|
UserMessageFormDTO userMessage = new UserMessageFormDTO(); |
|
|
|
userMessage.setApp(AppClientConstant.APP_RESI); |
|
|
|
userMessage.setCustomerId(replyFormDTO.getCustomerId()); |
|
|
|
userMessage.setGridId(eventEntity.getGridId()); |
|
|
|
String messageContent = String.format(UserMessageConstant.REPLY_EVENT, name); |
|
|
|
userMessage.setMessageContent(messageContent); |
|
|
|
userMessage.setReadFlag(ReadFlagConstant.UN_READ); |
|
|
|
userMessage.setTitle(UserMessageConstant.EVENT_TITILE); |
|
|
|
userMessage.setMessageType(UserMessageTypeConstant.EVENT); |
|
|
|
userMessage.setTargetId(eventEntity.getId()); |
|
|
|
//通知事件上报人
|
|
|
|
userMessage.setUserId(eventEntity.getReportUserId()); |
|
|
|
epmetMessageOpenFeignClient.saveUserMessage(userMessage); |
|
|
|
//2021.12.21 给报事人推送站内信 sun end
|
|
|
|
} |
|
|
|
|
|
|
|
private void scanReplyContent(String content) { |
|
|
|