From 6bbc328ee49cd5098002da3c75d9620e1ac9b42f Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 27 Jul 2023 10:37:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E5=9B=9E=E5=92=8C=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/todocenter/manage/TodoCenterManage.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 1d12b4c..bab2441 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -1091,6 +1091,22 @@ public class TodoCenterManage { project.setUpdateOn(LocalDateTime.now()); projectService.save(project); + ProjectInst oldInst = projectInstService.getOne(Wrappers.lambdaUpdate(ProjectInst.class) + .eq(ProjectInst::getProjectId, oldProject.getId()) + .eq(ProjectInst::getInstCode, oldProject.getInstCode())); + + String instCode = oldProject.getInstCode(); + oldInst.setInstCode("EMPTY"); + projectInstService.updateById(oldInst); + + ProjectInst newPi = new ProjectInst(); + newPi.setProjectId(project.getId()); + newPi.setInstType(oldInst.getInstType()); + newPi.setInstCode(instCode); + newPi.setCreatOn(LocalDateTime.now()); + newPi.setUpdateOn(LocalDateTime.now()); + projectInstService.save(newPi); + projectService.update(Wrappers.lambdaUpdate(Project.class) .set(Project::getNewest,Boolean.FALSE) .ne(Project::getId,project.getId()) @@ -1101,7 +1117,6 @@ public class TodoCenterManage { ? Boolean.TRUE : Boolean.FALSE; Long projectDtoId = projectDto.getId(); Project projectInfo = projectService.getById(projectDtoId); - String instCode = projectInfo.getInstCode(); ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getInstCode, instCode)); Integer instType = projectInst.getInstType();