From be5271fe1f78384a958c759b633b46d0aa9ae61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E7=AC=91=E7=9D=80=E9=9D=A2=E5=AF=B9=E6=98=8E?= =?UTF-8?q?=E5=A4=A9?= <752558143@qq.com> Date: Mon, 27 May 2024 15:23:58 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=B7=A5=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../station/MesProductionNoSortModuleService.java | 149 ++++++++++++++++++++- .../MesProductionProcessContextStepService.java | 2 +- .../MesVariableWhenFinishedReadStepService.java | 2 +- 3 files changed, 148 insertions(+), 5 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/MesProductionNoSortModuleService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/MesProductionNoSortModuleService.java index 8c0ca2e..97d3ae9 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/MesProductionNoSortModuleService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/MesProductionNoSortModuleService.java @@ -5,12 +5,14 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseModuleService; import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; import cn.estsh.i3plus.pojo.mes.bean.MesStateMachineStatus; +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 lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -27,16 +29,157 @@ public class MesProductionNoSortModuleService extends BaseModuleService { @Override public void init(StationRequestBean reqBean) { + /** + * 工单号 和 分组 + */ + StationResultBean resultBean = getStationResultBean(reqBean); + + //TODO 获取 头部上下文 信息 +// productionProcessContextStepService.getProductionProcessContext(); + + this.sendMessage(reqBean, resultBean); + + + + + + + this.sendMessage(reqBean, resultBean); + + } + + private StationResultBean getStationResultBean(StationRequestBean reqBean) { StationResultBean resultBean = new StationResultBean(); resultBean.setBusiType(MesPcnEnumUtil.STATION_BUSI_TYPE.MODULE_CONTENT.getValue()); resultBean.setDataType(MesPcnEnumUtil.STATION_DATA_TYPE.CUSTOM.getValue()); resultBean.setCustomPageName(MesPcnExtConstWords.CUSTOM_PAGE_NAME_DEFAULT); resultBean.setSpecialDisplayData(getStepColIndent(reqBean)); - //TODO 获取 头部上下文 信息 -// productionProcessContextStepService.getProductionProcessContext(); + List> stationKvBeansList = new ArrayList<>(); + List stationKvBeans = new ArrayList<>(); + StationKvBean stationKvBean = new StationKvBean(); + stationKvBean.setKey("orderNo"); + stationKvBean.setName("工单号"); + stationKvBean.setValue("11111"); + stationKvBeans.add(stationKvBean); - this.sendMessage(reqBean, resultBean); + StationKvBean stationKvBean1 = new StationKvBean(); + stationKvBean1.setKey("partNo"); + stationKvBean1.setName("零件号"); + stationKvBean1.setValue("111"); + stationKvBeans.add(stationKvBean1); + + StationKvBean stationKvBean2 = new StationKvBean(); + stationKvBean2.setKey("count"); + stationKvBean2.setName("单数"); + stationKvBean2.setValue("1111"); + stationKvBeans.add(stationKvBean2); + + stationKvBeansList.add(stationKvBeans); + List stationKvBeans1 = new ArrayList<>(); + StationKvBean stationKvBean4 = new StationKvBean(); + stationKvBean4.setKey("orderNo"); + stationKvBean4.setName("工单号"); + stationKvBean4.setValue("11111"); + stationKvBeans1.add(stationKvBean4); + + StationKvBean stationKvBean5 = new StationKvBean(); + stationKvBean5.setKey("partNo"); + stationKvBean5.setName("零件号"); + stationKvBean5.setValue("111"); + stationKvBeans1.add(stationKvBean5); + + StationKvBean stationKvBean6 = new StationKvBean(); + stationKvBean6.setKey("count"); + stationKvBean6.setName("单数"); + stationKvBean6.setValue("1111"); + stationKvBeans1.add(stationKvBean6); + stationKvBeansList.add(stationKvBeans1); + + List stationKvBeans3 = new ArrayList<>(); + + StationKvBean stationKvBean7 = new StationKvBean(); + stationKvBean7.setKey("shiftCode"); + stationKvBean7.setName("班次"); + stationKvBean7.setValue("白班"); + stationKvBeans3.add(stationKvBean7); + + StationKvBean stationKvBean8 = new StationKvBean(); + stationKvBean8.setKey("shiftGroup"); + stationKvBean8.setName("班组"); + stationKvBean8.setValue("注塑2班"); + stationKvBeans3.add(stationKvBean8); + + resultBean.setResultObj(stationKvBeans3); + resultBean.setResultList(stationKvBeansList); + return resultBean; + } + + private StationResultBean getStationResultBean1(StationRequestBean reqBean) { + StationResultBean resultBean = new StationResultBean(); + resultBean.setBusiType(MesPcnEnumUtil.STATION_BUSI_TYPE.MODULE_CUSTOM_CONTENT.getValue()); + resultBean.setDataType(MesPcnEnumUtil.STATION_DATA_TYPE.ECHART.getValue()); + resultBean.setCustomPageName(MesPcnExtConstWords.CUSTOM_PAGE_NAME_DEFAULT); + resultBean.setSpecialDisplayData(getStepColIndent(reqBean)); + + List> stationKvBeansList = new ArrayList<>(); + List stationKvBeans = new ArrayList<>(); + StationKvBean stationKvBean = new StationKvBean(); + stationKvBean.setKey("orderNo"); + stationKvBean.setName("工单号"); + stationKvBean.setValue("11111"); + stationKvBeans.add(stationKvBean); + + StationKvBean stationKvBean1 = new StationKvBean(); + stationKvBean1.setKey("partNo"); + stationKvBean1.setName("零件号"); + stationKvBean1.setValue("111"); + stationKvBeans.add(stationKvBean1); + + StationKvBean stationKvBean2 = new StationKvBean(); + stationKvBean2.setKey("count"); + stationKvBean2.setName("单数"); + stationKvBean2.setValue("1111"); + stationKvBeans.add(stationKvBean2); + + stationKvBeansList.add(stationKvBeans); + List stationKvBeans1 = new ArrayList<>(); + StationKvBean stationKvBean4 = new StationKvBean(); + stationKvBean4.setKey("orderNo"); + stationKvBean4.setName("工单号"); + stationKvBean4.setValue("11111"); + stationKvBeans1.add(stationKvBean4); + + StationKvBean stationKvBean5 = new StationKvBean(); + stationKvBean5.setKey("partNo"); + stationKvBean5.setName("零件号"); + stationKvBean5.setValue("111"); + stationKvBeans1.add(stationKvBean5); + + StationKvBean stationKvBean6 = new StationKvBean(); + stationKvBean6.setKey("count"); + stationKvBean6.setName("单数"); + stationKvBean6.setValue("1111"); + stationKvBeans1.add(stationKvBean6); + stationKvBeansList.add(stationKvBeans1); + + List stationKvBeans3 = new ArrayList<>(); + + StationKvBean stationKvBean7 = new StationKvBean(); + stationKvBean7.setKey("shiftCode"); + stationKvBean7.setName("班次"); + stationKvBean7.setValue("白班"); + stationKvBeans3.add(stationKvBean7); + + StationKvBean stationKvBean8 = new StationKvBean(); + stationKvBean8.setKey("shiftGroup"); + stationKvBean8.setName("班组"); + stationKvBean8.setValue("注塑2班"); + stationKvBeans3.add(stationKvBean8); + + resultBean.setResultObj(stationKvBeans3); + resultBean.setResultList(stationKvBeansList); + return resultBean; } @Override diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionProcessContextStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionProcessContextStepService.java index 1f00fd6..c6b410c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionProcessContextStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionProcessContextStepService.java @@ -75,7 +75,7 @@ public class MesProductionProcessContextStepService extends BaseStepService impl if (StringUtils.isEmpty(productionProcessContext.getWorkCenterJson())) productionProcessContext.workCenterJson(prodOrgExtService.getWorkCenterDb(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode())); //生产过程上下文对象赋值工位信息 - if (StringUtils.isEmpty(productionProcessContext.getWorkCenterJson())) productionProcessContext.workCellJson(prodOrgExtService.getWorkCellDb(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode())); + if (StringUtils.isEmpty(productionProcessContext.getWorkCellJson())) productionProcessContext.workCellJson(prodOrgExtService.getWorkCellDb(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode())); //生产过程上下文对象赋值工序工艺信息 if (StringUtils.isEmpty(productionProcessContext.getProcessCode()) || !productionProcessContext.getProcessCode().equals(reqBean.getProcessCode())) processContext(reqBean, productionProcessContext); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesVariableWhenFinishedReadStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesVariableWhenFinishedReadStepService.java index 55de276..6c66b9b 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesVariableWhenFinishedReadStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesVariableWhenFinishedReadStepService.java @@ -32,7 +32,7 @@ import java.util.*; import java.util.stream.Collectors; /** - * @Description : 保存加工参数 + * @Description : 保存工艺参数 * @Author : wangjie **/ @Slf4j From 9cf6a961511dd3c49f8013ca7af1d4845412385f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E7=AC=91=E7=9D=80=E9=9D=A2=E5=AF=B9=E6=98=8E?= =?UTF-8?q?=E5=A4=A9?= <752558143@qq.com> Date: Tue, 28 May 2024 18:43:47 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=B7=A5=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../step/MesProductSnSaveStepService.java | 60 ++++++++++++ .../MesProductionReocrdGenerateStepService.java | 103 +++++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnSaveStepService.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionReocrdGenerateStepService.java diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnSaveStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnSaveStepService.java new file mode 100644 index 0000000..cb568a3 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnSaveStepService.java @@ -0,0 +1,60 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step; + +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesSnProductionProcessContext; +import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; +import cn.estsh.i3plus.pojo.mes.bean.MesMouldMultiCavity; +import cn.estsh.i3plus.pojo.mes.bean.MesPart; +import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn; +import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell; +import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel; +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.MesPartRepository; +import cn.estsh.i3plus.pojo.mes.repository.MesProduceSnRepository; +import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; +import cn.hutool.core.date.DateUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @Description : 保存零件条码信息工步 + * @Author : zxw + **/ +@Slf4j +@Service +public class MesProductSnSaveStepService extends BaseStepService { + + @Autowired + private IMesProductionProcessContextStepService productionProcessContextStepService; + + @Autowired + private MesProduceSnRepository mesProduceSnRepository; + + public static final String ORDER_NO_JIS_SORT = "ORDER_NO_JIS_SORT"; + + @Override + public StepResult execute(StationRequestBean reqBean) { + + MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getEquipmentVariableList(reqBean, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue()); + List mesProduceSns = productionProcessContext.getProduceSnDataList(); + + mesProduceSns.forEach(mesProduceSn -> { + mesProduceSn.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()); + }); + mesProduceSnRepository.saveAll(mesProduceSns); + + return StepResult.getSuccessComplete(); + } +} 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 new file mode 100644 index 0000000..eecb3a1 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionReocrdGenerateStepService.java @@ -0,0 +1,103 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step; + +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext; +import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; +import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker; +import cn.estsh.i3plus.pojo.base.enumutil.MesEnumUtil; +import cn.estsh.i3plus.pojo.mes.bean.MesPart; +import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn; +import cn.estsh.i3plus.pojo.mes.bean.MesProductionRecord; +import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell; +import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel; +import cn.estsh.i3plus.pojo.mes.model.StationRequestBean; +import cn.estsh.i3plus.pojo.mes.model.StepResult; +import cn.estsh.i3plus.pojo.mes.repository.MesPartRepository; +import cn.estsh.i3plus.pojo.mes.repository.MesProduceSnRepository; +import cn.estsh.i3plus.pojo.mes.repository.MesProductionRecordRepository; +import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; +import cn.hutool.core.date.DateUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @Description : 生成加工记录工步 + * @Author : wangjie + **/ +@Slf4j +@Service +public class MesProductionReocrdGenerateStepService extends BaseStepService { + @Autowired + private SnowflakeIdMaker snowflakeIdMaker; + + @Autowired + private IMesProductionProcessContextStepService productionProcessContextStepService; + + @Autowired + private MesProduceSnRepository mesProduceSnRepository; + + @Autowired + private MesProductionRecordRepository mesProductionRecordRepository; + + public static final String ORDER_NO_JIS_SORT = "ORDER_NO_JIS_SORT"; + + + @Override + public StepResult execute(StationRequestBean reqBean) { + + MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getEquipmentVariableList(reqBean, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue()); + List mesProduceSns = productionProcessContext.getProduceSnDataList(); + + List mesProductionRecords = new ArrayList<>(); + mesProduceSns.forEach(mesProduceSn -> { + + MesProductionRecord mesProductionRecord = getMesProductionRecord(productionProcessContext, mesProduceSn); + mesProductionRecords.add(mesProductionRecord); + }); + + mesProductionRecordRepository.saveAll(mesProductionRecords); + + return StepResult.getSuccessComplete(); + } + + private MesProductionRecord getMesProductionRecord(MesProductionProcessContext productionProcessContext, MesProduceSn mesProduceSn) { + MesProductionRecord mesProductionRecord = new MesProductionRecord(); + + mesProductionRecord.setSerialNumber(mesProduceSn.getSerialNumber()); + mesProductionRecord.setAreaCode(mesProduceSn.getAreaCode()); + mesProductionRecord.setCraftCode(mesProduceSn.getCraftCode()); + mesProductionRecord.setCustSn(mesProduceSn.getCustSn()); + mesProductionRecord.setEquipmentCode(mesProduceSn.getEquipmentCode()); + mesProductionRecord.setIsComplete(MesEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); + mesProductionRecord.setCompleteDateTime(DateUtil.formatDateTime(new Date())); + mesProductionRecord.setLotNo(mesProduceSn.getLotNo()); + mesProductionRecord.setEquipmentName(mesProduceSn.getEquipmentName()); + + String mouldNo = ""; + if (productionProcessContext.getFirstMouldNo() != null) { + mouldNo = productionProcessContext.getFirstMouldNo().getEquipVariableValue(); + }else if (productionProcessContext.getFirstMouldNo() == null && productionProcessContext.getMouldNo() != null){ + mouldNo = productionProcessContext.getMouldNo().getEquipVariableValue(); + } + mesProductionRecord.setMouldNo(mouldNo); + // todo + // mesProductionRecord.setMouldRecordId(); + 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()); + mesProductionRecord.setWorkCellCode(mesProduceSn.getWorkCellCode()); + mesProductionRecord.setWorkCenterCode(mesProduceSn.getWorkCenterCode()); + return mesProductionRecord; + } + +} From 529edd19d6bce15000604bf18d0cc766b66d376c Mon Sep 17 00:00:00 2001 From: gsz Date: Tue, 28 May 2024 19:35:39 +0800 Subject: [PATCH 3/4] =?UTF-8?q?MES-PCN=E8=AE=BE=E5=A4=87=E5=81=9C=E6=9C=BA?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B+=E5=BC=80=E5=85=B3=E7=8F=AD=E8=AE=B0?= =?UTF-8?q?=E5=BD=95+=E4=BA=A7=E7=BA=BF=E4=B8=8E=E7=8F=AD=E7=BB=84+?= =?UTF-8?q?=E4=BA=A7=E7=BA=BF=E4=B8=8E=E7=8F=AD=E6=AC=A1=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/base/IMesBasDowntimeReasonTypeService.java | 24 +++++++ .../pcn/api/base/IMesProdShiftRecordService.java | 23 ++++++ .../api/base/IMesShiftGroupCenterCfgService.java | 20 ++++++ .../ext/mes/pcn/api/base/IMesShiftService.java | 21 ++++++ .../busi/MesDowntimeReasonTypeController.java | 51 ++++++++++++++ .../busi/MesProdShiftRecordController.java | 82 ++++++++++++++++++++++ .../controller/busi/MesShiftController.java | 44 ++++++++++++ .../busi/MesShiftGroupCenterCfgController.java | 41 +++++++++++ .../base/MesBasDowntimeReasonTypeServiceImpl.java | 70 ++++++++++++++++++ .../base/MesProdShiftRecordServiceImpl.java | 79 +++++++++++++++++++++ .../base/MesShiftGroupCenterCfgServiceImpl.java | 46 ++++++++++++ .../serviceimpl/base/MesShiftServiceImpl.java | 46 ++++++++++++ 12 files changed, 547 insertions(+) create mode 100644 modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesBasDowntimeReasonTypeService.java create mode 100644 modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdShiftRecordService.java create mode 100644 modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesShiftGroupCenterCfgService.java create mode 100644 modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesShiftService.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesDowntimeReasonTypeController.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesProdShiftRecordController.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShiftController.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShiftGroupCenterCfgController.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesBasDowntimeReasonTypeServiceImpl.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdShiftRecordServiceImpl.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftGroupCenterCfgServiceImpl.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftServiceImpl.java diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesBasDowntimeReasonTypeService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesBasDowntimeReasonTypeService.java new file mode 100644 index 0000000..c8e9d8d --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesBasDowntimeReasonTypeService.java @@ -0,0 +1,24 @@ +package cn.estsh.i3plus.ext.mes.pcn.api.base; + +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.mes.bean.MesDowntimeReasonType; + +import java.util.List; + +/** + * @Description :设备停机类型 + * @Reference : + * @Author : gsz + * @CreateDate 2024/5/17 14:06 + * @Modify: + **/ +public interface IMesBasDowntimeReasonTypeService { + + /** + * 查询设备停机类型和原因 + * @param downtimeReasonType + * @param pager + * @return + */ + List findMesDowntimeTypeReason(MesDowntimeReasonType downtimeReasonType, Pager pager); +} diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdShiftRecordService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdShiftRecordService.java new file mode 100644 index 0000000..b099b1a --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdShiftRecordService.java @@ -0,0 +1,23 @@ +package cn.estsh.i3plus.ext.mes.pcn.api.base; + + +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.mes.bean.MesProdShiftRecord; +import io.swagger.annotations.ApiOperation; + +/** + * @Description: 开关班记录 + * @Author: gsz + * @Date: 2024/5/25 18:16 + * @Modify: + */ +public interface IMesProdShiftRecordService { + + @ApiOperation(value = "查询开关班记录") + public ListPager queryMesProdShiftRecordByPager(MesProdShiftRecord partInspection, Pager pager); + + void insertMesProdShiftRecord(MesProdShiftRecord item, String organizeCode); + + void saveMesProdShiftRecord(MesProdShiftRecord item, String organizeCode); +} diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesShiftGroupCenterCfgService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesShiftGroupCenterCfgService.java new file mode 100644 index 0000000..64266bb --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesShiftGroupCenterCfgService.java @@ -0,0 +1,20 @@ +package cn.estsh.i3plus.ext.mes.pcn.api.base; + + +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.mes.bean.MesShiftGroupCenterCfg; +import io.swagger.annotations.ApiOperation; + +/** + * @Description: 产线与班组的对应关系 + * @Author: gsz + * @Date: 2024/5/25 18:16 + * @Modify: + */ +public interface IMesShiftGroupCenterCfgService { + + @ApiOperation(value = "查询产线与班组的对应关系") + public ListPager queryMesShiftGroupCenterCfgByPager(MesShiftGroupCenterCfg mesShiftGroupCenterCfg, Pager pager); + +} diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesShiftService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesShiftService.java new file mode 100644 index 0000000..66ba5b4 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesShiftService.java @@ -0,0 +1,21 @@ +package cn.estsh.i3plus.ext.mes.pcn.api.base; + + +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.mes.bean.MesShift; +import io.swagger.annotations.ApiOperation; + +/** + * @Description: 产线与班次的对应关系 + * @Author: gsz + * @Date: 2024/5/25 18:16 + * @Modify: + */ +public interface IMesShiftService { + + + @ApiOperation(value = "查询产线与班次的对应关系") + public ListPager queryMesShiftByPager(MesShift mesShift, Pager pager); + +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesDowntimeReasonTypeController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesDowntimeReasonTypeController.java new file mode 100644 index 0000000..f434f8e --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesDowntimeReasonTypeController.java @@ -0,0 +1,51 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesBasDowntimeReasonTypeService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant; +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil; +import cn.estsh.i3plus.pojo.mes.bean.MesDowntimeReasonType; +import cn.estsh.impp.framework.boot.auth.AuthUtil; +import cn.estsh.impp.framework.boot.exception.ImppBusiException; +import cn.estsh.impp.framework.boot.util.ResultBean; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Description :设备停机类型 + * @Reference : + * @Author : gsz + * @CreateDate : 2024-05-17 14:16 + * @Modify: + **/ +@RestController +@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesDowntimeReasonType") +public class MesDowntimeReasonTypeController { + + @Autowired + private IMesBasDowntimeReasonTypeService downtimeReasonTypeService; + + @GetMapping(value = "/find-downtime-type-reason") + @ApiOperation(value = "查询设备停机类型和原因") + public ResultBean findMesDowntimeTypeReason(MesDowntimeReasonType mesDowntimeReasontype, Pager pager) { + try { + mesDowntimeReasontype.setOrganizeCode(AuthUtil.getOrganizeCode()); + //查询汇总工单数量 + List mesDowntimeReasonTypes = downtimeReasonTypeService.findMesDowntimeTypeReason(mesDowntimeReasontype, pager); + + return ResultBean.success("查询成功") + .setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()) + .setListPager(new ListPager<>(mesDowntimeReasonTypes, pager)); + } catch (ImppBusiException e) { + return ResultBean.fail(e).build(); + } catch (Exception e) { + return ResultBean.fail(e); + } + } +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesProdShiftRecordController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesProdShiftRecordController.java new file mode 100644 index 0000000..e90a77c --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesProdShiftRecordController.java @@ -0,0 +1,82 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesProdShiftRecordService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant; +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.mes.bean.MesProdShiftRecord; +import cn.estsh.impp.framework.boot.auth.AuthUtil; +import cn.estsh.impp.framework.boot.exception.ImppBusiException; +import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; +import cn.estsh.impp.framework.boot.util.ResultBean; +import cn.estsh.impp.framework.boot.util.ValidatorBean; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * @Description: 开关班记录 + * @Author: gsz + * @Date: 2024/5/25 18:16 + * @Modify: + */ +@RestController +@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesProdShiftRecord") +public class MesProdShiftRecordController { + + private IMesProdShiftRecordService mesProdShiftRecordService; + + @GetMapping("/query-pager") + @ApiOperation(value = "查询开关班记录") + public ResultBean queryMesProdShiftRecordByPager(MesProdShiftRecord mesProdShiftRecord, Pager pager) { + try { + mesProdShiftRecord.setOrganizeCode(AuthUtil.getOrganizeCode()); + ListPager partInspectionListPager = mesProdShiftRecordService.queryMesProdShiftRecordByPager(mesProdShiftRecord, pager); + return ResultBean.success("查询成功").setListPager(partInspectionListPager); + } catch (ImppBusiException imppException) { + return ResultBean.fail(imppException); + } catch (Exception e) { + return ImppExceptionBuilder.newInstance().buildExceptionResult(e); + } + } + + @PostMapping("/insert") + @ApiOperation(value = "保存开关班记录") + public ResultBean insertMesProdShiftRecord(@RequestBody MesProdShiftRecord item) { + + try { + // 数据校验 + ValidatorBean.checkNotNull(item.getOrganizeCode(), "工厂号不能为空"); + ValidatorBean.checkNotNull(item.getWorkCenterCode(), "workCenterCode不能为空" ); + ValidatorBean.checkNotNull(item.getShiftGroup(), "shiftGroup不能为空"); + ValidatorBean.checkNotNull(item.getShiftCode(), "shiftCode不能为空"); + + + mesProdShiftRecordService.insertMesProdShiftRecord(item, AuthUtil.getOrganizeCode()); + return ResultBean.success("NC处理成功"); + } catch (ImppBusiException imppException) { + return ResultBean.fail(imppException); + } catch (Exception e) { + return ImppExceptionBuilder.newInstance().buildExceptionResult(e); + } + } + + @PostMapping("/update") + @ApiOperation(value = "保存开关班记录") + public ResultBean updateMesProdShiftRecord(@RequestBody MesProdShiftRecord item) { + + try { + // 数据校验 + ValidatorBean.checkNotNull(item.getOrganizeCode(), "工厂号不能为空"); + ValidatorBean.checkNotNull(item.getWorkCenterCode(), "workCenterCode不能为空" ); + ValidatorBean.checkNotNull(item.getShiftGroup(), "shiftGroup不能为空"); + ValidatorBean.checkNotNull(item.getShiftCode(), "shiftCode不能为空"); + + mesProdShiftRecordService.saveMesProdShiftRecord(item, AuthUtil.getOrganizeCode()); + return ResultBean.success("NC处理成功"); + } catch (ImppBusiException imppException) { + return ResultBean.fail(imppException); + } catch (Exception e) { + return ImppExceptionBuilder.newInstance().buildExceptionResult(e); + } + } +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShiftController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShiftController.java new file mode 100644 index 0000000..782fce7 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShiftController.java @@ -0,0 +1,44 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesShiftService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant; +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.mes.bean.MesShift; +import cn.estsh.impp.framework.boot.auth.AuthUtil; +import cn.estsh.impp.framework.boot.exception.ImppBusiException; +import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; +import cn.estsh.impp.framework.boot.util.ResultBean; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Description: 产线与班次的对应关系 + * @Author: gsz + * @Date: 2024/5/25 18:16 + * @Modify: + */ +@RestController +@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesShift") +public class MesShiftController { + + private IMesShiftService mesShiftService; + + @GetMapping("/query-pager") + @ApiOperation(value = "产线与班次的对应关系") + public ResultBean queryMesShiftByPager(MesShift mesShift, Pager pager) { + try { + mesShift.setOrganizeCode(AuthUtil.getOrganizeCode()); + ListPager partInspectionListPager = mesShiftService.queryMesShiftByPager(mesShift, pager); + return ResultBean.success("查询成功").setListPager(partInspectionListPager); + } catch (ImppBusiException imppException) { + return ResultBean.fail(imppException); + } catch (Exception e) { + return ImppExceptionBuilder.newInstance().buildExceptionResult(e); + } + } + + +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShiftGroupCenterCfgController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShiftGroupCenterCfgController.java new file mode 100644 index 0000000..ea2a099 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShiftGroupCenterCfgController.java @@ -0,0 +1,41 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesShiftGroupCenterCfgService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant; +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.mes.bean.MesShiftGroupCenterCfg; +import cn.estsh.impp.framework.boot.auth.AuthUtil; +import cn.estsh.impp.framework.boot.exception.ImppBusiException; +import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; +import cn.estsh.impp.framework.boot.util.ResultBean; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * @Description: 产线与班组的对应关系 + * @Author: gsz + * @Date: 2024/5/25 18:16 + * @Modify: + */ +@RestController +@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesShiftGroupCenterCfg") +public class MesShiftGroupCenterCfgController { + + private IMesShiftGroupCenterCfgService mesShiftGroupCenterCfgService; + + @GetMapping("/query-pager") + @ApiOperation(value = "产线与班组的对应关系") + public ResultBean queryMesShiftGroupCenterCfgByPager(MesShiftGroupCenterCfg mesShiftGroupCenterCfg, Pager pager) { + try { + mesShiftGroupCenterCfg.setOrganizeCode(AuthUtil.getOrganizeCode()); + ListPager partInspectionListPager = mesShiftGroupCenterCfgService.queryMesShiftGroupCenterCfgByPager(mesShiftGroupCenterCfg, pager); + return ResultBean.success("查询成功").setListPager(partInspectionListPager); + } catch (ImppBusiException imppException) { + return ResultBean.fail(imppException); + } catch (Exception e) { + return ImppExceptionBuilder.newInstance().buildExceptionResult(e); + } + } + +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesBasDowntimeReasonTypeServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesBasDowntimeReasonTypeServiceImpl.java new file mode 100644 index 0000000..02ec227 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesBasDowntimeReasonTypeServiceImpl.java @@ -0,0 +1,70 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesBasDowntimeReasonTypeService; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; +import cn.estsh.i3plus.pojo.base.util.StringUtil; +import cn.estsh.i3plus.pojo.mes.bean.MesDowntimeReason; +import cn.estsh.i3plus.pojo.mes.bean.MesDowntimeReasonType; +import cn.estsh.i3plus.pojo.mes.repository.IMesBasDowntimeReasonRepository; +import cn.estsh.i3plus.pojo.mes.repository.IMesBasDowntimeReasonTypeRepository; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + + +/** + * @Description : 设备停机类型 + * @Reference : + * @Author : gsz + * @CreateDate 2024/5/17 14:06 + * @Modify: + **/ +@Service +@Slf4j +public class MesBasDowntimeReasonTypeServiceImpl implements IMesBasDowntimeReasonTypeService { + + @Autowired + private IMesBasDowntimeReasonRepository downtimeReasonRDao; + @Autowired + private IMesBasDowntimeReasonTypeRepository downtimeReasonTypeRDao; + + + /** + * 查询设备停机类型和原因 + * + * @param downtimeReasonType + * @param pager + * @return + */ + @Override + public List findMesDowntimeTypeReason(MesDowntimeReasonType downtimeReasonType, Pager pager) { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(downtimeReasonType.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(downtimeReasonType.getReasonTypeCode(), "reasonTypeCode", packBean); + List downtimeReasonTypeList = downtimeReasonTypeRDao.findByHqlPage(packBean, pager); + + if (!CollectionUtils.isEmpty(downtimeReasonTypeList)) { + //查对应原因 + List mesDowntimeReasonList = downtimeReasonRDao.findByProperty( + new String[]{"organizeCode", "isDeleted", "isValid"}, + new Object[]{downtimeReasonType.getOrganizeCode(), + CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue()}); + + Map> reasonMap = mesDowntimeReasonList.stream().collect(Collectors.groupingBy(MesDowntimeReason::getReasonTypeCode)); + + for (MesDowntimeReasonType mesDowntimeReasonType : downtimeReasonTypeList) { + if (!StringUtil.isEmpty(reasonMap.get(mesDowntimeReasonType.getReasonTypeCode()))) { + mesDowntimeReasonType.setDowntimeReasonList(reasonMap.get(mesDowntimeReasonType.getReasonTypeCode())); + } + } + } + return downtimeReasonTypeList; + } +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdShiftRecordServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdShiftRecordServiceImpl.java new file mode 100644 index 0000000..3681bff --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdShiftRecordServiceImpl.java @@ -0,0 +1,79 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesProdShiftRecordService; +import cn.estsh.i3plus.platform.common.convert.ConvertBean; +import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.base.common.PagerHelper; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; +import cn.estsh.i3plus.pojo.base.util.StringUtil; +import cn.estsh.i3plus.pojo.mes.bean.MesProdShiftRecord; +import cn.estsh.i3plus.pojo.mes.repository.MesProdShiftRecordRepository; +import cn.estsh.impp.framework.boot.auth.AuthUtil; +import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @Description: 开关班记录表 + * @Author: gsz + * @Date: 2024/5/21 14:16 + * @Modify: + */ +@Service +@Slf4j +public class MesProdShiftRecordServiceImpl implements IMesProdShiftRecordService { + + @Autowired + private MesProdShiftRecordRepository mesProdShiftRecordRDao; + + @Override + public ListPager queryMesProdShiftRecordByPager(MesProdShiftRecord bean, Pager pager) { + + DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(bean.getWorkCenterCode(), "workCenterCode", packBean); + DdlPreparedPack.getStringEqualPack(bean.getShiftGroup(), "shiftGroup", packBean); + DdlPreparedPack.getStringEqualPack(bean.getShiftCode(), "shiftCode", packBean); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean); + pager = PagerHelper.getPager(pager, mesProdShiftRecordRDao.findByHqlWhereCount(packBean)); + + List resultList = mesProdShiftRecordRDao.findByHqlWherePage(packBean, pager); + + return new ListPager<>(resultList, pager); + } + + @Override + public void insertMesProdShiftRecord(MesProdShiftRecord item, String organizeCode) { + + ConvertBean.serviceModelInitialize(item, AuthUtil.getSessionUser().getUserName()); + mesProdShiftRecordRDao.save(item); + } + @Override + public void saveMesProdShiftRecord(MesProdShiftRecord item, String organizeCode) { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(item.getWorkCenterCode(), "workCenterCode", packBean); +// DdlPreparedPack.getStringEqualPack(item.getShiftGroup(), "shiftGroup", packBean); +// DdlPreparedPack.getStringEqualPack(item.getShiftCode(), "shiftCode", packBean); + + MesProdShiftRecord mesProdShiftRecord = mesProdShiftRecordRDao.getByProperty(packBean); + if (StringUtil.isEmpty(mesProdShiftRecord)) { + throw ImppExceptionBuilder.newInstance() + .setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode()) + .setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode()) + .setErrorDetail("开关班记录产线【%s】班组代码【%s】班次代码【%s】不存在,请检查数据", + item.getWorkCenterCode(),item.getShiftGroup(),item.getShiftCode()) + .build(); + } + mesProdShiftRecord.setShiftGroup(item.getShiftGroup()); + mesProdShiftRecord.setShiftCode(item.getShiftCode()); + ConvertBean.serviceModelUpdate(item, AuthUtil.getSessionUser().getUserName()); + mesProdShiftRecordRDao.save(item); + } +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftGroupCenterCfgServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftGroupCenterCfgServiceImpl.java new file mode 100644 index 0000000..3d183a5 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftGroupCenterCfgServiceImpl.java @@ -0,0 +1,46 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesShiftGroupCenterCfgService; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.base.common.PagerHelper; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; +import cn.estsh.i3plus.pojo.mes.bean.MesShiftGroupCenterCfg; +import cn.estsh.i3plus.pojo.mes.repository.MesShiftGroupCenterCfgRepository; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @Description: 产线与班组的对应关系 + * @Author: gsz + * @Date: 2024/5/21 14:16 + * @Modify: + */ +@Service +@Slf4j +public class MesShiftGroupCenterCfgServiceImpl implements IMesShiftGroupCenterCfgService { + + @Autowired + private MesShiftGroupCenterCfgRepository mesShiftGroupCenterCfgRDao; + + @Override + public ListPager queryMesShiftGroupCenterCfgByPager(MesShiftGroupCenterCfg bean, Pager pager) { + + DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(bean.getWorkCenterCode(), "workCenterCode", packBean); + DdlPreparedPack.getStringEqualPack(bean.getShiftGroup(), "shiftGroup", packBean); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean); + pager = PagerHelper.getPager(pager, mesShiftGroupCenterCfgRDao.findByHqlWhereCount(packBean)); + + List resultList = mesShiftGroupCenterCfgRDao.findByHqlWherePage(packBean, pager); + + return new ListPager<>(resultList, pager); + } + +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftServiceImpl.java new file mode 100644 index 0000000..b8ea6e8 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftServiceImpl.java @@ -0,0 +1,46 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesShiftService; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.base.common.PagerHelper; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; +import cn.estsh.i3plus.pojo.mes.bean.MesShift; +import cn.estsh.i3plus.pojo.mes.repository.MesShiftRepository; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @Description: 产线与班次的对应关系 + * @Author: gsz + * @Date: 2024/5/21 14:16 + * @Modify: + */ +@Service +@Slf4j +public class MesShiftServiceImpl implements IMesShiftService { + + @Autowired + private MesShiftRepository mesShiftRepository; + + @Override + public ListPager queryMesShiftByPager(MesShift bean, Pager pager) { + + DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(bean.getWorkCenterCode(), "workCenterCode", packBean); + DdlPreparedPack.getStringEqualPack(bean.getShiftCode(), "shiftCode", packBean); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean); + pager = PagerHelper.getPager(pager, mesShiftRepository.findByHqlWhereCount(packBean)); + + List resultList = mesShiftRepository.findByHqlWherePage(packBean, pager); + + return new ListPager<>(resultList, pager); + } + +} From 76cf6ce84fd23e232bac4ac7c6de21b654e1232d Mon Sep 17 00:00:00 2001 From: gsz Date: Tue, 28 May 2024 19:36:39 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=8F=91=E9=80=81=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=8C=87=E4=BB=A4=E5=B7=A5=E6=AD=A5=E3=80=81=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=85=81=E8=AE=B8=E5=8A=A0=E5=B7=A5=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E5=B7=A5=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MesSendInitializationCmdStepSeryice.java | 106 ++++++++++++++++++ .../equiplog/MesSendProcessCmdStepService.java | 118 +++++++++++++++++++++ 2 files changed, 224 insertions(+) create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesSendInitializationCmdStepSeryice.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesSendProcessCmdStepService.java diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesSendInitializationCmdStepSeryice.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesSendInitializationCmdStepSeryice.java new file mode 100644 index 0000000..84bc3ef --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesSendInitializationCmdStepSeryice.java @@ -0,0 +1,106 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.equiplog; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesMouldMultiCavityService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEquipVariableCfgRuleMatchDispatchService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEquipmentLogExtService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCfgCollectContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext; +import cn.estsh.i3plus.mes.pcn.api.iservice.base.IPartService; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; +import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; +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.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.List; +import java.util.Map; +import java.util.Optional; + +/** + * @Description : 发送初始化指令工步 + * @Author : wangjie + **/ +@Slf4j +@Service("MesSendInitializationCmdStepSeryice") +public class MesSendInitializationCmdStepSeryice extends BaseStepService { + + @Autowired + private IMesProductionProcessContextStepService productionProcessContextStepService; + + @Autowired + private IMesEquipmentLogExtService equipmentLogExtService; + + @Autowired + private IMesEquipVariableCfgRuleMatchDispatchService equipVariableCfgRuleMatchService; + + @Autowired + private IMesMouldMultiCavityService mouldMultiCavityService; + + @Autowired + private IPartService partService; + + @Override + public StepResult init(StationRequestBean reqBean) { + + productionProcessContextStepService.doSendStepContextMessage(reqBean); + + return super.init(reqBean); + + } + + @Override + public StepResult execute(StationRequestBean reqBean) { + + StationResultBean resultBean = new StationResultBean(); + + StepResult stepResult = StepResult.getSuccessComplete(); + + Optional> stepParamMap = getStepParams(reqBean); + + MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean, stepParamMap); + + //当前工序已存在头道模具号跟一模多腔信息 + if (!StringUtils.isEmpty(productionProcessContext.getFirstMouldNo()) && !StringUtils.isEmpty(productionProcessContext.getMouldCavityJson())) return stepResult; + + //获取生产过程上下文对象有异常信息 抛出异常 + if (!productionProcessContextStepService.getEquipmentVariableCfgList(productionProcessContext).getSuccess()) execExpSendMsgAndThrowEx(reqBean, resultBean, productionProcessContext.getMessage()); + + List equipmentVariableCfgList = productionProcessContext.getEquipVariableCfgListByVct(); + + equipmentVariableCfgList = productionProcessContextStepService.collectEquipmentVariableCfgList(equipmentVariableCfgList, MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.INIT_INSTRUCTION_STEP.getValue()); + + MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip(); + + //配置错误 抛出异常 + if (CollectionUtils.isEmpty(equipmentVariableCfgList)) execExpSendMsgAndThrowEx(reqBean, resultBean, + String.format("请检查设备数据变量接口逻辑信息,设备[%s]未配置变量配置类型[%s]头道模具号相关变量类别的数据变量接口逻辑信息!", cellEquipContext.getEquipmentCode(), cellEquipContext.getVariableCfgType())); + + List categoryLevelTwoList = productionProcessContextStepService.collectCategoryLevelTwoList(equipmentVariableCfgList); + + List equipmentVariableList = productionProcessContextStepService.findEquipmentVariableList(productionProcessContext, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue(), categoryLevelTwoList); + + //配置错误 抛出异常 + if (CollectionUtils.isEmpty(equipmentVariableList)) execExpSendMsgAndThrowEx(reqBean, resultBean, + String.format("请检查设备数据变量信息,根据设备[%s]对应的数据变量接口逻辑信息,未配置变量类型[%s]二级变量%s相关的数据变量信息!", cellEquipContext.getEquipmentCode(), MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getDescription(), categoryLevelTwoList.toString())); + + List collectContextList = equipmentLogExtService.doHandleEquipmentLogList(cellEquipContext, equipmentVariableList, equipmentVariableCfgList); + this.sendMessage(reqBean, resultBean, JSONObject.toJSONString(collectContextList), MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT); + + //todo + + return stepResult; + + } + + +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesSendProcessCmdStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesSendProcessCmdStepService.java new file mode 100644 index 0000000..bc927a2 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesSendProcessCmdStepService.java @@ -0,0 +1,118 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.equiplog; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesMouldMultiCavityService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEquipVariableCfgRuleMatchDispatchService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEquipmentLogExtService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCfgCollectContext; +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.api.iservice.base.IPartService; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; +import cn.estsh.i3plus.mes.pcn.util.StationKvBeanUtil; +import cn.estsh.i3plus.platform.common.util.MesPcnConstWords; +import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; +import cn.estsh.i3plus.pojo.mes.bean.*; +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 com.alibaba.fastjson.JSONObject; +import javassist.tools.web.Webserver; +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 javax.jws.WebService; +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("MesSendProcessCmdStepService") +public class MesSendProcessCmdStepService extends BaseStepService { + + @Autowired + private IMesProductionProcessContextStepService productionProcessContextStepService; + + @Autowired + private IMesEquipmentLogExtService equipmentLogExtService; + + @Autowired + private IMesEquipVariableCfgRuleMatchDispatchService equipVariableCfgRuleMatchService; + + @Autowired + private IMesMouldMultiCavityService mouldMultiCavityService; + + @Autowired + private IPartService partService; + + @Override + public StepResult init(StationRequestBean reqBean) { + + productionProcessContextStepService.doSendStepContextMessage(reqBean); + + return super.init(reqBean); + + } + + @Override + public StepResult execute(StationRequestBean reqBean) { + + StationResultBean resultBean = new StationResultBean(); + + StepResult stepResult = StepResult.getSuccessComplete(); + + Optional> stepParamMap = getStepParams(reqBean); + + MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean, stepParamMap); + + //当前工序已存在头道模具号跟一模多腔信息 + if (!StringUtils.isEmpty(productionProcessContext.getFirstMouldNo()) && !StringUtils.isEmpty(productionProcessContext.getMouldCavityJson())) return stepResult; + + //获取生产过程上下文对象有异常信息 抛出异常 + if (!productionProcessContextStepService.getEquipmentVariableCfgList(productionProcessContext).getSuccess()) execExpSendMsgAndThrowEx(reqBean, resultBean, productionProcessContext.getMessage()); + + List equipmentVariableCfgList = productionProcessContext.getEquipVariableCfgListByVct(); + + equipmentVariableCfgList = productionProcessContextStepService.collectEquipmentVariableCfgList(equipmentVariableCfgList, MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PROCESS_INSTRUCTION_STEP.getValue()); + + MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip(); + + //配置错误 抛出异常 + if (CollectionUtils.isEmpty(equipmentVariableCfgList)) execExpSendMsgAndThrowEx(reqBean, resultBean, + String.format("请检查设备数据变量接口逻辑信息,设备[%s]未配置变量配置类型[%s]允许加工指令工步 相关变量类别的数据变量接口逻辑信息!", cellEquipContext.getEquipmentCode(), cellEquipContext.getVariableCfgType())); + + List categoryLevelTwoList = productionProcessContextStepService.collectCategoryLevelTwoList(equipmentVariableCfgList); + + List equipmentVariableList = productionProcessContextStepService.findEquipmentVariableList(productionProcessContext, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue(), categoryLevelTwoList); + + //配置错误 抛出异常 + if (CollectionUtils.isEmpty(equipmentVariableList)) execExpSendMsgAndThrowEx(reqBean, resultBean, + String.format("请检查设备数据变量信息,根据设备[%s]对应的数据变量接口逻辑信息,未配置变量类型[%s]二级变量%s相关的数据变量信息!", cellEquipContext.getEquipmentCode(), MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getDescription(), categoryLevelTwoList.toString())); + + List collectContextList = equipmentLogExtService.doHandleEquipmentLogList(cellEquipContext, equipmentVariableList, equipmentVariableCfgList); + this.sendMessage(reqBean, resultBean, JSONObject.toJSONString(collectContextList), MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT); + + //发送 todo + + + if (!stepResult.isCompleted()) threadSleep(stepParamMap, MesPcnExtConstWords.READ_FAILURE_SLEEP, MesPcnExtConstWords.READ_FAILURE_SLEEP_DEFAULT_TIME); + + return stepResult; + + } + + +}