opt:每周出入库的数量趋势默认每天为0

This commit is contained in:
2024-11-08 17:13:29 +08:00
parent 55ac6175f6
commit 70e3c093a7

View File

@@ -260,25 +260,23 @@ public class CockpitServiceImpl implements CockpitService {
List<Map<String, Object>> tp_in_default = new ArrayList<>();
List<Map<String, Object>> tp_out_default = new ArrayList<>();
List<TaskInfo> result = cockpitMapper.getTaskCountsByDays();
if (ObjectUtil.isNotEmpty(result)) {
//料箱库入库
List<TaskInfo> stockList1 = result.stream()
.filter(r -> Integer.parseInt(r.getTask_type()) <= 14 && "FStockId".equals(r.getStor_code()))
.collect(Collectors.toList());
//料箱库出库
List<TaskInfo> stockList2 = result.stream()
.filter(r -> Integer.parseInt(r.getTask_type()) >= 20 && Integer.parseInt(r.getTask_type()) <= 25 && "FStockId".equals(r.getStor_code()))
.collect(Collectors.toList());
//托盘库入库
List<TaskInfo> stockList3 = result.stream().filter(r -> "30".equals(r.getTask_type()) && "FStockPallet".equals(r.getStor_code())).collect(Collectors.toList());
//托盘库出库
List<TaskInfo> stockList4 = result.stream().filter(r -> "40".equals(r.getTask_type()) && "FStockPallet".equals(r.getStor_code())).collect(Collectors.toList());
//计算每天的数量
getWeekWorkStatistics(stockList1, lx_in_default, 7);
getWeekWorkStatistics(stockList2, lx_out_default, 7);
getWeekWorkStatistics(stockList3, tp_in_default, 7);
getWeekWorkStatistics(stockList4, tp_out_default, 7);
}
//料箱库入库
List<TaskInfo> stockList1 = result.stream()
.filter(r -> Integer.parseInt(r.getTask_type()) <= 14 && "FStockId".equals(r.getStor_code()))
.collect(Collectors.toList());
//料箱库出库
List<TaskInfo> stockList2 = result.stream()
.filter(r -> Integer.parseInt(r.getTask_type()) >= 20 && Integer.parseInt(r.getTask_type()) <= 25 && "FStockId".equals(r.getStor_code()))
.collect(Collectors.toList());
//托盘库入库
List<TaskInfo> stockList3 = result.stream().filter(r -> "30".equals(r.getTask_type()) && "FStockPallet".equals(r.getStor_code())).collect(Collectors.toList());
//托盘库出库
List<TaskInfo> stockList4 = result.stream().filter(r -> "40".equals(r.getTask_type()) && "FStockPallet".equals(r.getStor_code())).collect(Collectors.toList());
//计算每天的数量
getWeekWorkStatistics(stockList1, lx_in_default, 7);
getWeekWorkStatistics(stockList2, lx_out_default, 7);
getWeekWorkStatistics(stockList3, tp_in_default, 7);
getWeekWorkStatistics(stockList4, tp_out_default, 7);
jsonObject.put("lx_in_week", lx_in_default);
jsonObject.put("lx_out_week", lx_out_default);
jsonObject.put("tp_in_week", tp_in_default);