|
@ -714,50 +714,37 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void closeIssue(CloseIssueFormDTO formDTO) { |
|
|
public void closeIssue(CloseIssueFormDTO formDTO) { |
|
|
//公开回复内容审核
|
|
|
//公开回复内容审核
|
|
|
if (StringUtils.isNotBlank(formDTO.getCloseReason())) { |
|
|
checkCloseReason(formDTO.getCloseReason()); |
|
|
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); |
|
|
|
|
|
TextTaskDTO taskDTO = new TextTaskDTO(); |
|
|
|
|
|
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
|
|
taskDTO.setContent(formDTO.getCloseReason()); |
|
|
|
|
|
textScanParamDTO.getTasks().add(taskDTO); |
|
|
|
|
|
Result<SyncScanResult> 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()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Date date = new Date(); |
|
|
Date nowTime = new Date(); |
|
|
//1:更新议题详情表数据
|
|
|
//1:更新议题详情表数据
|
|
|
IssueEntity entity = baseDao.selectById(formDTO.getIssueId()); |
|
|
IssueEntity entity = baseDao.selectById(formDTO.getIssueId()); |
|
|
if (null == entity) { |
|
|
if (null == entity) { |
|
|
throw new RenException(IssueConstant.SELECT_EXCEPTION); |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SELECT_EXCEPTION,"议题不存在"); |
|
|
} |
|
|
} |
|
|
if (IssueConstant.ISSUE_CLOSED.equals(entity.getIssueStatus())) { |
|
|
if (IssueConstant.ISSUE_CLOSED.equals(entity.getIssueStatus())) { |
|
|
throw new RenException(IssueConstant.OPERATION_EXCEPTION); |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.OPERATION_EXCEPTION,"议题不存在"); |
|
|
} |
|
|
} |
|
|
entity.setIssueStatus(IssueConstant.ISSUE_CLOSED); |
|
|
entity.setIssueStatus(IssueConstant.ISSUE_CLOSED); |
|
|
entity.setCloseReason(formDTO.getCloseReason()); |
|
|
entity.setCloseReason(formDTO.getCloseReason()); |
|
|
entity.setResolveType(formDTO.getResolveType()); |
|
|
entity.setResolveType(formDTO.getResolveType()); |
|
|
entity.setVotingDeadline(date); |
|
|
entity.setVotingDeadline(nowTime); |
|
|
entity.setClosedTime(date); |
|
|
entity.setClosedTime(nowTime); |
|
|
if (baseDao.updateById(entity) < NumConstant.ONE) { |
|
|
if (baseDao.updateById(entity) < NumConstant.ONE) { |
|
|
throw new RenException(IssueConstant.UPPDATE_EXCEPTION); |
|
|
throw new RenException(IssueConstant.UPPDATE_EXCEPTION); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//2:调用gov-org服务,查询组织网格名称
|
|
|
//2:调用gov-org服务,查询组织网格名称
|
|
|
AgencyGridResultDTO agencyGridResultDTO = new AgencyGridResultDTO(); |
|
|
/*AgencyGridResultDTO agencyGridResultDTO = new AgencyGridResultDTO(); |
|
|
agencyGridResultDTO.setAgencyId(entity.getOrgId()); |
|
|
agencyGridResultDTO.setAgencyId(entity.getOrgId()); |
|
|
agencyGridResultDTO.setGridId(entity.getGridId()); |
|
|
agencyGridResultDTO.setGridId(entity.getGridId()); |
|
|
Result<AgencyGridResultDTO> resultDTO = govOrgFeignClient.getAgencyAndGrid(agencyGridResultDTO); |
|
|
Result<AgencyGridResultDTO> resultDTO = govOrgFeignClient.getAgencyAndGrid(agencyGridResultDTO); |
|
|
if (!resultDTO.success() || null == resultDTO.getData()) { |
|
|
if (!resultDTO.success() || null == resultDTO.getData()) { |
|
|
throw new RenException(IssueConstant.SELECT_GOV_ORG_EXCEPTION); |
|
|
throw new RenException(IssueConstant.SELECT_GOV_ORG_EXCEPTION); |
|
|
} |
|
|
} |
|
|
agencyGridResultDTO = resultDTO.getData(); |
|
|
agencyGridResultDTO = resultDTO.getData();*/ |
|
|
|
|
|
//上面代码注释,改用缓存
|
|
|
|
|
|
GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(entity.getGridId()); |
|
|
//3:议题进展记录表新增数据
|
|
|
//3:议题进展记录表新增数据
|
|
|
IssueProcessEntity processEntity = new IssueProcessEntity(); |
|
|
IssueProcessEntity processEntity = new IssueProcessEntity(); |
|
|
processEntity.setIssueId(formDTO.getIssueId()); |
|
|
processEntity.setIssueId(formDTO.getIssueId()); |
|
@ -765,31 +752,27 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp |
|
|
processEntity.setOrgType(IssueConstant.ISSUE_GRID); |
|
|
processEntity.setOrgType(IssueConstant.ISSUE_GRID); |
|
|
processEntity.setOrgId(entity.getGridId()); |
|
|
processEntity.setOrgId(entity.getGridId()); |
|
|
processEntity.setOperationExplain(formDTO.getCloseReason()); |
|
|
processEntity.setOperationExplain(formDTO.getCloseReason()); |
|
|
processEntity.setOrgName(agencyGridResultDTO.getAgencyName() + "-" + agencyGridResultDTO.getGridName()); |
|
|
// processEntity.setOrgName(agencyGridResultDTO.getAgencyName() + "-" + agencyGridResultDTO.getGridName());
|
|
|
|
|
|
processEntity.setOrgName(gridInfoCache.getGridNamePath()); |
|
|
|
|
|
processEntity.setCreatedTime(nowTime); |
|
|
|
|
|
processEntity.setUpdatedTime(nowTime); |
|
|
|
|
|
processEntity.setCustomerId(entity.getCustomerId()); |
|
|
issueProcessDao.insert(processEntity); |
|
|
issueProcessDao.insert(processEntity); |
|
|
|
|
|
|
|
|
//4:调用epmet-message服务,给居民端话题创建人和议题发起人发送消息
|
|
|
//4:调用epmet-message服务,给居民端话题创建人和议题发起人发送消息
|
|
|
if (entity.getSourceType().equals(ModuleConstants.ISSUE_FROM_TOPIC)){ |
|
|
if (entity.getSourceType().equals(ModuleConstants.ISSUE_FROM_TOPIC)){ |
|
|
//4.1:调用resi-group查询话题创建人数据(目前议题来源只有来自话题)
|
|
|
//4.1:调用resi-group查询话题创建人数据(目前议题来源只有来自话题)
|
|
|
Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); |
|
|
sendToTopicAndShiftIssueResiUser(entity.getSourceId(),formDTO.getResolveType(),entity,formDTO.getCloseReason()); |
|
|
if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { |
|
|
}else if(entity.getSourceType().equals("ic_event")){ |
|
|
throw new RenException(IssueConstant.SELECT_TOPIC_EXCEPTION); |
|
|
ColseProjectOrDemandFormDTO colseProjectOrDemandFormDTO=new ColseProjectOrDemandFormDTO(); |
|
|
} |
|
|
colseProjectOrDemandFormDTO.setCustomerId(entity.getCustomerId()); |
|
|
ResiTopicDTO topicDTO = resultTopicDTO.getData(); |
|
|
colseProjectOrDemandFormDTO.setIcEventId(entity.getSourceId()); |
|
|
//4.2:创建消息模板
|
|
|
colseProjectOrDemandFormDTO.setType("issue"); |
|
|
String messageContent = ""; |
|
|
colseProjectOrDemandFormDTO.setUserId(formDTO.getCurrentUserId()); |
|
|
if (IssueConstant.ISSUE_RESOLVED.equals(formDTO.getResolveType())) { |
|
|
colseProjectOrDemandFormDTO.setCloseCaseTime(nowTime); |
|
|
messageContent = String.format(UserMessageConstant.ISSUE_RESOLVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason()); |
|
|
Result result = govProjectOpenFeignClient.closeProjectOrDemand(colseProjectOrDemandFormDTO); |
|
|
} else if (IssueConstant.ISSUE_UNRESOLVED.equals(formDTO.getResolveType())) { |
|
|
if (!result.success()) { |
|
|
messageContent = String.format(UserMessageConstant.ISSUE_UNRESOLVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason()); |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"议题关闭异常,该议题来源于事件,回写事件信息失败","议题关闭异常:事件办结异常"); |
|
|
} |
|
|
|
|
|
//4.3:调用服务,发送消息
|
|
|
|
|
|
if (!saveUserMessageList(topicDTO, messageContent, entity).success()) { |
|
|
|
|
|
throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION); |
|
|
|
|
|
} |
|
|
|
|
|
//4.4:2020.10.26 添加推送微信订阅消息功能 sun
|
|
|
|
|
|
if (!saveWxmpMessageList(topicDTO, messageContent, entity).success()) { |
|
|
|
|
|
logger.error("议题关闭,推送微信订阅消息失败!"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -805,6 +788,50 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 议题关闭时,填写的关闭理由,走内容审核 |
|
|
|
|
|
* @param closeReason |
|
|
|
|
|
*/ |
|
|
|
|
|
private void checkCloseReason(String closeReason) { |
|
|
|
|
|
if (StringUtils.isNotBlank(closeReason)) { |
|
|
|
|
|
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); |
|
|
|
|
|
TextTaskDTO taskDTO = new TextTaskDTO(); |
|
|
|
|
|
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
|
|
taskDTO.setContent(closeReason); |
|
|
|
|
|
textScanParamDTO.getTasks().add(taskDTO); |
|
|
|
|
|
Result<SyncScanResult> 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()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void sendToTopicAndShiftIssueResiUser(String topicId,String resolveType,IssueEntity issueEntity,String closeReason) { |
|
|
|
|
|
Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(topicId); |
|
|
|
|
|
if (resultTopicDTO.success() &&null != resultTopicDTO.getData()) { |
|
|
|
|
|
ResiTopicDTO topicDTO = resultTopicDTO.getData(); |
|
|
|
|
|
//4.2:创建消息模板
|
|
|
|
|
|
String messageContent = ""; |
|
|
|
|
|
if (IssueConstant.ISSUE_RESOLVED.equals(resolveType)) { |
|
|
|
|
|
messageContent = String.format(UserMessageConstant.ISSUE_RESOLVED_MSG, topicDTO.getTopicContent(), closeReason); |
|
|
|
|
|
} else if (IssueConstant.ISSUE_UNRESOLVED.equals(resolveType)) { |
|
|
|
|
|
messageContent = String.format(UserMessageConstant.ISSUE_UNRESOLVED_MSG, topicDTO.getTopicContent(), closeReason); |
|
|
|
|
|
} |
|
|
|
|
|
//4.3:调用服务,发送消息
|
|
|
|
|
|
if (!saveUserMessageList(topicDTO, messageContent, issueEntity).success()) { |
|
|
|
|
|
throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION); |
|
|
|
|
|
} |
|
|
|
|
|
//4.4:2020.10.26 添加推送微信订阅消息功能 sun
|
|
|
|
|
|
if (!saveWxmpMessageList(topicDTO, messageContent, issueEntity).success()) { |
|
|
|
|
|
logger.warn("议题关闭,推送微信订阅消息失败!"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 关闭议题时给话题创建人和议题发起人发送消息 |
|
|
* @Description 关闭议题时给话题创建人和议题发起人发送消息 |
|
|
* @author sun |
|
|
* @author sun |
|
|