展示组件

tags/yfai-pcn-ext-v1.0
微笑着面对明天 11 months ago
parent 9b761d52f7
commit 143361ccd0

@ -3,6 +3,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.station;
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.pojo.context.MesCellEquipContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdShiftContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseModuleService;
@ -27,6 +28,7 @@ import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;
import java.util.stream.Collectors;
/**
@ -56,6 +58,8 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
// 获取班次信息
List<StationKvBean> prodShiftDataContext = mesProductionDispatchContextStepService.getProdShiftDataContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
MesProdShiftContext mesProdShiftKvBean = mesProductionDispatchContextStepService.getMesProdShiftKvBean(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
if (CollectionUtils.isEmpty(prodShiftDataContext)) {
this.sendMessage(reqBean, new StationResultBean().writeDbLog(), "请先开班", MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
throw ImppExceptionBuilder.newInstance().setSystemID(CommonEnumUtil.SOFT_TYPE.MES_PCN.getCode()).setErrorCode("NO_SHOW_MSG").build();
@ -68,7 +72,9 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
List<StationKvBean> shiftCountContext = new ArrayList<>();
if (mesWorkCell.getIsShowMsg() != null && Objects.equal(MesExtEnumUtil.WORK_FILE_TYPE.HISTOGRAM.getValue(),mesWorkCell.getIsShowMsg())) {
List<StationKvBean> productionStatisticsContext = mesProductionDispatchContextStepService.getProductionStatisticsContext(reqBean);
if (CollectionUtils.isEmpty(productionStatisticsContext)) {
StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(), new StationKvBean(new StringJoiner(MesPcnExtConstWords.AND).add(mesProdShiftKvBean.getShiftGroup()).add(mesProdShiftKvBean.getShiftCode()).toString(), "加工次数", "0"));
}
StationResultBean shiftCountBean = getStationResultBean(reqBean, productionStatisticsContext);
this.sendMessage(reqBean, shiftCountBean);
}
@ -83,20 +89,7 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
resultBean.setDataType(MesPcnEnumUtil.STATION_DATA_TYPE.CUSTOM.getValue());
resultBean.setCustomPageName(MesPcnExtConstWords.CUSTOM_PAGE_NAME_DEFAULT);
resultBean.setSpecialDisplayData(getStepColIndent(reqBean));
/*
List<StationKvBean> stationKvBeans3 = new ArrayList<>();
StationKvBean stationKvBean7 = new StationKvBean();
stationKvBean7.setKey("shiftCode");
stationKvBean7.setName("班次");
stationKvBean7.setValue("白班");
stationKvBeans3.add(stationKvBean7);
StationKvBean stationKvBean8 = new StationKvBean();
stationKvBean8.setKey("shiftGroup");
stationKvBean8.setName("班组");
stationKvBean8.setValue("注塑2班");
stationKvBeans3.add(stationKvBean8);*/
resultBean.setResultObj(prodShiftDataContext);
resultBean.setResultList(moduleContentContext);
@ -111,6 +104,7 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
resultBean.setDataAttrList(packDataAttrList());
resultBean.setSpecialDisplayData(getStepColIndent(reqBean));
resultBean.setResultList(productionStatisticsContext);
return resultBean;
}

@ -439,17 +439,17 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp
public Boolean 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();
List<StationKvBean> stationKvBeans = getProductionStatisticsContext(reqBean);
if (CollectionUtils.isEmpty(stationKvBeans)) {
String key = mesProdShiftKvBean.getShiftGroup() + "_" + mesProdShiftKvBean.getShiftCode();
String name = "加工次数";
String value = count + "";
List<StationKvBean> generateStationKvBeans = StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(), new StationKvBean(key, name, value));
saveProductionStatisticsContext(reqBean, generateStationKvBeans);
} else {
stationKvBeans.stream().forEach(stationKvBean -> {
if (Objects.equal(stationKvBean.getKey(), mesProdShiftKvBean.getShiftGroup() + "_" + mesProdShiftKvBean.getShiftCode())) {
if (Objects.equal(stationKvBean.getKey(), key)) {
stationKvBean.setValue(stationKvBean == null ? count + "" : (Integer.valueOf(stationKvBean.getValue()) + count) + "");
}
});

Loading…
Cancel
Save