diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java index 4daf702..2ff1307 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java @@ -206,7 +206,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService @Override public void savePartInspection(MesPartInspectionInputModel model, String org) { - MesProduceSn produceSn = checkProduceSn(model.getSn(), org); + MesProduceSn produceSn = getProduceSn(model.getSn(), org); //零件检测详情为空,则代表本次校验为合格。 if (CollectionUtils.isEmpty(model.getPartInspectionDetailList())) { @@ -215,7 +215,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService if (model.isTransferFlg() && model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { //移库 - MesMove move = createMove(model,getDestLocateNo(model, org),configService.getCfgValue(org, "LGORT"), org, produceSn.getWorkCenterCode()); + MesMove move = createMove(model,getDestLocateNo(model, org),configService.getCfgValue(org, "LGORT"), org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode()); moveRepository.save(move); } @@ -228,7 +228,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService partInspectionRepository.save(partInspection); if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { - + checkProduceSn(produceSn, model.getSn()); produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()); ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName()); produceSnExtService.update(produceSn); @@ -275,6 +275,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService partInspectionDetailRepository.saveAll(model.getPartInspectionDetailList()); if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { + checkProduceSn(produceSn, model.getSn()); produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()); ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName()); produceSnExtService.update(produceSn); @@ -289,7 +290,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService } //移库 - MesMove move = createMove(model,srcLocate,configService.getCfgValue(org, "LGORT"), org, produceSn.getWorkCenterCode()); + MesMove move = createMove(model,srcLocate,configService.getCfgValue(org, "LGORT"), org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode()); moveRepository.save(move); } } @@ -334,6 +335,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService String srcLocateNo = null; //若是扫描条码 则判定条码可疑 if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { + checkProduceSn(produceSn, model.getSn()); produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue()); ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName()); produceSnExtService.update(produceSn); @@ -344,7 +346,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService srcLocateNo = configService.getCfgValue(org, "LGORT"); } //移库 - MesMove move = createMove(model,srcLocateNo, configService.getCfgValue(org, "UMLGO"), org, produceSn.getWorkCenterCode()); + MesMove move = createMove(model,srcLocateNo, configService.getCfgValue(org, "UMLGO"), org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode()); moveRepository.save(move); } else { @@ -383,6 +385,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService //若是扫描条码 则判定条码可疑 if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { + checkProduceSn(produceSn, model.getSn()); produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue()); ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName()); produceSnExtService.update(produceSn); @@ -392,7 +395,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService partInspectionDetailRepository.saveAll(model.getPartInspectionDetailList()); //移库 - MesMove move = createMove(model, configService.getCfgValue(org, "LGORT"), configService.getCfgValue(org, "UMLGO"), org, produceSn.getWorkCenterCode()); + MesMove move = createMove(model, configService.getCfgValue(org, "LGORT"), configService.getCfgValue(org, "UMLGO"), org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode()); moveRepository.save(move); @@ -543,7 +546,6 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService * @param org * @return */ - private MesProduceSn checkProduceSn(String serialNumber, String org) { //根据扫描的条码查询条码是否存在 DdlPackBean packBean = DdlPackBean.getDdlPackBean(org); @@ -563,11 +565,32 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getDescription())); } -// //是否需要判断条码质量状态 -// if (produceSn.getQcStatus() != MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()) { -// throw new ImppBusiException(String.format("【%s】此条码质量状态为【%s】,请选择【%s】状态的条码", serialNumber, MesExtEnumUtil.PRODUCE_QC_STATUS.valueOfDescription(produceSn.getQcStatus()), -// MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getDescription())); -// } + return produceSn; + } + + private MesProduceSn getProduceSn(String serialNumber, String org) { + if (StringUtils.isEmpty(serialNumber)) return null; + //根据扫描的条码查询条码是否存在 + DdlPackBean packBean = DdlPackBean.getDdlPackBean(org); + DdlPreparedPack.getStringEqualPack(serialNumber, "productSn", packBean); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean); + return produceSnRepository.getByProperty(packBean); + } + + private MesProduceSn checkProduceSn(MesProduceSn produceSn, String serialNumber) { + + //若不存在则提示条码不存在 + if (StringUtils.isEmpty(produceSn)) { + throw new ImppBusiException(String.format("【%s】此条码不存在,请检查数据", serialNumber)); + } + + //根据条码状态判断 是不是已下线条码 + //若不是已下线的条码则提示 条码状态 请选择已下线的条码 + if (produceSn.getSnStatus() != MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()) { + throw new ImppBusiException(String.format("【%s】此条码状态为【%s】,请选择状态为【%s】状态的条码", serialNumber, MesExtEnumUtil.PRODUCE_SN_STATUS.valueOfDescription(produceSn.getSnStatus()), + MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getDescription())); + } + return produceSn; } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java index 09a36c7..08aa6d5 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java @@ -327,7 +327,9 @@ public class MesNcProcessingService implements IMesNcProcessingService { */ private void saveDate(MesNcProcessingInputModel model, MesPartSap part, Integer type, MesDefectType person, String org,String areaCode, boolean isOrder) { - MesProduceSn sn = checkProduceSn(model.getSn(), org); + String workCenterCode = null == model.getPartInspection() ? null : model.getPartInspection().getWorkCenterCode(); + + MesProduceSn sn = getProduceSn(model.getSn(), org); String source = configService.getCfgValue(org, "LGORT"); if (!StringUtils.isEmpty(model.getProductVersion())) { @@ -344,6 +346,7 @@ public class MesNcProcessingService implements IMesNcProcessingService { if (type == MesExtEnumUtil.NC_TYPE.NORMAL.getValue()) { + checkProduceSn(sn, model.getSn()); //更新条码质量状态 sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS_TO_QUALIFIED.getValue()); ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser()); @@ -360,7 +363,7 @@ public class MesNcProcessingService implements IMesNcProcessingService { //移库 转正常、放行:8000移至2000 // MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org); - MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE); + MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE); moveRepository.save(move); } else if (type == MesExtEnumUtil.NC_TYPE.REWORK.getValue()) { @@ -410,11 +413,12 @@ public class MesNcProcessingService implements IMesNcProcessingService { model.getPartInspection().setReworkTaskId(reworkTask.getId()); partInspectionRepository.save(model.getPartInspection()); - MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE); + MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE); moveRepository.save(move); } else if (type == MesExtEnumUtil.NC_TYPE.SCRAP.getValue()) { + checkProduceSn(sn, model.getSn()); //更新条码质量状态 sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue()); ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser()); @@ -432,17 +436,17 @@ public class MesNcProcessingService implements IMesNcProcessingService { ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser()); partInspectionRepository.save(model.getPartInspection()); if (isOrder) { - MesMove move = createMove(model, source, configService.getCfgValue(org, "SCRAP"), org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE); + MesMove move = createMove(model, source, configService.getCfgValue(org, "SCRAP"), org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE); moveRepository.save(move); } else { //移库 转报废 根据责任方库区对应关系的主数据,选择哪个责任方,就移动到哪个库区(8000移至8002/8003) - MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE); + MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE); // MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "SCRAP"), org); moveRepository.save(move); } } else if (type == MesExtEnumUtil.NC_TYPE.RELEASE.getValue()) { - + checkProduceSn(sn, model.getSn()); //更新条码质量状态 sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()); ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser()); @@ -460,7 +464,7 @@ public class MesNcProcessingService implements IMesNcProcessingService { //移库 转正常、放行:8000移至2000 // MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org); - MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE); + MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE); moveRepository.save(move); } @@ -482,6 +486,25 @@ public class MesNcProcessingService implements IMesNcProcessingService { return produceSn; } + private MesProduceSn getProduceSn(String serialNumber, String org) { + if (StringUtils.isEmpty(serialNumber)) return null; + //根据扫描的条码查询条码是否存在 + DdlPackBean packBean = DdlPackBean.getDdlPackBean(org); + DdlPreparedPack.getStringEqualPack(serialNumber, "productSn", packBean); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean); + return produceSnRepository.getByProperty(packBean); + } + + private MesProduceSn checkProduceSn(MesProduceSn produceSn, String serialNumber) { + + //若不存在则提示条码不存在 + if (StringUtils.isEmpty(produceSn)) { + throw new ImppBusiException(String.format("【%s】此条码不存在,请检查数据", serialNumber)); + } + + return produceSn; + } + private MesMove createMove(MesNcProcessingInputModel model, String source, String target, String org, String workCenterCode, MesExtEnumUtil.MOVE_TYPE moveType) { GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM"); serialNoModel.setPartNo(model.getPart().getPartNo()); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyGeneratePartNoStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyGeneratePartNoStepService.java index 15817e1..84c6196 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyGeneratePartNoStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyGeneratePartNoStepService.java @@ -90,7 +90,7 @@ public class MesAssemblyGeneratePartNoStepService extends BaseStepService { MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip(); //未知腔数配置【工位参数】, 不验证装配件条码的个数 - String cavityUnknownCfg = fsmCommonService.doHandleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_UNKNOWN_CFG); + String cavityUnknownCfg = getCavityUnknownCfg(reqBean); //非未知腔数,验证装配件条码个数是否匹配 腔数*每腔个数 if (StringUtils.isEmpty(cavityUnknownCfg) && equipVariableCollectContextList.size() != cellEquipContext.getCavity() * cellEquipContext.getBindQty()) @@ -124,6 +124,12 @@ public class MesAssemblyGeneratePartNoStepService extends BaseStepService { } + //未知腔数配置【工位参数】 + private String getCavityUnknownCfg(StationRequestBean reqBean) { + String cavityUnknownCfg = fsmCommonService.doHandleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_UNKNOWN_CFG); + return (!StringUtils.isEmpty(cavityUnknownCfg) && cavityUnknownCfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? cavityUnknownCfg : null; + } + //获取设备下所有的装配件规则清单, 根据非排序加工规则ID分组 private Map> doHandleAssemblyNosortCfg(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesCellEquipContext cellEquipContext) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyMatchNosortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyMatchNosortStepService.java index 690ea15..79712eb 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyMatchNosortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyMatchNosortStepService.java @@ -153,7 +153,7 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService { private List resetAssembly(StationRequestBean reqBean, List prodRuleContextList) { //是否支持混腔扫描[工位参数] - String cavityNosortCfg = fsmCommonService.doHandleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_NOSORT_CFG); + String cavityNosortCfg = getCavityNosortCfg(reqBean); prodRuleContextList.forEach(o -> { @@ -176,6 +176,12 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService { return prodRuleContextList; } + //是否支持混腔扫描[工位参数] + private String getCavityNosortCfg(StationRequestBean reqBean) { + String cavityNosortCfg = fsmCommonService.doHandleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_NOSORT_CFG); + return (!StringUtils.isEmpty(cavityNosortCfg) && cavityNosortCfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? cavityNosortCfg : null; + } + //验证当前是否属于装配件跳过码 private Boolean checkIsSkip(MesProductionProcessContext productionProcessContext, List equipVariableCollectContextList) { if (equipVariableCollectContextList.size() > 1) return false; diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesCountDownShowStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesCountDownShowStepService.java index b39e449..2b87326 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesCountDownShowStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesCountDownShowStepService.java @@ -72,7 +72,7 @@ public class MesCountDownShowStepService extends BaseStepService { Boolean isOpenTimeLock = (!StringUtils.isEmpty(workCell.getIsOpenTimeLock()) && CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue() == workCell.getIsOpenTimeLock()) ? true : false; //解析工位参数 - String countDownTime = doCalcCountDownCfg(reqBean, isOpenTimeLock); + String countDownTime = doCalcCountDownCfg(reqBean, isOpenTimeLock, productionProcessContext.getWorkCell()); return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, String.format("[%sS]倒计时启动!", countDownTime)); @@ -102,15 +102,9 @@ public class MesCountDownShowStepService extends BaseStepService { return resultMap; } - private String doCalcCountDownCfg(StationRequestBean reqBean, Boolean isOpenTimeLock) { + private String doCalcCountDownCfg(StationRequestBean reqBean, Boolean isOpenTimeLock, MesWorkCell workCell) { - //获取工位参数 - Map wcpcMap = fsmCommonService.doHandleFsmWcpcMapDataForDoScan(reqBean); - - //配置值: 60,5 60代表总倒计时,显示绿色; 5代表接近超时,显示黄色; 超时后显示红色 - String countDownCfg = wcpcMap.containsKey(MesPcnExtConstWords.COUNT_DOWN_CFG) ? wcpcMap.get(MesPcnExtConstWords.COUNT_DOWN_CFG) : null; - String[] countDownCfgArr = !StringUtils.isEmpty(countDownCfg) ? countDownCfg.split(MesPcnExtConstWords.COMMA) : null; - countDownCfgArr = (null != countDownCfgArr && countDownCfgArr.length == 2) ? countDownCfgArr : MesPcnExtConstWords.COUNT_DOWN_CFG_DEFAULT.split(MesPcnExtConstWords.COMMA); + String[] countDownCfgArr = getCountDownCfgArr(reqBean, workCell); List resultList = StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(), new StationKvBean(MesExtEnumUtil.COLOR.GREEN.getValue(), "倒计时时长", countDownCfgArr[0]), new StationKvBean(MesExtEnumUtil.COLOR.YELLOW.getValue(), "即将超时", countDownCfgArr[1]), new StationKvBean(MesExtEnumUtil.COLOR.RED.getValue(), "已经超时", MesPcnExtConstWords.ZERO_STR)); @@ -127,4 +121,30 @@ public class MesCountDownShowStepService extends BaseStepService { } + //配置值: 60,5 60代表总倒计时,显示绿色; 5代表接近超时,显示黄色; 到0则为超时显示红色, 到0后客户端自动递增数值到99结束 + private String[] getCountDownCfgArr(StationRequestBean reqBean, MesWorkCell workCell) { + + String[] countDownCfgArr = null; + + if (!StringUtils.isEmpty(workCell.getWhileTimes())) countDownCfgArr = getCountDownCfgArr(workCell.getWhileTimes()); + + if (null != countDownCfgArr) return countDownCfgArr; + + //获取工位参数 + Map wcpcMap = fsmCommonService.doHandleFsmWcpcMapDataForDoScan(reqBean); + + String countDownCfg = wcpcMap.containsKey(MesPcnExtConstWords.COUNT_DOWN_CFG) ? wcpcMap.get(MesPcnExtConstWords.COUNT_DOWN_CFG) : null; + + if (!StringUtils.isEmpty(countDownCfg)) countDownCfgArr = getCountDownCfgArr(countDownCfg); + + if (null != countDownCfgArr) return countDownCfgArr; + + return MesPcnExtConstWords.COUNT_DOWN_CFG_DEFAULT.split(MesPcnExtConstWords.COMMA); + } + + private String[] getCountDownCfgArr(String countDownCfg) { + String[] countDownCfgArr = !StringUtils.isEmpty(countDownCfg) ? countDownCfg.split(MesPcnExtConstWords.COMMA) : null; + return (null != countDownCfgArr && countDownCfgArr.length == 2) ? countDownCfgArr : null; + } + } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanNosortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanNosortStepService.java index 16bd500..eb9c628 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanNosortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanNosortStepService.java @@ -122,7 +122,7 @@ public class MesProductSnScanNosortStepService extends BaseStepService { if (StringUtils.isEmpty(scanInfo) && (scanedQty.compareTo(needQty) < 0 || isAllowJump)) execSendGuideAndThrowEx(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), "请扫描主条码!"); //是否支持混腔扫描[工位参数] - String cavityNosortCfg = fsmCommonService.doHandleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_NOSORT_CFG); + String cavityNosortCfg = getCavityNosortCfg(reqBean); //封装待验证的主条码信息 if (!scanInfo.equals(productionProcessContext.getFinishCode())) equipVariableCollectContextList = doHandleScanProductSnContext(reqBean, scanInfo, equipVariableCollectContextList, cavityNosortCfg); @@ -162,6 +162,12 @@ public class MesProductSnScanNosortStepService extends BaseStepService { } + //是否支持混腔扫描[工位参数] + private String getCavityNosortCfg(StationRequestBean reqBean) { + String cavityNosortCfg = fsmCommonService.doHandleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_NOSORT_CFG); + return (!StringUtils.isEmpty(cavityNosortCfg) && cavityNosortCfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? cavityNosortCfg : null; + } + private Integer calcScanedQty(List equipVariableCollectContextList, List productionPsInContextList) { return (CollectionUtils.isEmpty(equipVariableCollectContextList) ? MesPcnExtConstWords.ZERO : equipVariableCollectContextList.size()) + (CollectionUtils.isEmpty(productionPsInContextList) ? MesPcnExtConstWords.ZERO : productionPsInContextList.size()); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/test/TestServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/test/TestServiceImpl.java index e07d598..e8b921c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/test/TestServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/test/TestServiceImpl.java @@ -74,7 +74,7 @@ public class TestServiceImpl implements TestService{ equipmentLogDetail.setEquipVariableId(123123l); equipmentLogDetail.setEquipVariableName("aaa"); equipmentLogDetail.setReadWriteFlag(1); - equipmentLogDetail.setDataType("40"); + equipmentLogDetail.setDataType(40); equipmentLogDetail.setEquipId(7); equipmentLogDetail.setEquipmentCode("Foaming5#"); list.add(equipmentLogDetail); diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesEquipVariableCollectContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesEquipVariableCollectContext.java index 79ab324..5dc5d3f 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesEquipVariableCollectContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesEquipVariableCollectContext.java @@ -54,7 +54,7 @@ public class MesEquipVariableCollectContext implements Serializable { private String categoryLevelTwo; @ApiParam("数据类型") - private Integer variableDataType; + private Integer dataType; @ApiParam("DB块") private String code; @@ -74,9 +74,6 @@ public class MesEquipVariableCollectContext implements Serializable { @ApiParam("读写标记") private Integer readWriteFlag; - @ApiParam("数据类型") - private String dataType; - @ApiParam("变量当前值[读到的equipVariableValue值如果存在特殊字符, 原始值赋给此字段后再过滤特殊字符]") private String realEquipVariableValue;