|
|
|
@ -83,10 +83,6 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
this.sendMessage(reqBean, new StationResultBean().writeDbLog(), "请先开班!", MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
|
|
|
|
|
MesPcnException.throwBusiException("请先开班!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//班次开始时间 ,班次结束时间
|
|
|
|
|
getShiftTimeStationKvBean(reqBean, prodShiftDataContext);
|
|
|
|
|
|
|
|
|
|
// 发送班次班组和工单
|
|
|
|
|
StationResultBean resultBean = getStationResultBean(reqBean, moduleContentContext, prodShiftDataContext);
|
|
|
|
|
this.sendMessage(reqBean, resultBean);
|
|
|
|
@ -112,25 +108,6 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
((IStepService) SpringContextsUtil.getBean("mesEquipByPassReadStepService")).executeInState(reqBean);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void getShiftTimeStationKvBean(StationRequestBean reqBean, List<StationKvBean> prodShiftDataContext) {
|
|
|
|
|
List<MesShift> shiftList = mesShiftService.queryMesShift(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
|
|
|
|
|
if (CollectionUtils.isEmpty(shiftList)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Optional<StationKvBean> shiftCodeOptional = prodShiftDataContext.stream().filter(shift -> MesPcnExtConstWords.SHIFT_CODE.equals(shift.getKey())).findFirst();
|
|
|
|
|
if (!shiftCodeOptional.isPresent()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Optional<MesShift> shiftOptional = shiftList.stream().filter(t -> t.getShiftCode().equals(shiftCodeOptional.get().getValue())).findFirst();
|
|
|
|
|
if (!shiftOptional.isPresent()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
StationKvBeanUtil.addStationKvBeanList(prodShiftDataContext,
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.START_TIME, "班次开始时间", shiftOptional.get().getStartTime()),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.END_TIME, "班次结束时间", shiftOptional.get().getEndTime()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<StationKvBean> getShiftRecordStationKvBeans(StationRequestBean reqBean) {
|
|
|
|
|
// 获取班次信息 redis
|
|
|
|
|
List<StationKvBean> prodShiftDataContext = productionCustomContextStepService.getProdShiftDataContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
|
|
|
|
@ -230,11 +207,18 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
|
|
|
|
|
//封装展示组件班组班次内容
|
|
|
|
|
private List<StationKvBean> getProdShiftData(MesProdShiftRecord record) {
|
|
|
|
|
|
|
|
|
|
return StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(),
|
|
|
|
|
List<StationKvBean> stationKvBeans = StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.SHIFT_GROUP, "班组", record.getShiftGroup()),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.SHIFT_GROUP_NAME, "班组名称", record.getShiftGroupName()),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.SHIFT_CODE, "班次", record.getShiftCode()),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.SHIFT_NAME, "班次名称", record.getShiftName()));
|
|
|
|
|
//班次开始时间 ,班次结束时间
|
|
|
|
|
Map<String, String> shiftTimeMap = mesShiftService.getShiftTimeMap(record);
|
|
|
|
|
if (!java.util.Objects.isNull(shiftTimeMap)) {
|
|
|
|
|
StationKvBeanUtil.addStationKvBeanList(stationKvBeans,
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.START_TIME,"开始时间",shiftTimeMap.get(MesPcnExtConstWords.START_TIME)),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.END_TIME,"结束时间",shiftTimeMap.get(MesPcnExtConstWords.END_TIME)));
|
|
|
|
|
}
|
|
|
|
|
return stationKvBeans;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|