From e8f48d7034e79b96f2fa8267e3319d783cfd6928 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Thu, 6 Jun 2024 14:59:22 +0800 Subject: [PATCH] step --- .../MesProductResultErrorHandleStepService.java | 2 +- .../step/MesProductSnCheckStepService.java | 87 ++++++++++++++++++++++ .../step/MesProductSnGenerateStepService.java | 2 +- .../step/MesProductSnScanStepService.java | 3 +- .../MesProductionReocrdGenerateStepService.java | 3 +- .../pojo/context/MesProductionPsOutContext.java | 24 +----- 6 files changed, 94 insertions(+), 27 deletions(-) create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckStepService.java diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java index 05aae9b..375d895 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java @@ -108,7 +108,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { partInspection.setWorkCenterCode(reqBean.getWorkCenterCode()); partInspection.setSourceType(MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()); partInspection.setPartNo(mesProduceSn.getPartNo()); - partInspection.setPartName(mesProduceSn.getPartNameRdd()); + partInspection.setPartName(mesProduceSn.getPartName()); partInspection.setDefectTypeCode(mesDefectType.getDefectTypeCode()); partInspection.setInspectionDate(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMATTER)); partInspection.setLotNo(mesProduceSn.getLotNo()); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckStepService.java new file mode 100644 index 0000000..608a2c2 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckStepService.java @@ -0,0 +1,87 @@ +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.pojo.context.*; +import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.i3plus.mes.pcn.actor.shipping.dispatch.IFsmCommonService; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; +import cn.estsh.i3plus.platform.common.tool.TimeTool; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; +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 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.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + +/** + * @Description : 主条码验证工步 + * @Author : wangjie + **/ +@Slf4j +@Service("mesProductSnCheckStepService") +public class MesProductSnCheckStepService extends BaseStepService { + + @Autowired + private IMesProductionProcessContextStepService productionProcessContextStepService; + + @Autowired + private IMesProductionDispatchContextStepService productionDispatchContextStepService; + + @Autowired + private IFsmCommonService fsmCommonService; + + @Override + public StepResult execute(StationRequestBean reqBean) { + + StationResultBean resultBean = new StationResultBean(); + + StepResult stepResult = StepResult.getSuccessComplete(); + + //获取上下文信息 + MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean); + + //获取生产过程上下文对象有异常信息 抛出异常 + if (!productionProcessContext.getSuccess()) return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, productionProcessContext.getMessage()); + + //存储生产过程上下文对象 + productionProcessContextStepService.saveProductionProcessContext(reqBean, productionProcessContext); + + + + + + + + + + + + + + + + + + + + + return stepResult; + } + + + + + +} 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 1d432e4..7f2e59c 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 @@ -136,7 +136,7 @@ public class MesProductSnGenerateStepService extends BaseStepService { mesProduceSn.setProductSn(sn); mesProduceSn.setCustSn(sn); mesProduceSn.setPartNo(mesPart.getPartNo()); - mesProduceSn.setPartNameRdd(mesPart.getPartName()); + mesProduceSn.setPartName(mesPart.getPartName()); mesProduceSn.setAreaCode(mesWorkCell.getAreaCode()); mesProduceSn.setWorkCenterCode(mesWorkCell.getWorkCenterCode()); mesProduceSn.setWorkCellCode(mesWorkCell.getWorkCellCode()); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanStepService.java index 1dc23cd..d984a68 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanStepService.java @@ -130,7 +130,8 @@ public class MesProductSnScanStepService extends BaseStepService { //是否支持混腔扫描[工位参数] String cavityNosortCfg = fsmCommonService.doHandleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_NOSORT_CFG); if (StringUtils.isEmpty(cavityNosortCfg)) return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("当前扫描信息主条码[%s]!", scanInfo)); - else return execDynamicsCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, false, + + return execDynamicsCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, false, MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT, String.format("当前扫描信息主条码[%s],已知腔数[%s],还需要再连续扫描[%s]次主条码!", scanInfo, needQty, needQty - equipVariableCollectContextList.size())); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionReocrdGenerateStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionReocrdGenerateStepService.java index f317df1..32868d0 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionReocrdGenerateStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionReocrdGenerateStepService.java @@ -84,7 +84,7 @@ public class MesProductionReocrdGenerateStepService extends BaseStepService { mesProductionRecord.setEquipmentCode(productionProcessContext.getCurCellEquip().getEquipmentCode()); mesProductionRecord.setEquipmentName(productionProcessContext.getCurCellEquip().getEquipmentName()); mesProductionRecord.setPartNo(mesProduceSn.getPartNo()); - mesProductionRecord.setPartName(mesProduceSn.getPartNameRdd()); + mesProductionRecord.setPartName(mesProduceSn.getPartName()); mesProductionRecord.setIsComplete(MesEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); mesProductionRecord.setCompleteDateTime(DateUtil.formatDateTime(new Date())); mesProductionRecord.setLotNo(mesProduceSn.getLotNo()); @@ -107,7 +107,6 @@ public class MesProductionReocrdGenerateStepService extends BaseStepService { mesProductionRecord.setProcessCode(mesProduceSn.getProcessCode()); mesProductionRecord.setReportPartNo(mesProduceSn.getPartNo()); mesProductionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue()); - mesProductionRecord.setReportType(mesProduceSn.getReportType() + ""); mesProductionRecord.setShiftCode(mesProduceSn.getShiftCode()); mesProductionRecord.setShiftGroup(mesProduceSn.getShiftGroup()); mesProductionRecord.setWorkOrderNo(mesProduceSn.getWorkOrderNo()); diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsOutContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsOutContext.java index fb9d355..73fa749 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsOutContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsOutContext.java @@ -1,5 +1,6 @@ package cn.estsh.i3plus.ext.mes.pcn.pojo.context; +import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn; import io.swagger.annotations.ApiParam; import lombok.Data; @@ -9,32 +10,11 @@ import java.io.Serializable; * 生产过程上下文对象-零件条码(非排序产出零件条码) */ @Data -public class MesProductionPsOutContext implements Serializable { +public class MesProductionPsOutContext extends MesProduceSn implements Serializable { private static final long serialVersionUID = 5562937531822977296L; @ApiParam(name = "数据关联键 非排序:snowflakeId") private String foreignKey; - @ApiParam("组织代码") - private String organizeCode; - - @ApiParam("零件条码ID") - private Long id; - - @ApiParam("非排序产出零件条码") - private String productSn; - - @ApiParam("非排序产出零件过程条码") - private String serialNumber; - - @ApiParam("非排序产出客户条码") - private String custSn; - - @ApiParam("零件号") - private String partNo; - - @ApiParam("零件名称") - private String partName; - }