|
|
@ -8,22 +8,28 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
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.serviceimpl.fsm.BaseModuleService;
|
|
|
|
import cn.estsh.i3plus.mes.pcn.util.StationKvBeanUtil;
|
|
|
|
import cn.estsh.i3plus.mes.pcn.util.StationKvBeanUtil;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
|
|
|
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.MesStateMachineStatus;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesStateMachineStatus;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.AttrBean;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.AttrBean;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationKvBean;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationKvBean;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesFileRepository;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.PojoAttrUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.PojoAttrUtil;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.google.common.base.Objects;
|
|
|
|
import com.google.common.base.Objects;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -45,7 +51,8 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService;
|
|
|
|
private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private MesFileRepository mesFileRepository;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void init(StationRequestBean reqBean) {
|
|
|
|
public void init(StationRequestBean reqBean) {
|
|
|
@ -69,13 +76,12 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
this.sendMessage(reqBean, resultBean);
|
|
|
|
this.sendMessage(reqBean, resultBean);
|
|
|
|
|
|
|
|
|
|
|
|
// 整合班次加工数量
|
|
|
|
// 整合班次加工数量
|
|
|
|
List<StationKvBean> shiftCountContext = new ArrayList<>();
|
|
|
|
|
|
|
|
if (mesWorkCell.getIsShowMsg() != null && Objects.equal(MesExtEnumUtil.WORK_FILE_TYPE.HISTOGRAM.getValue(),mesWorkCell.getIsShowMsg())) {
|
|
|
|
if (mesWorkCell.getIsShowMsg() != null && Objects.equal(MesExtEnumUtil.WORK_FILE_TYPE.HISTOGRAM.getValue(),mesWorkCell.getIsShowMsg())) {
|
|
|
|
List<StationKvBean> productionStatisticsContext = mesProductionDispatchContextStepService.getProductionStatisticsContext(reqBean);
|
|
|
|
List<StationKvBean> productionStatisticsContext = mesProductionDispatchContextStepService.getProductionStatisticsContext(reqBean);
|
|
|
|
if (CollectionUtils.isEmpty(productionStatisticsContext)) {
|
|
|
|
if (CollectionUtils.isEmpty(productionStatisticsContext)) {
|
|
|
|
StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(), new StationKvBean(new StringJoiner(MesPcnExtConstWords.AND).add(mesProdShiftKvBean.getShiftGroup()).add(mesProdShiftKvBean.getShiftCode()).toString(), "加工次数", "0"));
|
|
|
|
StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(), new StationKvBean(new StringJoiner(MesPcnExtConstWords.AND).add(mesProdShiftKvBean.getShiftGroup()).add(mesProdShiftKvBean.getShiftCode()).toString(), "加工次数", "0"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
StationResultBean shiftCountBean = getStationResultBean(reqBean, productionStatisticsContext);
|
|
|
|
StationResultBean shiftCountBean = getStationResultBean(reqBean, productionStatisticsContext,mesWorkCell);
|
|
|
|
this.sendMessage(reqBean, shiftCountBean);
|
|
|
|
this.sendMessage(reqBean, shiftCountBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -96,16 +102,38 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
return resultBean;
|
|
|
|
return resultBean;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private StationResultBean getStationResultBean(StationRequestBean reqBean, List<StationKvBean> productionStatisticsContext) {
|
|
|
|
private StationResultBean getStationResultBean(StationRequestBean reqBean, List<StationKvBean> productionStatisticsContext, MesWorkCell mesWorkCell) {
|
|
|
|
StationResultBean resultBean = new StationResultBean();
|
|
|
|
StationResultBean resultBean = new StationResultBean();
|
|
|
|
resultBean.setBusiType(MesPcnEnumUtil.STATION_BUSI_TYPE.MODULE_CUSTOM_CONTENT.getValue());
|
|
|
|
resultBean.setBusiType(MesPcnEnumUtil.STATION_BUSI_TYPE.MODULE_CUSTOM_CONTENT.getValue());
|
|
|
|
resultBean.setDataType(MesPcnEnumUtil.STATION_DATA_TYPE.ECHART.getValue());
|
|
|
|
String dataType = MesPcnEnumUtil.STATION_DATA_TYPE.ECHART.getValue();
|
|
|
|
resultBean.setCustomPageName(MesPcnExtConstWords.CUSTOM_PAGE_NAME_DEFAULT);
|
|
|
|
JSONObject reqJson = new JSONObject();
|
|
|
|
resultBean.setDataAttrList(packDataAttrList());
|
|
|
|
String url = "";
|
|
|
|
resultBean.setSpecialDisplayData(getStepColIndent(reqBean));
|
|
|
|
if (!StringUtils.isEmpty(mesWorkCell.getFileId())) {
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(Long.parseLong(mesWorkCell.getFileId()), "id", packBean);
|
|
|
|
|
|
|
|
MesFile mesFile = mesFileRepository.getByProperty(packBean);
|
|
|
|
|
|
|
|
url = mesFile.getFileUrl();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Objects.equal(MesExtEnumUtil.WORK_FILE_TYPE.HISTOGRAM.getValue(), mesWorkCell.getIsShowMsg())) {
|
|
|
|
|
|
|
|
dataType = MesPcnEnumUtil.STATION_DATA_TYPE.ECHART.getValue();
|
|
|
|
|
|
|
|
} else if (Objects.equal(MesExtEnumUtil.WORK_FILE_TYPE.PROD_VIDEO.getValue(), mesWorkCell.getIsShowMsg())) {
|
|
|
|
|
|
|
|
dataType = MesPcnEnumUtil.STATION_DATA_TYPE.VIDEO.getValue();
|
|
|
|
|
|
|
|
reqJson.put("url", url);
|
|
|
|
|
|
|
|
resultBean.setResultObj(reqJson);
|
|
|
|
|
|
|
|
} else if (Objects.equal(MesExtEnumUtil.WORK_FILE_TYPE.WORK_CELL_PICTURE.getValue(), mesWorkCell.getIsShowMsg())) {
|
|
|
|
|
|
|
|
dataType = MesPcnEnumUtil.STATION_DATA_TYPE.IMAGE.getValue();
|
|
|
|
|
|
|
|
reqJson.put("url", url);
|
|
|
|
|
|
|
|
resultBean.setResultObj(reqJson);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
dataType = MesPcnEnumUtil.STATION_DATA_TYPE.TEXT.getValue();
|
|
|
|
|
|
|
|
resultBean.setResultList(productionStatisticsContext);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resultBean.setDataType(dataType);
|
|
|
|
|
|
|
|
resultBean.setCustomPageName(MesPcnExtConstWords.CUSTOM_PAGE_NAME_WORK_CELL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resultBean.setResultList(productionStatisticsContext);
|
|
|
|
|
|
|
|
return resultBean;
|
|
|
|
return resultBean;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private List<AttrBean> packDataAttrList() {
|
|
|
|
private List<AttrBean> packDataAttrList() {
|
|
|
|