|
@@ -119,13 +119,6 @@ public class DailyBoardServiceImpl implements DailyBoardService {
|
|
|
// 查询佰卓和实业的事业部id
|
|
|
List<Department> departmentList = departmentService.list(q -> q.like(Department::getName, "实业").or().eq(Department::getName, "佰卓").select(BaseIdPo::getId));
|
|
|
List<Long> departmentIds = departmentList.stream().map(BaseIdPo::getId).collect(Collectors.toList());
|
|
|
- // 查询今日订单
|
|
|
- List<OrderInfo> orderInfoList = orderService.list(q -> q.eq(OrderInfo::getSource, 2)
|
|
|
- .between(OrderInfo::getWlnCreateTime, beginDate, endDate)
|
|
|
- .in(OrderInfo::getDepartmentId, departmentIds));
|
|
|
- if (ObjectUtil.isEmpty(orderInfoList)) {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
// 查询今日生成完成任务
|
|
|
Map<Long, List<ProductionTask>> taskMap = productionTaskService.mapKGroup(ProductionTask::getOrderId, q -> q.between(ProductionTask::getCompleteTime, beginDate, endDate));
|
|
|
// 查询今日出库单出库数据
|
|
@@ -133,8 +126,28 @@ public class DailyBoardServiceImpl implements DailyBoardService {
|
|
|
q -> q.between(OutboundOrder::getOutboundTime, beginDate, endDate)
|
|
|
.groupBy(Arrays.asList(OutboundOrder::getCode, OutboundOrder::getOrderWlnCode, OutboundOrder::getSkuSpecCode, OutboundOrder::getStorageCode, OutboundOrder::getQuantity)));
|
|
|
|
|
|
+ Set<String> orderWlnCodeSet = outboundOrderMap.keySet();
|
|
|
+ // 订单id
|
|
|
+ Set<Long> orderIds = new HashSet<>(taskMap.keySet());
|
|
|
+ if (ObjectUtil.isNotEmpty(orderWlnCodeSet)) {
|
|
|
+ // 出库单订单
|
|
|
+ List<OrderInfo> outboundOrders = orderService.list(q -> q.in(OrderInfo::getWlnCode, orderWlnCodeSet).select(BaseIdPo::getId));
|
|
|
+ List<Long> outboundOrderIds = outboundOrders.stream().map(BaseIdPo::getId).collect(Collectors.toList());
|
|
|
+ orderIds.addAll(outboundOrderIds);
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isEmpty(orderIds)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询今日订单
|
|
|
+ List<OrderInfo> orderInfoList = orderService.list(q -> q.eq(OrderInfo::getSource, 2)
|
|
|
+ .in(BaseIdPo::getId, orderIds)
|
|
|
+ .in(OrderInfo::getDepartmentId, departmentIds));
|
|
|
+ if (ObjectUtil.isEmpty(orderInfoList)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
// 获取今日订单sku列表
|
|
|
- List<Long> orderIds = orderInfoList.stream().map(BaseIdPo::getId).collect(Collectors.toList());
|
|
|
List<OrderSku> orderSkuList = orderSkuService.list(q -> q.in(OrderSku::getOrderId, orderIds));
|
|
|
Map<Long, List<OrderSku>> map = orderSkuList.stream().collect(Collectors.groupingBy(OrderSku::getOrderId));
|
|
|
List<Long> skuSpecIds = orderSkuList.stream().map(OrderSku::getSkuSpecId).collect(Collectors.toList());
|