Merge branch 'refs/heads/feature/DM/nflg-bom' into feature/DM/nflg-bom-transition
This commit is contained in:
commit
4ce8b7c41a
|
|
@ -63,23 +63,19 @@ public class EbomV2Api extends BaseApi {
|
|||
@ApiOperation("从CAD获取BOM数据并转为EBom")
|
||||
public ResultVO<List<ImportOriginalBomVO>> pullFromCadAndToEBom() throws ExecutionException, InterruptedException {
|
||||
List<BomOriginalCadParentEntity> parents = originalCadParentService.lambdaQuery().eq(BomOriginalCadParentEntity::getStatus, 1).eq(BomOriginalCadParentEntity::getCreatedBy, SessionUtil.getUserCode()).list();
|
||||
List<ImportOriginalBomVO> result=new ArrayList<>();
|
||||
List<ImportOriginalBomVO> result = new ArrayList<>();
|
||||
try {
|
||||
|
||||
result = originalParentV2Service.pullFromCadAndToEBom(parents);
|
||||
//更新物料使用
|
||||
// ebomChildService.updateEBomMaterialUse(parents.stream().map(BomOriginalCadParentEntity::getMaterialNo).collect(Collectors.toSet()));
|
||||
|
||||
//跟新EBom 根节点
|
||||
ebomParentService.getBaseMapper().updateRootState();
|
||||
ebomParentService.getBaseMapper().updateRootForWaitReview();
|
||||
|
||||
ebomParentService.resetAllBomExist();
|
||||
}
|
||||
catch (Exception e){
|
||||
VUtils.isTure(true).throwMessage("转换失败:"+e.getMessage());
|
||||
}
|
||||
finally {
|
||||
} catch (Exception e) {
|
||||
VUtils.isTure(true).throwMessage("转换失败:" + e.getMessage());
|
||||
} finally {
|
||||
List<Integer> delRowIds = parents.stream().map(BomOriginalCadParentEntity::getRowId).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(delRowIds)) {
|
||||
originalParentV2Service.delCadData(delRowIds);
|
||||
|
|
|
|||
|
|
@ -9,11 +9,13 @@ import com.alibaba.fastjson.JSON;
|
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.nflg.product.bomnew.constant.EBomStatusEnum;
|
||||
import com.nflg.product.bomnew.constant.OriginalEditStatusEnum;
|
||||
import com.nflg.product.bomnew.constant.OriginalStatusEnum;
|
||||
import com.nflg.product.bomnew.mapper.master.BomNewOriginalParentMapper;
|
||||
import com.nflg.product.bomnew.pojo.dto.BaseImportExcelDTO;
|
||||
import com.nflg.product.bomnew.pojo.dto.BomNewOriginalExcelDTO;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewOriginalParentEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomOriginalCadChildEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomOriginalCadParentEntity;
|
||||
|
|
@ -108,10 +110,9 @@ public class BomNewOriginalParentV2Service extends ServiceImpl<BomNewOriginalPar
|
|||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<ImportOriginalBomVO> pullFromCadAndToEBom(List<BomOriginalCadParentEntity> parents) throws ExecutionException, InterruptedException {
|
||||
|
||||
List<ImportOriginalBomVO> toEBomResult = new ArrayList();
|
||||
|
||||
VUtils.isTure(CollUtil.isEmpty(parents)).throwMessage("没有你的数据,你无需转换");
|
||||
//检查物料编码在主数据中是否存在
|
||||
List<BomOriginalCadChildEntity> childs = originalCadChildService.lambdaQuery().in(BomOriginalCadChildEntity::getParentRowId, parents.stream().map(u -> u.getRowId()).collect(Collectors.toList())).list();
|
||||
|
|
@ -123,7 +124,45 @@ public class BomNewOriginalParentV2Service extends ServiceImpl<BomNewOriginalPar
|
|||
Set<String> noMaterialNoChartNos = parents.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo())).map(u -> u.getChartNo()).collect(Collectors.toSet());
|
||||
VUtils.isTure(CollUtil.isNotEmpty(noMaterialNoChartNos)).throwMessage(StrUtil.join(",", noMaterialNoChartNos) + "物料编码为空,请检查(父级物料编码不能为空)");
|
||||
|
||||
//判断当前用户创建的bom(工作列表)是否已创建了虚拟包,有则中断此次转换
|
||||
List<String> parentMaterialNos = parents.stream().filter(u -> StrUtil.isNotBlank(u.getMaterialNo())).map(u -> u.getMaterialNo()).collect(Collectors.toList());
|
||||
List<BomNewEbomParentEntity> checkList = ebomParentService.lambdaQuery().in(BomNewEbomParentEntity::getMaterialNo, parentMaterialNos).lt(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue())
|
||||
.gt(BomNewEbomParentEntity::getVirtrualPackageEnum, 0).list();
|
||||
if(CollUtil.isNotEmpty(checkList)){
|
||||
List<String> hasVirtualPackageMaterialNo = checkList.stream().map(u ->StrUtil.join("-",u.getMaterialNo(),u.getCurrentVersion()) ).collect(Collectors.toList());
|
||||
VUtils.isTure(true).throwMessage(StrUtil.join(",", hasVirtualPackageMaterialNo)+"已生成虚拟包,请先删除再导入");
|
||||
}
|
||||
|
||||
PlmBomToOriginalConvertV2 convert = new PlmBomToOriginalConvertV2();
|
||||
//存原始BOM
|
||||
toOriginalBom(parents,convert);
|
||||
//转Ebom
|
||||
return toEbom(convert);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换EBOM
|
||||
* @param convert
|
||||
* @return
|
||||
* @throws ExecutionException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<ImportOriginalBomVO> toEbom(PlmBomToOriginalConvertV2 convert) throws ExecutionException, InterruptedException {
|
||||
if (CollUtil.isNotEmpty(convert.getResultParent())) {
|
||||
return convertToEBomV2(convert.getResultParent().stream().map(u -> u.getRowId()).collect(Collectors.toList()));
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 转原始BOM
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void toOriginalBom(List<BomOriginalCadParentEntity> parents,PlmBomToOriginalConvertV2 convert ){
|
||||
|
||||
for (BomOriginalCadParentEntity parent : parents) {
|
||||
//转原始BOM
|
||||
convert.convertOriginalBom(parent);
|
||||
|
|
@ -135,13 +174,6 @@ public class BomNewOriginalParentV2Service extends ServiceImpl<BomNewOriginalPar
|
|||
if (CollUtil.isNotEmpty(convert.getResultChild())) {
|
||||
originalChildService.saveOrUpdateBatch(convert.getResultChild());
|
||||
}
|
||||
//转Ebom
|
||||
|
||||
if (CollUtil.isNotEmpty(convert.getResultParent())) {
|
||||
toEBomResult = convertToEBomV2(convert.getResultParent().stream().map(u -> u.getRowId()).collect(Collectors.toList()));
|
||||
}
|
||||
return toEBomResult;
|
||||
|
||||
}
|
||||
|
||||
@Transactional()
|
||||
|
|
|
|||
|
|
@ -307,10 +307,10 @@ public abstract class BaseConvert {
|
|||
if (oldChildList.size() != newChildList.size()) {
|
||||
return false;
|
||||
}
|
||||
Map<String, List<BomNewEbomChildEntity> > oldChildMap = oldChildList.stream().collect(Collectors.groupingBy(u->StrUtil.join(u.getMaterialNo(),u.getProjectType()) ));
|
||||
Map<String, List<BomNewEbomChildEntity> > oldChildMap = oldChildList.stream().collect(Collectors.groupingBy(u->StrUtil.join("",u.getMaterialNo(),u.getProjectType(),u.getNum()) ));
|
||||
for (BomNewEbomChildEntity newChild : newChildList) {
|
||||
String key=StrUtil.join(newChild.getMaterialNo(),newChild.getProjectType());
|
||||
if(!oldChildMap.containsKey(key) || Objects.equals(newChild.getNum(), oldChildMap.get(key).get(0).getNum()) ){
|
||||
String key=StrUtil.join("",newChild.getMaterialNo(),newChild.getProjectType(),newChild.getNum());
|
||||
if(!oldChildMap.containsKey(key)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
|
||||
/**
|
||||
* 合并一般零部件
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -106,21 +107,21 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
|
||||
List<BomOriginalListVO> result = new ArrayList();
|
||||
//子级中,一般零部件
|
||||
List<BomOriginalListVO> commonPartList = list.stream().filter(u -> StrUtil.isNotBlank(u.getMaterialNo()) && u.getRegReplaceIs().equals(1)).collect(Collectors.toList());
|
||||
List<BomOriginalListVO> commonPartList = list.stream().filter(u -> StrUtil.isNotBlank(u.getMaterialNo()) && u.getRegReplaceIs().equals(1)).collect(Collectors.toList());
|
||||
|
||||
Map<String, List<BomOriginalListVO>> materialNoGroupMp =commonPartList.stream().collect(Collectors.groupingBy(BomOriginalListVO::getMaterialNo));
|
||||
Map<String, List<BomOriginalListVO>> materialNoGroupMp = commonPartList.stream().collect(Collectors.groupingBy(BomOriginalListVO::getMaterialNo));
|
||||
for (Map.Entry<String, List<BomOriginalListVO>> entry : materialNoGroupMp.entrySet()) {
|
||||
List<BomOriginalListVO> list1 = entry.getValue();
|
||||
BomOriginalListVO one = list1.get(0);
|
||||
BigDecimal numResult = BigDecimal.ZERO;
|
||||
BigDecimal totalWeightResult = BigDecimal.ZERO;
|
||||
List<Long> rowIds=new ArrayList<>();
|
||||
List<Long> rowIds = new ArrayList<>();
|
||||
for (BomOriginalListVO item : list1) {
|
||||
BigDecimal numNew=BigDecimal.ZERO;
|
||||
if( EBomConstant.KG.equalsIgnoreCase(item.getMaterialUnit())){
|
||||
BigDecimal numNew = BigDecimal.ZERO;
|
||||
if (EBomConstant.KG.equalsIgnoreCase(item.getMaterialUnit())) {
|
||||
numNew = item.getTotalWeight();
|
||||
}else {
|
||||
numNew= item.getNum();
|
||||
} else {
|
||||
numNew = item.getNum();
|
||||
}
|
||||
// numResult = NumberUtil.add(numResult, Objects.nonNull( item.getNum()) ? item.getNum() : BigDecimal.ZERO);
|
||||
numResult = NumberUtil.add(numResult, numNew);
|
||||
|
|
@ -129,11 +130,11 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
}
|
||||
one.setNum(numResult);
|
||||
one.setTotalWeight(totalWeightResult);
|
||||
one.setSourceRowId(StrUtil.join(",",rowIds) );
|
||||
one.setSourceRowId(StrUtil.join(",", rowIds));
|
||||
result.add(one);
|
||||
}
|
||||
Set<Long> commonPartRowIds = commonPartList.stream().map(u -> u.getRowId()).collect(Collectors.toSet());
|
||||
result.addAll(list.stream().filter(u->!commonPartRowIds.contains(u.getRowId())).collect(Collectors.toList()));
|
||||
result.addAll(list.stream().filter(u -> !commonPartRowIds.contains(u.getRowId())).collect(Collectors.toList()));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -148,67 +149,59 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
//子节点
|
||||
List<BomOriginalListVO> parentChild = bomDetail.stream().filter(u -> Objects.nonNull(u.getParentRowId()) && u.getParentRowId().equals(parentEnt.getBomRowId())).distinct().collect(Collectors.toList());
|
||||
|
||||
|
||||
|
||||
BomNewEbomParentEntity oldEBom = ebomParentService.lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo, parentEnt.getMaterialNo()).last(" order by current_version desc limit 1").one();
|
||||
List<BomNewEbomChildEntity> oldParenChild = ebomChildService.getBaseMapper().getChildByMaterialNo(parentEnt.getMaterialNo());
|
||||
//无Ebom时
|
||||
if (Objects.isNull(oldEBom)) {
|
||||
Long parentRowId = buildEBomParent(parentEnt);
|
||||
Long parentRowId = buildEBomParent(parentEnt, "V00");
|
||||
parentEnt.setEBomRowId(parentRowId);
|
||||
handlerChild(parentEnt, parentChild);
|
||||
return;
|
||||
}
|
||||
|
||||
// List<BomNewEbomChildEntity> oldParenChild = ebomChildService.lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId,oldEBom.getRowId()).list();
|
||||
//草稿态
|
||||
if (!EBomStatusEnum.PUBLISHED.equalsValue(oldEBom.getStatus())) {
|
||||
|
||||
//不是同一个人,跳过并返回告知用户
|
||||
if (!parent.getCreatedBy().equals(oldEBom.getCreatedBy())) {
|
||||
VUtils.isTure(true).throwMessage(parent.getMaterialNo() + ":已存在" + oldEBom.getCreatedBy() + "创建的BOM版本,改BOM已跳过");
|
||||
return;
|
||||
}
|
||||
if (CollUtil.isNotEmpty(parentChild)) {
|
||||
//结构不一致且用户是一人则覆盖
|
||||
if (!isSameEBomV2(Convert.toList(BomNewEbomChildEntity.class, parentChild), oldParenChild)) {
|
||||
if (parent.getCreatedBy().equals(oldEBom.getCreatedBy())) {
|
||||
ebomParentService.getBaseMapper().deleteById(oldEBom.getRowId());
|
||||
ebomChildService.getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldEBom.getRowId()));
|
||||
Long parentRowId = buildEBomParent(parentEnt);
|
||||
parentEnt.setEBomRowId(parentRowId);
|
||||
handlerChild(parentEnt, parentChild);
|
||||
}
|
||||
// 当前处理人为同一人则直接覆盖
|
||||
if (parent.getCreatedBy().equals(oldEBom.getCreatedBy())) {
|
||||
ebomParentService.getBaseMapper().deleteById(oldEBom.getRowId());
|
||||
ebomChildService.getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldEBom.getRowId()));
|
||||
Long parentRowId = buildEBomParent(parentEnt, oldEBom.getCurrentVersion());
|
||||
parentEnt.setEBomRowId(parentRowId);
|
||||
handlerChild(parentEnt, parentChild);
|
||||
}
|
||||
} else {
|
||||
if (parentEnt.getMaterialCategoryCode().equals(OriginalConstant.COMMON_MATERIAL_CATEGORY_CODE)) {
|
||||
//通过名称找子级
|
||||
BaseMaterialVO materialBaseInfo = getCommonMaterialByRel(parentEnt);
|
||||
if (Objects.nonNull(materialBaseInfo)) {
|
||||
List<BomNewEbomChildEntity> oldChild = ebomChildService.getBaseMapper().getChildByMaterialNo(parentEnt.getMaterialNo());
|
||||
// List<BomNewEbomChildEntity> oldChild = ebomChildService.getBaseMapper().getChildByMaterialNo(parentEnt.getMaterialNo());
|
||||
BomNewEbomChildEntity newChild = buildCommonEbomChildEntity(materialBaseInfo, parentEnt);
|
||||
//存在旧版本
|
||||
if (CollUtil.isNotEmpty(oldChild)) {
|
||||
//结构是否相同 且为同一处理人
|
||||
if (!isSameEBom(oldChild, ImmutableList.of(newChild)) && parent.getCreatedBy().equals(oldEBom.getCreatedBy())) {
|
||||
//结构是否相同 且为同一处理人
|
||||
if (parent.getCreatedBy().equals(oldEBom.getCreatedBy())) {
|
||||
|
||||
ebomParentService.getBaseMapper().deleteById(oldEBom.getRowId());
|
||||
ebomChildService.getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldEBom.getRowId()));
|
||||
ebomParentService.getBaseMapper().deleteById(oldEBom.getRowId());
|
||||
ebomChildService.getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldEBom.getRowId()));
|
||||
|
||||
Long parentRowId = buildEBomParent(parentEnt);
|
||||
newChild.setParentRowId(parentRowId);
|
||||
this.eBomChildResult.add(newChild);
|
||||
}
|
||||
Long parentRowId = buildEBomParent(parentEnt, oldEBom.getCurrentVersion());
|
||||
newChild.setParentRowId(parentRowId);
|
||||
this.eBomChildResult.add(newChild);
|
||||
}
|
||||
|
||||
} else {
|
||||
buildEBomParent(parentEnt);
|
||||
}
|
||||
} else {
|
||||
buildEBomParent(parentEnt);
|
||||
//
|
||||
}
|
||||
//
|
||||
}
|
||||
} else { //正式版
|
||||
//bom不
|
||||
if (!isSameEBomV2(Convert.toList(BomNewEbomChildEntity.class, parentChild), oldParenChild)) {
|
||||
Long parentRowId = buildEBomParent(parentEnt);
|
||||
parentEnt.setEBomRowId(parentRowId);
|
||||
handlerChild(parentEnt, parentChild);
|
||||
}
|
||||
} else { //正式版(生成临时小版本)
|
||||
|
||||
String smallBomVersion = VersionUtil.getNextVersionForSmallVersion(oldEBom.getCurrentVersion());
|
||||
Long parentRowId = buildEBomParent(parentEnt, smallBomVersion);
|
||||
parentEnt.setEBomRowId(parentRowId);
|
||||
handlerChild(parentEnt, parentChild);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -241,7 +234,7 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
}
|
||||
|
||||
//合并一般零部件
|
||||
parentChild= mergeCommonPartBOM(parentChild);
|
||||
parentChild = mergeCommonPartBOM(parentChild);
|
||||
|
||||
for (BomOriginalListVO childVo : parentChild) {
|
||||
if (StrUtil.isNotBlank(childVo.getMaterialNo()) && StrUtil.isNotBlank(childVo.getMaterialCategoryCode()) && childVo.getMaterialCategoryCode().equals(OriginalConstant.COMMON_MATERIAL_CATEGORY_CODE)) {
|
||||
|
|
@ -252,24 +245,24 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
BomNewEbomParentEntity oldEBom = ebomParentService.lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo, childVo.getMaterialNo()).last(" order by current_version desc limit 1").one();
|
||||
List<BomNewEbomChildEntity> oldParenChild = SpringUtil.getBean(BomNewEbomChildMapper.class).getChildByMaterialNo(parentEntity.getMaterialNo());
|
||||
//不存在EBom 时
|
||||
if(Objects.isNull(oldEBom)){
|
||||
buildCommonMaterialChildBom(childVo, materialBaseInfo);
|
||||
if (Objects.isNull(oldEBom)) {
|
||||
buildCommonMaterialChildBom(childVo, materialBaseInfo, "V00");
|
||||
|
||||
}else {
|
||||
if(!EBomStatusEnum.PUBLISHED.equalsValue(oldEBom.getStatus())){
|
||||
} else {
|
||||
if (!EBomStatusEnum.PUBLISHED.equalsValue(oldEBom.getStatus())) {
|
||||
BomNewEbomChildEntity newChild = buildCommonEbomChildEntity(materialBaseInfo, parentEntity);
|
||||
//结构是否相同 且为同一个人
|
||||
if (!isSameEBom(oldParenChild, ImmutableList.of(newChild)) && oldEBom.getCreatedBy().equals(parentEntity.getCreatedBy())) {
|
||||
ebomParentService.getBaseMapper().deleteById(oldEBom.getRowId());
|
||||
ebomChildService.getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldEBom.getRowId()));
|
||||
|
||||
Long parentRowId = buildEBomParent(childVo);
|
||||
Long parentRowId = buildEBomParent(childVo, oldEBom.getCurrentVersion());
|
||||
newChild.setParentRowId(parentRowId);
|
||||
this.eBomChildResult.add(newChild);
|
||||
}
|
||||
}
|
||||
else { //正式则直接升级
|
||||
buildCommonMaterialChildBom(childVo, materialBaseInfo);
|
||||
} else { //正式则直接升级
|
||||
String smallBomVersion = VersionUtil.getNextVersionForSmallVersion(oldEBom.getCurrentVersion());
|
||||
buildCommonMaterialChildBom(childVo, materialBaseInfo, smallBomVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -280,12 +273,13 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
}
|
||||
|
||||
/**
|
||||
* 创建一般零部件BOM
|
||||
* 创建一般零部件BOM
|
||||
*
|
||||
* @param childVo
|
||||
* @param materialBaseInfo
|
||||
*/
|
||||
private void buildCommonMaterialChildBom(BomOriginalListVO childVo,BaseMaterialVO materialBaseInfo){
|
||||
Long parentRowId = buildEBomParent(childVo);
|
||||
private void buildCommonMaterialChildBom(BomOriginalListVO childVo, BaseMaterialVO materialBaseInfo, String bomVersion) {
|
||||
Long parentRowId = buildEBomParent(childVo, bomVersion);
|
||||
childVo.setEBomRowId(parentRowId);
|
||||
BomNewEbomChildEntity childEntity = buildCommonEbomChildEntity(materialBaseInfo, childVo);
|
||||
this.eBomChildResult.add(childEntity);
|
||||
|
|
@ -362,7 +356,7 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
/**
|
||||
* 构建EBom父级
|
||||
*/
|
||||
private Long buildEBomParent(BomOriginalListVO parentEnt) {
|
||||
private Long buildEBomParent(BomOriginalListVO parentEnt, String bomVersion) {
|
||||
Map<String, BomNewEbomParentEntity> parentMap = ListCommonUtil.listToMap(this.getEBomParentResult(), BomNewEbomParentEntity::getMaterialNo);
|
||||
if (parentMap.containsKey(parentEnt.getMaterialNo())) {
|
||||
return parentMap.get(parentEnt.getMaterialNo()).getRowId();
|
||||
|
|
@ -372,9 +366,9 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
BeanUtil.copyProperties(parentEnt, eBomParent, "materialGetType");
|
||||
eBomParent.setRowId(parentEnt.getEBomRowId() > 0 ? parentEnt.getEBomRowId() : IdWorker.getId());
|
||||
eBomParent.setSource(EBomSourceEnum.FROM_BOM.getValue());
|
||||
eBomParent.setCurrentVersion(VersionUtil.getNextVersion(Objects.isNull(ebom) ? "" : ebom.getCurrentVersion()));
|
||||
eBomParent.setCurrentVersion(bomVersion);
|
||||
eBomParent.setConvertToEbomTime(LocalDateTime.now());
|
||||
eBomParent.setSourceRowId(StrUtil.isNotBlank(parentEnt.getSourceRowId())?parentEnt.getSourceRowId(): parentEnt.getRowId().toString());
|
||||
eBomParent.setSourceRowId(StrUtil.isNotBlank(parentEnt.getSourceRowId()) ? parentEnt.getSourceRowId() : parentEnt.getRowId().toString());
|
||||
eBomParent.setLastVersionIs(1);
|
||||
eBomParent.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue());
|
||||
//eBomParent.setModifyTime(LocalDateTime.now());
|
||||
|
|
@ -428,7 +422,7 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
childEntity.setParentRowId(parent.getEBomRowId());
|
||||
childEntity.setIdentityNo(StrUtil.join("_", parent.getEBomRowId().toString(), childEntity.getRowId()));
|
||||
childEntity.setModifyTime(LocalDateTime.now());
|
||||
childEntity.setSourceRowId(StrUtil.isNotBlank(child.getSourceRowId())?child.getSourceRowId(): child.getRowId().toString());
|
||||
childEntity.setSourceRowId(StrUtil.isNotBlank(child.getSourceRowId()) ? child.getSourceRowId() : child.getRowId().toString());
|
||||
//当为原材料时,数量=总重 单位改为KG 图号=编码
|
||||
// if((StrUtil.isNotBlank(childEntity.getMaterialCategoryCode())&& childEntity.getMaterialCategoryCode().startsWith("10") ) || (StrUtil.isNotBlank(childEntity.getMaterialNo()) && childEntity.getMaterialNo().startsWith("11"))){
|
||||
// childEntity.setNum(childEntity.getTotalWeight());
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import java.util.stream.Collectors;
|
|||
* @Author 大米
|
||||
* @Date 2022-11-08
|
||||
*/
|
||||
public class ListCommonUtil extends ListUtil {
|
||||
public class ListCommonUtil extends ListUtil {
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue