Browse Source

以防bid重复

master
PoffyZhang 1 year ago
parent
commit
faeba268d3
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      syn-data-task/src/main/java/com/ningdatech/syndataapi/open/manage/ProjectReceiveManage.java

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

@@ -3,6 +3,7 @@ package com.ningdatech.syndataapi.open.manage;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.syndataapi.common.constant.BizConst;
import com.ningdatech.syndataapi.scheduler.model.dto.ProjectBaseInfoDTO;
import com.ningdatech.syndataapi.scheduler.model.dto.ProjectSaveDTO;
@@ -175,8 +176,6 @@ public class ProjectReceiveManage {
// 6.保存 采购信息
List<ProjectProcure> procures = dto.getProcures();
if(Objects.nonNull(procures)){
// 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){
@@ -184,15 +183,18 @@ public class ProjectReceiveManage {
old.setOp(BizConst.OP_DELETE);
procureService.updateById(old);
}
Integer index = 1;
for(ProjectProcure procure : procures){
//添加标记
ProjectProcure saveProcure = BeanUtil.copyProperties(procure,ProjectProcure.class);
saveProcure.setBaseProjId(baseProjId);
saveProcure.setBaseBidCode(baseProjId + StrPool.DASH + String.format(StrPool.FORMAT_DATE_SINGLE_DIGITS,index));
saveProcure.setTongID(null);
saveProcure.setTongTime(LocalDateTime.now());
saveProcure.setBizTime(LocalDateTime.now());
saveProcure.setOp(BizConst.OP_INSERT);
procureService.save(saveProcure);
index ++;
}
}



Loading…
Cancel
Save