代码优化

tags/yfai-pcn-ext-v2.3
王杰 7 months ago
parent 62eecf9af4
commit 4b087ed17b

@ -113,19 +113,13 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
@Override
public MesProdShiftContext getMesProdShiftKvBean(String organizeCode, String workCenterCode) {
log.info("获取生产线的当前班组班次信息 --- getMesProdShiftKvBean --- start");
List<StationKvBean> stationKvBeans = getProdShiftDataContext(organizeCode, workCenterCode);
if (CollectionUtils.isEmpty(stationKvBeans)) return null;
log.info("获取生产线的当前班组班次信息 --- getMesProdShiftKvBean --- end");
MesProdShiftContext mesProdShiftContext = new MesProdShiftContext();
if (CollectionUtils.isEmpty(stationKvBeans)) {
return null;
}
StationKvBean shiftGroupKvBean = stationKvBeans.stream().filter(stationKvBean -> Objects.equal(stationKvBean.getKey(), MesPcnExtConstWords.SHIFT_GROUP)).findFirst().orElse(null);
StationKvBean shiftCodeKvBean = stationKvBeans.stream().filter(stationKvBean -> Objects.equal(stationKvBean.getKey(), MesPcnExtConstWords.SHIFT_CODE)).findFirst().orElse(null);
MesProdShiftContext mesProdShiftContext = new MesProdShiftContext();
mesProdShiftContext.setShiftCode(shiftGroupKvBean == null ? null : shiftCodeKvBean.getValue());
mesProdShiftContext.setShiftGroup(shiftCodeKvBean == null ? null : shiftGroupKvBean.getValue());
return mesProdShiftContext;

Loading…
Cancel
Save