|
|
|
@ -2,22 +2,32 @@ 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.MesProductionProcessContext;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseModuleService;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.util.StationKvBeanUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesStateMachineStatus;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.AttrBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationKvBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.PojoAttrUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import com.google.common.base.Objects;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description : 展示组件:非排序生产
|
|
|
|
@ -33,21 +43,47 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void init(StationRequestBean reqBean) {
|
|
|
|
|
// 获取工单信息
|
|
|
|
|
List<List<StationKvBean>> moduleContentContext = mesProductionDispatchContextStepService.getModuleContentContext(reqBean);
|
|
|
|
|
StationResultBean resultBean = getStationResultBean(reqBean, moduleContentContext);
|
|
|
|
|
StationResultBean resultBean1 = getStationResultBean1(reqBean);
|
|
|
|
|
|
|
|
|
|
//获取上下文信息
|
|
|
|
|
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getEquipmentVariableList(reqBean, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue());
|
|
|
|
|
MesWorkCell mesWorkCell = productionProcessContext.getWorkCell();
|
|
|
|
|
|
|
|
|
|
// 获取班次信息
|
|
|
|
|
List<StationKvBean> prodShiftDataContext = mesProductionDispatchContextStepService.getProdShiftDataContext(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();
|
|
|
|
|
}
|
|
|
|
|
// 发送班次班组和工单
|
|
|
|
|
StationResultBean resultBean = getStationResultBean(reqBean, moduleContentContext, prodShiftDataContext);
|
|
|
|
|
this.sendMessage(reqBean, resultBean);
|
|
|
|
|
|
|
|
|
|
// 整合班次加工数量
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
StationResultBean shiftCountBean = getStationResultBean(reqBean, productionStatisticsContext);
|
|
|
|
|
this.sendMessage(reqBean, shiftCountBean);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private StationResultBean getStationResultBean(StationRequestBean reqBean, List<List<StationKvBean>> moduleContentContext) {
|
|
|
|
|
private StationResultBean getStationResultBean(StationRequestBean reqBean, List<List<StationKvBean>> moduleContentContext, List<StationKvBean> prodShiftDataContext) {
|
|
|
|
|
StationResultBean resultBean = new StationResultBean();
|
|
|
|
|
resultBean.setBusiType(MesPcnEnumUtil.STATION_BUSI_TYPE.MODULE_CONTENT.getValue());
|
|
|
|
|
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();
|
|
|
|
@ -60,14 +96,14 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
stationKvBean8.setKey("shiftGroup");
|
|
|
|
|
stationKvBean8.setName("班组");
|
|
|
|
|
stationKvBean8.setValue("注塑2班");
|
|
|
|
|
stationKvBeans3.add(stationKvBean8);
|
|
|
|
|
stationKvBeans3.add(stationKvBean8);*/
|
|
|
|
|
|
|
|
|
|
resultBean.setResultObj(stationKvBeans3);
|
|
|
|
|
resultBean.setResultObj(prodShiftDataContext);
|
|
|
|
|
resultBean.setResultList(moduleContentContext);
|
|
|
|
|
return resultBean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private StationResultBean getStationResultBean1(StationRequestBean reqBean) {
|
|
|
|
|
private StationResultBean getStationResultBean(StationRequestBean reqBean, List<StationKvBean> productionStatisticsContext) {
|
|
|
|
|
StationResultBean resultBean = new StationResultBean();
|
|
|
|
|
resultBean.setBusiType(MesPcnEnumUtil.STATION_BUSI_TYPE.MODULE_CUSTOM_CONTENT.getValue());
|
|
|
|
|
resultBean.setDataType(MesPcnEnumUtil.STATION_DATA_TYPE.ECHART.getValue());
|
|
|
|
@ -75,51 +111,7 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
resultBean.setDataAttrList(packDataAttrList());
|
|
|
|
|
resultBean.setSpecialDisplayData(getStepColIndent(reqBean));
|
|
|
|
|
|
|
|
|
|
List<List<StationKvBean>> stationKvBeansList = new ArrayList<>();
|
|
|
|
|
List<StationKvBean> stationKvBeans = new ArrayList<>();
|
|
|
|
|
StationKvBean stationKvBean = new StationKvBean();
|
|
|
|
|
stationKvBean.setKey("orderNo");
|
|
|
|
|
stationKvBean.setName("工单号");
|
|
|
|
|
stationKvBean.setValue("11111");
|
|
|
|
|
stationKvBeans.add(stationKvBean);
|
|
|
|
|
|
|
|
|
|
StationKvBean stationKvBean1 = new StationKvBean();
|
|
|
|
|
stationKvBean1.setKey("partNo");
|
|
|
|
|
stationKvBean1.setName("零件号");
|
|
|
|
|
stationKvBean1.setValue("111");
|
|
|
|
|
stationKvBeans.add(stationKvBean1);
|
|
|
|
|
|
|
|
|
|
StationKvBean stationKvBean2 = new StationKvBean();
|
|
|
|
|
stationKvBean2.setKey("count");
|
|
|
|
|
stationKvBean2.setName("单数");
|
|
|
|
|
stationKvBean2.setValue("1111");
|
|
|
|
|
stationKvBeans.add(stationKvBean2);
|
|
|
|
|
|
|
|
|
|
stationKvBeansList.add(stationKvBeans);
|
|
|
|
|
List<StationKvBean> stationKvBeans1 = new ArrayList<>();
|
|
|
|
|
StationKvBean stationKvBean4 = new StationKvBean();
|
|
|
|
|
stationKvBean4.setKey("orderNo");
|
|
|
|
|
stationKvBean4.setName("工单号");
|
|
|
|
|
stationKvBean4.setValue("11111");
|
|
|
|
|
stationKvBeans1.add(stationKvBean4);
|
|
|
|
|
|
|
|
|
|
StationKvBean stationKvBean5 = new StationKvBean();
|
|
|
|
|
stationKvBean5.setKey("partNo");
|
|
|
|
|
stationKvBean5.setName("零件号");
|
|
|
|
|
stationKvBean5.setValue("111");
|
|
|
|
|
stationKvBeans1.add(stationKvBean5);
|
|
|
|
|
|
|
|
|
|
StationKvBean stationKvBean6 = new StationKvBean();
|
|
|
|
|
stationKvBean6.setKey("count");
|
|
|
|
|
stationKvBean6.setName("单数");
|
|
|
|
|
stationKvBean6.setValue("1111");
|
|
|
|
|
stationKvBeans1.add(stationKvBean6);
|
|
|
|
|
stationKvBeansList.add(stationKvBeans1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//resultBean.setResultObj(stationKvBeans3);
|
|
|
|
|
resultBean.setResultList(stationKvBeansList);
|
|
|
|
|
resultBean.setResultList(productionStatisticsContext);
|
|
|
|
|
return resultBean;
|
|
|
|
|
}
|
|
|
|
|
private List<AttrBean> packDataAttrList() {
|
|
|
|
|