|
|
|
@ -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);
|
|
|
|
|