|
|
|
@ -3,8 +3,10 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionRecordService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step.method.MesWorkOrderCheckCompleteQtyStepService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsInContext;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsOutContext;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IStepService;
|
|
|
|
@ -17,7 +19,6 @@ import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import io.swagger.models.auth.In;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -45,9 +46,6 @@ public class MesProductionDataSaveBeforeControlOrderStepService extends BaseStep
|
|
|
|
|
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesWorkOrderCheckCompleteQtyStepService workOrderCheckCompleteQtyStepService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesProductionRecordService productionRecordService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -55,8 +53,6 @@ public class MesProductionDataSaveBeforeControlOrderStepService extends BaseStep
|
|
|
|
|
|
|
|
|
|
StationResultBean resultBean = new StationResultBean();
|
|
|
|
|
|
|
|
|
|
StepResult stepResult = StepResult.getSuccessComplete();
|
|
|
|
|
|
|
|
|
|
//获取上下文信息: 处理加工不可用规则
|
|
|
|
|
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.dispatchProdRuleIgnoreCfgContext(reqBean);
|
|
|
|
|
|
|
|
|
@ -76,6 +72,7 @@ public class MesProductionDataSaveBeforeControlOrderStepService extends BaseStep
|
|
|
|
|
List<MesProductionPsInContext> productionPsInContextList = productionDispatchContextStepService.getProductionPsInContext(reqBean);
|
|
|
|
|
Map<Integer, MesProductionPsInContext> psiMap = CollectionUtils.isEmpty(productionPsInContextList) ? null : productionPsInContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getForeignKey()))).collect(Collectors.toMap(MesProductionPsInContext::getForeignKey, o -> o));
|
|
|
|
|
|
|
|
|
|
Loop:
|
|
|
|
|
synchronized (new StringJoiner(MesPcnExtConstWords.COLON).add(reqBean.getOrganizeCode()).add(reqBean.getWorkCenterCode()).add(MesPcnExtConstWords.WORK_ORDER_COMPLETE_CONTEXT).toString().intern()) {
|
|
|
|
|
|
|
|
|
|
//验证是否需要汇报
|
|
|
|
@ -83,12 +80,12 @@ public class MesProductionDataSaveBeforeControlOrderStepService extends BaseStep
|
|
|
|
|
|
|
|
|
|
Map<String, List<MesProductionPsOutContext>> reportPsMap = productionPsOutContextList.stream().filter(o -> (null != o && o.getIsCalcCompleteQty().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0)).collect(Collectors.groupingBy(MesProductionPsOutContext::getPartNo));
|
|
|
|
|
|
|
|
|
|
if ()
|
|
|
|
|
if (CollectionUtils.isEmpty(reportPsMap)) break Loop;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//验证加工单完成数量
|
|
|
|
|
workOrderCheckCompleteQtyStepService.dispatchWorkOrderCompleteQtyContext(
|
|
|
|
|
reqBean, resultBean, stepResult, productionProcessContext, productionPartContextList, productionPsInContextList);
|
|
|
|
|
|
|
|
|
|
//匹配失败需要清除本次扫描/读取信息
|
|
|
|
|
if (!stepResult.isCompleted() && workOrderCheckCompleteQtyStepService.doBusiCheckToDelete(reqBean, stepResult, productionPartContextList, productionPsInContextList))
|
|
|
|
@ -106,7 +103,8 @@ public class MesProductionDataSaveBeforeControlOrderStepService extends BaseStep
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return stepResult;
|
|
|
|
|
//非排序线 保存加工结果工步 execute 方法 使用的是 新事务
|
|
|
|
|
return ((IStepService) SpringContextsUtil.getBean("mesProductionDataSaveStepService")).execute(reqBean);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|