From e931661d018d5b4eba9ef279c5c5ae6df7c7e0e6 Mon Sep 17 00:00:00 2001 From: jun Date: Wed, 18 Sep 2024 13:51:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=85=E8=A3=85=E8=A7=A3=E7=BB=91=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IMesProductionDispatchContextStepService.java | 12 ++++ .../IMesRecyclablePackageBindingService.java | 3 + .../MesRecyclablePackageBindingServiceImpl.java | 19 ++++++ .../MesProcessMethodSourceBoxInOutServiceImpl.java | 15 ----- .../MesProcessMethodSourceBoxInOutStepService.java | 35 +++++++++-- .../MesRecyclablePackageUnBindingStepService.java | 71 ++++++++++++++++++++++ .../MesProductionDispatchContextStepService.java | 31 ++++++++++ .../MesProductionRecyclablePackageContext.java | 16 ++--- .../ext/mes/pcn/pojo/util/MesPcnExtConstWords.java | 8 +++ 9 files changed, 183 insertions(+), 27 deletions(-) delete mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/processmethod/MesProcessMethodSourceBoxInOutServiceImpl.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesRecyclablePackageUnBindingStepService.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 4132298..03e7eb1 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 @@ -207,4 +207,16 @@ public interface IMesProductionDispatchContextStepService { @ApiOperation(value = "删除上下文扫/读信息:可回用包装条码") void removeScanRecyclablePackageContext(StationRequestBean reqBean); + @ApiOperation(value = "获取进料可回用包装信息") + List getProductionRecyclablePackageContext(StationRequestBean reqBean); + + @ApiOperation(value = "验证进料可回用包装是否存在") + Boolean checkProductionRecyclablePackageContextIsExist(StationRequestBean reqBean); + + @ApiOperation(value = "保存进料可回用包装", notes = "[JSON]List") + Boolean dispatchProductionRecyclablePackageContext(StationRequestBean reqBean, List recyclablePackageContextList); + + @ApiOperation(value = "删除进料可回用包装") + Boolean removeProductionRecyclablePackageContext(StationRequestBean reqBean); + } diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/recyclablepackage/IMesRecyclablePackageBindingService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/recyclablepackage/IMesRecyclablePackageBindingService.java index 709b5d8..2f2d7c9 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/recyclablepackage/IMesRecyclablePackageBindingService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/recyclablepackage/IMesRecyclablePackageBindingService.java @@ -41,4 +41,7 @@ public interface IMesRecyclablePackageBindingService { @ApiOperation("扫描信息") MesRecyclablePackageBinding doScan(MesRecyclablePackageBindingModel mesRecyclablePackageBindingModel); + @ApiOperation("解绑") + void doMesRecyclablePackageUnBinding(MesRecyclablePackageBinding mesRecyclablePackageBinding, List bindingDetailList,String userName); + } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/recyclablepackage/MesRecyclablePackageBindingServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/recyclablepackage/MesRecyclablePackageBindingServiceImpl.java index 1727335..a7e64c3 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/recyclablepackage/MesRecyclablePackageBindingServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/recyclablepackage/MesRecyclablePackageBindingServiceImpl.java @@ -168,6 +168,25 @@ public class MesRecyclablePackageBindingServiceImpl implements IMesRecyclablePac } + @Override + public void doMesRecyclablePackageUnBinding(MesRecyclablePackageBinding mesRecyclablePackageBinding, List bindingDetailList,String userName) { + for (MesRecyclablePackageBindingDetail detail : bindingDetailList) { + detail.setIsDeleted(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); + detail.setRemark(MesPcnExtConstWords.STEP_UNBINDING); + detail.setSystemSyncStatus(CommonEnumUtil.FALSE); + detail.setSystemSyncDatetime(MesPcnExtConstWords.EMPTY); + ConvertBean.serviceModelUpdate(detail, userName); + } + mesRecyclablePackageBindingDetailRepository.saveAll(bindingDetailList); + //更新数量 + mesRecyclablePackageBinding.setTotalQty(MesPcnExtConstWords.ZERO); + mesRecyclablePackageBinding.setStatus(MesExtEnumUtil.RECYCLABLE_PACKAGE_PACKAGE_BINDING_STATUS.UNPACKED.getValue()); + ConvertBean.serviceModelUpdate(mesRecyclablePackageBinding, userName); + mesRecyclablePackageBindingRepository.update(mesRecyclablePackageBinding); + //记录日志 + mesRecyclablePackageBindingLogService.insertUnBinding(mesRecyclablePackageBinding, bindingDetailList); + } + private MesRecyclablePackageBinding doScanPackageSn(MesRecyclablePackageBindingModel mesRecyclablePackageBindingModel) { //校验包装 mesRecyclablePackageService.checkMesRecyclablePackage(mesRecyclablePackageBindingModel.getOrganizeCode(), mesRecyclablePackageBindingModel.getPackageSn()); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/processmethod/MesProcessMethodSourceBoxInOutServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/processmethod/MesProcessMethodSourceBoxInOutServiceImpl.java deleted file mode 100644 index 1e89236..0000000 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/processmethod/MesProcessMethodSourceBoxInOutServiceImpl.java +++ /dev/null @@ -1,15 +0,0 @@ -package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.processmethod; - -import groovy.util.logging.Slf4j; -import org.springframework.stereotype.Service; -/** - * @Description : 原箱进原箱出 - * @Reference : - * @Author : junsheng.li - * @CreateDate 2024/9/12 21:24 - * @Modify: - **/ -@Service -@Slf4j -public class MesProcessMethodSourceBoxInOutServiceImpl { -} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProcessMethodSourceBoxInOutStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProcessMethodSourceBoxInOutStepService.java index 54d036f..66c70cd 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProcessMethodSourceBoxInOutStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProcessMethodSourceBoxInOutStepService.java @@ -3,11 +3,14 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.recyclablepackage.IMesRecyclablePackageBindingLogService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.recyclablepackage.IMesRecyclablePackageBindingService; 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.context.MesProductionPsInContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionRecyclablePackageContext; 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.api.iservice.base.IConfigService; import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; import cn.estsh.i3plus.pojo.mes.bean.MesConfig; @@ -54,6 +57,9 @@ public class MesProcessMethodSourceBoxInOutStepService extends BaseStepService { @Autowired private IConfigService configService; + @Autowired + private IFsmCommonService fsmCommonService; + @Override public StepResult execute(StationRequestBean reqBean) { @@ -74,6 +80,12 @@ public class MesProcessMethodSourceBoxInOutStepService extends BaseStepService { //获取上下文生产扫/读信息:可回用包装条码 List equipVariableCollectContextList = productionDispatchContextStepService.getScanRecyclablePackageContext(reqBean); + + //没有待验证的可回用包装条码 并且存在已验证过的可回用包装条码,默认放行 + if (CollectionUtils.isEmpty(equipVariableCollectContextList) && productionDispatchContextStepService.checkProductionRecyclablePackageContextIsExist(reqBean)){ + return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "当前没有需要验证的可回用包装条码,且存在已验证可回用包装条码信息,当前工步默认放行!"); + } + if (CollectionUtils.isEmpty(equipVariableCollectContextList)){ return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "当前缺失可回用包装条码信息!"); } @@ -84,9 +96,12 @@ public class MesProcessMethodSourceBoxInOutStepService extends BaseStepService { //从上下文中取出工位对象 MesWorkCell workCell = productionProcessContext.getWorkCell(); + //上下文对象-零件条码 List productionPsInContextList = new ArrayList<>(); + //上下文对象-可回用包装 + List recyclablePackageContextList = new ArrayList<>(); - if (!sourceBoxInOut(reqBean, equipVariableCollectContextList, stepResult, productionPsInContextList, workCell).isCompleted()) { + if (!sourceBoxInOut(reqBean, equipVariableCollectContextList, stepResult, productionPsInContextList,recyclablePackageContextList, workCell).isCompleted()) { return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, stepResult.getMsg()); } @@ -99,15 +114,19 @@ public class MesProcessMethodSourceBoxInOutStepService extends BaseStepService { //保存进料主条码数据 productionDispatchContextStepService.dispatchProductionPsInContext(reqBean, productionPsInContextList); + //保存进料可回用包装 + productionDispatchContextStepService.dispatchProductionRecyclablePackageContext(reqBean, recyclablePackageContextList); + return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("可回用包装条码%s状态成功!", equipVariableCollectContextList.iterator().next().getEquipVariableValue())); } - public StepResult sourceBoxInOut(StationRequestBean reqBean, List equipVariableCollectContextList, StepResult stepResult, List productionPsInContextList, MesWorkCell workCell) { + public StepResult sourceBoxInOut(StationRequestBean reqBean, List equipVariableCollectContextList, StepResult stepResult, List productionPsInContextList,List recyclablePackageContextList, MesWorkCell workCell) { //获取包装绑定主表 MesRecyclablePackageBinding recyclablePackageBinding = mesRecyclablePackageBindingService.getMesRecyclablePackageBindingByPackageSn(reqBean.getOrganizeCode(), equipVariableCollectContextList.iterator().next().getEquipVariableValue()); - if (Objects.isNull(recyclablePackageBinding)) + if (Objects.isNull(recyclablePackageBinding)){ return stepResult.isCompleted(false).msg(String.format("回收包装绑定[%s]信息不存在", equipVariableCollectContextList.iterator().next().getEquipVariableValue())); + } //校验状态 if (MesExtEnumUtil.RECYCLABLE_PACKAGE_PACKAGE_BINDING_STATUS.CLOSED.getValue() != recyclablePackageBinding.getStatus()) { return stepResult.isCompleted(false).msg(String.format("回收包装绑定[%s]状态不为[已关箱]", equipVariableCollectContextList.iterator().next().getEquipVariableValue())); @@ -115,8 +134,9 @@ public class MesProcessMethodSourceBoxInOutStepService extends BaseStepService { //获取绑定明细信息 List bindingDetailList = mesRecyclablePackageBindingService.findMesRecyclablePackageBindingDetailByPid(reqBean.getOrganizeCode(), recyclablePackageBinding.getId()); - if (CollectionUtils.isEmpty(bindingDetailList)) + if (CollectionUtils.isEmpty(bindingDetailList)){ return stepResult.isCompleted(false).msg(String.format("回收包装绑定[%s]明细信息不存在", equipVariableCollectContextList.iterator().next().getEquipVariableValue())); + } //查询条码信息 Map> produceSnMap = produceSnExtService.getProduceSnMap(reqBean.getOrganizeCode(), bindingDetailList.stream().map(MesRecyclablePackageBindingDetail::getProductSn).collect(Collectors.toList())); for (MesRecyclablePackageBindingDetail bindingDetail : bindingDetailList) { @@ -125,11 +145,18 @@ public class MesProcessMethodSourceBoxInOutStepService extends BaseStepService { for (int i = 0; i < bindingDetail.getQty(); i++) { productionPsInContextList.add(new MesProductionPsInContext(reqBean.getOrganizeCode(), bindingDetail.getProductSn()).messageSource(equipVariableCollectContextList.iterator().next().getMessageSource())); } + recyclablePackageContextList.add(new MesProductionRecyclablePackageContext(recyclablePackageBinding,bindingDetail)); //自制件 } else { + recyclablePackageContextList.add(new MesProductionRecyclablePackageContext(recyclablePackageBinding,bindingDetail).setId(produceSnMap.get(bindingDetail.getProductSn()).iterator().next().getId())); createProductionPsInContext(reqBean, stepResult, workCell, equipVariableCollectContextList.iterator().next(), produceSnMap.get(bindingDetail.getProductSn()), productionPsInContextList); } } + //没有单独扣减工步时在本工步扣减 + Map wcpcMap = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean); + if (wcpcMap.containsKey(MesPcnExtConstWords.CONTEXT_UNBINDING_STEP) && !Boolean.parseBoolean(wcpcMap.get(MesPcnExtConstWords.CONTEXT_UNBINDING_STEP))) { + mesRecyclablePackageBindingService.doMesRecyclablePackageUnBinding(recyclablePackageBinding, bindingDetailList, reqBean.getUserInfo()); + } return stepResult; } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesRecyclablePackageUnBindingStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesRecyclablePackageUnBindingStepService.java new file mode 100644 index 0000000..6e3b085 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesRecyclablePackageUnBindingStepService.java @@ -0,0 +1,71 @@ +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.recyclablepackage.IMesRecyclablePackageBindingService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionRecyclablePackageContext; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; +import cn.estsh.i3plus.pojo.mes.bean.recyclablepackage.MesRecyclablePackageBinding; +import cn.estsh.i3plus.pojo.mes.bean.recyclablepackage.MesRecyclablePackageBindingDetail; +import cn.estsh.i3plus.pojo.mes.model.StationRequestBean; +import cn.estsh.i3plus.pojo.mes.model.StationResultBean; +import cn.estsh.i3plus.pojo.mes.model.StepResult; +import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.Objects; + +/** + * @Description : 包装零件解绑 + * @Reference : + * @Author : junsheng.li + * @CreateDate 2024/9/13 18:08 + * @Modify: + **/ +@Slf4j +@Service("mesRecyclablePackageUnBindingStepService") +public class MesRecyclablePackageUnBindingStepService extends BaseStepService { + + @Autowired + private IMesProductionDispatchContextStepService productionDispatchContextStepService; + + @Autowired + private IMesRecyclablePackageBindingService mesRecyclablePackageBindingService; + + @Override + public StepResult execute(StationRequestBean reqBean) { + + StationResultBean resultBean = new StationResultBean(); + + StepResult stepResult = StepResult.getSuccessComplete(); + //验证进料可回用包装是否存在 + if (!productionDispatchContextStepService.checkProductionRecyclablePackageContextIsExist(reqBean)){ + return stepResult; + } + //获取进料可回用包装信息 + List productionRecyclablePackageContext = productionDispatchContextStepService.getProductionRecyclablePackageContext(reqBean); + //获取包装绑定主表 + MesRecyclablePackageBinding recyclablePackageBinding = mesRecyclablePackageBindingService.getMesRecyclablePackageBindingByPackageSn(reqBean.getOrganizeCode(), productionRecyclablePackageContext.iterator().next().getPackageSn()); + if (Objects.isNull(recyclablePackageBinding)) { + return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("回收包装绑定[%s]信息不存在", productionRecyclablePackageContext.iterator().next().getPackageSn())); + } + //校验状态 + if (MesExtEnumUtil.RECYCLABLE_PACKAGE_PACKAGE_BINDING_STATUS.CLOSED.getValue() != recyclablePackageBinding.getStatus()) { + return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("回收包装绑定[%s]状态不为[已关箱]", productionRecyclablePackageContext.iterator().next().getPackageSn())); + } + //获取绑定明细信息 + List bindingDetailList = mesRecyclablePackageBindingService.findMesRecyclablePackageBindingDetailByPid(reqBean.getOrganizeCode(), recyclablePackageBinding.getId()); + if (CollectionUtils.isEmpty(bindingDetailList)) { + return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("回收包装绑定[%s]明细信息不存在", productionRecyclablePackageContext.iterator().next().getPackageSn())); + } + //解绑 + mesRecyclablePackageBindingService.doMesRecyclablePackageUnBinding(recyclablePackageBinding, bindingDetailList, reqBean.getUserInfo()); + + return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("可回用包装条码%s解绑成功!", productionRecyclablePackageContext.iterator().next().getPackageSn())); + } + + +} 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 1ac25e4..b922d1c 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 @@ -437,6 +437,7 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp return false; } + //获取上下文生产扫/读信息:可回用包装条码 @Override public List getScanRecyclablePackageContext(StationRequestBean reqBean) { String productSnJson = getFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.SCAN_RECYCLABLE_PACKAGE_CONTEXT); @@ -457,9 +458,39 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp return dispatchFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.SCAN_RECYCLABLE_PACKAGE_CONTEXT, JSONObject.toJSONString(productSnList)); } + //删除上下文扫/读信息:可回用包装条码 @Override public void removeScanRecyclablePackageContext(StationRequestBean reqBean) { removeFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.SCAN_RECYCLABLE_PACKAGE_CONTEXT); } + //获取进料可回用包装信息 + @Override + public List getProductionRecyclablePackageContext(StationRequestBean reqBean) { + String productionPsInJson = getFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_RECYCLABLE_PACKAGE_CONTEXT); + return !StringUtils.isEmpty(productionPsInJson) ? JSONObject.parseArray(productionPsInJson, MesProductionRecyclablePackageContext.class) : null; + } + + //验证进料可回用包装是否存在 + @Override + public Boolean checkProductionRecyclablePackageContextIsExist(StationRequestBean reqBean) { + String productionPsInJson = getFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_RECYCLABLE_PACKAGE_CONTEXT); + return !StringUtils.isEmpty(productionPsInJson); + } + + //保存进料可回用包装 + @Override + public Boolean dispatchProductionRecyclablePackageContext(StationRequestBean reqBean, List recyclablePackageContextList) { + if (CollectionUtils.isEmpty(recyclablePackageContextList)) return removeProductionRecyclablePackageContext(reqBean); + return dispatchFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_RECYCLABLE_PACKAGE_CONTEXT, JSONObject.toJSONString(recyclablePackageContextList)); + + } + + //删除进料可回用包装 + @Override + public Boolean removeProductionRecyclablePackageContext(StationRequestBean reqBean) { + removeFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_RECYCLABLE_PACKAGE_CONTEXT); + return true; + } + } diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionRecyclablePackageContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionRecyclablePackageContext.java index 7670d01..fcbeec3 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionRecyclablePackageContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionRecyclablePackageContext.java @@ -1,5 +1,6 @@ package cn.estsh.i3plus.ext.mes.pcn.pojo.context; +import cn.estsh.i3plus.pojo.mes.bean.recyclablepackage.MesRecyclablePackageBinding; import cn.estsh.i3plus.pojo.mes.bean.recyclablepackage.MesRecyclablePackageBindingDetail; import io.swagger.annotations.ApiParam; import lombok.Data; @@ -42,17 +43,16 @@ public class MesProductionRecyclablePackageContext implements Serializable { } - public MesProductionRecyclablePackageContext(String organizeCode, String packageSn, String packageTypeCode) { - this.organizeCode = organizeCode; - this.packageSn = packageSn; - this.packageTypeCode = packageTypeCode; - } - - - public MesProductionRecyclablePackageContext copy(MesRecyclablePackageBindingDetail mesRecyclablePackageBindingDetail) { + public MesProductionRecyclablePackageContext(MesRecyclablePackageBinding recyclablePackageBinding,MesRecyclablePackageBindingDetail mesRecyclablePackageBindingDetail) { + this.organizeCode = recyclablePackageBinding.getOrganizeCode(); + this.packageSn = recyclablePackageBinding.getPackageSn(); this.partName = mesRecyclablePackageBindingDetail.getPartName(); this.partNo = mesRecyclablePackageBindingDetail.getPartNo(); this.productSn = mesRecyclablePackageBindingDetail.getProductSn(); + } + + public MesProductionRecyclablePackageContext setId(long id){ + this.id = id; return this; } 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 f7aac35..7b520fb 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 @@ -255,6 +255,8 @@ public class MesPcnExtConstWords { public static final String ENDLESS_LOOP_READ_TIMES = "ENDLESS_LOOP_READ_TIMES"; // 死循环读取默认默认次数 public static final String ENDLESS_LOOP_READ_TIMES_DEFAULT = "10"; + // 流程包含解绑工步 + public static final String CONTEXT_UNBINDING_STEP = "CONTEXT_UNBINDING_STEP"; // 工位/工步 参数按钮事件 public static final String FUNCTION_CMD = "FUNCTION_CMD"; @@ -412,6 +414,9 @@ public class MesPcnExtConstWords { public static final String PRODUCTION_PS_OUT_CONTEXT = "PRODUCTION_PS_OUT_CONTEXT"; // 上下文: 料桶原材料数据 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"; + //OPC_API_PARAM @@ -454,4 +459,7 @@ public class MesPcnExtConstWords { // 裁片成品列表弹框打印 public static final String FUNCITON_CUT_ORDER_DIALOG_PRINT = "FUNCTION_CUT_ORDER_DIALOG_PRINT"; + + //工步解绑 + public static final String STEP_UNBINDING = "工步解绑"; }