From 9bcde9f54d6e41874b7d99ba2de91e985d72ed88 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sat, 31 Aug 2024 17:19:52 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E5=8D=95=E4=BD=8D=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BF=AE=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hz/pm/api/projectlib/manage/QxProjectManage.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 a77c6c4..d91941c 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 @@ -111,6 +111,7 @@ public class QxProjectManage { } } + @Transactional(rollbackFor = Exception.class) public synchronized void submitPurchaseRecord(QxPurchaseRecordReq req) { QxProject project = qxProjectService.getById(req.getProjectId()); if (!QxProjectStatus.DECLARED.eq(project.getStatus())) { @@ -122,8 +123,12 @@ public class QxProjectManage { } BeanUtil.copyProperties(req, purchase); qxPurchaseService.saveOrUpdate(purchase); + qxProjectService.update(Wrappers.lambdaUpdate(QxProject.class) + .set(QxProject::getStatus, QxProjectStatus.PURCHASED.getCode()) + .eq(QxProject::getId, req.getProjectId())); } + @Transactional(rollbackFor = Exception.class) public void submitAcceptRecord(QxAcceptRecordReq req) { QxProject project = qxProjectService.getById(req.getProjectId()); if (!QxProjectStatus.UPGRADED.eq(project.getStatus())) { @@ -138,8 +143,12 @@ 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())); } + @Transactional(rollbackFor = Exception.class) public void submitUpgradeRecord(QxUpgradeRecordReq req) { QxProject project = qxProjectService.getById(req.getProjectId()); if (!QxProjectStatus.PURCHASED.eq(project.getStatus())) { @@ -153,6 +162,9 @@ 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())); } public QxProjectDetailVO getProjectDetail(Long projectId) {