forked from I3-YF/i3plus-mes-pcn-yfai
Merge branch 'mes-uat-changshu0609-temp-wj-250616-xisu' into mes-uat-changshu0609-temp-wj-250616-xisu-merge-nht
commit
38cc443854
@ -0,0 +1,89 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.*;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesContainerPackageDetailContext;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyContext;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
||||||
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||||
|
import cn.estsh.i3plus.platform.common.tool.MathOperation;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesStation;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
||||||
|
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 lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 站点匹配进料工步
|
||||||
|
* @Author : wangjie
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service("mesStationMatchProductSnInStepService")
|
||||||
|
public class MesStationMatchProductSnInStepService extends BaseStepService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesProductionCustomContextStepService productionCustomContextStepService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesStationContainerSnExtService stationContainerSnExtService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesTimeEfficientCfgMatchService timeEfficientCfgMatchService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StepResult execute(StationRequestBean reqBean) {
|
||||||
|
|
||||||
|
StationResultBean resultBean = new StationResultBean();
|
||||||
|
|
||||||
|
StepResult stepResult = StepResult.getSuccessComplete();
|
||||||
|
|
||||||
|
//获取工位当前设备信息
|
||||||
|
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.dispatchCurCellEquipment(reqBean);
|
||||||
|
|
||||||
|
//配置错误 抛出异常
|
||||||
|
if (!productionProcessContext.getSuccess()) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), productionProcessContext.getMessage());
|
||||||
|
|
||||||
|
//处理设备站点【原料站点&&混料站点&&成品站点&&可疑站点】
|
||||||
|
List<MesStation> stationList = productionProcessContextStepService.dispatchEquipmentStationContext(reqBean, productionProcessContext.getCurCellEquip().getEquipmentCode(),
|
||||||
|
Stream.of(MesExtEnumUtil.STATION_TYPE.STATION_TYPE_10.getValue(), MesExtEnumUtil.STATION_TYPE.STATION_TYPE_40.getValue(),
|
||||||
|
MesExtEnumUtil.STATION_TYPE.STATION_TYPE_30.getValue(), MesExtEnumUtil.STATION_TYPE.STATION_TYPE_50.getValue()).collect(Collectors.toList()));
|
||||||
|
//搜集设备站点【原料站点&&混料站点】
|
||||||
|
List<MesStation> stationList2PsIn = productionProcessContextStepService.dispatchEquipmentStationContext(stationList,
|
||||||
|
Stream.of(MesExtEnumUtil.STATION_TYPE.STATION_TYPE_10.getValue(), MesExtEnumUtil.STATION_TYPE.STATION_TYPE_40.getValue()).collect(Collectors.toList()));
|
||||||
|
//搜集设备站点【混料站点&&成品站点&&可疑站点】
|
||||||
|
List<MesStation> stationList2PsOut = productionProcessContextStepService.dispatchEquipmentStationContext(stationList,
|
||||||
|
Stream.of(MesExtEnumUtil.STATION_TYPE.STATION_TYPE_40.getValue(), MesExtEnumUtil.STATION_TYPE.STATION_TYPE_30.getValue(), MesExtEnumUtil.STATION_TYPE.STATION_TYPE_50.getValue()).collect(Collectors.toList()));
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(stationList)) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), "站点匹配装配件时验证设备未关联支持扣减的站点");
|
||||||
|
|
||||||
|
//保存站点用于缺料时进行上料绑定
|
||||||
|
productionDispatchContextStepService.dispatchMatchStationContext(reqBean, stationList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "站点匹配装配件验证成功!");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue