Browse Source

Merge remote-tracking branch 'origin/master'

master
PoffyZhang 1 year ago
parent
commit
986f7efe47
4 changed files with 89 additions and 28 deletions
  1. +7
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  2. +14
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java
  3. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java
  4. +63
    -23
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 7
- 5
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

@@ -355,13 +355,15 @@ public class ProjectLibManage {
Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication())
? Boolean.TRUE : Boolean.FALSE;
//采取批量删除 批量添加的方式 批量删除建设方案申报后的应用信息
List<Long> projectIdList = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectCode, oldProject.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,oldProject.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())) {
Project finalProject = project;


+ 14
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java View File

@@ -7,6 +7,7 @@ import javax.validation.Valid;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.todocenter.model.vo.NotSealedInfoVO;
import com.ningdatech.pmapi.todocenter.model.vo.TodoNumVO;
import com.wflow.workflow.bean.dto.ReqAuditOpinionSaveDTO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@@ -96,6 +97,19 @@ public class TodoCenterController {
}

/**
* 保存盖章审核提交的审核意见
* @param param 操作参数
* @return 操作结果
*/
@PostMapping("/saveAuditOpinion")
@WebLog("保存盖章审核提交的审核意见")
public Object saveAuditOpinion(@Valid @RequestBody ReqAuditOpinionSaveDTO param) {
return todoCenterManage.saveAuditOpinion(param);
}



/**
* 待办中心-我已处理项目列表查询
* @param param
* @return


+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java View File

@@ -416,6 +416,11 @@ public class HandlerManage {
.set(Project::getPretrialFileName,null)
.eq(Project::getId,declaredProject.getId());
projectService.update(updateWrapper);
}else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)) {
updateWrapper.set(Project::getConstructFileId,null)
.set(Project::getConstructFileName,null)
.eq(Project::getId,declaredProject.getId());
projectService.update(updateWrapper);
}
}



+ 63
- 23
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -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);
}
}

Loading…
Cancel
Save