|
|
@ -9,6 +9,7 @@ import cn.estsh.i3plus.ext.mes.pojo.bean.*;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.model.jx.JxCenterWorkingBoardBusiModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.model.jx.JxCenterWorkingBoardBusiModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.model.jx.JxMergeTimeSlotsModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.model.jx.JxMergeTimeSlotsModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.repository.MesShiftProdCenterRecordRepository;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.repository.MesShiftProdCenterRecordRepository;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.repository.SxWorkCellLineOffRecordRepository;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.repository.SxWorkCellTaktCollectRepository;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.repository.SxWorkCellTaktCollectRepository;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil;
|
|
|
@ -51,6 +52,8 @@ public class JxCenterWorkingBoardCenterThreeService extends JxCenterWorkingBoard
|
|
|
|
|
|
|
|
|
|
|
|
private SxWorkCellTaktCollectRepository workCellTaktCollectRepository;
|
|
|
|
private SxWorkCellTaktCollectRepository workCellTaktCollectRepository;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private SxWorkCellLineOffRecordRepository workCellLineOffRecordRepository;
|
|
|
|
|
|
|
|
|
|
|
|
private MesShiftProdCenterRecordRepository shiftProdCenterRecordRepository;
|
|
|
|
private MesShiftProdCenterRecordRepository shiftProdCenterRecordRepository;
|
|
|
|
|
|
|
|
|
|
|
|
private IBusiConfigService busiConfigService;
|
|
|
|
private IBusiConfigService busiConfigService;
|
|
|
@ -64,6 +67,7 @@ public class JxCenterWorkingBoardCenterThreeService extends JxCenterWorkingBoard
|
|
|
|
this.timeSegmentStatisticsService = (IJxTimeSegmentStatisticsService) SpringContextsUtil.getBean("jxTimeSegmentStatisticsService");
|
|
|
|
this.timeSegmentStatisticsService = (IJxTimeSegmentStatisticsService) SpringContextsUtil.getBean("jxTimeSegmentStatisticsService");
|
|
|
|
this.prodOrgExtService = (IProdOrgExtService) SpringContextsUtil.getBean("prodOrgExtService");
|
|
|
|
this.prodOrgExtService = (IProdOrgExtService) SpringContextsUtil.getBean("prodOrgExtService");
|
|
|
|
this.workCellTaktCollectRepository = (SxWorkCellTaktCollectRepository) SpringContextsUtil.getBean("sxWorkCellTaktCollectRepository");
|
|
|
|
this.workCellTaktCollectRepository = (SxWorkCellTaktCollectRepository) SpringContextsUtil.getBean("sxWorkCellTaktCollectRepository");
|
|
|
|
|
|
|
|
this.workCellLineOffRecordRepository = (SxWorkCellLineOffRecordRepository) SpringContextsUtil.getBean("sxWorkCellLineOffRecordRepository");
|
|
|
|
this.shiftProdCenterRecordRepository = (MesShiftProdCenterRecordRepository) SpringContextsUtil.getBean("mesShiftProdCenterRecordRepository");
|
|
|
|
this.shiftProdCenterRecordRepository = (MesShiftProdCenterRecordRepository) SpringContextsUtil.getBean("mesShiftProdCenterRecordRepository");
|
|
|
|
this.busiConfigService = (IBusiConfigService) SpringContextsUtil.getBean("busiConfigService");
|
|
|
|
this.busiConfigService = (IBusiConfigService) SpringContextsUtil.getBean("busiConfigService");
|
|
|
|
this.mergeTimeSlotsService = (IJxMergeTimeSlotsService) SpringContextsUtil.getBean("jxMergeTimeSlotsService");
|
|
|
|
this.mergeTimeSlotsService = (IJxMergeTimeSlotsService) SpringContextsUtil.getBean("jxMergeTimeSlotsService");
|
|
|
@ -96,13 +100,11 @@ public class JxCenterWorkingBoardCenterThreeService extends JxCenterWorkingBoard
|
|
|
|
|
|
|
|
|
|
|
|
dataMap.put("当前计划台数", getQtyStr(getCurPlanQty(curOutPutStatisticsList, curWorkOrder, workCenterExtDb, dataMap)));
|
|
|
|
dataMap.put("当前计划台数", getQtyStr(getCurPlanQty(curOutPutStatisticsList, curWorkOrder, workCenterExtDb, dataMap)));
|
|
|
|
|
|
|
|
|
|
|
|
Double completeQty = dataMap.containsKey(MesExtConstWords.COMPLET_QTY) ? (Double) dataMap.get(MesExtConstWords.COMPLET_QTY) : getOutPutStatisticsList2AmountQty(curOutPutStatisticsList);
|
|
|
|
dataMap.put("当前实绩台数", getQtyStr(dataMap.containsKey(MesExtConstWords.COMPLET_QTY) ? (Double) dataMap.get(MesExtConstWords.COMPLET_QTY) : getOutPutStatisticsList2AmountQty(curOutPutStatisticsList)));
|
|
|
|
|
|
|
|
|
|
|
|
dataMap.put("当前实绩台数", getQtyStr(completeQty));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataMap.put("小时产量", getTimeSegmentStatistics(outPutStatisticsTimeSegmentList, workCenterExtDb));
|
|
|
|
dataMap.put("小时产量", getTimeSegmentStatistics(outPutStatisticsTimeSegmentList, workCenterExtDb));
|
|
|
|
|
|
|
|
|
|
|
|
dataMap.put("工序平衡可视化", getWorkCellTaktStatistics(dataMap, workCenterExtDb, curWorkOrder, completeQty));
|
|
|
|
dataMap.put("工序平衡可视化", getWorkCellTaktStatistics(dataMap, workCenterExtDb, curWorkOrder));
|
|
|
|
|
|
|
|
|
|
|
|
return clearUselessData(dataMap);
|
|
|
|
return clearUselessData(dataMap);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -220,7 +222,7 @@ public class JxCenterWorkingBoardCenterThreeService extends JxCenterWorkingBoard
|
|
|
|
return CollectionUtils.isEmpty(outPutStatisticsTimeSegmentList) ? new Double(0) : outPutStatisticsTimeSegmentList.stream().filter(o -> null != o).mapToDouble(MesOutPutStatisticsTimeSegment::getQty).sum();
|
|
|
|
return CollectionUtils.isEmpty(outPutStatisticsTimeSegmentList) ? new Double(0) : outPutStatisticsTimeSegmentList.stream().filter(o -> null != o).mapToDouble(MesOutPutStatisticsTimeSegment::getQty).sum();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private JxCenterWorkingBoardBusiModel getWorkCellTaktStatistics(Map<String, Object> dataMap, MesWorkCenterExt workCenterExtDb, Optional<MesWorkOrder> curWorkOrder, Double completeQty) {
|
|
|
|
private JxCenterWorkingBoardBusiModel getWorkCellTaktStatistics(Map<String, Object> dataMap, MesWorkCenterExt workCenterExtDb, Optional<MesWorkOrder> curWorkOrder) {
|
|
|
|
|
|
|
|
|
|
|
|
JxCenterWorkingBoardBusiModel psData = new JxCenterWorkingBoardBusiModel().title("工序平衡可视化");
|
|
|
|
JxCenterWorkingBoardBusiModel psData = new JxCenterWorkingBoardBusiModel().title("工序平衡可视化");
|
|
|
|
|
|
|
|
|
|
|
@ -245,7 +247,7 @@ public class JxCenterWorkingBoardCenterThreeService extends JxCenterWorkingBoard
|
|
|
|
|
|
|
|
|
|
|
|
log.info("嘉兴产线运行看板 --- center03 --- curTime:{} --- lastHourTime:{} --- THREAD:{}", curTime, lastHourTime, Thread.currentThread().getName());
|
|
|
|
log.info("嘉兴产线运行看板 --- center03 --- curTime:{} --- lastHourTime:{} --- THREAD:{}", curTime, lastHourTime, Thread.currentThread().getName());
|
|
|
|
|
|
|
|
|
|
|
|
BigDecimal realTakt = getRealTakt(shiftProdCenterRecordList, completeQty, curTime, lastHourTime);
|
|
|
|
BigDecimal realTakt = getRealTakt(shiftProdCenterRecordList, workCenterExtDb, curTime, lastHourTime);
|
|
|
|
|
|
|
|
|
|
|
|
log.info("嘉兴产线运行看板 --- center03 --- realTakt:{} --- THREAD:{}", realTakt, Thread.currentThread().getName());
|
|
|
|
log.info("嘉兴产线运行看板 --- center03 --- realTakt:{} --- THREAD:{}", realTakt, Thread.currentThread().getName());
|
|
|
|
|
|
|
|
|
|
|
@ -282,6 +284,13 @@ public class JxCenterWorkingBoardCenterThreeService extends JxCenterWorkingBoard
|
|
|
|
return workCellTaktCollectRepository.findByHqlWhere(packBean);
|
|
|
|
return workCellTaktCollectRepository.findByHqlWhere(packBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Integer getWorkCellLineOffRecordCount(MesWorkCenterExt workCenterExtDb, String curTime, String lastHourTime) {
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(workCenterExtDb.getOrganizeCode());
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(workCenterExtDb.getWorkCenterCode(), MesExtConstWords.WORK_CENTER_CODE, packBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.timeBuilder(lastHourTime, curTime, MesExtConstWords.CREATE_DATE_TIME, true, true, packBean);
|
|
|
|
|
|
|
|
return workCellLineOffRecordRepository.findByHqlWhereCount(packBean);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private MesBusiConfig getLimitCfg(MesWorkCenterExt workCenterExtDb) {
|
|
|
|
private MesBusiConfig getLimitCfg(MesWorkCenterExt workCenterExtDb) {
|
|
|
|
String limitCfg4Cached = (String) execCachedCenterWorkingBoardData(workCenterExtDb.getOrganizeCode(), MesExtConstWords.ZERO_STR, MesExtConstWords.SX_WORK_CELL_TAKT_LIMIT_CFG, null);
|
|
|
|
String limitCfg4Cached = (String) execCachedCenterWorkingBoardData(workCenterExtDb.getOrganizeCode(), MesExtConstWords.ZERO_STR, MesExtConstWords.SX_WORK_CELL_TAKT_LIMIT_CFG, null);
|
|
|
|
return !StringUtils.isEmpty(limitCfg4Cached) ? JSONObject.parseObject(limitCfg4Cached, MesBusiConfig.class) : execLimitCfg(workCenterExtDb.getOrganizeCode());
|
|
|
|
return !StringUtils.isEmpty(limitCfg4Cached) ? JSONObject.parseObject(limitCfg4Cached, MesBusiConfig.class) : execLimitCfg(workCenterExtDb.getOrganizeCode());
|
|
|
@ -334,10 +343,11 @@ public class JxCenterWorkingBoardCenterThreeService extends JxCenterWorkingBoard
|
|
|
|
return shiftProdCenterRecordRepository.findByHqlWhere(packBean);
|
|
|
|
return shiftProdCenterRecordRepository.findByHqlWhere(packBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private BigDecimal getRealTakt(List<MesShiftProdCenterRecord> shiftProdCenterRecordList, Double completeQty, String curTime, String lastHourTime) {
|
|
|
|
private BigDecimal getRealTakt(List<MesShiftProdCenterRecord> shiftProdCenterRecordList, MesWorkCenterExt workCenterExtDb, String curTime, String lastHourTime) {
|
|
|
|
|
|
|
|
Integer completeQty = getWorkCellLineOffRecordCount(workCenterExtDb, curTime, lastHourTime);
|
|
|
|
log.info("嘉兴产线运行看板 --- center03 --- completeQty:{} --- THREAD:{}", completeQty, Thread.currentThread().getName());
|
|
|
|
log.info("嘉兴产线运行看板 --- center03 --- completeQty:{} --- THREAD:{}", completeQty, Thread.currentThread().getName());
|
|
|
|
if (MathOperation.compareTo(completeQty, new Double(0)) == 0) return format1RounHalfUp(new Double(0));
|
|
|
|
if (MathOperation.compareTo(completeQty, new Double(0)) == 0) return format1RounHalfUp(new Double(0));
|
|
|
|
return format1RounHalfUp(MathOperation.div(MathOperation.mul(MathOperation.sub(new Double(60), getStopTime(shiftProdCenterRecordList, curTime, lastHourTime)), new Double(60)), completeQty));
|
|
|
|
return format1RounHalfUp(MathOperation.div(MathOperation.mul(MathOperation.sub(new Double(60), getStopTime(shiftProdCenterRecordList, curTime, lastHourTime)), new Double(60)), new Double(completeQty)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Double getStopTime(List<MesShiftProdCenterRecord> shiftProdCenterRecordList, String curTime, String lastHourTime) {
|
|
|
|
private Double getStopTime(List<MesShiftProdCenterRecord> shiftProdCenterRecordList, String curTime, String lastHourTime) {
|
|
|
|