| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -27,8 +27,12 @@ import com.epmet.commons.tools.constant.NumConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.EpmetErrorCode; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.page.PageData; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					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.ConvertUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.Result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ScanContentUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.ParameterKeyConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.ProjectConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.UserMessageConstant; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -48,6 +52,7 @@ import com.epmet.redis.ProjectRedis; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Value; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.stereotype.Service; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.transaction.annotation.Transactional; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -82,6 +87,10 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private MessageFeignClient messageFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private ProjectRelatedPersonnelService projectRelatedPersonnelService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Value("${openapi.scan.server.url}") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private String scanApiUrl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Value("${openapi.scan.method.textSyncScan}") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private String textSyncScanMethod; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private final static String ONE_DAY = "<1"; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -290,6 +299,20 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						public void closed(ProjectClosedFromDTO fromDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//公开回复内容审核
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							TextTaskDTO taskDTO = new TextTaskDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							taskDTO.setContent(fromDTO.getPublicReply()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							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()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//更新项目表状态
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -298,7 +321,6 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							projectEntity.setStatus(ProjectConstant.CLOSED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							projectEntity.setClosedStatus(fromDTO.getClosedStatus()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							baseDao.updateById(projectEntity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//更新项目关联表
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ProjectStaffEntity projectStaffEntity = new ProjectStaffEntity(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							projectStaffEntity.setId(fromDTO.getProjectStaffId()); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -353,6 +375,20 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						@Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						public void projectReturn(ReturnFromDTO fromDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//公开回复内容审核
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							TextTaskDTO taskDTO = new TextTaskDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							taskDTO.setContent(fromDTO.getPublicReply()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							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()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode()); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |