Merge remote-tracking branch 'origin/dev-wuhan' into dev-wuhan

tags/yfai-pcn-ext-v2.3
jun 8 months ago
commit 05d89d34bb

@ -6,6 +6,7 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesCutRawErrorProofingModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesCutUpdateRawLengthModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.tool.MathOperation;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
@ -153,6 +154,16 @@ public class MesCutRawErrorProofingService implements IMesCutRawErrorProofingSer
result.setIsRedirect(CommonEnumUtil.VALID);
}
MesCutModifyRawLengthRecord modifyRawLengthRecord = new MesCutModifyRawLengthRecord();
ConvertBean.serviceModelInitialize(modifyRawLengthRecord, model.getUserName());
modifyRawLengthRecord.setLength(materialSnDb.getLength());
modifyRawLengthRecord.setSubLength(materialSnDb.getSurplusLength());
modifyRawLengthRecord.setSn(model.getSn());
modifyRawLengthRecord.setCutWorkOrderNo(model.getCutWorkOrderNo());
modifyRawLengthRecord.setType(MesExtEnumUtil.CUT_RAW_LENGTH_TYPE.OTHER.getValue());
modifyRawLengthRecord.setOrganizeCode(model.getOrganizeCode());
cutModifyRawLengthRecordRepository.save(modifyRawLengthRecord);
ConvertBean.serviceModelUpdate(workOrderCutMaterial, model.getUserName());
workOrderCutMaterialRepository.save(workOrderCutMaterial);
ConvertBean.serviceModelUpdate(materialSnDb, model.getUserName());
@ -201,7 +212,15 @@ public class MesCutRawErrorProofingService implements IMesCutRawErrorProofingSer
ConvertBean.serviceModelUpdate(materialSnDb, model.getUserName());
materialSnRepository.save(materialSnDb);
MesCutModifyRawLengthRecord modifyRawLengthRecord = new MesCutModifyRawLengthRecord();
ConvertBean.serviceModelInitialize(modifyRawLengthRecord, model.getUserName());
modifyRawLengthRecord.setLength(materialSnDb.getLength());
modifyRawLengthRecord.setSubLength(materialSnDb.getSurplusLength());
modifyRawLengthRecord.setSn(model.getSn());
modifyRawLengthRecord.setModifyReason(model.getModifyReason());
modifyRawLengthRecord.setType(MesExtEnumUtil.CUT_RAW_LENGTH_TYPE.OTHER.getValue());
modifyRawLengthRecord.setOrganizeCode(model.getOrganizeCode());
cutModifyRawLengthRecordRepository.save(modifyRawLengthRecord);
}

@ -0,0 +1,223 @@
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.IMesWorkOrderExtService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCollectContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPartContext;
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.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IStepService;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
import cn.estsh.i3plus.pojo.mes.bean.MesQueueOrder;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder;
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 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.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @Description :
* @Author : wangjie
**/
@Slf4j
@Service("mesWorkOrderCutCheckStepService")
public class MesWorkOrderCutCheckStepService extends BaseStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IMesWorkOrderExtService workOrderExtService;
@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());
//存储生产过程上下文对象
productionProcessContextStepService.dispatchProductionProcessContext(reqBean, productionProcessContext);
//清除本次已获取得到的加工单信息
productionDispatchContextStepService.removeScanWorkOrderNoContext(reqBean);
//获取上下文生产扫/读信息:加工单
List<MesEquipVariableCollectContext> equipVariableCollectContextList = productionDispatchContextStepService.getScanWorkOrderNoContext(reqBean);
if (CollectionUtils.isEmpty(equipVariableCollectContextList)) return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "当前缺失待验证的加工单信息!");
//从上下文中取出生产线对象
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
//获取上下文产出零件信息
List<MesProductionPartContext> cachedProductionPartContextList = productionDispatchContextStepService.getProductionPartContext(reqBean);
//获取工单对应的条码数据信息
List<MesProductionPsInContext> cachedProductionPsInContextList = productionDispatchContextStepService.getProductionPsInContext(reqBean);
//验证扫描信息是否属于工艺强过码
Boolean isCraftJumpCode = matchCraftJumpCode(productionProcessContext, equipVariableCollectContextList);
//验证是否支持跳过
Boolean isAllowJump = checkIsAllowJump(cachedProductionPartContextList, cachedProductionPsInContextList);
//当前不允许跳过
if (isCraftJumpCode && !isAllowJump)
return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.SCAN.getValue()).
scanInfo(equipVariableCollectContextList.get(0).getEquipVariableValue()), stepResult, String.format("当前扫描信息工艺强过码[%s],当前没有可以跳过的加工单信息!", equipVariableCollectContextList.get(0).getEquipVariableValue()));
//允许跳过,先更新数据
if (isCraftJumpCode && isAllowJump) {
updateProductionPartAndPsInContextList(reqBean, cachedProductionPartContextList, cachedProductionPsInContextList, equipVariableCollectContextList.get(0).getEquipVariableValue());
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.SCAN.getValue()).
scanInfo(equipVariableCollectContextList.get(0).getEquipVariableValue()), stepResult, String.format("当前扫描信息工艺强过码[%s]!", equipVariableCollectContextList.get(0).getEquipVariableValue()));
}
//验证工单的有效性
List<MesProductionPartContext> productionPartContextList = new ArrayList<>();
List<MesProductionPsInContext> productionPsInContextList = new ArrayList<>();
if (!checkWorkOrderValid(reqBean, resultBean, stepResult, productionProcessContext, workCenter,
equipVariableCollectContextList, productionPartContextList, productionPsInContextList).isCompleted()) return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, stepResult.getMsg());
return null;
}
//验证工单的有效性
private StepResult checkWorkOrderValid(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesProductionProcessContext productionProcessContext, MesWorkCenter workCenter,
List<MesEquipVariableCollectContext> equipVariableCollectContextList, List<MesProductionPartContext> productionPartContextList, List<MesProductionPsInContext> productionPsInContextList) {
//搜集生产工单号
List<String> filterList = equipVariableCollectContextList.stream().filter(o -> (null != o)).map(MesEquipVariableCollectContext::getEquipVariableValue).collect(Collectors.toList());
List<String> workOrderNoList = filterList.stream().filter(o -> (!StringUtils.isEmpty(o) && !o.equals(productionProcessContext.getFinishCode()))).distinct().collect(Collectors.toList());
Map<String, Map<String, Object>> workOrderMap = workOrderExtService.getWorkOrderMapSort(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), workOrderNoList);
for (String workOrderNo : workOrderNoList) {
if (StringUtils.isEmpty(workOrderNo)) continue;
Map<String, Object> itemMap = CollectionUtils.isEmpty(workOrderMap) ? null : workOrderMap.get(workOrderNo);
if (CollectionUtils.isEmpty(itemMap))
return stepResult.isCompleted(false).msg(String.format("请检查工单信息,加工单号[%s]无效!", workOrderNo));
if (itemMap.containsKey(MesPcnExtConstWords.MESSAGE))
return stepResult.isCompleted(false).msg((String) itemMap.get(MesPcnExtConstWords.MESSAGE));
MesWorkOrder workOrder = (MesWorkOrder) itemMap.get(MesWorkOrder.class.getSimpleName());
if (!MesExtEnumUtil.ORDER_STATUS.checkAllowStatus(workCenter.getCenterType(), workOrder.getWorkOrderStatus()))
return stepResult.isCompleted(false).msg(String.format("请检查工单信息,加工单[%s]信息工单状态[%s]!", workOrderNo, MesExtEnumUtil.ORDER_STATUS.valueOfDescription(workOrder.getWorkOrderStatus())));
if (!workOrder.getWorkCenterCode().equals(reqBean.getWorkCenterCode()))
return stepResult.isCompleted(false).msg(String.format("请检查工单信息,加工单[%s]信息所属生产线[%s]与当前生产线[%s]不一致!", workOrderNo, workOrder.getWorkCenterCode(), reqBean.getWorkCenterCode()));
if (StringUtils.isEmpty(workOrder.getPartProdGroupCode()))
return stepResult.isCompleted(false).msg(String.format("请检查工单信息,加工单[%s]信息未关联零件生产组!", workOrderNo));
MesProduceSn produceSn = (MesProduceSn) itemMap.get(MesProduceSn.class.getSimpleName());
if (MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue() != produceSn.getQcStatus())
return stepResult.isCompleted(false).msg(String.format("请检查产品条码信息,产品条码[%s]质量状态[%s]", produceSn.getProductSn(), MesExtEnumUtil.PRODUCE_QC_STATUS.valueOfDescription(produceSn.getQcStatus())));
if (MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue() <= produceSn.getSnStatus() || MesExtEnumUtil.PRODUCE_SN_STATUS.UNKNOW.getValue() == produceSn.getSnStatus())
return stepResult.isCompleted(false).msg(String.format("请检查产品条码信息,产品条码[%s]条码状态[%s]", produceSn.getProductSn(), MesExtEnumUtil.PRODUCE_SN_STATUS.valueOfDescription(produceSn.getSnStatus())));
MesQueueOrder queueOrder = (MesQueueOrder) itemMap.get(MesQueueOrder.class.getSimpleName());
if (MesExtEnumUtil.QUEUE_ORDER_STATUS.FINISH.getValue() == queueOrder.getStatus())
return stepResult.isCompleted(false).msg(String.format("请检查产品条码工位队列信息,产品条码[%s]工位队列状态[%s]", queueOrder.getProductSn(), MesExtEnumUtil.QUEUE_ORDER_STATUS.valueOfDescription(queueOrder.getStatus())));
//封装产成零件
MesProductionPartContext productionPartContext = new MesProductionPartContext().copyPartNo(workOrder, equipVariableCollectContextList.get(0).getMessageSource()).isCheck(productionProcessContext.getWorkCell());
productionPartContextList.add(productionPartContext);
//封装产品条码
productionPsInContextList.add(new MesProductionPsInContext(productionProcessContext.getWorkCell(), produceSn).messageSource(equipVariableCollectContextList.get(0).getMessageSource()).relateId(queueOrder.getId()));
}
//封装空腔
equipVariableCollectContextList.stream().filter(o -> (null != o && o.getEquipVariableValue().equals(productionProcessContext.getFinishCode()))).forEach(o -> {
productionPartContextList.add(new MesProductionPartContext().isFinishCode());
productionPsInContextList.add(new MesProductionPsInContext().isFinishCode());
});
return stepResult;
}
//验证扫描信息属于工艺强过码 并且支持跳过,进行数据变更
private void updateProductionPartAndPsInContextList(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList, List<MesProductionPsInContext> cachedProductionPsInContextList, String craftJumpCode) {
productionPartContextList.forEach(o -> {
if (o.getCheckSeqResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0) {
o.setCraftJumpCode(craftJumpCode);
}
});
cachedProductionPsInContextList.forEach(o -> {
if (o.getCheckCraftResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0) o.setCraftJumpCode(craftJumpCode);
});
//保存上下文产出零件信息
productionDispatchContextStepService.dispatchProductionPartContext(reqBean, productionPartContextList);
}
//验证是否支持跳过
private Boolean checkIsAllowJump(List<MesProductionPartContext> productionPartContextList, List<MesProductionPsInContext> cachedProductionPsInContextList) {
Optional<MesProductionPartContext> optional1 = CollectionUtils.isEmpty(productionPartContextList) ? null : productionPartContextList.stream().filter(o -> (null != o && o.getCheckSeqResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).findFirst();
Optional<MesProductionPsInContext> optional2 = CollectionUtils.isEmpty(cachedProductionPsInContextList) ? null : cachedProductionPsInContextList.stream().filter(o -> (null != o && o.getCheckCraftResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).findFirst();
if (null != optional1 && optional1.isPresent()) return true;
if (null != optional2 && optional2.isPresent()) return true;
return false;
}
public List<MesProductionPartContext> removeBusiData(StationRequestBean reqBean) {
productionDispatchContextStepService.removeProductionPartContext(reqBean);
productionDispatchContextStepService.removeProductionPsInContext(reqBean);
productionDispatchContextStepService.removeProductionPsOutContext(reqBean);
productionDispatchContextStepService.removeProdRuleDataContext(reqBean);
return null;
}
//验证扫描信息是否属于工艺强过码
public Boolean matchCraftJumpCode(MesProductionProcessContext productionProcessContext, List<MesEquipVariableCollectContext> equipVariableCollectContextList) {
if (equipVariableCollectContextList.size() != 1 || MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() != equipVariableCollectContextList.get(0).getMessageSource()) return false;
if (!equipVariableCollectContextList.get(0).getEquipVariableValue().equals(productionProcessContext.getCraftJumpCode())) return false;
return true;
}
//根据是否空腔搜集数据
public List<MesProductionPartContext> filterProductionPartContext(List<MesProductionPartContext> productionPartContextList, Boolean flag) {
return flag ? productionPartContextList.stream().filter(o -> (null != o && o.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).collect(Collectors.toList()) :
productionPartContextList.stream().filter(o -> (null != o && o.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0)).collect(Collectors.toList());
}
//验证是否全部为空腔
public Boolean checkIsAllFinishCode(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList) {
Optional<MesProductionPartContext> optional = productionPartContextList.stream().filter(o -> (null != o && o.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).findFirst();
if (null != optional && optional.isPresent()) return false;
return true;
}
}

@ -0,0 +1,138 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionCustomContextStepService;
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.pojo.context.MesEquipVariableCollectContext;
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.pojo.base.enumutil.MesPcnEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter;
import cn.estsh.i3plus.pojo.mes.model.StationKvBean;
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 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.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Description :
* @Author : wangjie
**/
@Slf4j
@Service("mesWorkOrderCutScanStepService")
public class MesWorkOrderCutScanStepService extends BaseStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IMesProductionCustomContextStepService productionCustomContextStepService;
@Override
public StepResult guide(StationRequestBean reqBean) {
productionCustomContextStepService.sendStepContextMessage(reqBean);
return stepSuccessCompleteAndSendGuideReturn(reqBean, new StationResultBean().writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), "请扫描裁片工单!");
}
@Override
public StepResult execute(StationRequestBean reqBean) {
StationResultBean resultBean = new StationResultBean();
StepResult stepResult = StepResult.getSuccessComplete();
//扫描信息置空
String scanInfo = reqBean.resetScanInfo(reqBean.getScanInfo());
//获取上下文信息
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.dispatchCurCellEquipment(reqBean);
//获取生产过程上下文对象有异常信息 抛出异常
if (!productionProcessContext.getSuccess()) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), productionProcessContext.getMessage());
//存储生产过程上下文对象
productionProcessContextStepService.dispatchProductionProcessContext(reqBean, productionProcessContext);
//从上下文中取出生产线对象
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
//如果没有扫描信息, 取手选工单信息, 封装扫/读信息:裁片工单信息
List<MesEquipVariableCollectContext> equipVariableCollectContextList;
//优先验证扫描裁片工单
if (!StringUtils.isEmpty(scanInfo)) equipVariableCollectContextList = doHandleScanWorkOrderNoContext(reqBean, stepResult, scanInfo);
//选择裁片工单
else equipVariableCollectContextList = doHandleScanWorkOrderNoContext(reqBean, stepResult, workCenter);
//扫描信息为空
if (CollectionUtils.isEmpty(equipVariableCollectContextList)) stepSendGuideAndThrowEx(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), "请扫描裁片工单!");
//保存上下文扫/读信息:裁片工单
productionDispatchContextStepService.dispatchScanWorkOrderNoContext(reqBean, equipVariableCollectContextList);
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.SCAN.getValue()).scanInfo(scanInfo), stepResult, stepResult.getMsg());
}
//封装扫/读信息:裁片工单信息 (扫描)
private List<MesEquipVariableCollectContext> doHandleScanWorkOrderNoContext(StationRequestBean reqBean, StepResult stepResult, String scanInfo) {
List<MesEquipVariableCollectContext> equipVariableCollectContextList = new ArrayList<>();
equipVariableCollectContextList.add(new MesEquipVariableCollectContext(reqBean.getOrganizeCode(), scanInfo, MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue()));
//发送工步内容
productionCustomContextStepService.sendStepContextMessage(reqBean, scanInfo, MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN);
stepResult.msg(String.format("当前扫描信息裁片工单[%s]!", scanInfo));
return equipVariableCollectContextList;
}
//封装扫/读信息:裁片工单信息 (选择)
private List<MesEquipVariableCollectContext> doHandleScanWorkOrderNoContext(StationRequestBean reqBean, StepResult stepResult, MesWorkCenter workCenter) {
//排序线不支持选择裁片工单
if (workCenter.getCenterType().compareTo(MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue()) != 0) return null;
//获取手动选择的腔数及工单信息上下文, 扫描的裁片工单也会存入其中
List<StationKvBean> chooseCavityOrder = productionProcessContextStepService.getFunctionChooseCavityOrderContext(reqBean);
if (CollectionUtils.isEmpty(chooseCavityOrder)) return null;
String cellMessageSorce = chooseCavityOrder.stream().filter(o -> (null != o && o.getKey().equals(MesPcnExtConstWords.CELL_MESSAGE_SOURCE))).findFirst().get().getValue();
String isConsume = chooseCavityOrder.stream().filter(o -> (null != o && o.getKey().equals(MesPcnExtConstWords.CRAFT_JUMP_CODE))).findFirst().get().getValue();
List<String> chooseList = new ArrayList<>(Arrays.asList(chooseCavityOrder.stream().filter(o -> (null != o && o.getKey().equals(MesPcnExtConstWords.WORK_ORDER_NO))).findFirst().get().getValue().split(MesPcnExtConstWords.SEMICOLON)));
List<MesEquipVariableCollectContext> equipVariableCollectContextList = new ArrayList<>();
chooseList.stream().filter(o -> !StringUtils.isEmpty(o)).forEach(o ->
equipVariableCollectContextList.add(new MesEquipVariableCollectContext(reqBean.getOrganizeCode(), o, Integer.valueOf(cellMessageSorce)).isConsume(Integer.valueOf(isConsume))));
//发送工步内容
String scanInfo = chooseCavityOrder.stream().filter(o -> (null != o && !o.getKey().equals(MesPcnExtConstWords.CELL_MESSAGE_SOURCE))).map(o -> o.getName() + MesPcnExtConstWords.SQUARE_BRACKETS_L + o.getValue() + MesPcnExtConstWords.SQUARE_BRACKETS_R).collect(Collectors.joining(MesPcnExtConstWords.SEMICOLON));
productionCustomContextStepService.sendStepContextMessage(reqBean, scanInfo, MesExtEnumUtil.CELL_MESSAGE_SOURCE.getByValue(Integer.valueOf(cellMessageSorce)));
stepResult.msg(String.format("当前%s%s!", MesExtEnumUtil.CELL_MESSAGE_SOURCE.valueOfDescription(Integer.valueOf(cellMessageSorce)), scanInfo));
return equipVariableCollectContextList;
}
}
Loading…
Cancel
Save