From 0e31283840dafe706d9de09dfce8efee03f767d0 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 31 Aug 2023 13:47:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov/manage/GovProjectCollectionManage.java | 3 --- .../syndataapi/common/constant/BizConst.java | 4 +++ .../open/manage/ProjectReceiveManage.java | 30 +++++++++++++++++++--- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java index f5b6bfa..36bca2c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java @@ -96,13 +96,10 @@ public class GovProjectCollectionManage { * @return */ public PageVo list(ProjectListReq req) { - UserInfoDetails user = LoginUserUtil.loginUserDetail(); - Page page = req.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(GovBizProjectBaseinfo.class) .like(StringUtils.isNotBlank(req.getProjectName()),GovBizProjectBaseinfo::getBaseProjName,req.getProjectName()) .like(StringUtils.isNotBlank(req.getBuildOrg()),GovBizProjectBaseinfo::getBaseBuildDeprt,req.getBuildOrg()) - .eq(GovBizProjectBaseinfo::getBaseBuildDeprtDing,user.getEmpPosUnitCode()) .eq(StringUtils.isNotBlank(req.getAreaCode()),GovBizProjectBaseinfo::getAreaCode,req.getAreaCode()) .eq(StringUtils.isNotBlank(req.getRegionCode()),GovBizProjectBaseinfo::getAreaCode,req.getRegionCode()) .orderByDesc(GovBizProjectBaseinfo::getBizTime); diff --git a/syn-data-task/src/main/java/com/ningdatech/syndataapi/common/constant/BizConst.java b/syn-data-task/src/main/java/com/ningdatech/syndataapi/common/constant/BizConst.java index d9666a6..7dfcf21 100644 --- a/syn-data-task/src/main/java/com/ningdatech/syndataapi/common/constant/BizConst.java +++ b/syn-data-task/src/main/java/com/ningdatech/syndataapi/common/constant/BizConst.java @@ -98,4 +98,8 @@ public interface BizConst { String OP_SUCCESS = "操作成功"; String SAVE_FAIL = "保存失败"; String NOT_EFFECTIVE = "1"; + + String OP_INSERT = "insert"; + String OP_UPDATE = "update"; + String OP_DELETE = "delete"; } diff --git a/syn-data-task/src/main/java/com/ningdatech/syndataapi/open/manage/ProjectReceiveManage.java b/syn-data-task/src/main/java/com/ningdatech/syndataapi/open/manage/ProjectReceiveManage.java index 3ca9a7f..20fd7ee 100644 --- a/syn-data-task/src/main/java/com/ningdatech/syndataapi/open/manage/ProjectReceiveManage.java +++ b/syn-data-task/src/main/java/com/ningdatech/syndataapi/open/manage/ProjectReceiveManage.java @@ -59,7 +59,10 @@ public class ProjectReceiveManage { .last(BizConst.LIMIT_1)); ProjectBaseInfo saveBase = BeanUtil.copyProperties(baseInfo,ProjectBaseInfo.class); if(Objects.isNull(oldBaseInfo)){ + saveBase.setOp(BizConst.OP_INSERT); saveBase.setTongTime(LocalDateTime.now()); + }else { + saveBase.setOp(BizConst.OP_UPDATE); } saveBase.setBizTime(LocalDateTime.now()); baseInfoService.saveOrUpdate(saveBase); @@ -74,12 +77,14 @@ public class ProjectReceiveManage { ProjectApply saveApply = BeanUtil.copyProperties(apply,ProjectApply.class); saveApply.setBaseProjId(baseProjId); if(Objects.isNull(oldApply)){ + saveApply.setOp(BizConst.OP_INSERT); saveApply.setTongTime(LocalDateTime.now()); + }else{ + saveApply.setOp(BizConst.OP_UPDATE); } saveApply.setBizTime(LocalDateTime.now()); applyService.saveOrUpdate(saveApply); - // 3.保存 审批信息 ProjectApprove approve = dto.getApprove(); @@ -90,7 +95,10 @@ public class ProjectReceiveManage { ProjectApprove saveApprove = BeanUtil.copyProperties(approve,ProjectApprove.class); saveApprove.setBaseProjId(baseProjId); if(Objects.isNull(oldApprove)){ + saveApprove.setOp(BizConst.OP_INSERT); saveApprove.setTongTime(LocalDateTime.now()); + }else{ + saveApprove.setOp(BizConst.OP_UPDATE); } saveApprove.setBizTime(LocalDateTime.now()); approveService.saveOrUpdate(saveApprove); @@ -106,7 +114,10 @@ public class ProjectReceiveManage { ProjectCimplement saveCimplement = BeanUtil.copyProperties(cimplement,ProjectCimplement.class); saveCimplement.setBaseProjId(baseProjId); if(Objects.isNull(oldCimplement)){ + saveCimplement.setOp(BizConst.OP_INSERT); saveCimplement.setTongTime(LocalDateTime.now()); + }else{ + saveCimplement.setOp(BizConst.OP_UPDATE); } saveCimplement.setBizTime(LocalDateTime.now()); cimplementService.saveOrUpdate(saveCimplement); @@ -122,7 +133,10 @@ public class ProjectReceiveManage { ProjectMimplement saveMimplement = BeanUtil.copyProperties(mimplement,ProjectMimplement.class); saveMimplement.setBaseProjId(baseProjId); if(Objects.isNull(oldMimplement)){ + saveMimplement.setOp(BizConst.OP_INSERT); saveMimplement.setTongTime(LocalDateTime.now()); + }else{ + saveMimplement.setOp(BizConst.OP_UPDATE); } saveMimplement.setBizTime(LocalDateTime.now()); mimplementService.saveOrUpdate(saveMimplement); @@ -131,14 +145,23 @@ public class ProjectReceiveManage { // 6.保存 采购信息 List procures = dto.getProcures(); if(Objects.nonNull(procures)){ - procureService.remove(Wrappers.lambdaQuery(ProjectProcure.class) - .eq(ProjectProcure::getBaseProjId,baseProjId)); +// procureService.remove(Wrappers.lambdaQuery(ProjectProcure.class) +// .eq(ProjectProcure::getBaseProjId,baseProjId)); + List olds = procureService.list(Wrappers.lambdaQuery(ProjectProcure.class) + .eq(ProjectProcure::getBaseProjId, baseProjId)); + for(ProjectProcure old : olds){ + //删除标记 + old.setOp(BizConst.OP_DELETE); + procureService.save(old); + } for(ProjectProcure procure : procures){ + //添加标记 ProjectProcure saveProcure = BeanUtil.copyProperties(procure,ProjectProcure.class); saveProcure.setBaseProjId(baseProjId); saveProcure.setTongID(null); saveProcure.setTongTime(LocalDateTime.now()); saveProcure.setBizTime(LocalDateTime.now()); + saveProcure.setOp(BizConst.OP_INSERT); procureService.save(saveProcure); } } @@ -163,6 +186,7 @@ public class ProjectReceiveManage { saveBaseinfo.setTongTime(LocalDateTime.now()); } saveBaseinfo.setBizTime(LocalDateTime.now()); + saveBaseinfo.setOp(BizConst.OP_UPDATE); baseInfoService.saveOrUpdate(saveBaseinfo); return BizConst.OP_SUCCESS;