工步问题修复 工步调用工步 必须使用 executeInState方法

tags/yfai-pcn-ext-v1.0
王杰 12 months ago
parent 38bddc5b4a
commit e66cf87495

@ -61,7 +61,7 @@ public interface IMesProductionCustomContextStepService {
Boolean saveProductionStatisticsContext(StationRequestBean reqBean, List<StationKvBean> prodShiftDatList);
@ApiOperation(value = "新增上下文工位加工数统计信息")
Boolean addProductionStatisticsContext(StationRequestBean reqBean, int count);
Integer addProductionStatisticsContext(StationRequestBean reqBean, int count);
@ApiOperation(value = "删除上下文工位加工数统计信息")
void deleteProductionStatisticsContext(StationRequestBean reqBean);

@ -100,10 +100,10 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
//验证工位是否锁定
reqBean.getDataMap().put(MesPcnEnumUtil.ACTOR_RECEIVE_STRATEGY.WS_CMD_INIT_MODULE.getCode(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr());
((IStepService) SpringContextsUtil.getBean("mesCountDownShowStepService")).execute(reqBean);
((IStepService) SpringContextsUtil.getBean("mesCountDownShowStepService")).executeInState(reqBean);
//设备BYPASS监控
((IStepService) SpringContextsUtil.getBean("mesEquipByPassReadStepService")).execute(reqBean);
((IStepService) SpringContextsUtil.getBean("mesEquipByPassReadStepService")).executeInState(reqBean);
}

@ -93,7 +93,7 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
//全部匹配完毕,存在进料的时候直接调用 并且不存在产出零件的时候 生成零件条码工步 【收尾都调用是因为 生成零件条码工步 调用执行过程中可能会出现配置报错】
if (!hasUnBindAssembly && !CollectionUtils.isEmpty(productionPsInContextList) && productionPsInContextList.size() >= needQty && !productionDispatchContextStepService.checkProductionPsOutIsExistContext(reqBean))
((IStepService) SpringContextsUtil.getBean("mesProductSnGenerateStepService")).execute(reqBean);
((IStepService) SpringContextsUtil.getBean("mesProductSnGenerateStepService")).executeInState(reqBean);
//没有待绑定数据, 验证当前是否满足腔数 没有进料主条码代码当前加工规则已经全部加载, 有的话需要判断是否全部扫完 没有扫完需要返回false继续扫描主条码
if (!IsNeedScanAssembly || !hasUnBindAssembly)
@ -126,7 +126,7 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
}
//全部匹配完毕,存在进料且进料数量满足腔数的时候直接调用 生成零件条码工步
if (!hasUnBindAssembly && !CollectionUtils.isEmpty(productionPsInContextList) && productionPsInContextList.size() >= needQty) ((IStepService) SpringContextsUtil.getBean("mesProductSnGenerateStepService")).execute(reqBean);
if (!hasUnBindAssembly && !CollectionUtils.isEmpty(productionPsInContextList) && productionPsInContextList.size() >= needQty) ((IStepService) SpringContextsUtil.getBean("mesProductSnGenerateStepService")).executeInState(reqBean);
//没有待绑定数据, 验证当前是否满足腔数 没有进料主条码代码当前加工规则已经全部加载, 有的话需要判断是否全部扫完 没有扫完需要返回false继续扫描主条码
if (!hasUnBindAssembly)

@ -29,7 +29,7 @@ public class MesAssemblyMatchStepService extends BaseStepService {
public StepResult init(StationRequestBean reqBean) {
//显示装配件扫描项工步
return ((IStepService) SpringContextsUtil.getBean("mesAssemblyShowStepService")).execute(reqBean);
return ((IStepService) SpringContextsUtil.getBean("mesAssemblyShowStepService")).executeInState(reqBean);
}
@ -56,7 +56,7 @@ public class MesAssemblyMatchStepService extends BaseStepService {
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return stepResult;
//非排序线 装配件匹配工步
return ((IStepService) SpringContextsUtil.getBean("mesAssemblyMatchNosortStepService")).execute(reqBean);
return ((IStepService) SpringContextsUtil.getBean("mesAssemblyMatchNosortStepService")).executeInState(reqBean);
}

@ -45,10 +45,10 @@ public class MesAssemblySaveStepService extends BaseStepService {
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
//排序线 保存装配记录工步
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesAssemblySaveSortStepService")).execute(reqBean);
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesAssemblySaveSortStepService")).executeInState(reqBean);
//非排序线 保存装配记录工步
return ((IStepService) SpringContextsUtil.getBean("mesAssemblySaveNosortStepService")).execute(reqBean);
return ((IStepService) SpringContextsUtil.getBean("mesAssemblySaveNosortStepService")).executeInState(reqBean);
}

@ -45,10 +45,10 @@ public class MesAssemblyShowStepService extends BaseStepService {
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
//排序线 显示装配件扫描项工步
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesAssemblyShowSortStepService")).execute(reqBean);
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesAssemblyShowSortStepService")).executeInState(reqBean);
//非排序线 显示装配件扫描项工步
return ((IStepService) SpringContextsUtil.getBean("mesAssemblyShowNosortStepService")).execute(reqBean);
return ((IStepService) SpringContextsUtil.getBean("mesAssemblyShowNosortStepService")).executeInState(reqBean);
}

@ -56,7 +56,7 @@ public class MesManyCellNoticeNextStepService extends BaseStepService {
//调用多工位场景触发定位分屏工步, CLIENT_INFO是必要传参
reqBean.getDataMap().put(MesPcnExtConstWords.CLIENT_INFO, clientInfo);
return ((IStepService) SpringContextsUtil.getBean("mesManyCellTriggerTabSwitchStepService")).execute(reqBean);
return ((IStepService) SpringContextsUtil.getBean("mesManyCellTriggerTabSwitchStepService")).executeInState(reqBean);
}

@ -83,10 +83,10 @@ public class MesMouldRecordGenerateStepService extends BaseStepService {
mouldNo = mesMouldNoCollectContext.getEquipVariableValue();
}
MesProdMouldRecord mesProductionRecord = getMesProdMouldRecord(mesCellEquipContext, mouldNo, moduleId);
ConvertBean.serviceModelInitialize(mesProductionRecord, reqBean.getUserInfo());
mesProdMouldRecords.add(mesProductionRecord);
MesProdMouldRecord prodMouldRecord = getMesProdMouldRecord(mesCellEquipContext, mouldNo, moduleId);
prodMouldRecord.setOrganizeCode(reqBean.getOrganizeCode());
ConvertBean.serviceModelInitialize(prodMouldRecord, reqBean.getUserInfo());
mesProdMouldRecords.add(prodMouldRecord);
mesProdMouldRecordRepository.saveAll(mesProdMouldRecords);

@ -45,10 +45,10 @@ public class MesProductSnCheckStepService extends BaseStepService {
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
//排序线 主条码验证工步
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesProductSnCheckSortStepService")).execute(reqBean);
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesProductSnCheckSortStepService")).executeInState(reqBean);
//非排序线 主条码验证工步
return ((IStepService) SpringContextsUtil.getBean("mesProductSnCheckNosortStepService")).execute(reqBean);
return ((IStepService) SpringContextsUtil.getBean("mesProductSnCheckNosortStepService")).executeInState(reqBean);
}

@ -87,7 +87,7 @@ public class MesProductSnScanSortStepService extends BaseStepService {
Boolean sortNeedScanPs = (null != stepParamMap && stepParamMap.isPresent() && stepParamMap.get().containsKey(MesPcnExtConstWords.SORT_NEED_SCAN_PS)) ? true : false;
//需要扫描主条码配置存在 直接复用 非排序线 扫描主条码工步
if (sortNeedScanPs) return ((IStepService) SpringContextsUtil.getBean("mesProductSnScanNosortStepService")).execute(reqBean);
if (sortNeedScanPs) return ((IStepService) SpringContextsUtil.getBean("mesProductSnScanNosortStepService")).executeInState(reqBean);
//获取进料主条码数据信息
List<MesProductionPsInContext> productionPsInContextList = productionDispatchContextStepService.getProductionPsInContext(reqBean);

@ -64,10 +64,10 @@ public class MesProductSnScanStepService extends BaseStepService {
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
//排序线 扫描主条码工步
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesProductSnScanSortStepService")).execute(reqBean);
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesProductSnScanSortStepService")).executeInState(reqBean);
//非排序线 扫描主条码工步
return ((IStepService) SpringContextsUtil.getBean("mesProductSnScanNosortStepService")).execute(reqBean);
return ((IStepService) SpringContextsUtil.getBean("mesProductSnScanNosortStepService")).executeInState(reqBean);
}

@ -26,25 +26,25 @@ public class MesProductionDataSaveStepService extends BaseStepService {
StepResult stepResult = StepResult.getSuccessComplete();
//保存开模记录工步
((IStepService) SpringContextsUtil.getBean("mesMouldRecordGenerateStepService")).execute(reqBean);
((IStepService) SpringContextsUtil.getBean("mesMouldRecordGenerateStepService")).executeInState(reqBean);
//保存零件条码信息工步
((IStepService) SpringContextsUtil.getBean("mesProductSnSaveStepService")).execute(reqBean);
((IStepService) SpringContextsUtil.getBean("mesProductSnSaveStepService")).executeInState(reqBean);
//加工异常处理工步【此工步未整改】
((IStepService) SpringContextsUtil.getBean("mesProductResultErrorHandleStepService")).execute(reqBean);
((IStepService) SpringContextsUtil.getBean("mesProductResultErrorHandleStepService")).executeInState(reqBean);
//生成加工记录工步
((IStepService) SpringContextsUtil.getBean("mesProductionRecordGenerateStepService")).execute(reqBean);
((IStepService) SpringContextsUtil.getBean("mesProductionRecordGenerateStepService")).executeInState(reqBean);
//保存装配记录工步
((IStepService) SpringContextsUtil.getBean("mesAssemblySaveStepService")).execute(reqBean);
((IStepService) SpringContextsUtil.getBean("mesAssemblySaveStepService")).executeInState(reqBean);
//生产汇报工步 【此工步未整改】
//((IStepService) SpringContextsUtil.getBean("mesReportGenerateStepService")).execute(reqBean);
//((IStepService) SpringContextsUtil.getBean("mesReportGenerateStepService")).executeInState(reqBean);
//保存工单信息工步
((IStepService) SpringContextsUtil.getBean("mesWorkOrderSaveStepService")).execute(reqBean);
((IStepService) SpringContextsUtil.getBean("mesWorkOrderSaveStepService")).executeInState(reqBean);
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "保存加工结果成功!");

@ -99,11 +99,11 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
//保存上下文产品加工规则信息集合
productionDispatchContextStepService.saveProdRuleDataContext(reqBean, prodRuleContextList);
LOGGER.info("产线【{}】,工位【{}】,加工数累加{},{}",reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), productionPsOutContextList.size(),mesWorkCell.getIsCountFinish());
if (Objects.equal(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(),mesWorkCell.getIsCountFinish())) {
// 保存班次加工数量上下文
productionCustomContextStepService.addProductionStatisticsContext(reqBean,productionPsOutContextList.size());
if (Objects.equal(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), mesWorkCell.getIsCountFinish())) {
// 保存班次加工数量上下文
Integer amount = productionCustomContextStepService.addProductionStatisticsContext(reqBean,productionPsOutContextList.size());
this.sendMessage(reqBean, resultBean, String.format("生产线[%s]工位[%s]当前累加数[%s]已累计加工数[%s]", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), productionPsOutContextList.size(), amount), MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
}
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "生成加工记录成功!");

@ -76,10 +76,10 @@ public class MesWorkOrderCheckStepService extends BaseStepService {
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
//排序线 加工单验证工步
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesWorkOrderCheckSortStepService")).execute(reqBean);
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesWorkOrderCheckSortStepService")).executeInState(reqBean);
//非排序线 加工单验证工步
return ((IStepService) SpringContextsUtil.getBean("mesWorkOrderCheckNosortStepService")).execute(reqBean);
return ((IStepService) SpringContextsUtil.getBean("mesWorkOrderCheckNosortStepService")).executeInState(reqBean);
}

@ -22,7 +22,7 @@ import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.StringJoiner;
import java.util.logging.Logger;
import java.util.concurrent.atomic.AtomicReference;
/**
* @Description : BUSI
@ -180,28 +180,32 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
}
@Override
public Boolean addProductionStatisticsContext(StationRequestBean reqBean, int count) {
public Integer addProductionStatisticsContext(StationRequestBean reqBean, int count) {
MesProdShiftContext mesProdShiftKvBean = getMesProdShiftKvBean(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
//String key = new StringJoiner(MesPcnExtConstWords.AND).add(mesProdShiftKvBean.getShiftGroup()).add(mesProdShiftKvBean.getShiftCode()).toString();
String key = new StringJoiner(MesPcnExtConstWords.AND).add(mesProdShiftKvBean.getShiftGroup()).toString();
List<StationKvBean> stationKvBeans = getProductionStatisticsContext(reqBean);
List<StationKvBean> stationKvBeans = getProductionStatisticsContext(reqBean);
AtomicReference<Integer> amount = new AtomicReference<>();
amount.set(count);
if (CollectionUtils.isEmpty(stationKvBeans)) {
String name = "加工数";
String value = count + "";
List<StationKvBean> generateStationKvBeans = StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(), new StationKvBean(key, name, value),
new StationKvBean("color", "颜色", MesExtEnumUtil.COLOR.BLACK.getValue()));
saveProductionStatisticsContext(reqBean, generateStationKvBeans);
stationKvBeans = StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(),
new StationKvBean(mesProdShiftKvBean.getShiftGroup(), name, value), new StationKvBean("color", "颜色", MesExtEnumUtil.COLOR.BLACK.getValue()));
} else {
stationKvBeans.stream().forEach(stationKvBean -> {
if (stationKvBean.getKey().contains(key)) {
if (stationKvBean.getKey().contains(mesProdShiftKvBean.getShiftGroup())) {
stationKvBean.setValue(stationKvBean == null ? count + "" : (Integer.valueOf(stationKvBean.getValue()) + count) + "");
amount.set(Integer.valueOf(stationKvBean.getValue()));
}
});
saveProductionStatisticsContext(reqBean, stationKvBeans);
}
return true;
saveProductionStatisticsContext(reqBean, stationKvBeans);
return amount.get();
}
//可复用条码KEY

Loading…
Cancel
Save