|
|
@ -1760,4 +1760,84 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @Description 处理响应V2.0接口 |
|
|
|
* @author sun |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void responseV2(ProjectResponseFormDTO formDTO) { |
|
|
|
//公开回复内容审核
|
|
|
|
if (com.alibaba.nacos.client.utils.StringUtils.isNotBlank(formDTO.getPublicReply())) { |
|
|
|
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); |
|
|
|
TextTaskDTO taskDTO = new TextTaskDTO(); |
|
|
|
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
taskDTO.setContent(formDTO.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(formDTO.getProjectId()); |
|
|
|
if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) { |
|
|
|
throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode()); |
|
|
|
} |
|
|
|
ProjectStaffDTO projectStaff = projectStaffService.getLatestIdByProjectIdAndStaffId(formDTO.getProjectId(),formDTO.getUserId()); |
|
|
|
if(null == projectStaff){ |
|
|
|
log.error("com.epmet.service.impl.ProjectServiceImpl.response,project_staff表中没有与之对应的数据,传参:{}", JSON.toJSONString(formDTO)); |
|
|
|
throw new RenException("未找到项目相关人员记录"); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(formDTO.getProjectStaffId())){ |
|
|
|
formDTO.setProjectStaffId(projectStaff.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
//处理响应记录加入项目进展表
|
|
|
|
ProjectProcessEntity projectProcessEntity = new ProjectProcessEntity(); |
|
|
|
projectProcessEntity.setProjectId(formDTO.getProjectId()); |
|
|
|
projectProcessEntity.setCustomerId(projectStaff.getCustomerId()); |
|
|
|
projectProcessEntity.setDepartmentName(formDTO.getDepartmentName()); |
|
|
|
projectProcessEntity.setOrgIdPath(projectStaff.getOrgIdPath()); |
|
|
|
projectProcessEntity.setGridId(projectStaff.getGridId()); |
|
|
|
projectProcessEntity.setDepartmentId(projectStaff.getDepartmentId()); |
|
|
|
projectProcessEntity.setAgencyId(projectStaff.getOrgId()); |
|
|
|
projectProcessEntity.setOperation(ProjectConstant.OPERATION_RESPONSES); |
|
|
|
projectProcessEntity.setOperationName(ProjectConstant.OPERATION_RESPONSES_NAME); |
|
|
|
projectProcessEntity.setPublicReply(formDTO.getPublicReply()); |
|
|
|
projectProcessEntity.setInternalRemark(formDTO.getInternalRemark()); |
|
|
|
projectProcessEntity.setStaffId(formDTO.getUserId()); |
|
|
|
projectProcessService.insert(projectProcessEntity); |
|
|
|
|
|
|
|
//项目附件表新增数据 sun 2020.12.22
|
|
|
|
if (formDTO.getPublicFile().size() > NumConstant.ZERO || formDTO.getInternalFile().size() > NumConstant.ZERO) { |
|
|
|
saveFile(formDTO.getPublicFile(), formDTO.getInternalFile(), projectStaff.getCustomerId(), formDTO.getProjectId(), projectProcessEntity.getId()); |
|
|
|
}//end
|
|
|
|
|
|
|
|
//项目节点历时
|
|
|
|
ProjectOrgRelationEntity relationEntity = relationDao.selectByProjectStaffId(formDTO.getProjectStaffId()); |
|
|
|
if(null != relationEntity){ |
|
|
|
ProjectOrgRelationEntity relationDto = new ProjectOrgRelationEntity(); |
|
|
|
relationDto.setProjectStaffId(relationEntity.getProjectStaffId()); |
|
|
|
if(null == relationEntity.getFirstDealtDate()){ |
|
|
|
Date current = new Date(); |
|
|
|
relationDto.setFirstDealtDate(current); |
|
|
|
relationDto.setFirstReplyPeriod(calculateDelta_T(ProjectConstant.IMPRECISE_CALCULATION, |
|
|
|
ProjectConstant.CALCULATION_TYPE_DEFAULT,projectStaff.getId(), |
|
|
|
relationEntity.getInformedDate(),current)); |
|
|
|
relationDto.setOperation(ProjectConstant.OPERATION_RESPONSES); |
|
|
|
relationDao.maintainTimePropertyConsistency(relationDto); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
log.error("com.epmet.service.impl.ProjectServiceImpl#response,没有找到相关的节点耗时记录,参数:{}",JSON.toJSONString(formDTO)); |
|
|
|
throw new RenException("没有找到相关的节点耗时记录"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |