Pārlūkot izejas kodu

Merge branch '20230731_ls2_operation+early_warning+safety_risk+portrait' of http://git.ningdatech.com/liushuai/project-management into dev

 Conflicts:
	pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java
tags/24080901
PoffyZhang pirms 1 gada
vecāks
revīzija
a1e6ff6db7
7 mainītis faili ar 60 papildinājumiem un 14 dzēšanām
  1. +2
    -2
      ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java
  2. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java
  3. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java
  4. +8
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/FinalAcceptanceController.java
  5. +3
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java
  6. +4
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  7. +42
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/instance/InstanceTest.java

+ 2
- 2
ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java Parādīt failu

@@ -14,7 +14,7 @@ import java.util.Collections;
public class GeneratorCodeKingbaseConfig {

private static final String PATH_LXX = "/Users/liuxinxin/IdeaProjects/project-management/pmapi/src/main/java";
private static final String PATH_YYD = "/Users/wendy/coding/java/project-management/pmapi/src/main/java";
private static final String PATH_YYD = "/Users/wendy/code project/java/project-management/pmapi/src/main/java";
private static final String PATH_LS = "";
private static final String PATH_ZPF = "D:\\ningda\\project-management\\pmapi\\src\\main\\java";
private static final String PATH_CMM = "D:\\work\\project-management\\project-management\\pmapi\\src\\main\\java";
@@ -57,7 +57,7 @@ public class GeneratorCodeKingbaseConfig {

public static void main(String[] args) {
//generate("Liuxinxin", "expert", PATH_LXX, "expert_gov_business_strip");
generate("CMM", "meeting", PATH_YYD, "meeting_expert_judge");
generate("CMM", "test", PATH_CMM, "nd_performance_appraisal_app_indicator");
}

}

+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java Parādīt failu

@@ -210,6 +210,7 @@ public class ProjectDeclareYHAction {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.OPERATION.getCode());
}

@OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION")
public void START_TO_WORK(Message<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);


+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java Parādīt failu

@@ -216,7 +216,6 @@ public class ProjectDeclareStateMachineJNBuilder implements ProjectDeclareStateM
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and()

// 待开工 实施,从实施到建设中
.withExternal()
.source(ProjectStatusEnum.OPERATION)


+ 8
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/FinalAcceptanceController.java Parādīt failu

@@ -59,4 +59,12 @@ public class FinalAcceptanceController {
String instanceId = finalAcceptanceManage.startProcess(dto);
return "终验申报 【" + instanceId + "】 成功";
}

@ApiOperation(value = "终验申报重新提交", notes = "终验申报重新提交")
@WebLog("终验申报重新提交")
@PostMapping("/restart-process")
public String restartTheProcess(@Validated @RequestBody DefaultDeclaredDTO dto) {
String instanceId = finalAcceptanceManage.restartProcess(dto);
return "终验申报 【" + instanceId + "】 成功";
}
}

+ 3
- 9
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java Parādīt failu

@@ -206,9 +206,6 @@ public class FinalAcceptanceManage {

String regionCode = projectInfo.getAreaCode();

//放入终验材料
projectInfo.setFinalAcceptanceMaterials(projectDto.getFinalAcceptanceMaterials());

WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)
.eq(WflowModels::getRegionCode, regionCode)
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode())
@@ -238,8 +235,8 @@ public class FinalAcceptanceManage {

//保存终验项目
//生成新版本 并且进入下一状态
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId,
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE);
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId,projectDto,
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.FALSE);

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,
@@ -267,9 +264,6 @@ public class FinalAcceptanceManage {

String regionCode = projectInfo.getAreaCode();

//放入终验材料
projectInfo.setFinalAcceptanceMaterials(projectDto.getFinalAcceptanceMaterials());

WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)
.eq(WflowModels::getRegionCode, regionCode)
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode())
@@ -299,7 +293,7 @@ public class FinalAcceptanceManage {

//保存终验项目
//生成新版本 并且进入下一状态
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId,
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId,projectDto,
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE);

//发送给第一个审批人消息


+ 4
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java Parādīt failu

@@ -790,7 +790,7 @@ public class ProjectLibManage {
return project;
}

public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId, Integer instType,Boolean isBackReject) {
public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId,ProjectDTO dto, Integer instType,Boolean isBackReject) {
Project project = new Project();
VUtils.isTrue(Objects.isNull(oldProject))
.throwMessage("项目不存在!");
@@ -804,9 +804,11 @@ public class ProjectLibManage {
// 标识保存的项目信息是否为建设方案申报项目
project.setIsConstruct(Boolean.FALSE);
project.setIsBackReject(isBackReject);
//终验材料
project.setFinalAcceptanceMaterials(dto.getFinalAcceptanceMaterials());
stateMachineUtils.pass(project);

oldProject.setIsBackReject(Boolean.TRUE);
oldProject.setIsBackReject(isBackReject);
projectService.updateById(oldProject);

if (projectService.save(project)) {


+ 42
- 0
pmapi/src/test/java/com/ningdatech/pmapi/instance/InstanceTest.java Parādīt failu

@@ -4,12 +4,14 @@ import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.AppTests;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.wflow.workflow.bean.dto.TodoCenterListReqDTO;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.history.HistoricActivityInstance;
@@ -29,6 +31,7 @@ import java.util.stream.Collectors;
* @Date 2023/2/16 14:44
* @Author PoffyZhang
*/
@Slf4j
public class InstanceTest extends AppTests {

@Autowired
@@ -145,4 +148,43 @@ public class InstanceTest extends AppTests {
}
}

@Test
public void test4(){
String nodeId = "node_64d1bc4694fc85e4dd1f1b36";

List<HistoricActivityInstance> hais = historyService.createHistoricActivityInstanceQuery()
.activityId(nodeId)
.unfinished()
.orderByHistoricActivityInstanceStartTime()
.asc()
.list();

log.info("hais :{}",JSON.toJSONString(hais));

if (CollUtil.isEmpty(hais)) {
log.info("没有查到 历史实例");
return;
}

String instanceId = hais.get(0).getProcessInstanceId();
log.info("instanceId :{}",instanceId);

//查询当前未完成的此实例
HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery()
.processInstanceId(instanceId)
.unfinished()
.singleResult();

log.info("instance :{}",JSON.toJSONString(instance));
if (Objects.isNull(instance)) {
log.info("没有查到实例 或者 实例已经结束");
return;
}

//2.查到 此流程实例的 项目
ProjectInst pi = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getInstCode, instanceId)
.last(BizConst.LIMIT_1));
log.info("pi :{}",JSON.toJSONString(pi));
}
}

Notiek ielāde…
Atcelt
Saglabāt