Browse Source

操作标记

tags/24080901
PoffyZhang 1 year ago
parent
commit
0e31283840
3 changed files with 31 additions and 6 deletions
  1. +0
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java
  2. +4
    -0
      syn-data-task/src/main/java/com/ningdatech/syndataapi/common/constant/BizConst.java
  3. +27
    -3
      syn-data-task/src/main/java/com/ningdatech/syndataapi/open/manage/ProjectReceiveManage.java

+ 0
- 3
pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java View File

@@ -96,13 +96,10 @@ public class GovProjectCollectionManage {
* @return
*/
public PageVo<GovBizProjectListVO> list(ProjectListReq req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();

Page<GovBizProjectBaseinfo> page = req.page();
LambdaQueryWrapper<GovBizProjectBaseinfo> 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);


+ 4
- 0
syn-data-task/src/main/java/com/ningdatech/syndataapi/common/constant/BizConst.java View File

@@ -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";
}

+ 27
- 3
syn-data-task/src/main/java/com/ningdatech/syndataapi/open/manage/ProjectReceiveManage.java View File

@@ -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<ProjectProcure> 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<ProjectProcure> 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;


Loading…
Cancel
Save