kitting 修复调整

tags/yfai-mes-ext-v3.11^2
臧学普 3 months ago
parent 4a84cba207
commit 8c98d36b16

@ -335,7 +335,7 @@ public class MesWorkOrderService extends BaseMesService<MesWorkOrder> implements
if (!StringUtils.isEmpty(pullOrderCloseState)){ if (!StringUtils.isEmpty(pullOrderCloseState)){
List<String> closeState = Arrays.asList(pullOrderCloseState.split(",")); List<String> closeState = Arrays.asList(pullOrderCloseState.split(","));
if (closeState.contains(mesWorkOrder.getWorkOrderStatus().toString())){ if (closeState.contains(mesWorkOrder.getWorkOrderStatus().toString())){
mesPullingOrderInfoRao.updateByProperties(new String[]{"workOrderNo"}, new Object[]{mesWorkOrder.getWorkOrderNo()}, new String[]{"pullOrderStatus","modifyUser"}, new Object[]{ MesExtEnumUtil.PULL_ORDER_STATUS.PULL_ORDER_STATUS_50,userName}); mesPullingOrderInfoRao.updateByProperties(new String[]{"workOrderNo"}, new Object[]{mesWorkOrder.getWorkOrderNo()}, new String[]{"pullOrderStatus","modifyUser"}, new Object[]{ MesExtEnumUtil.PULL_ORDER_STATUS.PULL_ORDER_STATUS_50.getValue(),userName});
} }
} }
} }
@ -785,6 +785,10 @@ public class MesWorkOrderService extends BaseMesService<MesWorkOrder> implements
} }
private void doCreateKitting(List<MesWorkOrder> mesWorkOrderList,String organizeCode) { private void doCreateKitting(List<MesWorkOrder> mesWorkOrderList,String organizeCode) {
mesWorkOrderList = mesWorkOrderList.stream().filter(item ->item.getPullingStatus()!=MesExtEnumUtil.WORK_ORDER_PULLING_STATUS.SUBMIT.getValue()).collect(Collectors.toList());
if (mesWorkOrderList.isEmpty()){
return;
}
//1.拉动组获取 -- 根据拉动组类型获取kitting,需要判断是否生成是否生成拉动单开关 //1.拉动组获取 -- 根据拉动组类型获取kitting,需要判断是否生成是否生成拉动单开关
DdlPackBean partPullPackBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPackBean partPullPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_PULL_ORDER_TYPE.KITTING_PULL.getValue(),"pullOrderType", partPullPackBean); DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_PULL_ORDER_TYPE.KITTING_PULL.getValue(),"pullOrderType", partPullPackBean);
@ -957,6 +961,7 @@ public class MesWorkOrderService extends BaseMesService<MesWorkOrder> implements
for (int i = 1; i <= multiple; i++) { for (int i = 1; i <= multiple; i++) {
insertPullOrderInfo( mesWorkOrder, bomPullList, mesPartPull, mesPartPullDetailList, organizeCode, i, packRoundQty); insertPullOrderInfo( mesWorkOrder, bomPullList, mesPartPull, mesPartPullDetailList, organizeCode, i, packRoundQty);
} }
workOrderRepository.updateByProperties("workOrderNo",mesWorkOrder.getWorkOrderNo(),"pullingStatus",MesExtEnumUtil.WORK_ORDER_PULLING_STATUS.SUBMIT.getValue());
} }
// /** // /**
@ -995,12 +1000,12 @@ public class MesWorkOrderService extends BaseMesService<MesWorkOrder> implements
private void insertPullOrderInfo(MesWorkOrder mesWorkOrder,List<MesBom> bomPullList,MesPartPull mesPartPull,List<MesPartPullDetail> mesPartPullDetailList,String organizeCode,int i, int roundPackQty){ private void insertPullOrderInfo(MesWorkOrder mesWorkOrder,List<MesBom> bomPullList,MesPartPull mesPartPull,List<MesPartPullDetail> mesPartPullDetailList,String organizeCode,int i, int roundPackQty){
//校验当前工单是否已经生成过拉动单,如果已经生成过则不在生成 //校验当前工单是否已经生成过拉动单,如果已经生成过则不在生成
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode); // DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(mesWorkOrder.getWorkOrderNo(),"workOrderNo", ddlPackBean); // DdlPreparedPack.getStringEqualPack(mesWorkOrder.getWorkOrderNo(),"workOrderNo", ddlPackBean);
int count = mesPullingOrderInfoRao.findByHqlWhereCount(ddlPackBean); // int count = mesPullingOrderInfoRao.findByHqlWhereCount(ddlPackBean);
if (count >0){ // if (count >0){
return; // return;
} // }
// 计算所有拉动单的数量,生成拉动单 // 计算所有拉动单的数量,生成拉动单
Map<String, List<MesPartPullDetail>> pullDetailMap = mesPartPullDetailList.stream().filter(item->!StringUtils.isEmpty(item.getPullPartNo())).collect(Collectors.groupingBy(MesPartPullDetail::getPullPartNo)); Map<String, List<MesPartPullDetail>> pullDetailMap = mesPartPullDetailList.stream().filter(item->!StringUtils.isEmpty(item.getPullPartNo())).collect(Collectors.groupingBy(MesPartPullDetail::getPullPartNo));
List<String> pullDetailPartList = mesPartPullDetailList.stream().map(MesPartPullDetail::getPullPartNo).collect(Collectors.toList()); List<String> pullDetailPartList = mesPartPullDetailList.stream().map(MesPartPullDetail::getPullPartNo).collect(Collectors.toList());

Loading…
Cancel
Save