diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/TestController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/TestController.java index da061cc..0dd0740 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/TestController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/TestController.java @@ -1,6 +1,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEquipmentLogExtService; +import cn.estsh.i3plus.ext.mes.pcn.apiservice.schedulejob.MesReportNoSortJob; 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; @@ -23,8 +24,8 @@ import java.util.List; public class TestController { @Autowired private IMesEquipmentLogExtService mesEquipmentLogExtService; - - + @Autowired + private MesReportNoSortJob mesReportNoSortJob; @GetMapping("/equipment/log/query") @ApiOperation(value = "查询设备交互") public ResultBean queryReworkTaskByPager(String organizeCode, Integer equipId) { @@ -37,4 +38,11 @@ public class TestController { return ImppExceptionBuilder.newInstance().buildExceptionResult(e); } } + + @GetMapping("/reportOrder") + @ApiOperation(value = "报工") + public void reportOrder() { + mesReportNoSortJob.executeMesJob(null, null); + + } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesReportNoSortJob.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesReportNoSortJob.java index 8ced524..f048c98 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesReportNoSortJob.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesReportNoSortJob.java @@ -2,7 +2,16 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.schedulejob; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesWorkOrderService; +import cn.estsh.i3plus.platform.common.tool.TimeTool; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn; +import cn.estsh.i3plus.pojo.mes.bean.MesProductionRecord; +import cn.estsh.i3plus.pojo.mes.repository.MesProductionRecordRepository; +import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; +import cn.estsh.impp.framework.base.schedule.BaseImppScheduleJob; +import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.init.ApplicationProperties; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; @@ -13,6 +22,7 @@ import org.quartz.JobExecutionContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.Arrays; import java.util.List; /** @@ -29,13 +39,19 @@ public class MesReportNoSortJob extends BaseMesScheduleJob { @Autowired private IMesWorkOrderService workOrderService; + @Autowired + private MesProductionRecordRepository productionRecordRao; + public MesReportNoSortJob() { super(MesReportNoSortJob.class, "非排序报工JOB"); } @Override public void executeMesJob(JobExecutionContext context, ApplicationProperties applicationProperties) { - String jobParam = this.getJobParam(); - JSONObject jsonObject= JSONUtil.parseObj(jobParam); + JSONObject jsonObject= new JSONObject(); + + jsonObject.putIfAbsent("organizeCode", "CK01"); + jsonObject.putIfAbsent("userName", "job"); + String organizeCode = jsonObject.getStr("organizeCode"); String userName = jsonObject.getStr("userName"); if (null == organizeCode){ @@ -46,6 +62,31 @@ public class MesReportNoSortJob extends BaseMesScheduleJob { userName = "JOB"; } List unReportMesProduceSn = workOrderService.getUnReportMesProduceSn(organizeCode); - workOrderService.doProductReport(unReportMesProduceSn,organizeCode,userName); + for (MesProduceSn mesProduceSn : unReportMesProduceSn) { + try { + workOrderService.doProductReport(Arrays.asList(mesProduceSn), organizeCode, userName); + //1.获取生产加工记录production_record表中,report_status为待汇报状态的工单 + updateProductionRecord(organizeCode, userName, mesProduceSn); + } catch (ImppBusiException e) { + LOGGER.error("条码:{}报工失败", mesProduceSn.getProductSn(), e.getErrorDetail()); + updateProductionRecord(organizeCode, userName, mesProduceSn, e.getErrorDetail()); + continue; + } + } + } + + private void updateProductionRecord(String organizeCode, String userName, MesProduceSn mesProduceSn) { + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode); + + DdlPreparedPack.getStringEqualPack(mesProduceSn.getProductSn(), "productSn", ddlPackBean); + productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus"}, + new Object[]{userName, TimeTool.getNowTime(true), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue() },ddlPackBean); + } + private void updateProductionRecord(String organizeCode, String userName, MesProduceSn mesProduceSn, String errorMsg) { + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode); + + DdlPreparedPack.getStringEqualPack(mesProduceSn.getProductSn(), "productSn", ddlPackBean); + productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus", "remark"}, + new Object[]{userName, TimeTool.getNowTime(true), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue(), errorMsg },ddlPackBean); } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java index 3b00a21..03036a8 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java @@ -7,6 +7,7 @@ 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.*; @@ -223,18 +224,20 @@ public class MesWorkOrderService implements IMesWorkOrderService { List mesProduceSnList = new ArrayList<>(); //1.获取生产加工记录production_record表中,report_status为待汇报状态的工单 DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode); - DdlPreparedPack.getNumEqualPack( MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue(),"reportStatus",ddlPackBean); + List statusList = Stream.of(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue()).collect(Collectors.toList()); + DdlPreparedPack.getInPackList( statusList,"reportStatus",ddlPackBean); + DdlPreparedPack.getIsNotNull("workOrderNo",ddlPackBean); - List mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, 1); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"createDatetime"}, ddlPackBean); + List mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, 5); if (mesProductionRecordList.isEmpty()){ return mesProduceSnList; } //2.根据工单查询工单下的mesProduceSn - MesProductionRecord mesProductionRecord = mesProductionRecordList.get(0); + List workOrderNoList = mesProductionRecordList.stream().map(MesProductionRecord::getWorkOrderNo).collect(Collectors.toList()); //工单号 - String workOrderNo = mesProductionRecord.getWorkOrderNo(); DdlPackBean snPackBean = DdlPackBean.getDdlPackBean(organizeCode); - DdlPreparedPack.getStringEqualPack(workOrderNo,"workOrderNo",snPackBean); + DdlPreparedPack.getInPackList(workOrderNoList,"workOrderNo",snPackBean); return mesProduceSnRao.findByHqlWhere(snPackBean); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesEquipmentLogExtService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesEquipmentLogExtService.java index ebedf79..f213ccc 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesEquipmentLogExtService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/equiplog/MesEquipmentLogExtService.java @@ -57,7 +57,7 @@ public class MesEquipmentLogExtService implements IMesEquipmentLogExtService { if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(equipId) || CollectionUtils.isEmpty(equipVariableIdList)) return; DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPreparedPack.getNumEqualPack(equipId, MesPcnExtConstWords.EQUIP_ID, packBean); - if (!CollectionUtils.isEmpty(equipVariableIdList) && equipVariableIdList.size() == 1) DdlPreparedPack.getNumEqualPack(equipVariableIdList.get(0), MesPcnExtConstWords.EQUIP_VARIABLE_ID, packBean); + if (!CollectionUtils.isEmpty(equipVariableIdList) && equipVariableIdList.size() == 1 ) DdlPreparedPack.getNumEqualPack(equipVariableIdList.get(0), MesPcnExtConstWords.EQUIP_VARIABLE_ID, packBean); else DdlPreparedPack.getInPackList(equipVariableIdList, MesPcnExtConstWords.EQUIP_VARIABLE_ID, packBean); equipmentLogRepository.updateByProperties(new String[]{MesPcnExtConstWords.EQUIP_VARIABLE_STATUS}, new Object[]{MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.TRUE.getValue()}, packBean); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesSaveProcessResultStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesSaveProcessResultStepService.java index e5c89af..ec76025 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesSaveProcessResultStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesSaveProcessResultStepService.java @@ -77,7 +77,7 @@ public class MesSaveProcessResultStepService extends BaseStepService { /** * 加工异常处理工步 */ - mesProductResultErrorHandleStepService.execute(reqBean); + // mesProductResultErrorHandleStepService.execute(reqBean); /** * 报工 */ diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesSendEquipParamsCmdStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesSendEquipParamsCmdStepService.java index b820ab7..d398f92 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesSendEquipParamsCmdStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesSendEquipParamsCmdStepService.java @@ -77,6 +77,7 @@ public class MesSendEquipParamsCmdStepService extends BaseStepService { List mesEquipmentProdParamCfgList = new ArrayList<>(); Map> mesEquipmentVariableMap = getMesEquipmentProdParamCfgs(reqBean, prodRuleContextList, mesEquipmentProdParamCfgList); + mesEquipmentVariableMap.forEach((k, v) -> { v.stream().forEach(mesEquipmentProdParamCfg -> { DdlPackBean packBean = DdlPackBean.getDdlPackBean(); @@ -152,4 +153,6 @@ public class MesSendEquipParamsCmdStepService extends BaseStepService { } return !StringUtils.isEmpty(maxRetryTimes) ? maxRetryTimes : 3; } + + } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWriteMainBarcodeCmdStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWriteMainBarcodeCmdStepService.java new file mode 100644 index 0000000..d3f9152 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWriteMainBarcodeCmdStepService.java @@ -0,0 +1,171 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step; + +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IWriteVariableService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext; +import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; +import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentProdParamCfg; +import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentVariable; +import cn.estsh.i3plus.pojo.mes.bean.MesProdRouteOptParam; +import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter; +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.MesEquipmentProdParamCfgRepository; +import cn.estsh.i3plus.pojo.mes.repository.MesEquipmentVariableRepository; +import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description : 发送客户端主条码 + * @Author : zxw + **/ +@Slf4j +@Service("mesWriteMainBarcodeCmdStepService") +public class MesWriteMainBarcodeCmdStepService extends BaseStepService { + + @Autowired + private IMesProductionProcessContextStepService productionProcessContextStepService; + + @Autowired + private IMesProductionDispatchContextStepService productionDispatchContextStepService; + + @Autowired + private IWriteVariableService writeVariableService; + + @Autowired + private MesEquipmentVariableRepository mesEquipmentVariableRepository; + + @Autowired + private MesEquipmentProdParamCfgRepository mesEquipmentProdParamCfgRepository; + + + @Override + public StepResult execute(StationRequestBean reqBean) { + + StationResultBean resultBean = new StationResultBean(); + + StepResult stepResult = StepResult.getSuccessComplete(); + + //获取工步参数 + Optional> stepParamMap = getStepParams(reqBean); + + //获取上下文信息 + MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean, stepParamMap); + + //当前工位使用的设备 + MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip(); + + //获取上下文加工规则数据信息集合 + List prodRuleContextList = productionDispatchContextStepService.getProdRuleDataContext(reqBean); + + if (CollectionUtils.isEmpty(prodRuleContextList)) { + return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "未找到加工规则,无需发送加工参数"); + } + List mesEquipmentVariableList = new ArrayList<>(); + List mesEquipmentProdParamCfgList = new ArrayList<>(); + Map> mesEquipmentVariableMap = getMesEquipmentProdParamCfgs(reqBean, prodRuleContextList, mesEquipmentProdParamCfgList); + // 过滤掉非条码的 + mesEquipmentVariableMap = filterMsg(mesEquipmentVariableMap); + + mesEquipmentVariableMap.forEach((k, v) -> { + v.stream().forEach(mesEquipmentProdParamCfg -> { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(); + DdlPreparedPack.getNumEqualPack(mesEquipmentProdParamCfg.getEquipVariableId(), "id", packBean); + MesEquipmentVariable mesEquipmentVariable = mesEquipmentVariableRepository.getByProperty(packBean); + if (mesEquipmentVariable == null) { + return; + } + mesEquipmentVariableList.add(mesEquipmentVariable); + mesEquipmentProdParamCfgList.add(mesEquipmentProdParamCfg); + execSendEquipParamsCmd(reqBean, mesEquipmentProdParamCfg.getMatchRule(), mesEquipmentVariable, cellEquipContext.getKepwareFlag(mesEquipmentVariable.getChannel()), k, stepParamMap); + }); + }); + + + return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "发送加工参数成功"); + } + + /** + * 根据排序和非排序 获取对应的加工参数 + * @param reqBean + * @param prodRuleContextList + * @param mesEquipmentProdParamCfgList + * @return + */ + private Map> getMesEquipmentProdParamCfgs(StationRequestBean reqBean, List prodRuleContextList, List mesEquipmentProdParamCfgList) { + + MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean); + + Map> map = new HashMap<>(); + for (MesProdRuleContext mesProdRuleContext : prodRuleContextList) { + List mesEquipmentProdParamCfgs= new ArrayList<>(); + //从上下文中取出生产线对象 + MesWorkCenter workCenter = productionProcessContext.getWorkCenter(); + // 获取加工参数 + if (MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue() == workCenter.getCenterType()){ + + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(); + DdlPreparedPack.getNumEqualPack(mesProdRuleContext.getPid(), "sourceId", ddlPackBean); + mesEquipmentProdParamCfgs = mesEquipmentProdParamCfgRepository.findByHqlWhere(ddlPackBean); + } else { + MesWorkCenter mesWorkCenter = new MesWorkCenter(); + mesWorkCenter.setWorkCenterCode(reqBean.getWorkCenterCode()); + List assemblyDataContext = mesProdRuleContext.getAssemblyDataContext(mesWorkCenter); + List sourceIds = assemblyDataContext.stream().map(MesProductionAssemblyContext::getSourceId).collect(Collectors.toList()); + + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(); + DdlPreparedPack.getInPackList(sourceIds, "sourceId", ddlPackBean); + mesEquipmentProdParamCfgs = mesEquipmentProdParamCfgRepository.findByHqlWhere(ddlPackBean); + } + if (!CollectionUtils.isEmpty(mesEquipmentProdParamCfgs)) { + mesEquipmentProdParamCfgs = mesEquipmentProdParamCfgs.stream().distinct().collect(Collectors.toList()); + } + map.put(mesProdRuleContext.getForeignKey(), mesEquipmentProdParamCfgs); + } + return map; + } + + private void execSendEquipParamsCmd(StationRequestBean reqBean, + String value, MesEquipmentVariable equipmentVariable, String kepwareFlag, Integer foreignKey, Optional> stepParamMap) { + //最大重试次数[工步参数] + Integer maxRetryTimes = getMaxRetryTimes(stepParamMap); + + writeVariableService.writeVariable(reqBean, value, equipmentVariable, kepwareFlag, foreignKey, null, maxRetryTimes); + } + + //最大重试次数[工步参数] + private Integer getMaxRetryTimes(Optional> stepParamMap) { + Integer maxRetryTimes = null; + try { + maxRetryTimes = (null != stepParamMap && stepParamMap.isPresent() && stepParamMap.get().containsKey(MesPcnExtConstWords.MAX_RETRY_TIMES)) ? Integer.valueOf(stepParamMap.get().get(MesPcnExtConstWords.MAX_RETRY_TIMES).getParamValue()) : null; + } catch (NumberFormatException e) { + } + return !StringUtils.isEmpty(maxRetryTimes) ? maxRetryTimes : 3; + } + + private Map> filterMsg(Map> map){ + + if (CollectionUtils.isEmpty(map)) { + return null; + } + map.forEach((k,v) -> { + v = v.stream().filter(cfg -> StringUtils.isEmpty(cfg.getMatchRule()) && cfg.getMatchRule() + .toUpperCase().startsWith("BARCODE")).collect(Collectors.toList()); }); + return map; + } +}