|
@ -3227,6 +3227,8 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
if (ProjectConstant.CLOSED.equals(p.getStatus())) { |
|
|
if (ProjectConstant.CLOSED.equals(p.getStatus())) { |
|
|
p.setDepartmentNameList(departmentNameList); |
|
|
p.setDepartmentNameList(departmentNameList); |
|
|
p.setDetentionDays(NumConstant.ZERO_STR); |
|
|
p.setDetentionDays(NumConstant.ZERO_STR); |
|
|
|
|
|
p.setProcessable(false); |
|
|
|
|
|
p.setReturnable(false); |
|
|
} else { |
|
|
} else { |
|
|
ProjectDTO projectDTO = ConvertUtils.sourceToTarget(p, ProjectDTO.class); |
|
|
ProjectDTO projectDTO = ConvertUtils.sourceToTarget(p, ProjectDTO.class); |
|
|
projectDTO.setId(p.getProjectId()); |
|
|
projectDTO.setId(p.getProjectId()); |
|
@ -3240,6 +3242,44 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
} |
|
|
} |
|
|
departmentNameList = baseDao.selectDepartmentNameList(projectDTO); |
|
|
departmentNameList = baseDao.selectDepartmentNameList(projectDTO); |
|
|
p.setDepartmentNameList(departmentNameList); |
|
|
p.setDepartmentNameList(departmentNameList); |
|
|
|
|
|
ProjectStaffDTO projectStaffDTO = new ProjectStaffDTO(); |
|
|
|
|
|
projectStaffDTO.setProjectId(p.getProjectId()); |
|
|
|
|
|
projectStaffDTO.setStaffId(formDTO.getUserId()); |
|
|
|
|
|
List<DepartmentResultDTO> departmentList = projectStaffService.getDepartmentNameList(projectStaffDTO); |
|
|
|
|
|
if (null != departmentList && departmentList.size() > NumConstant.ZERO) { |
|
|
|
|
|
//TODO external_system值为1时,根据departmentList里的projectStaffId在project_sub_process表找最新的一条记录,
|
|
|
|
|
|
// 如果没有记录或者INTERNAL_STATUS是closed,processable的值为true
|
|
|
|
|
|
CustomerProjectParameterDTO customerProjectParameterDTO = new CustomerProjectParameterDTO(); |
|
|
|
|
|
customerProjectParameterDTO.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
customerProjectParameterDTO.setParameterKey(ProjectConstant.EXTERNAL_SYSTEM); |
|
|
|
|
|
String parameterValue = parameterService.getParameterValueByKey(customerProjectParameterDTO); |
|
|
|
|
|
if (StringUtils.isNotEmpty(parameterValue)){ |
|
|
|
|
|
if (parameterValue.equals(NumConstant.ONE_STR)) { |
|
|
|
|
|
List<String> projectStaffIds = departmentList.stream().map(m -> m.getProjectStaffId()).distinct().collect(Collectors.toList()); |
|
|
|
|
|
// 根据departmentList里的projectStaffId在project_sub_process表找最新的一条记录
|
|
|
|
|
|
ProjectSubProcessDTO projectSubProcessDTO = projectSubProcessService.selectSubProcess(projectStaffIds); |
|
|
|
|
|
if (null == projectSubProcessDTO || projectSubProcessDTO.getInternalStatus().equals(ProjectConstant.CLOSED)) { |
|
|
|
|
|
p.setProcessable(true); |
|
|
|
|
|
} else { |
|
|
|
|
|
p.setProcessable(false); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
p.setProcessable(true); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
p.setProcessable(true); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
p.setProcessable(false); |
|
|
|
|
|
} |
|
|
|
|
|
ReturnListFromDTO returnListFromDTO = new ReturnListFromDTO(); |
|
|
|
|
|
returnListFromDTO.setProjectId(p.getProjectId()); |
|
|
|
|
|
List<ReturnListResultDTO> returnableList = projectProcessService.getReturnableList(returnListFromDTO); |
|
|
|
|
|
if (null != returnableList && returnableList.size() > NumConstant.ZERO) { |
|
|
|
|
|
p.setReturnable(true); |
|
|
|
|
|
} else { |
|
|
|
|
|
p.setReturnable(false); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); |
|
|
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); |
|
|