Ver código fonte

以防bid重复

tags/24080901
PoffyZhang 1 ano atrás
pai
commit
faeba268d3
1 arquivos alterados com 4 adições e 2 exclusões
  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 Ver arquivo

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



Carregando…
Cancelar
Salvar