|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesCustomerPartService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesPullingOrderInfoService;
|
|
|
|
|
import cn.estsh.i3plus.icloud.core.sdk.ICoreUtilCloud;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
@ -49,6 +50,8 @@ public class MesPullingOrderInfoService extends BaseMesService<MesPullingOrderIn
|
|
|
|
|
private MesPullingOrderExtendsRepository mesPullingOrderExtendsRepository;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesPrintedSnLogRepository snLogRao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesCustomerPartService mesCustomerPartService;
|
|
|
|
|
protected void setPackQueryBean(MesPullingOrderInfo bean, DdlPackBean packBean) {
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getPullCode(), "pullCode", packBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getPullingOrderNo(), "pullingOrderNo", packBean);
|
|
|
|
@ -136,6 +139,9 @@ public class MesPullingOrderInfoService extends BaseMesService<MesPullingOrderIn
|
|
|
|
|
LOGGER.info("根据拉动组和生产工单产生拉动单JOB-->工厂号{},产线对应的工单对应工单零件mesWorkOrderPartList-->{}", organizeCode, mesWorkOrderPartList);
|
|
|
|
|
//5.取工单零件和拉动组交集,根据拉动主表对应的类型 生成相应的拉动单和拉动单明细
|
|
|
|
|
Map<String, List<MesWorkOrderPart>> workOrderNoListMap = mesWorkOrderPartList.stream().collect(Collectors.groupingBy(MesWorkOrderPart::getWorkOrderNo));
|
|
|
|
|
//6、获取客户物料信息
|
|
|
|
|
List<MesCustomerPart> mesCustomerPartByPartNoList = mesCustomerPartService.findMesCustomerPartByPartNo(organizeCode, partPullDetailListMap.keySet().stream().distinct().collect(Collectors.toList()));
|
|
|
|
|
Map<String, List<MesCustomerPart>> customerPartMap = CollectionUtils.isEmpty(mesCustomerPartByPartNoList) ? null : mesCustomerPartByPartNoList.stream().collect(Collectors.groupingBy(MesCustomerPart::getErpPartNo));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Map.Entry<String, List<MesWorkOrderPart>> stringListEntry : workOrderNoListMap.entrySet()) {
|
|
|
|
@ -234,7 +240,7 @@ public class MesPullingOrderInfoService extends BaseMesService<MesPullingOrderIn
|
|
|
|
|
pullingOrderPartInfo.setEquipment(partInfo.getEquipment());
|
|
|
|
|
pullingOrderPartInfo.setLocation(partInfo.getPullAddr());//todo
|
|
|
|
|
pullingOrderPartInfo.setStatus(MesExtEnumUtil.PULL_ORDER_PART_STATUS.UN_SENTED.getValue());///明细已送料为1,未送料为0
|
|
|
|
|
pullingOrderPartInfo.setCustPartNo(pullingOrder.getCustPartNo());
|
|
|
|
|
pullingOrderPartInfo.setCustPartNo(!Objects.isNull(customerPartMap) && customerPartMap.containsKey(partInfo.getPartNo()) ? customerPartMap.get(partInfo.getPartNo()).iterator().next().getCustPartNo() : "");
|
|
|
|
|
if (partInfo.getScanValidationType() == 10) {
|
|
|
|
|
pullingOrderPartInfo.setColor(MesExtEnumUtil.PART_PULL_DETAIL_COLOR.WHITE.getCode());
|
|
|
|
|
} else {
|
|
|
|
|