Conflicts: pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.javamaster
@@ -14,7 +14,7 @@ import java.util.Collections; | |||||
public class GeneratorCodeKingbaseConfig { | public class GeneratorCodeKingbaseConfig { | ||||
private static final String PATH_LXX = "/Users/liuxinxin/IdeaProjects/project-management/pmapi/src/main/java"; | 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_LS = ""; | ||||
private static final String PATH_ZPF = "D:\\ningda\\project-management\\pmapi\\src\\main\\java"; | 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"; | 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) { | public static void main(String[] args) { | ||||
//generate("Liuxinxin", "expert", PATH_LXX, "expert_gov_business_strip"); | //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"); | |||||
} | } | ||||
} | } |
@@ -210,6 +210,7 @@ public class ProjectDeclareYHAction { | |||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setStatus(ProjectStatusEnum.OPERATION.getCode()); | project.setStatus(ProjectStatusEnum.OPERATION.getCode()); | ||||
} | } | ||||
@OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") | @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") | ||||
public void START_TO_WORK(Message<ProjectStatusChangeEvent> message) { | public void START_TO_WORK(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
@@ -216,7 +216,6 @@ public class ProjectDeclareStateMachineJNBuilder implements ProjectDeclareStateM | |||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | ||||
// 待开工 实施,从实施到建设中 | // 待开工 实施,从实施到建设中 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.OPERATION) | .source(ProjectStatusEnum.OPERATION) | ||||
@@ -59,4 +59,12 @@ public class FinalAcceptanceController { | |||||
String instanceId = finalAcceptanceManage.startProcess(dto); | String instanceId = finalAcceptanceManage.startProcess(dto); | ||||
return "终验申报 【" + instanceId + "】 成功"; | return "终验申报 【" + instanceId + "】 成功"; | ||||
} | } | ||||
@ApiOperation(value = "终验申报重新提交", notes = "终验申报重新提交") | |||||
@WebLog("终验申报重新提交") | |||||
@PostMapping("/restart-process") | |||||
public String restartTheProcess(@Validated @RequestBody DefaultDeclaredDTO dto) { | |||||
String instanceId = finalAcceptanceManage.restartProcess(dto); | |||||
return "终验申报 【" + instanceId + "】 成功"; | |||||
} | |||||
} | } |
@@ -206,9 +206,6 @@ public class FinalAcceptanceManage { | |||||
String regionCode = projectInfo.getAreaCode(); | String regionCode = projectInfo.getAreaCode(); | ||||
//放入终验材料 | |||||
projectInfo.setFinalAcceptanceMaterials(projectDto.getFinalAcceptanceMaterials()); | |||||
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | ||||
.eq(WflowModels::getRegionCode, regionCode) | .eq(WflowModels::getRegionCode, regionCode) | ||||
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()) | .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, | noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, | ||||
@@ -267,9 +264,6 @@ public class FinalAcceptanceManage { | |||||
String regionCode = projectInfo.getAreaCode(); | String regionCode = projectInfo.getAreaCode(); | ||||
//放入终验材料 | |||||
projectInfo.setFinalAcceptanceMaterials(projectDto.getFinalAcceptanceMaterials()); | |||||
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | ||||
.eq(WflowModels::getRegionCode, regionCode) | .eq(WflowModels::getRegionCode, regionCode) | ||||
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()) | .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); | InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE); | ||||
//发送给第一个审批人消息 | //发送给第一个审批人消息 | ||||
@@ -790,7 +790,7 @@ public class ProjectLibManage { | |||||
return project; | 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(); | Project project = new Project(); | ||||
VUtils.isTrue(Objects.isNull(oldProject)) | VUtils.isTrue(Objects.isNull(oldProject)) | ||||
.throwMessage("项目不存在!"); | .throwMessage("项目不存在!"); | ||||
@@ -804,9 +804,11 @@ public class ProjectLibManage { | |||||
// 标识保存的项目信息是否为建设方案申报项目 | // 标识保存的项目信息是否为建设方案申报项目 | ||||
project.setIsConstruct(Boolean.FALSE); | project.setIsConstruct(Boolean.FALSE); | ||||
project.setIsBackReject(isBackReject); | project.setIsBackReject(isBackReject); | ||||
//终验材料 | |||||
project.setFinalAcceptanceMaterials(dto.getFinalAcceptanceMaterials()); | |||||
stateMachineUtils.pass(project); | stateMachineUtils.pass(project); | ||||
oldProject.setIsBackReject(Boolean.TRUE); | |||||
oldProject.setIsBackReject(isBackReject); | |||||
projectService.updateById(oldProject); | projectService.updateById(oldProject); | ||||
if (projectService.save(project)) { | if (projectService.save(project)) { | ||||
@@ -4,12 +4,14 @@ import cn.hutool.core.collection.CollUtil; | |||||
import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.pmapi.AppTests; | import com.ningdatech.pmapi.AppTests; | ||||
import com.ningdatech.pmapi.common.constant.BizConst; | |||||
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | ||||
import com.wflow.workflow.bean.dto.TodoCenterListReqDTO; | import com.wflow.workflow.bean.dto.TodoCenterListReqDTO; | ||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.flowable.engine.HistoryService; | import org.flowable.engine.HistoryService; | ||||
import org.flowable.engine.RuntimeService; | import org.flowable.engine.RuntimeService; | ||||
import org.flowable.engine.history.HistoricActivityInstance; | import org.flowable.engine.history.HistoricActivityInstance; | ||||
@@ -29,6 +31,7 @@ import java.util.stream.Collectors; | |||||
* @Date 2023/2/16 14:44 | * @Date 2023/2/16 14:44 | ||||
* @Author PoffyZhang | * @Author PoffyZhang | ||||
*/ | */ | ||||
@Slf4j | |||||
public class InstanceTest extends AppTests { | public class InstanceTest extends AppTests { | ||||
@Autowired | @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)); | |||||
} | |||||
} | } |