Explorar el Código

应用debug

tags/24080901
PoffyZhang hace 1 año
padre
commit
bea1a36ee6
Se han modificado 4 ficheros con 80 adiciones y 6 borrados
  1. +15
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/constant/ProjectConstant.java
  2. +8
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java
  3. +45
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  4. +12
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java

+ 15
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/constant/ProjectConstant.java Ver fichero

@@ -0,0 +1,15 @@
package com.ningdatech.pmapi.projectlib.constant;

/**
* @Classname ProjectConstant
* @Description
* @Date 2023/7/21 14:13
* @Author PoffyZhang
*/
public interface ProjectConstant {

class ProjectLib{
public static final String PROJECT_BASIC = "basic";
public static final String PROJECT_CONSTRUCT = "construct";
}
}

+ 8
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java Ver fichero

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.projectlib.controller;

import com.alibaba.fastjson.JSONObject;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
@@ -48,10 +49,16 @@ public class ProjectLibController {

@GetMapping("/history-list/{id}")
@ApiOperation("项目历史版本列表")
public List<ProjectDetailVO> historyProjects(@PathVariable Long id) {
public JSONObject historyProjects(@PathVariable Long id) {
return projectLibManage.historyProjects(id);
}

@GetMapping("/change-record/{id}")
@ApiOperation("查看项目变更记录-输入任一项目ID即可")
public JSONObject changeRecord(@PathVariable Long id) {
return projectLibManage.changeRecord(id);
}

@GetMapping("/application/list")
@ApiOperation("应用列表")
public PageVo<ProjectApplicationVO> applicationList(ProjectApplicationListReq req) {


+ 45
- 5
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java Ver fichero

@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.projectlib.manage;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -43,6 +44,7 @@ import com.ningdatech.pmapi.projectdeclared.service.IPaymentPlanService;
import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService;
import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService;
import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil;
import com.ningdatech.pmapi.projectlib.constant.ProjectConstant;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.handle.ProcessExecuteChainHandle;
@@ -481,7 +483,7 @@ public class ProjectLibManage {
.map(Project::getId).collect(Collectors.toList());
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectCode,project.getProjectCode())
.in(ProjectApplication::getProjectId,projectIdList));
.in(CollUtil.isNotEmpty(projectIdList),ProjectApplication::getProjectId,projectIdList));

//app
List<ProjectApplicationDTO> applicationList = projecDto.getApplicationList();
@@ -1000,11 +1002,12 @@ public class ProjectLibManage {
* @param id
* @return
*/
public List<ProjectDetailVO> historyProjects(Long id) {
public JSONObject historyProjects(Long id) {
JSONObject res = new JSONObject();
Project project = projectService.getById(id);

if(Objects.isNull(project)){
return Collections.emptyList();
return res;
}

List<Project> historyProjects = projectService.list(Wrappers.lambdaQuery(Project.class)
@@ -1012,11 +1015,48 @@ public class ProjectLibManage {
.orderByDesc(Project::getCreateOn));

if(CollUtil.isEmpty(historyProjects)){
return Collections.emptyList();
return res;
}

return historyProjects.stream()
List<ProjectDetailVO> basicProjects = historyProjects.stream()
.map(p -> this.getProjectDetail(p.getId()))
.filter(p -> !p.getIsConstruct())
.collect(Collectors.toList());
List<ProjectDetailVO> constructProjects = historyProjects.stream()
.map(p -> this.getProjectDetail(p.getId()))
.filter(p -> p.getIsConstruct())
.collect(Collectors.toList());
res.put(ProjectConstant.ProjectLib.PROJECT_BASIC,basicProjects);
res.put(ProjectConstant.ProjectLib.PROJECT_CONSTRUCT,constructProjects);
return res;
}

/**
* 查看 项目的 变更记录(驳回 重新发起的 和上个版本的变更字段)
* @param projectId
* @return
*/
public JSONObject changeRecord(Long projectId) {
JSONObject res = new JSONObject();

//1.先判断下 项目存不存在
Project project = projectService.getById(projectId);
VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在");

//2.要判断 项目在当前状态 有没有被驳回和退回过
//当前项目状态流程的 实例 看看是不是有2个以上 有2个说明 有退回 驳回
List<ProjectInst> pis = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getProjectId, projectId)
.orderByDesc(ProjectInst::getInstType)
.last("limit 2"));
VUtils.isTrue(CollUtil.isEmpty(pis)).throwMessage("该项目没有审批流");
VUtils.isTrue( pis.size() < 2 ||
!pis.get(0).getInstType().equals(pis.get(1).getInstType()))
.throwMessage("该项目在当前流程没有被驳回 撤回过");

//3. 去对比 当前版本和上个版本 的字段对比
String projectCode = project.getProjectCode();

return res;
}
}

+ 12
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java Ver fichero

@@ -379,6 +379,18 @@ public class ProjectDetailVO {
@ApiModelProperty("初步方案项目ID")
private Long prePlanProjectId;

@ApiModelProperty("是否为建设方案申报")
private Boolean isConstruct;

@ApiModelProperty("区县预审上级条线主管单位盖章审核意见")
private String countrySealAuditOpinion;

@ApiModelProperty("区县预审上级条线主管单位盖章审核日期")
private String countrySealAuditDate;

@ApiModelProperty("区县预审盖章上级条线主管单位印章编号")
private String countrySealNo;

public String getVersionStr() {
if (Objects.nonNull(this.newest) && this.newest) {
this.versionStr = "当前版本";


Cargando…
Cancelar
Guardar