|
|
@@ -27,6 +27,7 @@ import com.ningdatech.pmapi.todocenter.model.vo.*; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.vo.TodoNumVO; |
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
|
import com.wflow.contants.HisProInsEndActId; |
|
|
|
import com.wflow.workflow.bean.dto.ReqAuditOpinionSaveDTO; |
|
|
|
import com.wflow.workflow.bean.process.ProcessComment; |
|
|
|
import com.wflow.workflow.bean.process.enums.NodeTypeEnum; |
|
|
|
import com.wflow.workflow.utils.ProcessTaskUtils; |
|
|
@@ -1093,13 +1094,15 @@ public class TodoCenterManage { |
|
|
|
.eq(ProjectApplication::getProjectCode, project.getProjectCode())); |
|
|
|
}else { |
|
|
|
//采取批量删除 批量添加的方式 批量删除建设方案申报后的应用信息 |
|
|
|
List<Long> projectIdList = projectService.list(Wrappers.lambdaQuery(Project.class) |
|
|
|
.eq(Project::getProjectCode, projectInfo.getProjectCode()) |
|
|
|
//采取批量删除 批量添加的方式 批量删除建设方案申报后的应用信息 |
|
|
|
List<String> projectCodeList = projectService.list(Wrappers.lambdaQuery(Project.class) |
|
|
|
.eq(Project::getProjectCode, project.getProjectCode()) |
|
|
|
.eq(Project::getIsConstruct, Boolean.TRUE)).stream() |
|
|
|
.map(Project::getId).collect(Collectors.toList()); |
|
|
|
.map(Project::getProjectCode).collect(Collectors.toList()); |
|
|
|
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
.eq(ProjectApplication::getProjectCode,projectInfo.getProjectCode()) |
|
|
|
.in(ProjectApplication::getProjectId,projectIdList)); |
|
|
|
.eq(ProjectApplication::getProjectCode,project.getProjectCode()) |
|
|
|
.in(CollUtil.isNotEmpty(projectCodeList),ProjectApplication::getProjectCode,projectCodeList) |
|
|
|
.eq(ProjectApplication::getIsConstruct,Boolean.TRUE)); |
|
|
|
} |
|
|
|
if(isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())){ |
|
|
|
//批量添加 |
|
|
@@ -1148,12 +1151,6 @@ public class TodoCenterManage { |
|
|
|
String areaCode = project.getAreaCode(); |
|
|
|
String areaName = project.getArea(); |
|
|
|
Long pretrialFileId = project.getPretrialFileId(); |
|
|
|
// 如果项目关联的预审文件ID不为空,说明已经提交过审核意见,直接返回文件ID |
|
|
|
if (Objects.nonNull(pretrialFileId)){ |
|
|
|
notSealedInfoVo.setFileId(pretrialFileId); |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
return notSealedInfoVo; |
|
|
|
} |
|
|
|
Region region = regionService.getOne(Wrappers.lambdaQuery(Region.class) |
|
|
|
.eq(Region::getRegionCode, areaCode) |
|
|
|
.eq(Region::getRegionName,areaName)); |
|
|
@@ -1172,6 +1169,10 @@ public class TodoCenterManage { |
|
|
|
switch (regionLevel) { |
|
|
|
// 市级预审(市本级) |
|
|
|
case RegionConst.RL_CITY: |
|
|
|
// 如果项目关联的预审文件ID不为空,说明已经提交过审核意见,直接返回文件ID |
|
|
|
if (Boolean.TRUE.equals(getCityNotSealedInfoVO(pretrialFileId, notSealedInfoVo))) { |
|
|
|
return notSealedInfoVo; |
|
|
|
} |
|
|
|
String cityTemplateName = TodoCenterConstant.SealTemplate.CITY_TEMPLATE; |
|
|
|
// 设置pdf模板参数 |
|
|
|
JSONObject cityParamsMap = assemblyPdfParams(project,cityTemplateName); |
|
|
@@ -1185,9 +1186,7 @@ public class TodoCenterManage { |
|
|
|
} |
|
|
|
Long cityPdfId = generateNotSealedPdf(projectId, cityTemplateName, cityParamsMap); |
|
|
|
notSealedInfoVo.setFileId(cityPdfId); |
|
|
|
if (StringUtils.isNotBlank(auditOpinion)) { |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
} |
|
|
|
checkAuditOpinion(auditOpinion, notSealedInfoVo); |
|
|
|
return notSealedInfoVo; |
|
|
|
// 区县预审 |
|
|
|
case RegionConst.RL_COUNTY: |
|
|
@@ -1199,6 +1198,11 @@ public class TodoCenterManage { |
|
|
|
// 以是否有上级主管单位的维度判断(有上级条线主管单位,才有可能需要盖两次章) |
|
|
|
if (CommonEnum.YES.getCode().equals(isHigherSuperOrg)) { |
|
|
|
// 盖章审核登录用户所在单位为上级条线主管单位,此时为区县预审盖章流程第一个章 |
|
|
|
// 如果项目关联的预审文件ID和上级条线审核意见不为空,说明已经提交过审核意见,直接返回文件ID |
|
|
|
if (Boolean.TRUE.equals(getCountryNotSealedInfoVO(pretrialFileId, notSealedInfoVo, |
|
|
|
project.getCountrySealAuditOpinion()))){ |
|
|
|
return notSealedInfoVo; |
|
|
|
} |
|
|
|
if (empPosUnitCode.equals(higherSuperOrgCode)) { |
|
|
|
// 有上级条线主管单位信息且登录用户所在单位是上级条线主管单位, |
|
|
|
countryParamsMap.put("higherOrgOpinion", auditOpinion); |
|
|
@@ -1245,6 +1249,10 @@ public class TodoCenterManage { |
|
|
|
} |
|
|
|
// 没有上级主管条线单位 |
|
|
|
else if (CommonEnum.NO.getCode().equals(isHigherSuperOrg)) { |
|
|
|
// 如果项目关联的预审文件ID不为空,说明已经提交过审核意见,直接返回文件ID |
|
|
|
if (Boolean.TRUE.equals(getCityNotSealedInfoVO(pretrialFileId, notSealedInfoVo))) { |
|
|
|
return notSealedInfoVo; |
|
|
|
} |
|
|
|
// 有本级主管单位信息 |
|
|
|
if (CommonEnum.YES.getCode().equals(isSuperOrg)) { |
|
|
|
// 登录用户所在单位是本级主管单位,装配本级主管单位审核意见 |
|
|
@@ -1265,9 +1273,7 @@ public class TodoCenterManage { |
|
|
|
} |
|
|
|
} |
|
|
|
notSealedInfoVo.setFileId(notSealedId); |
|
|
|
if (StringUtils.isNotBlank(auditOpinion)) { |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
} |
|
|
|
checkAuditOpinion(auditOpinion, notSealedInfoVo); |
|
|
|
return notSealedInfoVo; |
|
|
|
default: |
|
|
|
throw new IllegalStateException("Unexpected value: " + regionLevel); |
|
|
@@ -1277,9 +1283,7 @@ public class TodoCenterManage { |
|
|
|
else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)){ |
|
|
|
Long constructFileId = project.getConstructFileId(); |
|
|
|
// 如果项目关联的建设方案文件ID不为空,说明已经提交过审核意见,直接返回文件ID |
|
|
|
if (Objects.nonNull(constructFileId)){ |
|
|
|
notSealedInfoVo.setFileId(constructFileId); |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
if (Boolean.TRUE.equals(getCityNotSealedInfoVO(constructFileId, notSealedInfoVo))) { |
|
|
|
return notSealedInfoVo; |
|
|
|
} |
|
|
|
// 设置pdf模板参数 |
|
|
@@ -1291,14 +1295,36 @@ public class TodoCenterManage { |
|
|
|
constructParamsMap.put("bigDataBureauAuditDate",auditDate); |
|
|
|
Long constructNotFileId = generateNotSealedPdf(projectId, constructTemplateName, constructParamsMap); |
|
|
|
notSealedInfoVo.setFileId(constructNotFileId); |
|
|
|
if (StringUtils.isNotBlank(auditOpinion)) { |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
} |
|
|
|
checkAuditOpinion(auditOpinion, notSealedInfoVo); |
|
|
|
return notSealedInfoVo; |
|
|
|
} |
|
|
|
return notSealedInfoVo; |
|
|
|
} |
|
|
|
|
|
|
|
private void checkAuditOpinion(String auditOpinion, NotSealedInfoVO notSealedInfoVo) { |
|
|
|
if (StringUtils.isNotBlank(auditOpinion)) { |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private Boolean getCityNotSealedInfoVO(Long fileId,NotSealedInfoVO notSealedInfoVo) { |
|
|
|
if (Objects.nonNull(fileId)){ |
|
|
|
notSealedInfoVo.setFileId(fileId); |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
return true; |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
private Boolean getCountryNotSealedInfoVO(Long fileId,NotSealedInfoVO notSealedInfoVo,String auditOpinion) { |
|
|
|
if (Objects.nonNull(fileId) && StringUtils.isNotBlank(auditOpinion)){ |
|
|
|
notSealedInfoVo.setFileId(fileId); |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
return true; |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
private SealInfoDTO getHigherSealInfoDTO(Project project, JSONObject countryParamsMap) { |
|
|
|
String countrySealAuditOpinion = project.getCountrySealAuditOpinion(); |
|
|
|
String countrySealAuditDate = project.getCountrySealAuditDate(); |
|
|
@@ -1683,4 +1709,18 @@ public class TodoCenterManage { |
|
|
|
} |
|
|
|
return tasks.get(0).getId(); |
|
|
|
} |
|
|
|
|
|
|
|
public Object saveAuditOpinion(ReqAuditOpinionSaveDTO param) { |
|
|
|
// 获取登录用户ID |
|
|
|
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); |
|
|
|
// 获取登录用户浙政钉code |
|
|
|
String employeeCode = user.getEmployeeCode(); |
|
|
|
|
|
|
|
//前置判断前端传的taskId是否存在不存在的情况 有可能是 或签被别人审批掉了 |
|
|
|
Task task = taskService.createTaskQuery().taskId(param.getTaskId()).active().singleResult(); |
|
|
|
if (ObjectUtil.isNull(task)) { |
|
|
|
return TodoCenterConstant.Handler.TASKID_ERROR; |
|
|
|
} |
|
|
|
return processTaskService.saveAuditOpinion(param,employeeCode); |
|
|
|
} |
|
|
|
} |