From b8cf5c7cfe8f4355fccb8fd1bd66342c769c1ded Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Sun, 29 Sep 2024 17:39:11 +0800 Subject: [PATCH] =?UTF-8?q?byd=20=E8=A3=85=E9=85=8D=E4=BB=B6=E7=AD=96?= =?UTF-8?q?=E7=95=A5=20=E6=88=AA=E5=8F=96=E5=8F=B3=E4=BE=A7=E6=B5=81?= =?UTF-8?q?=E6=B0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IMesProductionDispatchContextStepService.java | 21 +++ .../MesNumberRuleMatchSubstringSerialService.java | 81 +++++++++ .../rulematch/MesNumberRuleMatchVkmService.java | 3 +- .../step/MesProductSnGenerateStepService.java | 22 ++- .../step/MesProductSnPrintNosortStepService.java | 193 +++++++++++++++++++++ .../step/MesProductSnPrintStepService.java | 172 +----------------- .../MesProductionDispatchContextStepService.java | 49 +++++- .../pcn/pojo/context/MesProdTempDataContext.java | 41 +++++ .../MesProductionAssemblyNosortContext.java | 3 + .../ext/mes/pcn/pojo/util/MesPcnExtConstWords.java | 3 +- 10 files changed, 412 insertions(+), 176 deletions(-) create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchSubstringSerialService.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintNosortStepService.java create mode 100644 modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdTempDataContext.java diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionDispatchContextStepService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionDispatchContextStepService.java index ce928da..6bd1a27 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionDispatchContextStepService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionDispatchContextStepService.java @@ -175,6 +175,9 @@ public interface IMesProductionDispatchContextStepService { @ApiOperation(value = "获取上下文产品加工规则数据信息集合") List getProdRuleDataContext(StationRequestBean reqBean); + @ApiOperation(value = "获取上下文产品加工规则数据信息集合") + List getProdRuleDataContext(String organizeCode, String workCenterCode, String workCellCode); + @ApiOperation(value = "验证上下文产品加工规则信息集合是否存在") Boolean checkProdRuleDataIsExistContext(StationRequestBean reqBean); @@ -229,4 +232,22 @@ public interface IMesProductionDispatchContextStepService { @ApiOperation(value = "删除进料可回用包装") Boolean removeProductionRecyclablePackageContext(StationRequestBean reqBean); + @ApiOperation(value = "获取上下文临时数据信息集合") + List getProdTempDataContext(StationRequestBean reqBean); + + @ApiOperation(value = "获取上下文临时数据信息集合") + List getProdTempDataContext(String organizeCode, String workCenterCode, String workCellCode); + + @ApiOperation(value = "保存上下文临时数据信息集合") + Boolean dispatchProdTempDataContext(StationRequestBean reqBean, List prodTempDataContextList); + + @ApiOperation(value = "保存上下文临时数据信息集合") + Boolean dispatchProdTempDataContext(String organizeCode, String workCenterCode, String workCellCode, List prodTempDataContextList); + + @ApiOperation(value = "删除上下文临时数据信息集合") + void removeProdTempDataContext(StationRequestBean reqBean); + + @ApiOperation(value = "删除上下文临时数据信息集合") + void removeProdTempDataContext(String organizeCode, String workCenterCode, String workCellCode); + } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchSubstringSerialService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchSubstringSerialService.java new file mode 100644 index 0000000..174a0cc --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchSubstringSerialService.java @@ -0,0 +1,81 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.rulematch; + +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesNumberRuleMatchDispatchService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdTempDataContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyNosortContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +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; + +/** + * 规则并截取右侧流水 + */ +@Slf4j +@Service +public class MesNumberRuleMatchSubstringSerialService implements IMesNumberRuleMatchDispatchService { + + @Autowired + private IMesProductionDispatchContextStepService productionDispatchContextStepService; + + @Override + public Map matchNumberRule(String organizeCode, String sn, Object... params) { + // 校验正则表达式 + Map result = ((IMesNumberRuleMatchDispatchService) SpringContextsUtil.getBean(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.MATCH_TYPE_20.getStrategyClass())).matchNumberRule(organizeCode, sn, params); + + if (!(Boolean) result.get(MesPcnExtConstWords.RESULT)) return result; + + MesProductionAssemblyNosortContext context = (MesProductionAssemblyNosortContext) params[0]; + + if (StringUtils.isEmpty(context.getSerialLength())) { + result.put(MesPcnExtConstWords.RESULT, false); + result.put(MesPcnExtConstWords.MESSAGE, String.format("装配件ID[%s]信息未维护[截取的流水号长度]!", context.getSourceId())); + return result; + } + + if (context.getSerialLength().compareTo(sn.length()) > 0 ) { + result.put(MesPcnExtConstWords.RESULT, false); + result.put(MesPcnExtConstWords.MESSAGE, String.format("装配件条码[%s]不匹配截取的流水号长度[%s]!", sn, context.getSerialLength())); + return result; + } + + //截取右侧流水, 生成零件条码工步需要使用此流水生成新的零件条码 + String serialNo = substringSerial(context.getAssemblySn(), context.getSerialLength()); + + //一腔如果存在两个这个规则的情况下,需要验证两次的流水号是否一直 + List prodTempDataContextList = productionDispatchContextStepService.getProdTempDataContext(organizeCode, context.getWorkCenterCode(), context.getWorkCellCode()); + Optional optional = CollectionUtils.isEmpty(prodTempDataContextList) ? null : + prodTempDataContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getForeignKey()) && o.getForeignKey().compareTo(context.getForeignKey()) == 0)).findFirst(); + if (null == optional || !optional.isPresent() || StringUtils.isEmpty(optional.get().getSerialNo())) { + if (CollectionUtils.isEmpty(prodTempDataContextList)) prodTempDataContextList = new ArrayList<>(); + prodTempDataContextList.add(new MesProdTempDataContext(organizeCode, context.getForeignKey()).serialNo(serialNo)); + productionDispatchContextStepService.dispatchProdTempDataContext(organizeCode, context.getWorkCenterCode(), context.getWorkCellCode(), prodTempDataContextList); + return result; + } + + if (!serialNo.equals(optional.get().getSerialNo())) { + result.put(MesPcnExtConstWords.RESULT, false); + result.put(MesPcnExtConstWords.MESSAGE, String.format("装配件条码[%s]的右侧流水号[%s]与首次扫描的流水号[%s]不一致!", sn, serialNo, optional.get().getSerialNo())); + return result; + } + + return result; + + } + + //截取右侧流水, 生成零件条码工步需要使用此流水生成新的零件条码 + private String substringSerial(String sn, Integer serialLength) { + return sn.substring(sn.length() - serialLength); + } + +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchVkmService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchVkmService.java index 4e9ad27..022f4f3 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchVkmService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchVkmService.java @@ -9,7 +9,6 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.i3plus.pojo.mes.bean.MesPartPackageRule; -import cn.estsh.i3plus.pojo.mes.model.StationRequestBean; import cn.estsh.i3plus.pojo.mes.repository.IMesPartPackageRuleDetailRepository; import cn.estsh.i3plus.pojo.mes.repository.IMesPartPackageRuleRepository; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; @@ -56,7 +55,7 @@ public class MesNumberRuleMatchVkmService implements IMesNumberRuleMatchDispatch //当前装配件清单信息 MesProductionAssemblyContext context = (MesProductionAssemblyContext) params[0]; //获取上下文产品加工规则数据信息集合 - List prodRuleContextList = productionDispatchContextStepService.getProdRuleDataContext(new StationRequestBean(organizeCode, context.getWorkCenterCode(), context.getWorkCellCode())); + List prodRuleContextList = productionDispatchContextStepService.getProdRuleDataContext(organizeCode, context.getWorkCenterCode(), context.getWorkCellCode()); if (CollectionUtils.isEmpty(prodRuleContextList)) { result.put(MesPcnExtConstWords.RESULT, false); result.put(MesPcnExtConstWords.MESSAGE, "当前不存在非排序加工规则数据,请重置工序!"); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnGenerateStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnGenerateStepService.java index 8a07dc2..ad476c5 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnGenerateStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnGenerateStepService.java @@ -166,11 +166,15 @@ public class MesProductSnGenerateStepService extends BaseStepService { else produceSn = new MesProduceSn(); if (StringUtils.isEmpty(produceSn.getProductSn())) { - produceSn.setProductSn((null != productionPsInContext && !StringUtils.isEmpty(productionPsInContext.getProductSn())) ? productionPsInContext.getProductSn() : doGererateSerialNo(reqBean, resultBean, getProduceSnNumberRule(reqBean, resultBean, part), part, prodShiftContext.getShiftCode())); + if (null != productionPsInContext && !StringUtils.isEmpty(productionPsInContext.getProductSn())) produceSn.setProductSn(productionPsInContext.getProductSn()); + else produceSn.setProductSn(doGererateSerialNo(reqBean, resultBean, + generateGenSerialNoModel(reqBean, resultBean, getProduceSnNumberRule(reqBean, resultBean, part), part).shiftCode(prodShiftContext.getShiftCode()).foreignKey(prodRuleContext.getForeignKey()))); produceSn.setCustSn(produceSn.getProductSn()); } - if (StringUtils.isEmpty(produceSn.getSerialNumber())) produceSn.setSerialNumber(doGererateSerialNo(reqBean, resultBean, MesPcnExtConstWords.DEFAULT_SERIAL_NUMBER_RULE, part, prodShiftContext.getShiftCode())); + if (StringUtils.isEmpty(produceSn.getSerialNumber())) + produceSn.setSerialNumber(doGererateSerialNo(reqBean, resultBean, + generateGenSerialNoModel(reqBean, resultBean, MesPcnExtConstWords.DEFAULT_SERIAL_NUMBER_RULE, part))); produceSn.setQty(new Double(1)); @@ -224,16 +228,18 @@ public class MesProductSnGenerateStepService extends BaseStepService { } - private String doGererateSerialNo(StationRequestBean reqBean, StationResultBean resultBean, String ruleCode, MesPart part, String shiftCode) { + private GenSerialNoModel generateGenSerialNoModel(StationRequestBean reqBean, StationResultBean resultBean, String ruleCode, MesPart part) { + return new GenSerialNoModel(ruleCode).prodLocation(reqBean.getWorkCenterCode()).partNo(part.getPartNo()) + .putDataMap(MesPart.class.getSimpleName(), part).basicInfo(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()); + } + + private String doGererateSerialNo(StationRequestBean reqBean, StationResultBean resultBean, GenSerialNoModel serialNoModel) { try { - return syncFuncService.syncSerialNo( - new GenSerialNoModel(ruleCode).prodLocation(reqBean.getWorkCenterCode()).partNo(part.getPartNo()).shiftCode(shiftCode) - .putDataMap(MesPart.class.getSimpleName(), part).basicInfo(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()), - reqBean.getUserInfo(), reqBean.getOrganizeCode(), 1).getResultList().get(0).toString(); + return syncFuncService.syncSerialNo(serialNoModel, reqBean.getUserInfo(), reqBean.getOrganizeCode(), 1).getResultList().get(0).toString(); } catch (ImppBusiException e) { stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), e.getErrorDetail()); } catch (Exception e) { - String webMsg = String.format("零件编码[%s]编码规则代码[%s]生成零件条码%s", part.getPartNo(), ruleCode, fsmRouteDataService.handleFsmCfgOrDefault(reqBean, MesPcnEnumUtil.FSM_CFG.FSM_EXCEPTION_MSG.getCode())); + String webMsg = String.format("零件编码[%s]编码规则代码[%s]生成零件条码%s", serialNoModel.getPartNo(), serialNoModel.getRuleCode(), fsmRouteDataService.handleFsmCfgOrDefault(reqBean, MesPcnEnumUtil.FSM_CFG.FSM_EXCEPTION_MSG.getCode())); this.sendMessage(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.ERROR.getValue()), webMsg, MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT); this.cacheException(reqBean, reqBean.getStepName(), webMsg, e, true); foundExThrowNoShowMsg(); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintNosortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintNosortStepService.java new file mode 100644 index 0000000..e7f29ad --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintNosortStepService.java @@ -0,0 +1,193 @@ +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.apiservice.serviceimpl.print.IPrintTemplateStrategyService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsOutContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintDataModel; +import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel; +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.TimeTool; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; +import cn.estsh.i3plus.pojo.mes.bean.*; +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.repository.IMesPrintedSnLogRepository; +import cn.estsh.i3plus.pojo.mes.repository.MesLabelTemplateParamRepository; +import cn.estsh.i3plus.pojo.mes.repository.MesLabelTemplateRepository; +import cn.estsh.i3plus.pojo.mes.repository.MesProduceSnRepository; +import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; +import cn.estsh.impp.framework.boot.util.SpringContextsUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description : 打印主条码 【非排序】 + * @Reference : + * @Author : Castle + * @CreateDate : 2024/6/6 13:39 + * @Modify: + **/ +@Service("mesProductSnPrintNosortStepService") +public class MesProductSnPrintNosortStepService extends BaseStepService { + + @Autowired + private IMesProductionDispatchContextStepService productionDispatchContextStepService; + + @Autowired + private MesLabelTemplateRepository labelTemplateRao; + + @Autowired + private MesLabelTemplateParamRepository labelTemplateParamRao; + + @Autowired + private IMesPrintedSnLogRepository snLogRao; + + @Autowired + private MesProduceSnRepository mesProduceSnRao; + + @Override + public StepResult execute(StationRequestBean reqBean) { +// /** +// * Map +// * valueList:List> +// * paramInfo:{ +// * templateContent:xxxx, +// * labelTemplateParamList: List> +// * } +// * +// * 根据foreign找出加工规则对应的上下文,判断是否需要打印 +// * +// */ + String organizeCode = reqBean.getOrganizeCode(); + StationResultBean resultBean = new StationResultBean(); + StepResult stepResult = StepResult.getSuccessComplete(); + + //获取上下文加工结果 + String prodResult = productionDispatchContextStepService.getProductResultContext(reqBean); + //验证加工结果是否满足参数条件: 可疑/报废是否打印 + if (checkIsMatchProdResult(reqBean, prodResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.PRODUCT_SUSPICIOUS) || checkIsMatchProdResult(reqBean, prodResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.PRODUCT_SCRAP)) + return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, String.format("打印失败:%s!", MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.codeOfDescription(prodResult))); + + // 根据foreign找出加工规则对应的上下文,判断是否需要打印 + List prodRuleDataContext = productionDispatchContextStepService.getProdRuleDataContext(reqBean); + Map> prodRuleContextMap = prodRuleDataContext.stream().collect(Collectors.groupingBy(MesProdRuleContext::getForeignKey)); + //需要打印的数据 String 是打印模板code + Map> resultData = new HashMap<>(); + //用于保存客户模板代码 和 模板信息关系 + Map labelTemplateMap = new HashMap<>(); + //返回打印标识 给前端 + //1. 获取上下文中生成的主条码 + List productionPsOutContextList = productionDispatchContextStepService.getProductionPsOutContext(reqBean); + /** + * 重构,返回给前端打印数据 + */ + List printModelList = new ArrayList<>(); + //2. 获取条码需要模板、模板代码、打印机 --- 循环遍历条码 封装数据 + for (MesProductionPsOutContext sn : productionPsOutContextList) { + List mesProdRuleContexts = prodRuleContextMap.get(sn.getForeignKey()); + if (mesProdRuleContexts == null || mesProdRuleContexts.isEmpty()) { + stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("零件号[%s]的加工规则丢失,请配置!", sn.getPartNo())); + } + MesProdRuleContext mesProdRuleContext = mesProdRuleContexts.get(0); + Integer isPrint = mesProdRuleContext.getIsPrint(); + if (isPrint == null || isPrint == CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) { + continue; + } + String prodLabelTemplate = sn.getProdLabelTemplate(); + if (prodLabelTemplate == null) { + stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("零件号[%s]的模板代码[%s]的模板信息丢失,请配置!", sn.getPartNo(), prodLabelTemplate)); + } + + MesProduceSnPrintModel mesProduceSnPrintModel = new MesProduceSnPrintModel(); + // 查模板代码 + MesLabelTemplate labelTemplate = getLabelTemplate(prodLabelTemplate, organizeCode); + mesProduceSnPrintModel.setMesLabelTemplate(labelTemplate); + mesProduceSnPrintModel.setProductSn(sn.getProductSn()); + mesProduceSnPrintModel.setPartNo(sn.getPartNo()); + mesProduceSnPrintModel.setOrganizeCode(organizeCode); + List snList = new ArrayList<>(); + snList.add(sn); + mesProduceSnPrintModel.getMesProduceSnList().addAll(snList); + //模板信息丢失抛出异常 + if (labelTemplate == null) { + stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("零件号[%s]的模板代码[%s]的模板信息丢失,请配置!", sn.getPartNo(), prodLabelTemplate)); + } + //根据反射获取策略类--封装打印数据 + String methodCode = labelTemplate.getMethodCode(); + //模板信息丢失抛出异常 + if (methodCode == null) { + stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("零件号[%s]的模板代码[%s]的反射类丢失,请配置!", sn.getPartNo(), prodLabelTemplate)); + } + IPrintTemplateStrategyService strategyService = (IPrintTemplateStrategyService) SpringContextsUtil.getBean(methodCode); + // GenSerialNoModel model , MesProduceSnPrintModel mesProduceSnPrintModel, MesNumberRule numberRule, StepResult stepResult, StationRequestBean reqBean, Boolean isStep + MesProduceSnPrintModel printModel = strategyService.execute(null, mesProduceSnPrintModel, null, stepResult, reqBean, true); + printModelList.add(printModel); + } + + //前端接收到busiTyep是customComponent,并且 dataType是file类型的消息,就需要打印后续消息里的数据,一个模板对应多个打印数据 + resultBean.setBusiType(MesPcnEnumUtil.STATION_BUSI_TYPE.CUSTOM_COMPONENT.getValue()); + resultBean.setDataType(MesPcnEnumUtil.STATION_DATA_TYPE.FILE.getValue()); + resultBean.setResultObj(printModelList); + //3. 发送数据给到前端 + this.sendMessage(reqBean, resultBean); + List snLogList = printModelList.stream().map(MesProduceSnPrintModel::getMesPrintedSnLogList).flatMap(List::stream).collect(Collectors.toList()); + //更新打印状态 + for (MesProductionPsOutContext outSn : productionPsOutContextList) { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(outSn.getOrganizeCode()); + DdlPreparedPack.getNumEqualPack(outSn.getId(), MesPcnExtConstWords.ID, packBean); + mesProduceSnRao.updateByProperties( + new String[]{MesPcnExtConstWords.PRINT_STATUS, MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME}, + new Object[]{MesExtEnumUtil.PRINT_STATUS.PRINTED.getValue(), reqBean.getUserInfo(), TimeTool.getNowTime(true)}, packBean); + } + //保存打印条码记录 + snLogRao.saveAll(snLogList); + return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "打印成功!"); + } + + //验证加工结果是否满足参数条件: 可疑/报废是否打印 + private Boolean checkIsMatchProdResult(StationRequestBean reqBean, String prodResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM prodResultEnum) { + + if (StringUtils.isEmpty(prodResult)) return false; + if (!prodResult.equals(prodResultEnum.getCode())) return false; + + Optional> stepParamMap = getStepParams(reqBean); + String unPrintParam = (null != stepParamMap && stepParamMap.isPresent() && stepParamMap.get().containsKey(prodResultEnum.name())) ? stepParamMap.get().get(prodResultEnum.name()).getParamValue() : null; + if (StringUtils.isEmpty(unPrintParam)) return false; + + return true; + + } + + /** + * 根据templateCode 获取模板信息 + * + * @param templateCode + * @param organizeCode + * @return + */ + private MesLabelTemplate getLabelTemplate(String templateCode, String organizeCode) { + DdlPackBean templatePackBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(templateCode, "templateCode", templatePackBean); + List mesLabelTemplateList = labelTemplateRao.findByHqlWhere(templatePackBean); + MesLabelTemplate mesLabelTemplate = null; + if (!mesLabelTemplateList.isEmpty()) { + mesLabelTemplate = mesLabelTemplateList.get(0); + //级联获取labelTemplateParam + DdlPackBean templateParamPackBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getNumEqualPack(mesLabelTemplate.getId(), "templateId", templateParamPackBean); + List params = labelTemplateParamRao.findByHqlWhere(templateParamPackBean); + mesLabelTemplate.setLabelTemplateParamList(params); + } + return mesLabelTemplate; + } +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintStepService.java index c696411..ea7c274 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintStepService.java @@ -1,34 +1,14 @@ 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.apiservice.serviceimpl.print.IPrintTemplateStrategyService; -import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext; -import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsOutContext; -import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintDataModel; -import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel; -import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService; import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; -import cn.estsh.i3plus.platform.common.tool.TimeTool; -import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; -import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; -import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; -import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; -import cn.estsh.i3plus.pojo.mes.bean.*; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IStepService; 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.repository.IMesPrintedSnLogRepository; -import cn.estsh.i3plus.pojo.mes.repository.MesLabelTemplateParamRepository; -import cn.estsh.i3plus.pojo.mes.repository.MesLabelTemplateRepository; -import cn.estsh.i3plus.pojo.mes.repository.MesProduceSnRepository; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; import cn.estsh.impp.framework.boot.util.SpringContextsUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; - -import java.util.*; -import java.util.stream.Collectors; /** * @Description : 打印主条码 @@ -37,157 +17,21 @@ import java.util.stream.Collectors; * @CreateDate : 2024/6/6 13:39 * @Modify: **/ -@Service +@Service("mesProductSnPrintStepService") public class MesProductSnPrintStepService extends BaseStepService { @Autowired - private IMesProductionDispatchContextStepService productionDispatchContextStepService; - - @Autowired - private MesLabelTemplateRepository labelTemplateRao; - - @Autowired - private MesLabelTemplateParamRepository labelTemplateParamRao; - - @Autowired - private IMesPrintedSnLogRepository snLogRao; - - @Autowired - private MesProduceSnRepository mesProduceSnRao; + private IMesProductionProcessContextStepService productionProcessContextStepService; @Override public StepResult execute(StationRequestBean reqBean) { -// /** -// * Map -// * valueList:List> -// * paramInfo:{ -// * templateContent:xxxx, -// * labelTemplateParamList: List> -// * } -// * -// * 根据foreign找出加工规则对应的上下文,判断是否需要打印 -// * -// */ - String organizeCode = reqBean.getOrganizeCode(); - StationResultBean resultBean = new StationResultBean(); - StepResult stepResult = StepResult.getSuccessComplete(); - //获取上下文加工结果 - String prodResult = productionDispatchContextStepService.getProductResultContext(reqBean); - //验证加工结果是否满足参数条件: 可疑/报废是否打印 - if (checkIsMatchProdResult(reqBean, prodResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.PRODUCT_SUSPICIOUS) || checkIsMatchProdResult(reqBean, prodResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.PRODUCT_SCRAP)) - return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, String.format("打印失败:%s!", MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.codeOfDescription(prodResult))); + //排序线 打印客户条码工步 + if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == productionProcessContextStepService.getCenterType(reqBean)) return ((IStepService) SpringContextsUtil.getBean("mesProductSnPrintSortStepService")).executeInState(reqBean); - // 根据foreign找出加工规则对应的上下文,判断是否需要打印 - List prodRuleDataContext = productionDispatchContextStepService.getProdRuleDataContext(reqBean); - Map> prodRuleContextMap = prodRuleDataContext.stream().collect(Collectors.groupingBy(MesProdRuleContext::getForeignKey)); - //需要打印的数据 String 是打印模板code - Map> resultData = new HashMap<>(); - //用于保存客户模板代码 和 模板信息关系 - Map labelTemplateMap = new HashMap<>(); - //返回打印标识 给前端 - //1. 获取上下文中生成的主条码 - List productionPsOutContextList = productionDispatchContextStepService.getProductionPsOutContext(reqBean); - /** - * 重构,返回给前端打印数据 - */ - List printModelList = new ArrayList<>(); - //2. 获取条码需要模板、模板代码、打印机 --- 循环遍历条码 封装数据 - for (MesProductionPsOutContext sn : productionPsOutContextList) { - List mesProdRuleContexts = prodRuleContextMap.get(sn.getForeignKey()); - if (mesProdRuleContexts == null || mesProdRuleContexts.isEmpty()) { - stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("零件号[%s]的加工规则丢失,请配置!", sn.getPartNo())); - } - MesProdRuleContext mesProdRuleContext = mesProdRuleContexts.get(0); - Integer isPrint = mesProdRuleContext.getIsPrint(); - if (isPrint == null || isPrint == CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) { - continue; - } - String prodLabelTemplate = sn.getProdLabelTemplate(); - if (prodLabelTemplate == null) { - stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("零件号[%s]的模板代码[%s]的模板信息丢失,请配置!", sn.getPartNo(), prodLabelTemplate)); - } - - MesProduceSnPrintModel mesProduceSnPrintModel = new MesProduceSnPrintModel(); - // 查模板代码 - MesLabelTemplate labelTemplate = getLabelTemplate(prodLabelTemplate, organizeCode); - mesProduceSnPrintModel.setMesLabelTemplate(labelTemplate); - mesProduceSnPrintModel.setProductSn(sn.getProductSn()); - mesProduceSnPrintModel.setPartNo(sn.getPartNo()); - mesProduceSnPrintModel.setOrganizeCode(organizeCode); - List snList = new ArrayList<>(); - snList.add(sn); - mesProduceSnPrintModel.getMesProduceSnList().addAll(snList); - //模板信息丢失抛出异常 - if (labelTemplate == null) { - stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("零件号[%s]的模板代码[%s]的模板信息丢失,请配置!", sn.getPartNo(), prodLabelTemplate)); - } - //根据反射获取策略类--封装打印数据 - String methodCode = labelTemplate.getMethodCode(); - //模板信息丢失抛出异常 - if (methodCode == null) { - stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("零件号[%s]的模板代码[%s]的反射类丢失,请配置!", sn.getPartNo(), prodLabelTemplate)); - } - IPrintTemplateStrategyService strategyService = (IPrintTemplateStrategyService) SpringContextsUtil.getBean(methodCode); - // GenSerialNoModel model , MesProduceSnPrintModel mesProduceSnPrintModel, MesNumberRule numberRule, StepResult stepResult, StationRequestBean reqBean, Boolean isStep - MesProduceSnPrintModel printModel = strategyService.execute(null, mesProduceSnPrintModel, null, stepResult, reqBean, true); - printModelList.add(printModel); - } - - //前端接收到busiTyep是customComponent,并且 dataType是file类型的消息,就需要打印后续消息里的数据,一个模板对应多个打印数据 - resultBean.setBusiType(MesPcnEnumUtil.STATION_BUSI_TYPE.CUSTOM_COMPONENT.getValue()); - resultBean.setDataType(MesPcnEnumUtil.STATION_DATA_TYPE.FILE.getValue()); - resultBean.setResultObj(printModelList); - //3. 发送数据给到前端 - this.sendMessage(reqBean, resultBean); - List snLogList = printModelList.stream().map(MesProduceSnPrintModel::getMesPrintedSnLogList).flatMap(List::stream).collect(Collectors.toList()); - //更新打印状态 - for (MesProductionPsOutContext outSn : productionPsOutContextList) { - DdlPackBean packBean = DdlPackBean.getDdlPackBean(outSn.getOrganizeCode()); - DdlPreparedPack.getNumEqualPack(outSn.getId(), MesPcnExtConstWords.ID, packBean); - mesProduceSnRao.updateByProperties( - new String[]{MesPcnExtConstWords.PRINT_STATUS, MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME}, - new Object[]{MesExtEnumUtil.PRINT_STATUS.PRINTED.getValue(), reqBean.getUserInfo(), TimeTool.getNowTime(true)}, packBean); - } - //保存打印条码记录 - snLogRao.saveAll(snLogList); - return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "打印成功!"); - } - - //验证加工结果是否满足参数条件: 可疑/报废是否打印 - private Boolean checkIsMatchProdResult(StationRequestBean reqBean, String prodResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM prodResultEnum) { - - if (StringUtils.isEmpty(prodResult)) return false; - if (!prodResult.equals(prodResultEnum.getCode())) return false; - - Optional> stepParamMap = getStepParams(reqBean); - String unPrintParam = (null != stepParamMap && stepParamMap.isPresent() && stepParamMap.get().containsKey(prodResultEnum.name())) ? stepParamMap.get().get(prodResultEnum.name()).getParamValue() : null; - if (StringUtils.isEmpty(unPrintParam)) return false; - - return true; + //非排序线 打印主条码工步 + return ((IStepService) SpringContextsUtil.getBean("mesProductSnPrintNosortStepService")).executeInState(reqBean); } - /** - * 根据templateCode 获取模板信息 - * - * @param templateCode - * @param organizeCode - * @return - */ - private MesLabelTemplate getLabelTemplate(String templateCode, String organizeCode) { - DdlPackBean templatePackBean = DdlPackBean.getDdlPackBean(organizeCode); - DdlPreparedPack.getStringEqualPack(templateCode, "templateCode", templatePackBean); - List mesLabelTemplateList = labelTemplateRao.findByHqlWhere(templatePackBean); - MesLabelTemplate mesLabelTemplate = null; - if (!mesLabelTemplateList.isEmpty()) { - mesLabelTemplate = mesLabelTemplateList.get(0); - //级联获取labelTemplateParam - DdlPackBean templateParamPackBean = DdlPackBean.getDdlPackBean(organizeCode); - DdlPreparedPack.getNumEqualPack(mesLabelTemplate.getId(), "templateId", templateParamPackBean); - List params = labelTemplateParamRao.findByHqlWhere(templateParamPackBean); - mesLabelTemplate.setLabelTemplateParamList(params); - } - return mesLabelTemplate; - } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java index 66dcd0e..e15258e 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java @@ -29,7 +29,13 @@ import java.util.StringJoiner; @Service("mesProductionDispatchContextStepService") public class MesProductionDispatchContextStepService extends BaseStepService implements IMesProductionDispatchContextStepService { - private String getContextKey(StationRequestBean reqBean) { return getFsmBusikey(reqBean, new StringJoiner(MesPcnExtConstWords.COLON).add(MesPcnExtConstWords.PRODUCTION_PROCESS_CONTEXT).add(MesPcnExtConstWords.BUSI_DATA_CONTEXT).toString()); } + private String getContextKey(StationRequestBean reqBean) { + return getFsmBusikey(reqBean, new StringJoiner(MesPcnExtConstWords.COLON).add(MesPcnExtConstWords.PRODUCTION_PROCESS_CONTEXT).add(MesPcnExtConstWords.BUSI_DATA_CONTEXT).toString()); + } + + private String getContextKey(String organizeCode, String workCenterCode, String workCellCode) { + return new StringJoiner(MesPcnExtConstWords.COLON).add(organizeCode).add(workCenterCode).add(workCellCode).add(MesPcnExtConstWords.PRODUCTION_PROCESS_CONTEXT).add(MesPcnExtConstWords.BUSI_DATA_CONTEXT).toString(); + } //清除上下文中的所有业务数据 @Override @@ -385,6 +391,13 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp return !StringUtils.isEmpty(prodRuleNosortJson) ? JSONObject.parseArray(prodRuleNosortJson, MesProdRuleContext.class) : null; } + //获取上下文产品加工规则信息集合 + @Override + public List getProdRuleDataContext(String organizeCode, String workCenterCode, String workCellCode) { + String prodRuleNosortJson = getFsmBusiData(organizeCode, getContextKey(organizeCode, workCenterCode, workCellCode), MesPcnExtConstWords.PROD_RULE_DATA_CONTEXT); + return !StringUtils.isEmpty(prodRuleNosortJson) ? JSONObject.parseArray(prodRuleNosortJson, MesProdRuleContext.class) : null; + } + //验证上下文产品加工规则信息集合是否存在 @Override public Boolean checkProdRuleDataIsExistContext(StationRequestBean reqBean) { @@ -511,4 +524,38 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp return true; } + @Override + public List getProdTempDataContext(StationRequestBean reqBean) { + String prodTempDataJson = getFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PROD_TEMP_DATA_CONTEXT); + return !StringUtils.isEmpty(prodTempDataJson) ? JSONObject.parseArray(prodTempDataJson, MesProdTempDataContext.class) : null; + } + + @Override + public List getProdTempDataContext(String organizeCode, String workCenterCode, String workCellCode) { + String prodTempDataJson = getFsmBusiData(organizeCode, getContextKey(organizeCode, workCenterCode, workCellCode), MesPcnExtConstWords.PROD_TEMP_DATA_CONTEXT); + return !StringUtils.isEmpty(prodTempDataJson) ? JSONObject.parseArray(prodTempDataJson, MesProdTempDataContext.class) : null; + } + + @Override + public Boolean dispatchProdTempDataContext(StationRequestBean reqBean, List prodTempDataContextList) { + if (CollectionUtils.isEmpty(prodTempDataContextList)) return false; + return dispatchFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PROD_TEMP_DATA_CONTEXT, JSONObject.toJSONString(prodTempDataContextList)); + } + + @Override + public Boolean dispatchProdTempDataContext(String organizeCode, String workCenterCode, String workCellCode, List prodTempDataContextList) { + if (CollectionUtils.isEmpty(prodTempDataContextList)) return false; + return dispatchFsmBusiData(organizeCode, getContextKey(organizeCode, workCenterCode, workCellCode), MesPcnExtConstWords.PROD_TEMP_DATA_CONTEXT, JSONObject.toJSONString(prodTempDataContextList)); + } + + @Override + public void removeProdTempDataContext(StationRequestBean reqBean) { + removeFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PROD_TEMP_DATA_CONTEXT); + } + + @Override + public void removeProdTempDataContext(String organizeCode, String workCenterCode, String workCellCode) { + removeFsmBusiData(organizeCode, getContextKey(organizeCode, workCenterCode, workCellCode), MesPcnExtConstWords.PROD_TEMP_DATA_CONTEXT); + } + } diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdTempDataContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdTempDataContext.java new file mode 100644 index 0000000..1c99f65 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdTempDataContext.java @@ -0,0 +1,41 @@ +package cn.estsh.i3plus.ext.mes.pcn.pojo.context; + +import io.swagger.annotations.ApiParam; +import lombok.Data; + +import java.io.Serializable; + +/** + * 生产过程上下文对象-临时数据 + */ +@Data +public class MesProdTempDataContext implements Serializable { + + private static final long serialVersionUID = -5184127961206077150L; + + @ApiParam("组织代码") + public String organizeCode; + + @ApiParam(name = "数据关联键") + private Integer foreignKey; + + @ApiParam("流水号") + public String serialNo; + + public MesProdTempDataContext() {} + + public MesProdTempDataContext(String organizeCode) { + this.organizeCode = organizeCode; + } + + public MesProdTempDataContext(String organizeCode, Integer foreignKey) { + this.organizeCode = organizeCode; + this.foreignKey = foreignKey; + } + + public MesProdTempDataContext serialNo(String serialNo) { + this.serialNo = serialNo; + return this; + } + +} diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java index 59a715d..698ecfe 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java @@ -37,6 +37,9 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon @ApiParam(name = "产成品图") private String outPartNoPic; + @ApiParam(value = "截取的流水号长度") + private Integer serialLength; + public MesProductionAssemblyNosortContext() {} public MesProductionAssemblyNosortContext copy(MesProdRuleContext prodRuleContext, MesAssemblyNosortCfg assemblyNosortCfg, String assemblySn) { diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java index 70940fb..41cb7e8 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java @@ -453,9 +453,10 @@ public class MesPcnExtConstWords { public static final String RAW_PART_CHARGING_DATA_CONTEXT = "RAW_PART_CHARGING_DATA_CONTEXT"; // 上下文: 可回用包装数据信息 public static final String PRODUCTION_RECYCLABLE_PACKAGE_CONTEXT = "PRODUCTION_RECYCLABLE_PACKAGE_CONTEXT"; - // 上下文: 裁片工单成品数据 public static final String WORK_ORDER_CUT_FG_DATA_CONTEXT = "WORK_ORDER_CUT_FG_DATA_CONTEXT"; + // 上下文: 临时数据 + public static final String PROD_TEMP_DATA_CONTEXT = "PROD_TEMP_DATA_CONTEXT"; //OPC_API_PARAM