加1|自制;2|外协;3|采购

This commit is contained in:
大米 2024-01-24 10:06:29 +08:00
parent 5821052b77
commit 4a9d9b5385
3 changed files with 11 additions and 6 deletions

View File

@ -398,7 +398,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
result = Convert.convert(BomNewPbomParentVO.class, parent);
}
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());
// 检查改图号是否已存在主数据中
@ -421,7 +421,12 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
Map<String, AddVirtrualMaterialDTO> mMap = materialService.batchAddMaterial(ImmutableList.of(toM));
// String materialNo = materialService.addMaterial(drawingNo, materialName, materialDesc, "201201");
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)

View File

@ -381,7 +381,7 @@ public class MaterialService {
if (optional.isPresent()) {
OaResult oaResult = optional.get();
materialMainEntity.setOaRowId(oaResult.getInstId());
materialMainEntity.setProcessState(100);
// materialMainEntity.setProcessState(10);
}
}
materialMainService.updateBatchById(entityList);

View File

@ -163,9 +163,9 @@ public class ConvertToMBom {
*
* @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) {
if (VirtualPackageTypeEnum.DELIVERY_PACKAGE.equalsValue(item.getVirtualPartType())) {
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);
}
//处理制作包无下级的情况
handEmptyMakePackage();
handEmptyMakePackage(childBomTree);
}