|
|
|
@ -4,6 +4,7 @@ import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesProdShiftRecordService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionCustomContextStepService;
|
|
|
|
|
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.api.busi.IMesWorkOrderExtService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdShiftContext;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPartContext;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
|
|
|
@ -15,10 +16,7 @@ import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesFile;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdShiftRecord;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesStateMachineStatus;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.AttrBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationKvBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
|
|
@ -40,6 +38,7 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.StringJoiner;
|
|
|
|
|
import java.util.function.BinaryOperator;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description : 展示组件:非排序生产
|
|
|
|
@ -62,6 +61,9 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
private IMesProdShiftRecordService mesProdShiftRecordService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesWorkOrderExtService workOrderExtService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesFileRepository mesFileRepository;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -93,7 +95,7 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
productionStatisticsContext = StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(), new StationKvBean(new StringJoiner(MesPcnExtConstWords.AND).add(mesProdShiftKvBean.getShiftGroup()).add(mesProdShiftKvBean.getShiftCode()).toString(), "加工数", "0"),
|
|
|
|
|
new StationKvBean("color", "颜色", MesExtEnumUtil.COLOR.BLACK.getValue()));
|
|
|
|
|
}
|
|
|
|
|
StationResultBean shiftCountBean = getStationResultBean(reqBean, productionStatisticsContext,mesWorkCell);
|
|
|
|
|
StationResultBean shiftCountBean = getStationResultBean(reqBean, productionStatisticsContext,mesWorkCell, mesProdShiftKvBean);
|
|
|
|
|
this.sendMessage(reqBean, shiftCountBean);
|
|
|
|
|
|
|
|
|
|
//验证工位是否锁定
|
|
|
|
@ -143,7 +145,7 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
|
|
|
|
|
return attrBeanList;
|
|
|
|
|
}
|
|
|
|
|
private StationResultBean getStationResultBean(StationRequestBean reqBean, List<StationKvBean> productionStatisticsContext, MesWorkCell mesWorkCell) {
|
|
|
|
|
private StationResultBean getStationResultBean(StationRequestBean reqBean, List<StationKvBean> productionStatisticsContext, MesWorkCell mesWorkCell, MesProdShiftContext mesProdShiftKvBean) {
|
|
|
|
|
StationResultBean resultBean = new StationResultBean();
|
|
|
|
|
resultBean.setBusiType(MesPcnEnumUtil.STATION_BUSI_TYPE.MODULE_CUSTOM_CONTENT.getValue());
|
|
|
|
|
String dataType = MesPcnEnumUtil.STATION_DATA_TYPE.ECHART.getValue();
|
|
|
|
@ -164,11 +166,21 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equal(MesExtEnumUtil.WORK_FILE_TYPE.HISTOGRAM.getValue(), mesWorkCell.getIsShowMsg())) {
|
|
|
|
|
dataType = MesPcnEnumUtil.STATION_DATA_TYPE.ECHART.getValue();
|
|
|
|
|
List<MesWorkOrder> workOrderList = workOrderExtService.getWorkOrderListByShiftCode(reqBean.getOrganizeCode(), mesWorkCell.getWorkCenterCode(), mesProdShiftKvBean.getShiftCode());
|
|
|
|
|
if (CollectionUtils.isEmpty(workOrderList)) {
|
|
|
|
|
StationKvBeanUtil.addStationKvBeanList(orderQtyKvBeans, new ArrayList<>(),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.QTY, "工单计划数", 0 + ""),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.COMPLATED_QTY, "工单完成数", 0 + ""));
|
|
|
|
|
} else {
|
|
|
|
|
double qty = workOrderList.stream().map(MesWorkOrder::getQty).reduce((a, b) -> a + b).get();
|
|
|
|
|
double complateQty = workOrderList.stream().map(MesWorkOrder::getCompleteQty).reduce((a, b) -> a + b).get();
|
|
|
|
|
|
|
|
|
|
StationKvBeanUtil.addStationKvBeanList(orderQtyKvBeans, new ArrayList<>(),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.QTY, "工单计划数", qty + ""),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.COMPLATED_QTY, "工单完成数", complateQty + ""));
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(productionPartContextList)) {
|
|
|
|
|
productionPartContextList.forEach(o -> StationKvBeanUtil.addStationKvBeanList(orderQtyKvBeans, new ArrayList<>(),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.WORK_ORDER_NO, "工单号", o.getWorkOrderNo() + ""),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.QTY, "工单计划数", o.getQty() + ""),
|
|
|
|
|
new StationKvBean(MesPcnExtConstWords.COMPLATED_QTY, "工单完成数", o.getCompleteQty() + "")));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
resultBean.setResultList(orderQtyKvBeans);
|
|
|
|
|