【BOM清单】物料颜色和工序id

dev
siontion 2 months ago
parent f6a9045c21
commit 963212d05e

@ -73,6 +73,8 @@ public class BOMChildDTOs {
private Inventory inventory;
private String version;
private List<BOMChildDTOs> BOMChildDTOs;
private Process Process;
private List<String> DynamicPropertyKeys;
private List<String> DynamicPropertyValues;

@ -25,9 +25,9 @@ public class Inventory {
private String Specification;
private String InventoryClass;
private InventoryClass InventoryClass;
private String UnitByStock;
private UnitByStock UnitByStock;
public Inventory(String code) {
Code = code;

@ -24,7 +24,7 @@ public class InventoryBOM {
private Boolean IsPhantom;
private String InventoryClass;
private InventoryClass InventoryClass;
public InventoryBOM(String code) {
Code = code;

@ -13,6 +13,7 @@ public class Process {
private String Process_Memo;
private String Code;
private String Name;
public void setProcess_Memo(String Process_Memo) {
this.Process_Memo = Process_Memo;
}
@ -27,4 +28,11 @@ public class Process {
return Code;
}
public void setName(String Name) {
this.Name = Name;
}
public String getName() {
return Name;
}
}

@ -59,4 +59,6 @@ public class BomMaterialVO {
@Schema(description = "一级产品编码")
private String topCode;
private String procedureName;
}

@ -42,6 +42,7 @@ import com.chanko.yunxi.mes.module.biz.dal.dataobject.warehouse.WarehouseDO;
import com.chanko.yunxi.mes.module.biz.dal.dataobject.workshop.WorkshopDO;
import com.chanko.yunxi.mes.module.biz.dal.mysql.customer.CustomerMapper;
import com.chanko.yunxi.mes.module.biz.dal.mysql.material.MaterialMapper;
import com.chanko.yunxi.mes.module.biz.dal.mysql.procedure.ProcedureMapper;
import com.chanko.yunxi.mes.module.biz.dal.mysql.projectorder.ProjectOrderMapper;
import com.chanko.yunxi.mes.module.biz.dal.mysql.projectorder.ProjectOrderSubMapper;
import com.chanko.yunxi.mes.module.biz.dal.mysql.storage.StorageMapper;
@ -162,6 +163,9 @@ public class ChanjetSchedule {
@Resource
private TplusStorageOutMapper tplusStorageOutMapper;
@Resource
private ProcedureMapper procedureMapper;
private Boolean getSystemParameters(){
Boolean chanjet_switch = true;
return chanjet_switch;
@ -194,7 +198,17 @@ public class ChanjetSchedule {
List<TplusLastestBomDO> insertList = BeanUtils.toBean(bomMaterialVOS, TplusLastestBomDO.class);
List<ProcedureDO> procedureDOS = procedureMapper.selectList(new LambdaUpdateWrapper<ProcedureDO>(){{
eq(ProcedureDO::getStatus,1);
}});
insertList.forEach(xo -> {
ProcedureDO procedureDO = procedureDOS.stream().filter(po->po.getCode().equals(xo.getProcedureName())).collect(Collectors.toList()).get(0);
if(procedureDO!=null){
xo.setProcedureId(procedureDO.getId()).setProcedureCode(procedureDO.getCode()).setProcedureName(procedureDO.getName());
}
xo.setId(null).setTopCode(so.getProjectSubCode()).setCreator("2").setUpdater("2");
});
@ -251,8 +265,8 @@ public class ChanjetSchedule {
materialDOWithColor.setSpec(topLayer.getInventory().getSpecification());
materialDOWithColor.setExternalCode(topLayer.getCode());
materialDOWithColor.setStatus(ValidStatusEnum.VALID.getCode());
materialDOWithColor.setUnit(topLayer.getUnit().getCode());
materialDOWithColor.setMaterialType(topLayer.getInventory().getInventoryClass());
materialDOWithColor.setUnit(topLayer.getUnit()==null?null:topLayer.getUnit().getCode());
materialDOWithColor.setMaterialType(topLayer.getInventory().getInventoryClass()==null?null:topLayer.getInventory().getInventoryClass().getCode());
materialDOWithColor.setInventoryProperty(6);
materialMapper.insert(materialDOWithColor);
@ -331,13 +345,15 @@ public class ChanjetSchedule {
.setIsVirtual(dto.getInventory().getIsPhantom() ? YesOrNoEnum.Y.getCode() : YesOrNoEnum.N.getCode())
.setBomVersion(dto.getVersion())
.setStockQuantity(new BigDecimal(stockData.getAvailableQuantity()))
.setUnit(stockData.getUnitName());
.setUnit(stockData.getUnitName())
.setProcedureName(dto.getProcess()==null?null:dto.getProcess().getName());
resultData.add(bomMaterialVO);
//判断物料编码+物料名称+规格+颜色是否存在
// 判断物料编码+物料名称+规格+颜色是否存在
for (Integer idx = 0; idx < dto.getDynamicPropertyValues().size(); idx++) {
if (dto.getDynamicPropertyKeys().get(idx).contains("bomdto_freeitem0".toLowerCase())
if (dto.getDynamicPropertyKeys().get(idx).contains("freeitem0".toLowerCase())
&& !StringUtils.isEmpty(dto.getDynamicPropertyValues().get(idx))) {
String color = dto.getDynamicPropertyValues().get(idx);
@ -357,8 +373,8 @@ public class ChanjetSchedule {
materialDOWithColor.setSpec(dto.getInventory().getSpecification());
materialDOWithColor.setExternalCode(dto.getInventory().getCode());
materialDOWithColor.setStatus(ValidStatusEnum.VALID.getCode());
materialDOWithColor.setUnit(dto.getInventory().getUnitByStock());
materialDOWithColor.setMaterialType(dto.getInventory().getInventoryClass());
materialDOWithColor.setUnit(dto.getInventory().getUnitByStock()==null?null:dto.getInventory().getUnitByStock().getCode());
materialDOWithColor.setMaterialType(dto.getInventory().getInventoryClass()==null?null:dto.getInventory().getInventoryClass().getCode());
materialDOWithColor.setInventoryProperty(6);
materialMapper.insert(materialDOWithColor);

Loading…
Cancel
Save