Explorar el Código

标段

tags/24080901
PoffyZhang hace 1 año
padre
commit
a5d88555bf
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. +9
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java

+ 9
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java Ver fichero

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.gov.contants.BizProjectContant;
import com.ningdatech.pmapi.gov.convert.ProjectConvert;
@@ -31,6 +32,7 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;

import java.time.LocalDateTime;
@@ -214,6 +216,7 @@ public class GovProjectCollectionManage {
* @param saveDTO
* @return
*/
@Transactional
public String save(GovBizProjectSaveDTO saveDTO) {
GovBizProjectBaseinfoDTO base = saveDTO.getBaseinfo();
String baseProjId = base.getBaseProjId();
@@ -297,6 +300,7 @@ public class GovProjectCollectionManage {
if(Objects.nonNull(cimplement)){
cimplement.setBaseProjId(baseProjId);
cimplement.setBaseProjName(baseProjName);
cimplement.setBaseBidCode(baseProjId + "-1");
GovBizProjectCimplement oldCimplement = cimplementService.getOne(Wrappers.lambdaQuery(GovBizProjectCimplement.class)
.eq(GovBizProjectCimplement::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));
@@ -319,12 +323,14 @@ public class GovProjectCollectionManage {
if(Objects.nonNull(mimplement)){
mimplement.setBaseProjId(baseProjId);
mimplement.setBaseProjName(baseProjName);
mimplement.setBaseBidCode(baseProjId + "-2");
GovBizProjectMimplement oldMimplement = mimplementService.getOne(Wrappers.lambdaQuery(GovBizProjectMimplement.class)
.eq(GovBizProjectMimplement::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));

GovBizProjectMimplement saveMimplement = BeanUtil.copyProperties(mimplement,GovBizProjectMimplement.class);
saveMimplement.setBaseProjId(baseProjId);

if(Objects.nonNull(oldMimplement)){
saveMimplement.setId(oldMimplement.getId());
}else{
@@ -338,9 +344,11 @@ public class GovProjectCollectionManage {

// 6.保存 采购信息
List<GovBizProjectProcureDTO> procures = saveDTO.getProcures();
Integer index = 1;
for(GovBizProjectProcureDTO procure : procures){
procure.setBaseProjId(baseProjId);
procure.setBaseProjName(baseProjName);
procure.setBaseBidCode(baseProjId + StrPool.DASH + index);

GovBizProjectProcure saveProcure = BeanUtil.copyProperties(procure,GovBizProjectProcure.class);
saveProcure.setBaseProjId(baseProjId);
@@ -359,6 +367,7 @@ public class GovProjectCollectionManage {
}
}
procureService.saveOrUpdate(saveProcure);
index++;
}




Cargando…
Cancelar
Guardar