소스 검색

以防bid重复

tags/24080901
PoffyZhang 1 년 전
부모
커밋
faeba268d3
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  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 파일 보기

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



불러오는 중...
취소
저장