From a6c2e44bbfb64a07f727a3c4f27c2fafa7cb52fe Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sun, 1 Sep 2024 13:54:05 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E6=8F=90=E4=BA=A4=E5=A4=87?= =?UTF-8?q?=E6=A1=88=E5=90=8E=E6=97=B6=E9=97=B4=E4=BF=AE=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hz/pm/api/projectlib/manage/QxProjectManage.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/QxProjectManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/QxProjectManage.java index 5ca8400..bce91b6 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/QxProjectManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/QxProjectManage.java @@ -132,9 +132,14 @@ public class QxProjectManage { } BeanUtil.copyProperties(req, purchase); qxPurchaseService.saveOrUpdate(purchase); + updateQxProjectStatus(QxProjectStatus.PURCHASED, req.getProjectId()); + } + + private void updateQxProjectStatus(QxProjectStatus status, Long id) { qxProjectService.update(Wrappers.lambdaUpdate(QxProject.class) - .set(QxProject::getStatus, QxProjectStatus.PURCHASED.getCode()) - .eq(QxProject::getId, req.getProjectId())); + .set(QxProject::getUpdateOn, LocalDateTime.now()) + .set(QxProject::getStatus, status.getCode()) + .eq(QxProject::getId, id)); } @Transactional(rollbackFor = Exception.class) @@ -152,9 +157,7 @@ public class QxProjectManage { .set(QxPurchase::getUpdateOn, LocalDateTime.now()) .set(QxPurchase::getUpdateBy, LoginUserUtil.getUserId()); qxPurchaseService.update(update); - qxProjectService.update(Wrappers.lambdaUpdate(QxProject.class) - .set(QxProject::getStatus, QxProjectStatus.ACCEPTED.getCode()) - .eq(QxProject::getId, req.getProjectId())); + updateQxProjectStatus(QxProjectStatus.ACCEPTED, req.getProjectId()); } @Transactional(rollbackFor = Exception.class) @@ -171,9 +174,7 @@ public class QxProjectManage { projectSystemReplaceInfos.add(qxReplaceInfo); } qxProjectSystemReplaceInfosService.updateBatchById(projectSystemReplaceInfos); - qxProjectService.update(Wrappers.lambdaUpdate(QxProject.class) - .set(QxProject::getStatus, QxProjectStatus.UPGRADED.getCode()) - .eq(QxProject::getId, req.getProjectId())); + updateQxProjectStatus(QxProjectStatus.UPGRADED, req.getProjectId()); } public QxProjectDetailVO getProjectDetail(Long projectId) {