mes-uat-changshu0609^2
王杰 1 week ago
parent 2a1c27f06d
commit 360d200a48

@ -144,12 +144,15 @@ public interface IMesProductionCustomContextStepService {
void dispatchContainerPackageDetailContext(String organizeCode, Map<String, MesContainerPackageDetailContext> remainQtyMap2Cache);
@ApiOperation(value = "验证主条码或容器条码是否被占用的key")
String getContainerPackageDetailPsKey(String organizeCode, String suffix, String psOrContainerSnAppendId);
String getContainerPackageDetailPsLockedKey(String organizeCode, String suffix, String psOrContainerSnAppendId);
@ApiOperation(value = "验证主条码或容器条码是否被占用")
Boolean checkContainerPackageDetailPsIsUsed(StationRequestBean reqBean, String suffix, String psOrContainerSnAppendId);
Boolean checkContainerPackageDetailPsLockedIsUsed(StationRequestBean reqBean, String suffix, String psOrContainerSnAppendId);
@ApiOperation(value = "锁定主条码或容器条码")
void dispatchContainerPackageDetailPs(StationRequestBean reqBean, String suffix, String psOrContainerSnAppendId);
void dispatchContainerPackageDetailPsLocked(StationRequestBean reqBean, String suffix, String psOrContainerSnAppendId);
@ApiOperation(value = "解锁主条码或容器条码")
void removeContainerPackageDetailPsLocked(StationRequestBean reqBean, String suffix, String psOrContainerSnAppendId);
}

@ -286,4 +286,10 @@ public interface IMesProductionDispatchContextStepService {
@ApiOperation(value = "保存站点用于缺料时进行上料绑定的容器条码")
void dispatchMatchStationFeedContainerSnContext(StationRequestBean reqBean, String sn);
@ApiOperation(value = "获取已被验证了的容器主条码信息")
List<MesContainerPackageDetailContext> getContainerPackageDetailPs(StationRequestBean reqBean);
@ApiOperation(value = "保存已被验证了的容器主条码信息")
void dispatchContainerPackageDetailPs(StationRequestBean reqBean, List<MesContainerPackageDetailContext> containerPackageDetailContextList);
}

@ -91,7 +91,7 @@ public interface IMesStationContainerSnExtService {
void insertContainerPackageDetailFeeding(StationRequestBean reqBean, MesContainerPackageDetailContext containerPackageDetailContext, MesProductionPsOutContext productionPsOutContext);
@ApiOperation(value = "修改上料明细表信息状态")
void updateContainerPackageDetail(String organizeCode, String userInfo, Long id, Integer snStatus);
void updateContainerPackageDetail(String organizeCode, String userInfo, Integer snStatus, Long... ids);
@ApiOperation(value = "写入容器条码与站点的关系信息")
void insertContainerSnStationList(String organizeCode, String userInfo, String station, List<MesContainerPackage> containerPackageList, String topContainerSn);

@ -248,12 +248,15 @@ public class MesStationContainerSnExtService implements IMesStationContainerSnEx
}
@Override
public void updateContainerPackageDetail(String organizeCode, String userInfo, Long id, Integer snStatus) {
public void updateContainerPackageDetail(String organizeCode, String userInfo, Integer snStatus, Long... ids) {
if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(userInfo) || StringUtils.isEmpty(snStatus) || null == ids) return;
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
if (ids.length == 1) DdlPreparedPack.getNumEqualPack(ids[0], MesPcnExtConstWords.ID, packBean);
else DdlPreparedPack.getInPackArray(ids, MesPcnExtConstWords.ID, packBean);
containerPackageDetailRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.ID},
new Object[]{organizeCode, id},
new String[]{MesPcnExtConstWords.SN_STATUS, MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.SYSTEM_SYNC_DATE_TIME},
new Object[]{snStatus, userInfo, TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesPcnExtConstWords.EMPTY});
new Object[]{snStatus, userInfo, TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesPcnExtConstWords.EMPTY},
packBean);
}
@Override

@ -210,7 +210,7 @@ public class MesAssemblySaveStepService extends BaseStepService {
stationContainerSnExtService.insertContainerPackageDetailFeeding(reqBean, containerPackageDetailContext, productionPsOutContext);
//修改上料明细表信息状态【扣减完成】
if (MathOperation.compareTo(containerPackageDetailContext.getRemainQty(), new Double(0)) == 0) {
stationContainerSnExtService.updateContainerPackageDetail(reqBean.getOrganizeCode(), reqBean.getUserInfo(), containerPackageDetailContext.getId(), MesExtEnumUtil.CONTAINER_BARCODE_STATUS.STATUS_20.getValue());
stationContainerSnExtService.updateContainerPackageDetail(reqBean.getOrganizeCode(), reqBean.getUserInfo(), MesExtEnumUtil.CONTAINER_BARCODE_STATUS.STATUS_20.getValue(), containerPackageDetailContext.getId());
}
}

@ -132,10 +132,15 @@ public class MesProductionDataSaveBeforeControlOrderStepService extends BaseStep
stepResult = ((IStepService) SpringContextsUtil.getBean("mesProductionDataSaveStepService")).execute(reqBean);
//保存加工结果事务提交之后, 保存工单计数
if (stepResult.isCompleted() && !StringUtils.isEmpty(stepResult.getStepAfterState())) {
IStepService stepService = ((IStepService) SpringContextsUtil.getBean(stepResult.getStepAfterState()));
stepResult.stepAfterState(null);
stepService.executeStepAfterExecute(reqBean, stepResult);
if (stepResult.isCompleted() && !CollectionUtils.isEmpty(stepResult.getStepAfterStateList())) {
List<String> stepAfterStateList = stepResult.getStepAfterStateList();
IStepService stepService;
for (String stepAfterState : stepAfterStateList) {
if (StringUtils.isEmpty(stepAfterState)) continue;
stepService = ((IStepService) SpringContextsUtil.getBean(stepAfterState));
stepService.executeStepAfterExecute(reqBean, stepResult);
}
stepResult.clearStepAfterStateList();
}
if (stepResult.isCompleted()) insertWorkOrderControlQtyRecord(reqBean, reportPsMap, shiftTimeMap.get(MesPcnExtConstWords.LOT_NO));
@ -144,9 +149,9 @@ public class MesProductionDataSaveBeforeControlOrderStepService extends BaseStep
}
//非排序线 保存加工结果工步 execute 方法 使用的是 新事务
//非排序线 保存加工结果工步 executeInState 方法 使用的是 当前事务
if (CollectionUtils.isEmpty(unProductionPartNoList))
return ((IStepService) SpringContextsUtil.getBean("mesProductionDataSaveStepService")).execute(reqBean);
return ((IStepService) SpringContextsUtil.getBean("mesProductionDataSaveStepService")).executeInState(reqBean);
stepNonCompleteAndSendMsg(reqBean, resultBean.writeDbLog(), stepResult, String.format("控制加工单数量验证零件号%s当前无法继续生产!", unProductionPartNoList.toString()));

@ -17,6 +17,7 @@ import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
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;
@ -78,10 +79,15 @@ public class MesProductionDataSaveBeforeLockOrderStepService extends BaseStepSer
stepResult = ((IStepService) SpringContextsUtil.getBean("mesProductionDataSaveStepService")).execute(reqBean);
//保存加工结果事务提交之后, 保存工单计数
if (stepResult.isCompleted() && !StringUtils.isEmpty(stepResult.getStepAfterState())) {
IStepService stepService = ((IStepService) SpringContextsUtil.getBean(stepResult.getStepAfterState()));
stepResult.stepAfterState(null);
stepService.executeStepAfterExecute(reqBean, stepResult);
if (stepResult.isCompleted() && !CollectionUtils.isEmpty(stepResult.getStepAfterStateList())) {
List<String> stepAfterStateList = stepResult.getStepAfterStateList();
IStepService stepService;
for (String stepAfterState : stepAfterStateList) {
if (StringUtils.isEmpty(stepAfterState)) continue;
stepService = ((IStepService) SpringContextsUtil.getBean(stepAfterState));
stepService.executeStepAfterExecute(reqBean, stepResult);
}
stepResult.clearStepAfterStateList();
}
}

@ -14,6 +14,7 @@ import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
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.LinkedList;
@ -58,7 +59,7 @@ public class MesProductionDataSaveStepService extends BaseStepService {
if (StringUtils.isEmpty(stepService)) continue;
StepResult innerStepResult = ((IStepService) SpringContextsUtil.getBean(stepService)).executeInState(reqBean);
if (!StringUtils.isEmpty(innerStepResult.getNextTriggerEvent())) stepResult.nextTriggerEvent(innerStepResult.getNextTriggerEvent());
if (!StringUtils.isEmpty(innerStepResult.getStepAfterState())) stepResult.stepAfterState(innerStepResult.getStepAfterState());
if (!CollectionUtils.isEmpty(innerStepResult.getStepAfterStateList())) stepResult.addStepAfterStateList(innerStepResult.getStepAfterStateList());
if (!innerStepResult.isCompleted()) return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "保存加工结果失败!");
}

@ -0,0 +1,95 @@
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.IMesStationContainerSnExtService;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step.method.stationpm.IMesStationMatchPsProcessMethodStrategyStepService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesContainerPackageDetailContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsInContext;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.mes.pcn.util.StringUtil;
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
import cn.estsh.i3plus.pojo.mes.model.StepResult;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
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.stream.Collectors;
/**
* @Description :
* @Author : wangjie
**/
@Slf4j
@Service("mesStationDeductionProductSnStepService")
public class MesStationDeductionProductSnStepService extends BaseStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IMesStationContainerSnExtService stationContainerSnExtService;
@Override
public StepResult execute(StationRequestBean reqBean) {
StationResultBean resultBean = new StationResultBean();
StepResult stepResult = StepResult.getSuccessComplete();
//获取工位当前设备信息
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.dispatchCurCellEquipment(reqBean);
//配置错误 抛出异常
if (!productionProcessContext.getSuccess()) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), productionProcessContext.getMessage());
//获取进料主条码数据信息
List<MesProductionPsInContext> productionPsInContextList = productionDispatchContextStepService.getProductionPsInContext(reqBean);
if (CollectionUtils.isEmpty(productionPsInContextList)) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), "当前不存在进料主条码信息,请重置工序解决!");
//验证是否需要进行原料站点扣减
List<String> containerSnDataList = productionPsInContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getContainerSnData()))).map(MesProductionPsInContext::getContainerSnData).collect(Collectors.toList());
if (CollectionUtils.isEmpty(containerSnDataList)) {
return stepDynamicsCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, true,
MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT, "验证每腔不存在容器匹配的主条码,默认跳过原料站点扣减!");
}
//修改上料明细表信息状态 【扣减完成】
Long[] ids = containerSnDataList.stream().filter(o -> !StringUtils.isEmpty(o)).map(Long::parseLong).toArray(Long[]::new);
stationContainerSnExtService.updateContainerPackageDetail(reqBean.getOrganizeCode(), reqBean.getUserInfo(), MesExtEnumUtil.CONTAINER_BARCODE_STATUS.STATUS_20.getValue(), ids);
// 赋值 stepAfterState, 当前工步集执行结束后会执行当前工步重写的executeStepAfterState方法
stepResult.addStepAfterStateList(StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()));
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "原料站点扣减成功!");
}
//当前工步集完成之后执行当前方法
@Override
public void executeStepAfterState(StationRequestBean reqBean, StepResult stepResult) {
if (!stepResult.isCompleted()) return;
//获取已被验证了的容器主条码信息
List<MesContainerPackageDetailContext> containerPackageDetailContextList = productionDispatchContextStepService.getContainerPackageDetailPs(reqBean);
if (CollectionUtils.isEmpty(containerPackageDetailContextList) || StringUtils.isEmpty(containerPackageDetailContextList.get(0).getProcessMethod())) return;
//加工模式策略
IMesStationMatchPsProcessMethodStrategyStepService strategyService = (IMesStationMatchPsProcessMethodStrategyStepService) SpringContextsUtil.getBean(MesExtEnumUtil.STATION_PROCESS_METHOD.valueOfStrategyClass(containerPackageDetailContextList.get(0).getProcessMethod()));
//【原料站点】解锁进料主条码信息
strategyService.removeContainerPackageDetailPsLocked(reqBean, containerPackageDetailContextList);
}
}

@ -102,7 +102,7 @@ public class MesStationMatchProductSnStepService extends BaseStepService {
MesExtEnumUtil.STATION_TYPE.STATION_TYPE_30.getValue(), MesExtEnumUtil.STATION_TYPE.STATION_TYPE_50.getValue()).collect(Collectors.toList()));
//剔除没有加工模式的站点数据
List<MesStation> filterList = stationList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getProcessMethod()))).collect(Collectors.toList());
List<MesStation> filterList = stationList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getProcessMethod()) && !StringUtils.isEmpty(MesExtEnumUtil.STATION_PROCESS_METHOD.valueOfDescription(o.getProcessMethod())))).collect(Collectors.toList());
//原料站点
List<MesStation> stationList10 = productionProcessContextStepService.dispatchEquipmentStationContext(filterList, Stream.of(MesExtEnumUtil.STATION_TYPE.STATION_TYPE_10.getValue()).collect(Collectors.toList()));
//混料站点
@ -129,7 +129,8 @@ public class MesStationMatchProductSnStepService extends BaseStepService {
productionDispatchContextStepService.dispatchMatchStationProductSnContext(reqBean, stationList2Ps);
//加工模式策略
IMesStationMatchPsProcessMethodStrategyStepService strategyService = (IMesStationMatchPsProcessMethodStrategyStepService) SpringContextsUtil.getBean(MesExtEnumUtil.STATION_PROCESS_METHOD.valueOfStrategyClass(stationList.get(0).getProcessMethod()));
MesStation station = stationList2Ps.get(0);
IMesStationMatchPsProcessMethodStrategyStepService strategyService = (IMesStationMatchPsProcessMethodStrategyStepService) SpringContextsUtil.getBean(MesExtEnumUtil.STATION_PROCESS_METHOD.valueOfStrategyClass(station.getProcessMethod()));
//【原料站点】获取容器条码上料明细表信息
MesContainerPackageDetailStationContext containerPackageDetailStationContext = strategyService.getContainerPackageDetailStationContext(reqBean.getOrganizeCode(), stationList2Ps);
@ -157,8 +158,12 @@ public class MesStationMatchProductSnStepService extends BaseStepService {
//是否验证工艺路线配置
String isCheckCraft = (null != stepParamMap && stepParamMap.isPresent() && stepParamMap.get().containsKey(MesPcnExtConstWords.IS_CHECK_CRAFT_CFG)) ? stepParamMap.get().get(MesPcnExtConstWords.IS_CHECK_CRAFT_CFG).getParamValue() : null;
//需要进行LOCK的站点
List<String> stationNameList = containerPackageDetailStationContext.getStationList().stream().filter(o -> null != o).map(o -> o.getStation().toUpperCase()).collect(Collectors.toList());
// 结尾需要缓存锁定的数据
List<MesContainerPackageDetailContext> needCachedList = null;
List<ReentrantLock> acquiredLocks = new ArrayList<>();
try {
if (!MesReentrantLockUtil.tryLock(acquiredLocks, stationNameList, MesPcnExtConstWords.MATCH_STATION_PRODUCT_SN_CONTEXT + MesPcnExtConstWords.COLON, 3000L)) {
@ -166,9 +171,6 @@ public class MesStationMatchProductSnStepService extends BaseStepService {
MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT, "匹配原料站点时LOCK失败,即将重试!");
}
// 结尾需要缓存锁定的数据
List<MesContainerPackageDetailContext> needCachedList = null;
//循环到全部验证成功或根据场景验证失败结束
for (int i = 0; i >= 0; i ++) {
@ -219,7 +221,7 @@ public class MesStationMatchProductSnStepService extends BaseStepService {
}
//锁定当前已被验证了的主条码或容器条码
strategyService.dispatchContainerPackageDetailPs(reqBean, needCachedList);
strategyService.dispatchContainerPackageDetailPsLocked(reqBean, needCachedList);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
@ -242,6 +244,9 @@ public class MesStationMatchProductSnStepService extends BaseStepService {
//生产零件条码业务处理
productSnGenerateStepService.doHandleProductSnGenerate(reqBean, resultBean, stepResult, productionProcessContext, productionPartContextList, productionPsInContextList, prodRuleContextList, prodShiftContext);
//缓存已被验证了的容器主条码信息
productionDispatchContextStepService.dispatchContainerPackageDetailPs(reqBean, needCachedList);
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "匹配原料站点验证成功!", MesPcnEnumUtil.PROMPT_SOUND.SUCCESS.getValue());
}

@ -88,7 +88,7 @@ public class MesWorkOrderQueueSavePushStepService extends BaseStepService {
//验证是否存在LOCK数据, 存在的情况下赋值 stepAfterState, 当前工步集执行结束后会执行当前工步重写的executeStepAfterState方法
Optional<MesQueueOrderPush> optional = CollectionUtils.isEmpty(queueOrderPushList) ? null : queueOrderPushList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getIsNeedLock()))).findFirst();
if (null != optional && optional.isPresent()) stepResult.stepAfterState(StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()));
if (null != optional && optional.isPresent()) stepResult.addStepAfterStateList(StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()));
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "保存工位队列成功!");

@ -127,7 +127,7 @@ public class MesWorkOrderSaveNosortStepService extends BaseStepService {
if (MathOperation.compareTo(calcCompleteQty, new Double(MesPcnExtConstWords.ZERO)) == 0) continue;
// 赋值 stepAfterState, 当前工步集执行结束后会执行当前工步重写的executeStepAfterState方法
if (StringUtils.isEmpty(stepResult.getStepAfterState())) stepResult.stepAfterState(StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()));
stepResult.addStepAfterStateList(StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()));
//TODO 排序考虑多工位扫描可疑码; 非排序考虑自进自出可疑或报废; 可疑数/报废数是否需要增加的问题[条码+零件+质量状态 增加履历]

@ -446,7 +446,7 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
//可扣减条码的缓存key
@Override
public String getContainerPackageDetailPsKey(String organizeCode, String suffix, String psOrContainerSnAppendId) {
public String getContainerPackageDetailPsLockedKey(String organizeCode, String suffix, String psOrContainerSnAppendId) {
return new StringJoiner(MesPcnExtConstWords.COLON)
.add(organizeCode)
.add(MesPcnExtConstWords.MATCH_STATION_PRODUCT_SN_CONTEXT)
@ -457,16 +457,22 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
//验证主条码或容器条码是否被占用
@Override
public Boolean checkContainerPackageDetailPsIsUsed(StationRequestBean reqBean, String suffix, String psOrContainerSnAppendId) {
String location = getFsmBusiData(reqBean.getOrganizeCode(), getContainerPackageDetailPsKey(reqBean.getOrganizeCode(), suffix, psOrContainerSnAppendId));
public Boolean checkContainerPackageDetailPsLockedIsUsed(StationRequestBean reqBean, String suffix, String psOrContainerSnAppendId) {
String location = getFsmBusiData(reqBean.getOrganizeCode(), getContainerPackageDetailPsLockedKey(reqBean.getOrganizeCode(), suffix, psOrContainerSnAppendId));
//此外无需考虑大小写转换
return (StringUtils.isEmpty(location) || StringEqualsUtil.stringEquals(location, reqBean.getClientInfo())) ? false : true;
}
//锁定主条码或容器条码
@Override
public void dispatchContainerPackageDetailPs(StationRequestBean reqBean, String suffix, String psOrContainerSnAppendId) {
dispatchFsmBusiData(reqBean.getOrganizeCode(), getContainerPackageDetailPsKey(reqBean.getOrganizeCode(), suffix, psOrContainerSnAppendId), reqBean.getClientInfo(), MesPcnEnumUtil.EXPIRE_TIME.ONE_QUARTER.getValue());
public void dispatchContainerPackageDetailPsLocked(StationRequestBean reqBean, String suffix, String psOrContainerSnAppendId) {
dispatchFsmBusiData(reqBean.getOrganizeCode(), getContainerPackageDetailPsLockedKey(reqBean.getOrganizeCode(), suffix, psOrContainerSnAppendId), reqBean.getClientInfo(), MesPcnEnumUtil.EXPIRE_TIME.ONE_QUARTER.getValue());
}
//解锁主条码或容器条码
@Override
public void removeContainerPackageDetailPsLocked(StationRequestBean reqBean, String suffix, String psOrContainerSnAppendId) {
removeFsmBusiData(reqBean.getOrganizeCode(), getContainerPackageDetailPsLockedKey(reqBean.getOrganizeCode(), suffix, psOrContainerSnAppendId));
}
}

@ -653,4 +653,18 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp
dispatchFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.MATCH_STATION_FEED_CONTAINER_SN_CONTEXT, sn);
}
//获取已被验证了的容器主条码信息
@Override
public List<MesContainerPackageDetailContext> getContainerPackageDetailPs(StationRequestBean reqBean) {
String context = getFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.MATCH_CONTAINER_PRODUCTSNIN_CONTEXT);
return !StringUtils.isEmpty(context) ? JSONObject.parseArray(context, MesContainerPackageDetailContext.class) : null;
}
//保存已被验证了的容器主条码信息
@Override
public void dispatchContainerPackageDetailPs(StationRequestBean reqBean, List<MesContainerPackageDetailContext> containerPackageDetailContextList) {
if (CollectionUtils.isEmpty(containerPackageDetailContextList)) return;
dispatchFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.MATCH_CONTAINER_PRODUCTSNIN_CONTEXT, JSONObject.toJSONString(containerPackageDetailContextList));
}
}

@ -23,6 +23,9 @@ public interface IMesStationMatchPsProcessMethodStrategyStepService {
default Boolean checkIsMatchCavity(Integer count1, Integer count2, Integer count3, Integer cavity, Boolean isBeforeCheck) { return true; }
@ApiOperation(value = "【原料站点】锁定进料主条码信息")
default void dispatchContainerPackageDetailPs(StationRequestBean reqBean, List<MesContainerPackageDetailContext> needCachedList) {}
default void dispatchContainerPackageDetailPsLocked(StationRequestBean reqBean, List<MesContainerPackageDetailContext> containerPackageDetailContextList) {}
@ApiOperation(value = "【原料站点】解锁进料主条码信息")
default void removeContainerPackageDetailPsLocked(StationRequestBean reqBean, List<MesContainerPackageDetailContext> containerPackageDetailContextList) {}
}

@ -55,7 +55,7 @@ public class MesStationMatchPsProcessMethodContainerStepService extends BaseStep
for (Map.Entry<String, List<MesContainerPackageDetailContext>> entry : containerSnDataMap.entrySet()) {
if (null == entry || !StringUtils.isEmpty(entry.getValue().get(0).getIsUsed())) continue;
//验证是否被使用
if (productionCustomContextStepService.checkContainerPackageDetailPsIsUsed(reqBean, MesPcnExtConstWords.CONTAINER_SN, entry.getKey())) {
if (productionCustomContextStepService.checkContainerPackageDetailPsLockedIsUsed(reqBean, MesPcnExtConstWords.CONTAINER_SN, entry.getKey())) {
//标记被使用
entry.getValue().get(0).isUsed();
continue;
@ -85,8 +85,14 @@ public class MesStationMatchPsProcessMethodContainerStepService extends BaseStep
//【原料站点】锁定进料主条码信息
@Override
public void dispatchContainerPackageDetailPs(StationRequestBean reqBean, List<MesContainerPackageDetailContext> needCachedList) {
productionCustomContextStepService.dispatchContainerPackageDetailPs(reqBean, MesPcnExtConstWords.CONTAINER_SN, needCachedList.get(0).getTopContainerSnKey());
public void dispatchContainerPackageDetailPsLocked(StationRequestBean reqBean, List<MesContainerPackageDetailContext> containerPackageDetailContextList) {
productionCustomContextStepService.dispatchContainerPackageDetailPsLocked(reqBean, MesPcnExtConstWords.CONTAINER_SN, containerPackageDetailContextList.get(0).getTopContainerSnKey());
}
//【原料站点】解锁进料主条码信息
@Override
public void removeContainerPackageDetailPsLocked(StationRequestBean reqBean, List<MesContainerPackageDetailContext> containerPackageDetailContextList) {
productionCustomContextStepService.removeContainerPackageDetailPsLocked(reqBean, MesPcnExtConstWords.CONTAINER_SN, containerPackageDetailContextList.get(0).getTopContainerSnKey());
}
}

@ -77,7 +77,7 @@ public class MesStationMatchPsProcessMethodSingleStepService extends BaseStepSer
//已经被匹配失败, 跳到下个站点进行验证第一个未匹配的进料主条码
if (!StringUtils.isEmpty(containerPackageDetailContext.getMatchResult()) && StringEqualsUtil.stringEquals(containerPackageDetailContext.getMatchResult(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValueStr())) break LOOP;
//验证是否被使用
if (productionCustomContextStepService.checkContainerPackageDetailPsIsUsed(reqBean, MesPcnExtConstWords.PRODUCT_SN, containerPackageDetailContext.getBarCodeKey())) {
if (productionCustomContextStepService.checkContainerPackageDetailPsLockedIsUsed(reqBean, MesPcnExtConstWords.PRODUCT_SN, containerPackageDetailContext.getBarCodeKey())) {
//标记被使用
containerPackageDetailContext.isUsed();
continue;
@ -122,9 +122,14 @@ public class MesStationMatchPsProcessMethodSingleStepService extends BaseStepSer
//【原料站点】锁定进料主条码信息
@Override
public void dispatchContainerPackageDetailPs(StationRequestBean reqBean, List<MesContainerPackageDetailContext> needCachedList) {
needCachedList.forEach(o -> productionCustomContextStepService.dispatchContainerPackageDetailPs(reqBean, MesPcnExtConstWords.PRODUCT_SN, o.getBarCodeKey()));
public void dispatchContainerPackageDetailPsLocked(StationRequestBean reqBean, List<MesContainerPackageDetailContext> containerPackageDetailContextList) {
containerPackageDetailContextList.forEach(o -> productionCustomContextStepService.dispatchContainerPackageDetailPsLocked(reqBean, MesPcnExtConstWords.PRODUCT_SN, o.getBarCodeKey()));
}
//【原料站点】解锁进料主条码信息
@Override
public void removeContainerPackageDetailPsLocked(StationRequestBean reqBean, List<MesContainerPackageDetailContext> containerPackageDetailContextList) {
containerPackageDetailContextList.forEach(o -> productionCustomContextStepService.removeContainerPackageDetailPsLocked(reqBean, MesPcnExtConstWords.PRODUCT_SN, o.getBarCodeKey()));
}
}

@ -750,6 +750,8 @@ public class MesPcnExtConstWords {
public static final String MATCH_STATION_ASSEMBLY_CONTEXT = "MATCH_STATION_ASSEMBLY_CONTEXT";
// 用于缺料时进行上料绑定的进料站点
public static final String MATCH_STATION_PRODUCT_SN_CONTEXT = "MATCH_STATION_PRODUCT_SN_CONTEXT";
// 匹配成功的进料主条码信息
public static final String MATCH_CONTAINER_PRODUCTSNIN_CONTEXT = "MATCH_CONTAINER_PRODUCTSNIN_CONTEXT";
// 用于扣料业务中进行LOCK
public static final String LOCK_STATION_CONTEXT = "LOCK_STATION_CONTEXT";

Loading…
Cancel
Save