Merge branch 'feature/DM/nflg-bom' of http://112.74.186.154:3000/nflj/nflg_project into feature/DM/nflg-bom

This commit is contained in:
jing's 2024-01-24 17:02:27 +08:00
commit 3ca4ee7606
6 changed files with 35 additions and 23 deletions

View File

@ -16,6 +16,8 @@ public class AddVirtrualMaterialDTO {
private String materialDesc ; private String materialDesc ;
private String materialCategoryCode; private String materialCategoryCode;
private String projectType;
@ApiModelProperty("申请后返回的物料编码") @ApiModelProperty("申请后返回的物料编码")
private String materialNo; private String materialNo;
} }

View File

@ -265,7 +265,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
child.setTechnologyUserCode(parentEntity.getTechnologyUserCode()); child.setTechnologyUserCode(parentEntity.getTechnologyUserCode());
child.setTechnologyUserName(parentEntity.getTechnologyUserName()); child.setTechnologyUserName(parentEntity.getTechnologyUserName());
if (parentEntity.getStatus().equals(PBomStatusEnum.PUBLISH.getValue())) { if ( parent.getStatus()< PBomStatusEnum.PUBLISH.getValue() && parentEntity.getStatus().equals(PBomStatusEnum.PUBLISH.getValue())) {
child.setStatus(PBomStatusEnum.BORROWED_PARTS.getValue()); child.setStatus(PBomStatusEnum.BORROWED_PARTS.getValue());
} }
@ -398,7 +398,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
result = Convert.convert(BomNewPbomParentVO.class, parent); result = Convert.convert(BomNewPbomParentVO.class, parent);
} }
materialMainService.intiMaterialInfo(ImmutableList.of(result)); materialMainService.intiMaterialInfo(ImmutableList.of(result));
VUtils.isTure(StrUtil.isBlank(result.getMaterialCategoryCode()) || !result.getMaterialCategoryCode().startsWith("20")).throwMessage("插入工艺包的物料需制作物料"); VUtils.isTure(StrUtil.isBlank(result.getMaterialCategoryCode()) || !result.getMaterialCategoryCode().startsWith("20")).throwMessage("插入工艺包的物料需制作物料");
// drawingNo = StrUtil.join("", result.getDrawingNo(), technologyPackageTypeEntity.getDrawingNoSuffix()); // drawingNo = StrUtil.join("", result.getDrawingNo(), technologyPackageTypeEntity.getDrawingNoSuffix());
// 检查改图号是否已存在主数据中 // 检查改图号是否已存在主数据中
@ -418,10 +418,16 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
toM.setDrawingNo(drawingNo); toM.setDrawingNo(drawingNo);
toM.setMaterialDesc(materialDesc); toM.setMaterialDesc(materialDesc);
toM.setMaterialCategoryCode("201201"); toM.setMaterialCategoryCode("201201");
toM.setProjectType(packageParam.getProjectType());
Map<String, AddVirtrualMaterialDTO> mMap = materialService.batchAddMaterial(ImmutableList.of(toM)); Map<String, AddVirtrualMaterialDTO> mMap = materialService.batchAddMaterial(ImmutableList.of(toM));
// String materialNo = materialService.addMaterial(drawingNo, materialName, materialDesc, "201201"); // String materialNo = materialService.addMaterial(drawingNo, materialName, materialDesc, "201201");
String materialNo=mMap.get(key).getMaterialNo(); String materialNo=mMap.get(key).getMaterialNo();
return materialMainService.getMaterialBaseInfo(ImmutableList.of(materialNo)).get(0); BaseMaterialVO resultD = materialMainService.getMaterialBaseInfo(ImmutableList.of(materialNo)).get(0);
//插入工艺包
packageParam.setTechnologyPackageMaterialNo(materialNo);
insertTechnologyPackage(packageParam);
return resultD;
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -432,6 +438,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
throw new NflgBusinessException(STATE.BusinessError, "单条物料时,请选择上下级"); throw new NflgBusinessException(STATE.BusinessError, "单条物料时,请选择上下级");
} }
TechnologyPackageParamBuilder builder = new TechnologyPackageParamBuilder(technologyPackageParam); TechnologyPackageParamBuilder builder = new TechnologyPackageParamBuilder(technologyPackageParam);
builder.builder();
if (CollUtil.isNotEmpty(builder.getPackageParent())) { if (CollUtil.isNotEmpty(builder.getPackageParent())) {
this.saveOrUpdateBatch(builder.getPackageParent()); this.saveOrUpdateBatch(builder.getPackageParent());
} }

View File

@ -187,6 +187,9 @@ public class MaterialService {
ma.setApplyUserCode(SessionUtil.getRealName()); ma.setApplyUserCode(SessionUtil.getRealName());
ma.setMaterialUnit("PC"); ma.setMaterialUnit("PC");
ma.setProcessState(10); ma.setProcessState(10);
if(StrUtil.isNotBlank(md.getProjectType())){
ma.setProjectType(md.getProjectType());
}
resultList.add(ma); resultList.add(ma);
AddMaterialMainDTO ent=new AddMaterialMainDTO(); AddMaterialMainDTO ent=new AddMaterialMainDTO();
@ -381,7 +384,7 @@ public class MaterialService {
if (optional.isPresent()) { if (optional.isPresent()) {
OaResult oaResult = optional.get(); OaResult oaResult = optional.get();
materialMainEntity.setOaRowId(oaResult.getInstId()); materialMainEntity.setOaRowId(oaResult.getInstId());
materialMainEntity.setProcessState(100); // materialMainEntity.setProcessState(10);
} }
} }
materialMainService.updateBatchById(entityList); materialMainService.updateBatchById(entityList);

View File

@ -146,7 +146,7 @@ public abstract class VirtualPackageBase {
parent.setSourceRowId(0L); parent.setSourceRowId(0L);
parent.setLastVersionIs(1); parent.setLastVersionIs(1);
parent.setNum(new BigDecimal(1)); parent.setNum(new BigDecimal(1));
parent.setDeviseName(SessionUtil.getUserCode()); parent.setDeviseUserCode(SessionUtil.getUserCode());
parent.setDeviseName(SessionUtil.getRealName()); parent.setDeviseName(SessionUtil.getRealName());
parent.setCreatedBy(SessionUtil.getUserCode()); parent.setCreatedBy(SessionUtil.getUserCode());
parent.setDeptName(SessionUtil.getDepartName()); parent.setDeptName(SessionUtil.getDepartName());

View File

@ -163,9 +163,9 @@ public class ConvertToMBom {
* *
* @param * @param
*/ */
private void handEmptyMakePackage() { private void handEmptyMakePackage(List<ConvertToMBomDTO> childBomTree) {
List<ConvertToMBomDTO> childBomTree = ConvertToMbomUtil.toTree(parent.getRowId(), allChildTreeList_1020, ConvertToMBomDTO::getRelParentRowId, ConvertToMBomDTO::getBomRowId); // List<ConvertToMBomDTO> childBomTree = ConvertToMbomUtil.toTree(parent.getRowId(), allChildTreeList_1020, ConvertToMBomDTO::getRelParentRowId, ConvertToMBomDTO::getBomRowId);
for (ConvertToMBomDTO item : childBomTree) { for (ConvertToMBomDTO item : childBomTree) {
if (VirtualPackageTypeEnum.DELIVERY_PACKAGE.equalsValue(item.getVirtualPartType())) { if (VirtualPackageTypeEnum.DELIVERY_PACKAGE.equalsValue(item.getVirtualPartType())) {
List<ConvertToMBomDTO> makeChild = item.getChildNodes().stream().filter(u -> VirtualPackageTypeEnum.MAKING_PACKAGE.equalsValue(u.getVirtualPartType())).collect(Collectors.toList()); List<ConvertToMBomDTO> makeChild = item.getChildNodes().stream().filter(u -> VirtualPackageTypeEnum.MAKING_PACKAGE.equalsValue(u.getVirtualPartType())).collect(Collectors.toList());
@ -231,7 +231,7 @@ public class ConvertToMBom {
recursionHandlerChild1020(item, directDeliveryPackage); recursionHandlerChild1020(item, directDeliveryPackage);
} }
//处理制作包无下级的情况 //处理制作包无下级的情况
handEmptyMakePackage(); handEmptyMakePackage(childBomTree);
} }