|
|
@ -1457,39 +1457,43 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi |
|
|
|
|
|
|
|
result = issueResult.getData(); |
|
|
|
ValidatorUtils.validateEntity(result, FirstTopicShiftedToIssueApplicationResultDTO.SwitchRequiredGroup.class); |
|
|
|
if(StringUtils.equals("close",result.getAuditSwitch()))ValidatorUtils.validateEntity(result, FirstTopicShiftedToIssueApplicationResultDTO.ForbidAuditionGroup.class);else ValidatorUtils.validateEntity(result, FirstTopicShiftedToIssueApplicationResultDTO.AllowAuditionGroup.class); |
|
|
|
|
|
|
|
//5.修改话题shiftIssue字段
|
|
|
|
ResiTopicEntity topic2Upd = new ResiTopicEntity(); |
|
|
|
topic2Upd.setId(topicTurnIssueFromDTO.getTopicId()); |
|
|
|
topic2Upd.setUpdatedBy(topicTurnIssueFromDTO.getUserId()); |
|
|
|
topic2Upd.setShiftIssue(Boolean.TRUE); |
|
|
|
topic2Upd.setIssueId(issueResult.getData().getIssueId()); |
|
|
|
topic2Upd.setUpdatedTime(now); |
|
|
|
int topicResult = baseDao.updateOne(topic2Upd); |
|
|
|
//6.新增话题操作记录
|
|
|
|
if (topicResult == NumConstant.ONE) { |
|
|
|
ResiTopicOperationEntity operation = new ResiTopicOperationEntity(); |
|
|
|
operation.setCreatedTime(now); |
|
|
|
operation.setCreatedBy(topicTurnIssueFromDTO.getUserId()); |
|
|
|
operation.setTopicId(topicTurnIssueFromDTO.getTopicId()); |
|
|
|
operation.setOperationType(ModuleConstant.TOPIC_OPERATION_TYPE_SHIFT_ISSUE); |
|
|
|
int operationResult = resiTopicOperationDao.insertOneByParams(operation); |
|
|
|
if (operationResult != NumConstant.ONE) { |
|
|
|
logger.warn(ModuleConstant.FAILURE_TO_ADD_TOPIC_OPERATION); |
|
|
|
if(StringUtils.equals("close",result.getAuditSwitch())) { |
|
|
|
ValidatorUtils.validateEntity(result, FirstTopicShiftedToIssueApplicationResultDTO.ForbidAuditionGroup.class); |
|
|
|
//5.修改话题shiftIssue字段
|
|
|
|
ResiTopicEntity topic2Upd = new ResiTopicEntity(); |
|
|
|
topic2Upd.setId(topicTurnIssueFromDTO.getTopicId()); |
|
|
|
topic2Upd.setUpdatedBy(topicTurnIssueFromDTO.getUserId()); |
|
|
|
topic2Upd.setShiftIssue(Boolean.TRUE); |
|
|
|
topic2Upd.setIssueId(issueResult.getData().getIssueId()); |
|
|
|
topic2Upd.setUpdatedTime(now); |
|
|
|
int topicResult = baseDao.updateOne(topic2Upd); |
|
|
|
//6.新增话题操作记录
|
|
|
|
if (topicResult == NumConstant.ONE) { |
|
|
|
ResiTopicOperationEntity operation = new ResiTopicOperationEntity(); |
|
|
|
operation.setCreatedTime(now); |
|
|
|
operation.setCreatedBy(topicTurnIssueFromDTO.getUserId()); |
|
|
|
operation.setTopicId(topicTurnIssueFromDTO.getTopicId()); |
|
|
|
operation.setOperationType(ModuleConstant.TOPIC_OPERATION_TYPE_SHIFT_ISSUE); |
|
|
|
int operationResult = resiTopicOperationDao.insertOneByParams(operation); |
|
|
|
if (operationResult != NumConstant.ONE) { |
|
|
|
logger.warn(ModuleConstant.FAILURE_TO_ADD_TOPIC_OPERATION); |
|
|
|
} |
|
|
|
} else logger.warn(ModuleConstant.FAILURE_TO_UPDATE_TOPIC); |
|
|
|
//7.更新组统计信息 议题数量+1
|
|
|
|
resiGroupStatisticalDao.incryTotalIssues(group.getGroupId()); |
|
|
|
if (null != groupCache && null != groupCache.getGroupStatisticalInfo()) { |
|
|
|
groupCache.getGroupStatisticalInfo().setTotalIssues( |
|
|
|
null == groupCache.getGroupStatisticalInfo().getTotalIssues() ? NumConstant.ONE |
|
|
|
: groupCache.getGroupStatisticalInfo().getTotalIssues() + NumConstant.ONE |
|
|
|
); |
|
|
|
resiGroupRedis.set(groupCache); |
|
|
|
} |
|
|
|
} else logger.warn(ModuleConstant.FAILURE_TO_UPDATE_TOPIC); |
|
|
|
//7.更新组统计信息 议题数量+1
|
|
|
|
resiGroupStatisticalDao.incryTotalIssues(group.getGroupId()); |
|
|
|
if (null != groupCache && null != groupCache.getGroupStatisticalInfo()) { |
|
|
|
groupCache.getGroupStatisticalInfo().setTotalIssues( |
|
|
|
null == groupCache.getGroupStatisticalInfo().getTotalIssues() ? NumConstant.ONE |
|
|
|
: groupCache.getGroupStatisticalInfo().getTotalIssues() + NumConstant.ONE |
|
|
|
); |
|
|
|
resiGroupRedis.set(groupCache); |
|
|
|
} |
|
|
|
else { |
|
|
|
ValidatorUtils.validateEntity(result, FirstTopicShiftedToIssueApplicationResultDTO.AllowAuditionGroup.class); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}else throw new RenException(dataFilterResult.getMsg()); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|