嘉兴 生产线运行看板

tags/yfai-mes-ext-v1.0
王杰 1 year ago
parent 5bcbb31f3c
commit fe6acb1cd5

@ -19,4 +19,12 @@ public interface IJxCenterWorkingBoardService {
@ApiOperation(value = "嘉兴产线运行看板", notes = "嘉兴产线运行看板")
Map<String, Object> queryCenterWorkingBoardData(Map<String, Object> dataMap);
/**
* 线
* @param dataMap
* @return 线
*/
@ApiOperation(value = "清除产线运行看板数据无用数据", notes = "清除产线运行看板数据无用数据")
default Map<String, Object> clearUselessData(Map<String, Object> dataMap) { return dataMap; }
}

@ -47,7 +47,8 @@ public class JxCenterWorkingBoardController extends MesBaseController {
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("参数缺失业务标志[flag]!")
.build();
dataMap.put(MesExtConstWords.ORGANIZE_CODE, AuthUtil.getOrganize().getOrganizeCode());
dataMap.put(MesExtConstWords.ORGANIZE_CODE, "CN33");
// dataMap.put(MesExtConstWords.ORGANIZE_CODE, AuthUtil.getOrganize().getOrganizeCode());
dataMap.put(MesExtConstWords.START_TIME, TimeTool.getNowTime(true));
return ResultBean.success("查询成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultMap(centerWorkingBoardService.queryCenterWorkingBoardData(dataMap));
} catch (ImppBusiException busExcep) {

@ -66,6 +66,13 @@ public class JxCenterWorkingBoardBusiOneService implements IJxCenterWorkingBoard
dataMap.put("公告信息", getWorkCenterNotificationBarData(workCenterExtDb));
return clearUselessData(dataMap);
}
@Override
public Map<String, Object> clearUselessData(Map<String, Object> dataMap) {
dataMap.remove(MesWorkCenterExt.class.getSimpleName());
dataMap.remove(MesShiftProdCenterRecord.class.getSimpleName());
return dataMap;
}

@ -95,6 +95,22 @@ public class JxCenterWorkingBoardBusiTwoService implements IJxCenterWorkingBoard
dataMap.put("生产计划进度", getProductionSchedule(workOrderList, outPutStatisticsList, workCenterExtDb));
return clearUselessData(dataMap);
}
@Override
public Map<String, Object> clearUselessData(Map<String, Object> dataMap) {
dataMap.remove(MesWorkCenterExt.class.getSimpleName());
dataMap.remove(MesShiftProdCenterRecord.class.getSimpleName());
dataMap.remove(MesWorkOrder.class.getSimpleName());
dataMap.remove(MesOutPutStatistics.class.getSimpleName());
dataMap.remove(MesExtConstWords.STANDARD_WORK);
dataMap.remove(MesExtConstWords.QTY);
dataMap.remove(MesExtConstWords.COMPLET_QTY);
dataMap.remove("serviceTime");
dataMap.remove("nonWorkingTime");
dataMap.remove("standardTime");
dataMap.remove("workingTime");
return dataMap;
}
@ -221,15 +237,15 @@ public class JxCenterWorkingBoardBusiTwoService implements IJxCenterWorkingBoard
Map<String, List<MesOutPutStatistics>> itemMap2OutPut = CollectionUtils.isEmpty(outPutList) ? null : outPutList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesOutPutStatistics::getWorkOrderNo));
psData.addChartData(partNo, statisticsPlanQty(orderList, itemMap2OutPut), getOutPutStatisticsList2AmountQty(outPutList), !CollectionUtils.isEmpty(psData.getChartDataList()) ? "#ffffff" : "#00ff00");
psData.addChartData(partNo, statisticsPlanQty(orderList, itemMap2OutPut, workCenterExtDb), getOutPutStatisticsList2AmountQty(outPutList), !CollectionUtils.isEmpty(psData.getChartDataList()) ? "#ffffff" : "#00ff00");
}
return psData;
}
private Double statisticsPlanQty(List<MesWorkOrder> orderList, Map<String, List<MesOutPutStatistics>> itemMap2OutPut) {
private Double statisticsPlanQty(List<MesWorkOrder> orderList, Map<String, List<MesOutPutStatistics>> itemMap2OutPut, MesWorkCenterExt workCenterExtDb) {
return CollectionUtils.isEmpty(orderList) ? new Double(0) :
orderList.stream().filter(o -> null != o).mapToDouble(o -> MathOperation.add(MathOperation.sub(o.getQty(), o.getCompleteQty()), getOutPutQty(o.getOrderNo(), itemMap2OutPut))).sum();
orderList.stream().filter(o -> null != o).mapToDouble(o -> o.getStartTime().contains(workCenterExtDb.getWorkTime()) ? o.getQty() : MathOperation.add(MathOperation.sub(o.getQty(), o.getCompleteQty()), getOutPutQty(o.getOrderNo(), itemMap2OutPut))).sum();
}
private Double getOutPutQty(String workOrderNo, Map<String, List<MesOutPutStatistics>> itemMap2OutPut) {

Loading…
Cancel
Save