|
|
@ -1797,38 +1797,10 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi |
|
|
|
if(null == group) { |
|
|
|
throw new RenException(ModuleConstant.FAILURE_TO_TURN_ISSUE); |
|
|
|
} |
|
|
|
TopicInfoFormDTO topicId = new TopicInfoFormDTO(); |
|
|
|
topicId.setTopicId(topicTurnIssueFromDTO.getTopicId()); |
|
|
|
Integer issueCount = govIssueFeignClient.checkTopicShiftIssue(topicId).getData(); |
|
|
|
if (issueCount != NumConstant.ZERO){ |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), ModuleConstant.ALREADY_SHIFT_ISSUE, ModuleConstant.ALREADY_SHIFT_ISSUE); |
|
|
|
} |
|
|
|
|
|
|
|
// 是否已经转议题?
|
|
|
|
checkShiftedIssue(topicTurnIssueFromDTO.getTopicId()); |
|
|
|
// 话题转议题审核:标题、建议
|
|
|
|
String issueTitle = topicTurnIssueFromDTO.getIssueTitle(); |
|
|
|
String suggestion = topicTurnIssueFromDTO.getSuggestion(); |
|
|
|
if (StringUtils.isNotBlank(issueTitle) || StringUtils.isNotBlank(suggestion)) { |
|
|
|
TextScanParamDTO textScan = new TextScanParamDTO(); |
|
|
|
//标题
|
|
|
|
TextTaskDTO taskTitle = new TextTaskDTO(); |
|
|
|
taskTitle.setContent(issueTitle); |
|
|
|
taskTitle.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
textScan.getTasks().add(taskTitle); |
|
|
|
//建议
|
|
|
|
TextTaskDTO taskSuggestion = new TextTaskDTO(); |
|
|
|
taskSuggestion.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
taskSuggestion.setContent(suggestion); |
|
|
|
textScan.getTasks().add(taskSuggestion); |
|
|
|
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); |
|
|
|
if (!textSyncScanResult.success()) { |
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
|
|
} else { |
|
|
|
if (!textSyncScanResult.getData().isAllPass()) { |
|
|
|
log.error(String.format(TopicConstant.SHIFT_ISSUE, issueTitle, suggestion)); |
|
|
|
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
scanIssueContent(topicTurnIssueFromDTO.getIssueTitle(),topicTurnIssueFromDTO.getSuggestion()); |
|
|
|
FirstTopicShiftedToIssueApplicationResultDTO result = null; |
|
|
|
|
|
|
|
//1.统一时间(群组服务 -> 议题服务)
|
|
|
@ -1856,6 +1828,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi |
|
|
|
issueInfo.setGroupName(null == groupCache ? ModuleConstant.EMPTY_STR : groupCache.getGroupName()); |
|
|
|
issueInfo.setVotableCount(resiGroupMemberService.gridResiCount(group.getGridId())); |
|
|
|
issueInfo.setGroupId(group.getGroupId()); |
|
|
|
issueInfo.setLatitude(group.getLocateDimension()); |
|
|
|
issueInfo.setLongitude(group.getLocateLongitude()); |
|
|
|
issueInfo.setAddress(group.getLocateAddress()); |
|
|
|
//4.调用gov-issue新增议题
|
|
|
|
Result<FirstTopicShiftedToIssueApplicationResultDTO> issueResult = issueOpenFeignClient.topicShiftedToIssueV2(issueInfo); |
|
|
|
if (issueResult == null || !issueResult.success() || null == issueResult.getData()) { |
|
|
@ -1994,6 +1969,53 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 话题已转议题,请勿重复操作 |
|
|
|
* @param topicId |
|
|
|
*/ |
|
|
|
private void checkShiftedIssue(String topicId) { |
|
|
|
TopicInfoFormDTO topicInfoFormDTO = new TopicInfoFormDTO(); |
|
|
|
topicInfoFormDTO.setTopicId(topicId); |
|
|
|
Result<Integer> result = govIssueFeignClient.checkTopicShiftIssue(topicInfoFormDTO); |
|
|
|
if (result.success()) { |
|
|
|
Integer issueCount = result.getData(); |
|
|
|
if (issueCount != NumConstant.ZERO) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), ModuleConstant.ALREADY_SHIFT_ISSUE, ModuleConstant.ALREADY_SHIFT_ISSUE); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 审核提出来 |
|
|
|
* @param issueTitle |
|
|
|
* @param suggestion |
|
|
|
*/ |
|
|
|
private void scanIssueContent(String issueTitle, String suggestion) { |
|
|
|
//话题转议题审核:标题、建议
|
|
|
|
if (StringUtils.isNotBlank(issueTitle) || StringUtils.isNotBlank(suggestion)) { |
|
|
|
TextScanParamDTO textScan = new TextScanParamDTO(); |
|
|
|
//标题
|
|
|
|
TextTaskDTO taskTitle = new TextTaskDTO(); |
|
|
|
taskTitle.setContent(issueTitle); |
|
|
|
taskTitle.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
textScan.getTasks().add(taskTitle); |
|
|
|
//建议
|
|
|
|
TextTaskDTO taskSuggestion = new TextTaskDTO(); |
|
|
|
taskSuggestion.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
taskSuggestion.setContent(suggestion); |
|
|
|
textScan.getTasks().add(taskSuggestion); |
|
|
|
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); |
|
|
|
if (!textSyncScanResult.success()) { |
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
|
|
} else { |
|
|
|
if (!textSyncScanResult.getData().isAllPass()) { |
|
|
|
log.error(String.format(TopicConstant.SHIFT_ISSUE, issueTitle, suggestion)); |
|
|
|
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 工作端审核议题通过时获取一些议题相关信息 |
|
|
|
* @param param |
|
|
@ -2019,7 +2041,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi |
|
|
|
} |
|
|
|
|
|
|
|
IssueShiftedFromTopicFormDTO issueInfo = ConvertUtils.sourceToTarget(param, IssueShiftedFromTopicFormDTO.class); |
|
|
|
|
|
|
|
issueInfo.setAddress(group.getLocateAddress()); |
|
|
|
issueInfo.setLongitude(group.getLocateLongitude()); |
|
|
|
issueInfo.setLatitude(group.getLocateDimension()); |
|
|
|
issueInfo.setCreatedTime(param.getUnifiedDate()); |
|
|
|
issueInfo.setGridId(group.getGridId()); |
|
|
|
issueInfo.setCustomerId(group.getCustomerId()); |
|
|
|