Parcourir la source

原矿报表按照山下门卫时间为准

donglang il y a 3 heures
Parent
commit
46b5a7f5ad

+ 11 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/repository/KwtGatekeeperWaybillOrderRepository.java

@@ -59,19 +59,29 @@ public class KwtGatekeeperWaybillOrderRepository extends ServiceImpl<KwtGatekeep
                         .eq(KwtGatekeeperWaybillOrder::getEntId, entId)
                         .in(KwtGatekeeperWaybillOrder::getLOrderId, lOrderIds)
                         .eq(KwtGatekeeperWaybillOrder::getType, type)
+                        .eq(KwtGatekeeperWaybillOrder::getStatus, 20)
                         .ge(KwtGatekeeperWaybillOrder::getLeaveTime, startOfDay)
                         .le(KwtGatekeeperWaybillOrder::getLeaveTime, endOfDay)
                         .orderByDesc(KwtGatekeeperWaybillOrder::getId));
     }
 
-    public List<KwtGatekeeperWaybillOrder> queryGatekeeperByWaybillOrders(List<Long> entIds, Set<Long> lOrderIds, Date startOfDay, Date endOfDay) {
+    public List<KwtGatekeeperWaybillOrder> queryGatekeeperByWaybillOrders(List<Long> entIds, Set<Long> lOrderIds, Integer type, Date startOfDay, Date endOfDay) {
         return list(
                 Wrappers.<KwtGatekeeperWaybillOrder>lambdaQuery()
                         .in(KwtGatekeeperWaybillOrder::getEntId, entIds)
                         .in(KwtGatekeeperWaybillOrder::getLOrderId, lOrderIds)
+                        .eq(KwtGatekeeperWaybillOrder::getType, type)
+                        .eq(KwtGatekeeperWaybillOrder::getStatus, 20)
                         .ge(KwtGatekeeperWaybillOrder::getLeaveTime, startOfDay)
                         .le(KwtGatekeeperWaybillOrder::getLeaveTime, endOfDay)
                         .orderByDesc(KwtGatekeeperWaybillOrder::getId));
     }
 
+    public List<KwtGatekeeperWaybillOrder> queryGatekeeperWaybillOrderByWOrderIds(Set<Long> wOrderIds) {
+        return list(
+                Wrappers.<KwtGatekeeperWaybillOrder>lambdaQuery()
+                        .in(KwtGatekeeperWaybillOrder::getWOrderId, wOrderIds)
+                        .orderByDesc(KwtGatekeeperWaybillOrder::getId));
+    }
+
 }

+ 7 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/app/WaybillOrderService.java

@@ -2361,12 +2361,15 @@ public class WaybillOrderService {
         Date startOfDay = DateUtils.getStartOfDay(param.getOneDayTime(), DateUtils.DATE_TIME_PATTERN);
         //当天结算时间
         Date endOfDay = DateUtils.getEndOfDay(param.getOneDayTime());
-        List<KwtGatekeeperWaybillOrder> gatekeepers = gatekeeperWaybillOrderRepository.queryGatekeeperByWaybillOrders(mockEntIds, lOrderIds, startOfDay, endOfDay);
-        if (CollectionUtils.isEmpty(gatekeepers)) {
+        List<KwtGatekeeperWaybillOrder> gatekeepeSeconds = gatekeeperWaybillOrderRepository.queryGatekeeperByWaybillOrders(mockEntIds, lOrderIds, Global.ADDRESS_UNLOAD, startOfDay, endOfDay);
+        if (CollectionUtils.isEmpty(gatekeepeSeconds)) {
             return Collections.emptyList();
         }
-        log.info("门卫,size:{}", gatekeepers.size());
-        Set<Long> gateWorderIds = gatekeepers.stream().map(KwtGatekeeperWaybillOrder::getLOrderId).collect(Collectors.toSet());
+        log.info("山下门卫,size:{}", gatekeepeSeconds.size());
+        Set<Long> gateWorderIds = gatekeepeSeconds.stream().map(KwtGatekeeperWaybillOrder::getLOrderId).collect(Collectors.toSet());
+
+        List<KwtGatekeeperWaybillOrder> gatekeepers = gatekeeperWaybillOrderRepository.queryGatekeeperWaybillOrderByWOrderIds(gateWorderIds);
+        log.info("山下和山下门卫,size:{}", gatekeepers.size());
         Map<String, KwtGatekeeperWaybillOrder> gatekeeperMap = gatekeepers.stream().collect(Collectors
                 .toMap(gate -> gate.getWOrderId() + "-" + gate.getType(), Function.identity(), (x, y) -> x));