Prechádzať zdrojové kódy

运单分页列表返回门卫订单信息

donglang 8 hodín pred
rodič
commit
9accaeec1f

+ 7 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/param/WaybillOrderResp.java

@@ -179,4 +179,11 @@ public class WaybillOrderResp implements Serializable {
     @Schema(description = "毛重")
     private BigDecimal grossAmount;
 
+    /**
+     * 门卫订单主键id
+     */
+    @Schema(description = "门卫订单主键id")
+    private Long gatekeeperId;
+
+
 }

+ 0 - 5
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/execlVo/WaybillOrderReportRespExcel2VO.java

@@ -84,10 +84,5 @@ public class WaybillOrderReportRespExcel2VO implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date leaveTime;
 
-    /**
-     * 卸货联系人
-     */
-    @ExcelProperty(value = "联系人")
-    private String unloadingPerson;
 
 }

+ 25 - 6
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillOrderV1Service.java

@@ -153,6 +153,7 @@ public class KwtWaybillOrderV1Service {
     private final KwtWaybillOrderTicketRepository kwtWaybillOrderTicketRepository;
     private final KwtWaybillOrderNodeRepository kwtWaybillOrderNodeRepository;
     private final VehicleTraceClient vehicleTraceClient;
+    private final KwtGatekeeperWaybillOrderRepository gatekeeperWaybillOrderRepository;
 
     @Resource
     private StreamBridge streamBridge;
@@ -3216,10 +3217,22 @@ public class KwtWaybillOrderV1Service {
                 .orElse(List.of()).stream()
                 .collect(Collectors.toMap(x->x.getContractId()+"-"+x.getGoodsId(), Function.identity(), (k1, k2) -> k1));
 
+        //查询门卫订单
+        log.debug("开始查询门卫订单");
+        Map<Long, KwtGatekeeperWaybillOrder> gatekeeperMap = new HashMap<>();
+                Set<Long> wOrderId = records.stream().map(KwtWaybillOrderSubtask::getWOrderId).collect(Collectors.toSet());
+        List<KwtGatekeeperWaybillOrder> gatekeeperList = gatekeeperWaybillOrderRepository.queryGatekeeperWaybillOrderByWOrderIds(wOrderId);
+
+        if (CollectionUtils.isNotEmpty(gatekeeperList)) {
+            gatekeeperMap = gatekeeperList.stream()
+                    .collect(Collectors.toMap(KwtGatekeeperWaybillOrder::getWOrderId,
+                            Function.identity(), (x, y) -> y));
+        }
+
         // 转换为响应对象
         log.debug("开始转换为响应对象");
         List<WaybillOrderResp> resps = convertToWaybillOrderRespList(
-                records, orderData, dictValueAndDictResDtoMap,logisticsOrderMap, tradeOrderContractVoMap,orderContracGoodstoMap);
+                records, orderData, dictValueAndDictResDtoMap,logisticsOrderMap, tradeOrderContractVoMap,orderContracGoodstoMap, gatekeeperMap);
         log.info("转换完成,响应对象数量: {}", resps.size());
 
         return PageDataResult.of(page, resps);
@@ -3461,10 +3474,11 @@ public class KwtWaybillOrderV1Service {
             Map<String, Map<String, String>> dictValueAndDictResDtoMap,
             Map<Long, KwtLogisticsOrder> logisticsOrderMap,
             Map<Long, TradeOrderContractVo> tradeOrderContractVoMap,
-            Map<String, TradeContractGoodsDto> orderContracGoodstoMap) {
+            Map<String, TradeContractGoodsDto> orderContracGoodstoMap,
+            Map<Long, KwtGatekeeperWaybillOrder> gatekeeperMap) {
 
         return records.stream()
-                .map(record -> buildWaybillOrderResp(record, orderData, dictValueAndDictResDtoMap,logisticsOrderMap, tradeOrderContractVoMap,orderContracGoodstoMap))
+                .map(record -> buildWaybillOrderResp(record, orderData, dictValueAndDictResDtoMap,logisticsOrderMap, tradeOrderContractVoMap,orderContracGoodstoMap, gatekeeperMap))
                 .collect(Collectors.toList());
     }
 
@@ -3477,7 +3491,8 @@ public class KwtWaybillOrderV1Service {
             Map<String, Map<String, String>> dictValueAndDictResDtoMap,
             Map<Long, KwtLogisticsOrder> logisticsOrderMap,
             Map<Long, TradeOrderContractVo> tradeOrderContractVoMap,
-            Map<String, TradeContractGoodsDto> orderContracGoodstoMap) {
+            Map<String, TradeContractGoodsDto> orderContracGoodstoMap,
+            Map<Long, KwtGatekeeperWaybillOrder> gatekeeperMap) {
 
         return getWaybillOrderResp(
                 record,
@@ -3494,7 +3509,8 @@ public class KwtWaybillOrderV1Service {
                 orderData.getTicketMap(),
                 logisticsOrderMap,
                 tradeOrderContractVoMap,
-                orderContracGoodstoMap);
+                orderContracGoodstoMap,
+                gatekeeperMap);
     }
 
     public WaybillOrderSaleVo saleSum() {
@@ -4138,7 +4154,8 @@ public class KwtWaybillOrderV1Service {
                                                         Map<String, KwtWaybillOrderTicket> ticketMap,
                                                         Map<Long, KwtLogisticsOrder> logisticsOrderMap,
                                                         Map<Long, TradeOrderContractVo> tradeOrderContractVoMap,
-                                                        Map<String, TradeContractGoodsDto> orderContracGoodstoMap) {
+                                                        Map<String, TradeContractGoodsDto> orderContracGoodstoMap,
+                                                        Map<Long, KwtGatekeeperWaybillOrder> gatekeeperMap) {
         WaybillOrderResp waybillOrderResp = new WaybillOrderResp();
         KwtWaybillOrder billOrder = finalWaybillOrderIdAndBillOrderMap.getOrDefault(record.getWOrderId(),
                 new KwtWaybillOrder());
@@ -4257,6 +4274,8 @@ public class KwtWaybillOrderV1Service {
             }
         }
 
+        KwtGatekeeperWaybillOrder gatekeeper = gatekeeperMap.getOrDefault(billOrder.getId(), new KwtGatekeeperWaybillOrder());
+        waybillOrderResp.setGatekeeperId(gatekeeper.getId());
 
         return waybillOrderResp;
     }