Bläddra i källkod

提交全图监控

chenxiaofei 6 månader sedan
förälder
incheckning
bc5ed91fdb
17 ändrade filer med 931 tillägg och 44 borttagningar
  1. 5 2
      sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/feign/VehicleTraceClient.java
  2. 2 0
      sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/model/dto/VehicleReturnData.java
  3. 3 14
      sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/model/vo/VehicleTraceResponse.java
  4. 7 2
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/operateService/KwcContractLogisticsService.java
  5. 4 4
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java
  6. 27 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/KwfTruckTraceController.java
  7. 47 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/MapVehicleQueryReq.java
  8. 32 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/TruckSelectReq.java
  9. 81 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/MapVehicleVo.java
  10. 41 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/TruckSelectVo.java
  11. 9 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/repository/KwtLogisticsOrderGoodsRepository.java
  12. 7 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/repository/KwtLogisticsOrderRepository.java
  13. 9 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/repository/KwtLogisticsOrderUnitRepository.java
  14. 46 3
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/repository/KwtWaybillOrderRepository.java
  15. 2 2
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillOrderV1Service.java
  16. 457 16
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/kwfTruckTraceService.java
  17. 152 0
      sql/2025/11/30/2025_11_30_cxf_creat.sql

+ 5 - 2
sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/feign/VehicleTraceClient.java

@@ -2,11 +2,14 @@ package com.sckw.transport.api.feign;
 
 import com.sckw.core.web.response.BaseResult;
 import com.sckw.transport.api.model.dto.VehicleDataDTO;
+import com.sckw.transport.api.model.dto.VehicleReturnData;
 import com.sckw.transport.api.model.vo.VehicleTraceResponse;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import java.util.List;
+
 /**
  * 车辆轨迹服务 Feign 客户端
  * 调用数据中台的车辆轨迹接口
@@ -27,7 +30,7 @@ public interface VehicleTraceClient {
      * @return 车辆位置信息
      */
     @PostMapping("/queryRealTimeLocation")
-    BaseResult<VehicleTraceResponse> queryRealTimeLocation(@RequestBody VehicleDataDTO vehicleDataDTO);
+    BaseResult<VehicleReturnData> queryRealTimeLocation(@RequestBody VehicleDataDTO vehicleDataDTO);
 
     /**
      * 查询车辆轨迹列表
@@ -35,7 +38,7 @@ public interface VehicleTraceClient {
      * @return 车辆轨迹列表
      */
     @PostMapping("/queryVehicleDataList")
-    BaseResult<VehicleTraceResponse> queryVehicleDataList(@RequestBody VehicleDataDTO vehicleDataDTO);
+    BaseResult<List<VehicleReturnData>> queryVehicleDataList(@RequestBody VehicleDataDTO vehicleDataDTO);
 
     /**
      * 上报车辆轨迹

+ 2 - 0
sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/model/dto/VehicleReturnData.java

@@ -2,6 +2,7 @@ package com.sckw.transport.api.model.dto;
 
 import lombok.Data;
 
+import java.io.Serial;
 import java.io.Serializable;
 import java.time.LocalDateTime;
 
@@ -13,6 +14,7 @@ import java.time.LocalDateTime;
 @Data
 public class VehicleReturnData implements Serializable {
 
+    @Serial
     private static final long serialVersionUID = 1L;
 
     /**

+ 3 - 14
sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/model/vo/VehicleTraceResponse.java

@@ -3,6 +3,7 @@ package com.sckw.transport.api.model.vo;
 import com.sckw.transport.api.model.dto.VehicleReturnData;
 import lombok.Data;
 
+import java.io.Serial;
 import java.io.Serializable;
 import java.util.List;
 
@@ -14,6 +15,7 @@ import java.util.List;
 @Data
 public class VehicleTraceResponse implements Serializable {
 
+    @Serial
     private static final long serialVersionUID = 1L;
 
     /**
@@ -25,18 +27,5 @@ public class VehicleTraceResponse implements Serializable {
      * 车辆轨迹列表数据
      */
     private List<VehicleReturnData> dataList;
-    
-    /**
-     * 兼容方法:获取列表数据
-     * 如果 dataList 不为空则返回 dataList,否则返回包含 data 的列表
-     */
-    public List<VehicleReturnData> getDataList() {
-        if (dataList != null) {
-            return dataList;
-        }
-        if (data != null) {
-            return List.of(data);
-        }
-        return List.of();
-    }
+
 }

+ 7 - 2
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/operateService/KwcContractLogisticsService.java

@@ -1056,8 +1056,13 @@ public class KwcContractLogisticsService {
 
     public PageDataResult<QueryLogisticListResp> queryLogisticsContractListByPage(QueryLogisticListReq req) {
         log.info("分页查询物流合同参数:{}", JSON.toJSONString( req));
-        Long entId = org.apache.commons.lang3.StringUtils.isNotBlank(req.getEntId()) ?  Long.valueOf(req.getEntId()) :
-                null;
+        Long entId;
+        if (org.apache.commons.lang3.StringUtils.isNotBlank(req.getEntId())) {
+            entId = Long.valueOf(req.getEntId());
+        }else{
+            entId = LoginUserHolder.getEntId();
+        }
+
         List<Long> entIdList = Lists.newArrayList();
         if (org.apache.commons.lang3.StringUtils.isNotBlank(req.getConsignCompanyId())){
             entIdList.add(Long.valueOf(req.getConsignCompanyId()));

+ 4 - 4
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java

@@ -1629,14 +1629,14 @@ public class KwfTruckService {
         
         try {
             // 使用 Feign 调用查询实时位置
-            BaseResult<VehicleTraceResponse> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
+            BaseResult<VehicleReturnData> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
             
             if (result == null || result.getCode() != HttpStatus.SUCCESS_CODE || result.getData() == null) {
                 log.warn("查询实时轨迹返回空数据, 运单号: {}", odrderNo);
                 return null;
             }
             
-            return result.getData().getData();
+            return result.getData();
         } catch (Exception e) {
             log.error("查询任务轨迹异常, 运单号: {}", odrderNo, e);
             return null;
@@ -1649,14 +1649,14 @@ public class KwfTruckService {
         
         try {
             // 使用 Feign 调用查询实时位置
-            BaseResult<VehicleTraceResponse> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
+            BaseResult<VehicleReturnData> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
             
             if (result == null || result.getCode() != HttpStatus.SUCCESS_CODE || result.getData() == null) {
                 log.warn("查询实时轨迹返回空数据, 车牌号: {}", truckId);
                 return null;
             }
             
-            return result.getData().getData();
+            return result.getData();
         } catch (Exception e) {
             log.error("查询任务轨迹异常, 车牌号: {}", truckId, e);
             return null;

+ 27 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/KwfTruckTraceController.java

@@ -8,6 +8,10 @@ import com.sckw.transport.model.param.TruckInfoReq;
 import com.sckw.transport.model.vo.CurrentTaskTraceReqVo;
 import com.sckw.transport.model.vo.KwfTruckTraceReplayVo;
 import com.sckw.transport.model.vo.TruckInfoVo;
+import com.sckw.transport.model.vo.TruckSelectVo;
+import com.sckw.transport.model.dto.TruckSelectReq;
+import com.sckw.transport.model.dto.MapVehicleQueryReq;
+import com.sckw.transport.model.vo.MapVehicleVo;
 import com.sckw.transport.service.kwfTruckTraceService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -15,6 +19,8 @@ import jakarta.validation.Valid;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 
 /**
  * @author cxf
@@ -68,4 +74,24 @@ public class KwfTruckTraceController {
         return BaseResult.success( kwfTruckTraceService.findPage(req));
     }
 
-}
+    /**
+     * 车辆下拉列表(支持多选、输入匹配)
+     */
+    @PostMapping("/truckSelect")
+    @Operation(summary = "车辆下拉列表", description = "支持根据车牌号输入匹配,返回车牌号和定位状态")
+    public BaseResult<List<TruckSelectVo>> getTruckSelectList(@RequestBody TruckSelectReq req) {
+        List<TruckSelectVo> list = kwfTruckTraceService.getTruckSelectList(req);
+        return BaseResult.success(list);
+    }
+
+    /**
+     * 分页查询地图车辆列表
+     */
+    @PostMapping("/mapVehicleList")
+    @Operation(summary = "地图车辆列表", description = "分页查询地图中展示的进行中任务车辆信息")
+    public BaseResult<PageDataResult<MapVehicleVo>> queryMapVehicleList(@RequestBody MapVehicleQueryReq req) {
+        PageDataResult<MapVehicleVo> result = kwfTruckTraceService.queryMapVehicleList(req);
+        return BaseResult.success(result);
+    }
+
+}

+ 47 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/MapVehicleQueryReq.java

@@ -0,0 +1,47 @@
+package com.sckw.transport.model.dto;
+
+import com.sckw.core.web.request.PageReq;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * 地图车辆查询请求
+ * @author system
+ */
+@Data
+@Schema(description = "地图车辆查询请求")
+public class MapVehicleQueryReq  implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    @Schema(description = "承运单位ID")
+    private Long carrierEntId;
+
+    @Schema(description = "托运单位ID")
+    private Long consignEntId;
+
+    @Schema(description = "物流订单号")
+    private String lOrderNo;
+
+    @Schema(description = "车辆定位状态(1-在线,0-离线,null-全部)")
+    private Integer locationStatus;
+    @Schema(description = "任务状态")
+    private Integer status;
+
+    @Schema(description = "开始日期(yyyy-MM-dd)默认当天")
+    private String startDate;
+
+    @Schema(description = "结束日期(yyyy-MM-dd)默认当天")
+    private String endDate;
+
+    @Schema(description = "页码", example = "1")
+    private Integer pageNum = 1;
+
+    @Schema(description = "每页数量", example = "20")
+    private Integer pageSize = 20;
+}

+ 32 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/TruckSelectReq.java

@@ -0,0 +1,32 @@
+package com.sckw.transport.model.dto;
+
+import com.sckw.core.web.request.PageReq;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * 车辆多选下拉查询请求
+ * @author system
+ */
+@Data
+@Schema(description = "车辆多选下拉查询请求")
+public class TruckSelectReq implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+    /**
+     * 车牌号
+     */
+    @Schema(description = "车牌号(模糊匹配)")
+    private String truckNo;
+    /**
+     * 定位状态筛选
+     */
+    @Schema(description = "定位状态筛选(1-在线,0-离线,null-全部)")
+    private Integer locationStatus;
+
+}

+ 81 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/MapVehicleVo.java

@@ -0,0 +1,81 @@
+package com.sckw.transport.model.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 地图车辆展示VO
+ * @author system
+ */
+@Data
+@Schema(description = "地图车辆展示信息")
+public class MapVehicleVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Schema(description = "商品信息")
+    private String goodsInfo;
+
+    @Schema(description = "装货重量/任务量")
+    private String loadWeight;
+
+    @Schema(description = "定位位置")
+    private String location;
+
+    @Schema(description = "定位时间(yyyy-MM-dd HH:mm:ss)")
+    private String locationTime;
+
+    @Schema(description = "车牌号")
+    private String truckNo;
+
+    @Schema(description = "车辆ID")
+    private Long truckId;
+
+    @Schema(description = "司机姓名")
+    private String driverName;
+
+    @Schema(description = "司机手机号")
+    private String driverPhone;
+
+    @Schema(description = "运单号")
+    private String wOrderNo;
+
+    @Schema(description = "物流订单号")
+    private String lOrderNo;
+
+    @Schema(description = "托运单位")
+    private String consignUnit;
+
+    @Schema(description = "承运单位")
+    private String carrierUnit;
+
+    @Schema(description = "经度")
+    private String longitude;
+
+    @Schema(description = "纬度")
+    private String latitude;
+
+    @Schema(description = "定位状态(1-在线,0-离线)")
+    private Integer locationStatus;
+
+    @Schema(description = "定位状态描述")
+    private String locationStatusDesc;
+
+    @Schema(description = "运单状态")
+    private Integer status;
+
+    @Schema(description = "运单状态描述")
+    private String statusDesc;
+
+    @Schema(description = "装货量")
+    private BigDecimal loadAmount;
+
+    @Schema(description = "任务量")
+    private BigDecimal entrustAmount;
+
+    @Schema(description = "单位")
+    private String unit;
+}

+ 41 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/TruckSelectVo.java

@@ -0,0 +1,41 @@
+package com.sckw.transport.model.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 车辆下拉选项VO
+ * @author system
+ */
+@Data
+@Schema(description = "车辆下拉选项")
+public class TruckSelectVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Schema(description = "车牌号")
+    private String truckNo;
+
+    @Schema(description = "定位状态(0-离线,1-在线)")
+    private Integer locationStatus;
+
+    @Schema(description = "定位状态描述")
+    private String locationStatusDesc;
+
+    @Schema(description = "车辆ID")
+    private Long truckId;
+
+    @Schema(description = "司机姓名")
+    private String driverName;
+
+    @Schema(description = "司机手机号")
+    private String driverPhone;
+
+    @Schema(description = "运单状态")
+    private Integer status;
+
+    @Schema(description = "运单状态描述")
+    private String statusDesc;
+}

+ 9 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/repository/KwtLogisticsOrderGoodsRepository.java

@@ -52,4 +52,13 @@ public class KwtLogisticsOrderGoodsRepository extends ServiceImpl<KwtLogisticsOr
                 .in(KwtLogisticsOrderGoods::getLOrderId,logIds)
         );
     }
+
+    /**
+     * 根据物流订单ID列表查询
+     */
+    public List<KwtLogisticsOrderGoods> queryByLOrderIds(List<Long> lOrderIds) {
+        return list(Wrappers.<KwtLogisticsOrderGoods>lambdaQuery()
+                .eq(KwtLogisticsOrderGoods::getDelFlag, 0)
+                .in(KwtLogisticsOrderGoods::getLOrderId, lOrderIds));
+    }
 }

+ 7 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/repository/KwtLogisticsOrderRepository.java

@@ -117,4 +117,11 @@ public class KwtLogisticsOrderRepository extends ServiceImpl<KwtLogisticsOrderMa
                 .like(StringUtils.isNotBlank(orderNo),KwtLogisticsOrder::getLOrderNo, orderNo)
         );
     }
+
+    public KwtLogisticsOrder queryByLogisticOrderNo(String lOrderNo) {
+        return getOne(Wrappers.<KwtLogisticsOrder>lambdaQuery()
+                .eq(KwtLogisticsOrder::getDelFlag,0)
+                .eq(KwtLogisticsOrder::getLOrderNo, lOrderNo)
+                .last("limit 1"));
+    }
 }

+ 9 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/repository/KwtLogisticsOrderUnitRepository.java

@@ -53,4 +53,13 @@ public class KwtLogisticsOrderUnitRepository extends ServiceImpl<KwtLogisticsOrd
                 .eq(KwtLogisticsOrderUnit::getDelFlag,0)
                 .eq(KwtLogisticsOrderUnit::getEntId,entId));
     }
+
+    /**
+     * 根据物流订单ID列表查询
+     */
+    public List<KwtLogisticsOrderUnit> queryByLOrderIds(List<Long> lOrderIds) {
+        return list(Wrappers.<KwtLogisticsOrderUnit>lambdaQuery()
+                .eq(KwtLogisticsOrderUnit::getDelFlag, 0)
+                .in(KwtLogisticsOrderUnit::getLOrderId, lOrderIds));
+    }
 }

+ 46 - 3
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/repository/KwtWaybillOrderRepository.java

@@ -14,6 +14,7 @@ import com.sckw.transport.model.KwtWaybillOrder;
 import org.springframework.stereotype.Repository;
 
 import java.time.LocalDateTime;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 import java.util.Objects;
@@ -180,6 +181,27 @@ public class KwtWaybillOrderRepository extends ServiceImpl<KwtWaybillOrderMapper
                         .eq(KwtWaybillOrder::getDelFlag, 0));
     }
 
+    /**
+     * 查询车辆列表(用于下拉选择)
+     * @param truckNo 车牌号关键字(模糊匹配)
+     * @return 车辆列表(按车牌号分组去重,最多返回100条)
+     */
+    public List<KwtWaybillOrder> selectTruckListForSelect(String truckNo) {
+        LambdaQueryWrapper<KwtWaybillOrder> wrapper = Wrappers.<KwtWaybillOrder>lambdaQuery()
+                .select(KwtWaybillOrder::getTruckId,
+                        KwtWaybillOrder::getTruckNo,
+                        KwtWaybillOrder::getDriverId,
+                        KwtWaybillOrder::getDriverName,
+                        KwtWaybillOrder::getDriverPhone,
+                        KwtWaybillOrder::getStatus)
+                .eq(KwtWaybillOrder::getDelFlag, 0)
+                .like(StringUtils.isNotBlank(truckNo), KwtWaybillOrder::getTruckNo, truckNo)
+                .groupBy(KwtWaybillOrder::getTruckNo)
+                .orderByDesc(KwtWaybillOrder::getUpdateTime)
+                .last("LIMIT 100");
+        return list(wrapper);
+    }
+
 
     public List<KwtWaybillOrder> queryByEntIdAndDriverId(Long entId, Long driverId) {
         Date thirtyDaysAgo = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -30));
@@ -191,6 +213,27 @@ public class KwtWaybillOrderRepository extends ServiceImpl<KwtWaybillOrderMapper
                         .ge(KwtWaybillOrder::getUpdateTime, thirtyDaysAgo));
     }
 
-
-
-}
+    /**
+     * 分页查询地图车辆列表(进行中任务)
+     * @param entIds 企业ID集合
+     * @param startDate 开始日期
+     * @param endDate 结束日期
+     * @param taskingStatus 任务状态列表
+     * @param wayOrderIds 运单ID集合
+     * @param pageNum 页码
+     * @param pageSize 每页数量
+     * @return 分页结果
+     */
+    public IPage<KwtWaybillOrder> queryMapVehicleListPage(Set<Long> entIds, Date startDate, Date endDate,
+                                                           List<Integer> taskingStatus, Set<Long> wayOrderIds, int pageNum, int pageSize) {
+        return page(new Page<>(pageNum, pageSize),
+                Wrappers.<KwtWaybillOrder>lambdaQuery()
+                        .eq(KwtWaybillOrder::getDelFlag, 0)
+                        .in(CollectionUtils.isNotEmpty(entIds), KwtWaybillOrder::getEntId, entIds)
+                        .in(KwtWaybillOrder::getStatus, taskingStatus)
+                        .in(CollectionUtils.isNotEmpty(wayOrderIds), KwtWaybillOrder::getId, wayOrderIds)
+                        .ge(Objects.nonNull(startDate), KwtWaybillOrder::getCreateTime, startDate)
+                        .le(Objects.nonNull(endDate), KwtWaybillOrder::getCreateTime, endDate)
+                        .orderByDesc(KwtWaybillOrder::getUpdateTime));
+    }
+}

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

@@ -2204,10 +2204,10 @@ public class KwtWaybillOrderV1Service {
                     // 使用 Feign 调用查询车辆轨迹列表
                     com.sckw.transport.api.model.dto.VehicleDataDTO vehicleDataDTO1 = new com.sckw.transport.api.model.dto.VehicleDataDTO();
                     vehicleDataDTO.setWOrderNo(waybillOrder.getWOrderNo());
-                    BaseResult<VehicleTraceResponse> result = vehicleTraceClient.queryVehicleDataList(vehicleDataDTO1);
+                    BaseResult<List<com.sckw.transport.api.model.dto.VehicleReturnData>> result = vehicleTraceClient.queryVehicleDataList(vehicleDataDTO1);
                     
                     if (result != null && result.getCode()!= HttpStatus.SUCCESS_CODE && result.getData() != null) {
-                        List<com.sckw.transport.api.model.dto.VehicleReturnData> vehicleReturn = result.getData().getDataList();
+                        List<com.sckw.transport.api.model.dto.VehicleReturnData> vehicleReturn = result.getData();
                         List<VehicleRouteData> vehicleReturnData = vehicleReturn.stream().map(x->{
                             VehicleRouteData vehicleRouteData = new VehicleRouteData();
                             vehicleRouteData.setTs(x.getTs());

+ 457 - 16
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/kwfTruckTraceService.java

@@ -3,12 +3,17 @@ package com.sckw.transport.service;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 import com.sckw.contract.api.RemoteContractService;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.UrlConstants;
 import com.sckw.core.model.enums.AddressTypeEnum;
 import com.sckw.core.model.enums.CarWaybillEnum;
+import com.sckw.core.model.enums.CarWaybillV1Enum;
 import com.sckw.core.utils.DateUtils;
 import com.sckw.core.utils.HttpUtil;
 import com.sckw.core.web.constant.CommonConstants;
@@ -30,26 +35,20 @@ import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.KwsEnterpriseResDto;
 import com.sckw.transport.common.config.UrlConfigProperties;
-import com.sckw.transport.model.KwtLogisticsOrderUnit;
-import com.sckw.transport.model.KwtWaybillOrder;
-import com.sckw.transport.model.KwtWaybillOrderAddress;
-import com.sckw.transport.model.KwtWaybillOrderSubtask;
+import com.sckw.transport.model.*;
 import com.sckw.transport.model.dto.TruckDto;
 import com.sckw.transport.api.feign.VehicleTraceClient;
 import com.sckw.transport.api.model.dto.VehicleDataDTO;
 import com.sckw.transport.api.model.dto.VehicleReturnData;
-import com.sckw.transport.api.model.vo.VehicleTraceResponse;
-import com.sckw.transport.model.param.CurrentTaskTraceReq;
-import com.sckw.transport.model.param.KwfTruckTraceReplayReq;
-import com.sckw.transport.model.param.TruckInfoReq;
-import com.sckw.transport.model.param.VehiclesTrajectoryReq;
+import com.sckw.transport.model.param.*;
 import com.sckw.transport.model.vo.CurrentTaskTraceReqVo;
 import com.sckw.transport.model.vo.KwfTruckTraceReplayVo;
 import com.sckw.transport.model.vo.TruckInfoVo;
-import com.sckw.transport.repository.KwtLogisticsOrderUnitRepository;
-import com.sckw.transport.repository.KwtWaybillOrderAddressRepository;
-import com.sckw.transport.repository.KwtWaybillOrderRepository;
-import com.sckw.transport.repository.KwtWaybillOrderSubtaskRepository;
+import com.sckw.transport.model.vo.TruckSelectVo;
+import com.sckw.transport.model.dto.TruckSelectReq;
+import com.sckw.transport.model.dto.MapVehicleQueryReq;
+import com.sckw.transport.model.vo.MapVehicleVo;
+import com.sckw.transport.repository.*;
 import com.sckw.transport.response.CollectZjxlResponse;
 import com.sckw.transport.service.zj.VehicleCollectService;
 import lombok.RequiredArgsConstructor;
@@ -64,11 +63,14 @@ import java.time.Duration;
 import java.time.LocalDateTime;
 import java.time.ZoneOffset;
 import java.time.format.DateTimeFormatter;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
+import lombok.Data;
+
 
 /**
  * @author PC
@@ -84,6 +86,8 @@ public class kwfTruckTraceService {
     private final VehicleCollectService vehicleCollectService;
     private final KwtLogisticsOrderUnitRepository kwtLogisticsOrderUnitRepository;
     private final VehicleTraceClient vehicleTraceClient;
+    private final KwtLogisticsOrderGoodsRepository kwtLogisticsOrderGoodsRepository;
+    private final KwtLogisticsOrderRepository kwtLogisticsOrderRepository;
     @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
     RemoteSystemService remoteSystemService;
 
@@ -536,14 +540,14 @@ public class kwfTruckTraceService {
 
         try {
             // 使用 Feign 调用查询实时位置
-            BaseResult<VehicleTraceResponse> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
+            BaseResult<VehicleReturnData> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
 
             if (result == null || result.getCode() != HttpStatus.SUCCESS_CODE || result.getData() == null) {
                 log.warn("查询实时轨迹返回空数据, 车牌号: {}", truckId);
                 return null;
             }
 
-            return result.getData().getData();
+            return result.getData();
         } catch (Exception e) {
             log.error("查询任务轨迹异常, 车牌号: {}", truckId, e);
             return null;
@@ -668,4 +672,441 @@ public class kwfTruckTraceService {
         truckDto.setTaskAddress(taskAddress);
         return truckDto;
     }
-}
+
+    /**
+     * 查询车辆下拉列表(支持多选和输入匹配)
+     * @param req 查询请求
+     * @return 车辆下拉列表
+     */
+    public List<TruckSelectVo> getTruckSelectList(TruckSelectReq req) {
+        log.info("查询车辆下拉列表参数:{}", JSON.toJSONString( req));
+        
+        // 使用 Repository 查询车辆运单数据
+        List<KwtWaybillOrder> waybillOrders = kwtWaybillOrderRepository.selectTruckListForSelect(req.getTruckNo());
+        
+        if (CollectionUtils.isEmpty(waybillOrders)) {
+            return new ArrayList<>();
+        }
+        
+        // 获取所有车牌号列表,用于查询实时位置
+        List<String> truckNos = waybillOrders.stream()
+                .map(KwtWaybillOrder::getTruckNo)
+                .distinct()
+                .collect(Collectors.toList());
+        
+        // 批量查询实时位置状态(30分钟内有数据为在线)
+        Map<String, Integer> truckLocationStatusMap = getStringIntegerMap(truckNos);
+
+        // 转换为 VO 对象并根据状态筛选
+        return waybillOrders.stream()
+                .map(order -> getTruckSelectVo(order, truckLocationStatusMap))
+                // 根据请求参数筛选定位状态
+                .filter(vo -> req.getLocationStatus() == null || vo.getLocationStatus().equals(req.getLocationStatus()))
+                .sorted(Comparator.comparing(TruckSelectVo::getLocationStatus).reversed())
+                .collect(Collectors.toList());
+    }
+
+    @NotNull
+    private Map<String, Integer> getStringIntegerMap(List<String> truckNos) {
+        Map<String, Integer> truckLocationStatusMap = new HashMap<>();
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime thirtyMinutesAgo = now.minusMinutes(30);
+
+        for (String truckNo : truckNos) {
+            try {
+                VehicleDataDTO vehicleDataDTO = new VehicleDataDTO();
+                vehicleDataDTO.setCarNo(truckNo);
+                BaseResult<VehicleReturnData> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
+
+                if (result == null || result.getCode() != HttpStatus.SUCCESS_CODE || result.getData() == null) {
+                    // 无定位数据,设置为离线
+                    truckLocationStatusMap.put(truckNo, 0);
+                    return truckLocationStatusMap;
+                }
+
+                VehicleReturnData vehicleData = result.getData();
+
+                // 判断定位时间是否在30分钟内
+                if (vehicleData.getTs() == null) {
+                    // 无GPS时间,设置为离线
+                    truckLocationStatusMap.put(truckNo, 0);
+                    return truckLocationStatusMap;
+                }
+
+                // 30分钟内为在线
+                if (vehicleData.getTs().isAfter(thirtyMinutesAgo)) {
+                    truckLocationStatusMap.put(truckNo, 1);
+                } else {
+                    truckLocationStatusMap.put(truckNo, 0);
+                }
+
+            } catch (Exception e) {
+                log.warn("查询车辆实时位置异常, 车牌号: {}", truckNo, e);
+                truckLocationStatusMap.put(truckNo, 0);
+            }
+        }
+        return truckLocationStatusMap;
+    }
+
+    @NotNull
+    private static TruckSelectVo getTruckSelectVo(KwtWaybillOrder order, Map<String, Integer> truckLocationStatusMap) {
+        TruckSelectVo vo = new TruckSelectVo();
+        vo.setTruckId(order.getTruckId());
+        vo.setTruckNo(order.getTruckNo());
+        vo.setDriverName(order.getDriverName());
+        vo.setDriverPhone(order.getDriverPhone());
+        vo.setStatus(order.getStatus());
+        vo.setStatusDesc(CarWaybillEnum.getName(order.getStatus()));
+
+        // 设置定位状态
+        Integer locationStatus = truckLocationStatusMap.getOrDefault(order.getTruckNo(), 0);
+        vo.setLocationStatus(locationStatus);
+        vo.setLocationStatusDesc(locationStatus == 1 ? "在线" : "离线");
+
+        return vo;
+    }
+
+    /**
+     * 分页查询地图车辆列表
+     * @param req 查询请求
+     * @return 分页结果
+     */
+    public PageDataResult<MapVehicleVo> queryMapVehicleList(MapVehicleQueryReq req) {
+        log.info("分页查询地图车辆列表参数:{}", req);
+        Set<Long> allEnt = getAllEnt();
+        // 处理日期参数,默认为当天
+        Date startDate = getDate(req.getStartDate());
+        Date endDate = getDate(req.getEndDate());
+
+        // 进行中任务状态:已接单(1)、到达装货点(5)、已装货(10)、已离场(15)
+        List<Integer> taskingStatus = Lists.newArrayList();
+        if (Objects.nonNull(req.getStatus())) {
+            taskingStatus.add(req.getStatus());
+        } else {
+            taskingStatus.addAll(Arrays.asList(CarWaybillV1Enum.PENDING_VEHICLE.getCode(), CarWaybillV1Enum.REFUSE_TRAFFIC.getCode(),
+                    CarWaybillV1Enum.EXIT_COMPLETED.getCode(), CarWaybillV1Enum.WAIT_LOADING.getCode()));
+        }
+        
+        // 前置条件:根据承运单位和托运单位筛选出符合条件的运单ID
+        Set<Long> wayOrderIds = getWayOrderIds(req);
+        if (CollectionUtils.isEmpty(wayOrderIds) && (StringUtils.isNotBlank(req.getLOrderNo()) || Objects.nonNull(req.getCarrierEntId()) || Objects.nonNull(req.getConsignEntId()))){
+            return PageDataResult.empty(req.getPageNum(), req.getPageSize());
+        }
+
+        // 使用 MyBatis-Plus 分页查询(如果有前置筛选条件,则添加运单ID的IN条件)
+
+        IPage<KwtWaybillOrder> page = kwtWaybillOrderRepository.queryMapVehicleListPage(allEnt,startDate, endDate, taskingStatus, wayOrderIds, req.getPageNum(),req.getPageSize() );
+        
+        List<KwtWaybillOrder> waybillOrders = page.getRecords();
+        if (CollectionUtils.isEmpty(waybillOrders)) {
+            return PageDataResult.empty(req.getPageNum(), req.getPageSize());
+        }
+        
+        // 获取运单ID列表
+        List<Long> wOrderIds = waybillOrders.stream()
+                .map(KwtWaybillOrder::getId)
+                .collect(Collectors.toList());
+        
+        // 查询子运单信息
+        List<KwtWaybillOrderSubtask> subtasks = kwtWaybillOrderSubtaskRepository.queryByWOrderIds(wOrderIds);
+        final Map<Long, KwtWaybillOrderSubtask> wOrderIdSubtaskMap;
+        if (CollectionUtils.isNotEmpty(subtasks)) {
+            wOrderIdSubtaskMap = subtasks.stream()
+                    .filter(subtask -> subtask.getWOrderId() != null)
+                    .collect(Collectors.toMap(KwtWaybillOrderSubtask::getWOrderId, Function.identity(), (k1, k2) -> k1));
+        } else {
+            wOrderIdSubtaskMap = new HashMap<>();
+        }
+        
+        // 获取物流订单ID
+        Set<Long> lOrderIds = new HashSet<>();
+        if (CollectionUtils.isNotEmpty(subtasks)) {
+            lOrderIds = subtasks.stream()
+                    .map(KwtWaybillOrderSubtask::getLOrderId)
+                    .filter(Objects::nonNull)
+                    .collect(Collectors.toSet());
+        }
+
+        List<KwtLogisticsOrderUnit> logisticsOrderUnits = Lists.newArrayList();
+        List<KwtLogisticsOrderGoods> goodsList = Lists.newArrayList();
+        if (CollectionUtils.isNotEmpty(lOrderIds)) {
+            // 查询托运企业和承运企业
+            logisticsOrderUnits = kwtLogisticsOrderUnitRepository.queryByLOrderIds(new ArrayList<>(lOrderIds));
+            // 查询商品信息
+            goodsList = kwtLogisticsOrderGoodsRepository.queryByLOrderIds(new ArrayList<>(lOrderIds));
+        }
+
+        
+        // 按物流订单ID和单位类型分组
+        Map<String, KwtLogisticsOrderUnit> unitMap =new HashMap<>();
+        if (CollectionUtils.isNotEmpty(logisticsOrderUnits)) {
+            unitMap = logisticsOrderUnits.stream()
+                    .filter(unit -> unit.getLOrderId() != null && unit.getUnitType() != null)
+                    .collect(Collectors.toMap(
+                        unit -> unit.getLOrderId() + "_" + unit.getUnitType(),
+                        Function.identity(),
+                        (k1, k2) -> k1
+                    ));
+        }
+        
+
+         Map<Long, KwtLogisticsOrderGoods> goodsMap =new HashMap<>();
+        if (CollectionUtils.isNotEmpty(goodsList)) {
+            goodsMap = goodsList.stream()
+                    .filter(goods -> goods.getLOrderId() != null)
+                    .collect(Collectors.toMap(KwtLogisticsOrderGoods::getLOrderId, Function.identity(), (k1, k2) -> k1));
+        }
+        
+        // 获取车牌号列表,查询定位信息
+        List<String> truckNos = waybillOrders.stream()
+                .map(KwtWaybillOrder::getTruckNo)
+                .distinct()
+                .collect(Collectors.toList());
+        
+        // 批量查询定位状态和位置信息
+        Map<String, VehicleLocationInfo> locationInfoMap = queryVehicleLocationBatch(truckNos);
+        
+        // 根据定位状态筛选(这个筛选保留在内存中,因为涉及外部服务调用)
+        List<KwtWaybillOrder> filteredOrders = waybillOrders;
+        if (req.getLocationStatus() != null) {
+            filteredOrders = waybillOrders.stream()
+                    .filter(order -> {
+                        VehicleLocationInfo locationInfo = locationInfoMap.get(order.getTruckNo());
+                        return locationInfo != null && req.getLocationStatus().equals(locationInfo.getLocationStatus());
+                    })
+                    .collect(Collectors.toList());
+        }
+        
+        // 转换为 VO
+        Map<String, KwtLogisticsOrderUnit> finalUnitMap = unitMap;
+        Map<Long, KwtLogisticsOrderGoods> finalGoodsMap = goodsMap;
+        List<MapVehicleVo> result = filteredOrders.stream()
+                .map(order -> buildMapVehicleVo(order, wOrderIdSubtaskMap, finalUnitMap, finalGoodsMap, locationInfoMap))
+                .sorted(Comparator.comparing(MapVehicleVo::getLocationTime, Comparator.reverseOrder()))
+                .collect(Collectors.toList());
+        
+        // 返回分页结果(使用数据库分页的总数)
+        return PageDataResult.of(page, result);
+    }
+
+    @NotNull
+    private Set<Long> getWayOrderIds(MapVehicleQueryReq req) {
+        Set<Long> wayOrderIds = Sets.newHashSet();
+        if (req.getConsignEntId() != null || req.getCarrierEntId() != null) {
+            // 第一步:从物流订单单位表查询符合条件的物流订单ID
+            // 同时有托运和承运单位条件,将企业ID和类型组合后批量查询
+            List<Long> entIds = Arrays.asList(req.getConsignEntId(), req.getCarrierEntId());
+
+            List<KwtLogisticsOrderUnit> allUnits = kwtLogisticsOrderUnitRepository.list(
+                    Wrappers.<KwtLogisticsOrderUnit>lambdaQuery()
+                            .eq(KwtLogisticsOrderUnit::getDelFlag, 0)
+                            .in(KwtLogisticsOrderUnit::getEntId, entIds)
+                            .in(KwtLogisticsOrderUnit::getUnitType, Arrays.asList(1, 2)));
+            if (CollectionUtils.isEmpty(allUnits)) {
+                return Set.of();
+            }
+            Set<Long> lOrderIds = allUnits.stream()
+                    .map(KwtLogisticsOrderUnit::getLOrderId)
+                    .collect(Collectors.toSet());
+            if (CollectionUtils.isEmpty(lOrderIds)) {
+                return Set.of();
+            }
+
+            // 第二步:根据物流订单ID查询子运单
+            List<KwtWaybillOrderSubtask> subtasks = kwtWaybillOrderSubtaskRepository.list(
+                    Wrappers.<KwtWaybillOrderSubtask>lambdaQuery()
+                            .eq(KwtWaybillOrderSubtask::getDelFlag, 0)
+                            .in(KwtWaybillOrderSubtask::getLOrderId, lOrderIds));
+
+            if (CollectionUtils.isEmpty(subtasks)) {
+                return Set.of();
+            }
+
+            // 第三步:获取运单ID
+            wayOrderIds = subtasks.stream()
+                    .map(KwtWaybillOrderSubtask::getWOrderId)
+                    .collect(Collectors.toSet());
+
+            if (CollectionUtils.isEmpty(wayOrderIds)) {
+                return Set.of();
+            }
+        }
+        if (StringUtils.isNotBlank(req.getLOrderNo())) {
+            // 获取物流订单ID
+            KwtLogisticsOrder logOrder = kwtLogisticsOrderRepository.queryByLogisticOrderNo(req.getLOrderNo());
+            if (Objects.isNull(logOrder)) {
+                return Set.of();
+            }
+            wayOrderIds.add(logOrder.getId());
+        }
+        return wayOrderIds;
+    }
+
+    @NotNull
+    private static Date getDate(String date) {
+        Date startDate;
+        if (StringUtils.isBlank(date)) {
+            startDate = DateUtils.getStartOfDay(new Date());
+        } else {
+            try {
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                startDate = sdf.parse(date);
+                startDate = DateUtils.getStartOfDay(startDate);
+            } catch (Exception e) {
+                log.error("解析开始日期失败", e);
+                startDate = DateUtils.getStartOfDay(new Date());
+            }
+        }
+        return startDate;
+    }
+
+    /**
+     * 批量查询车辆定位信息
+     */
+    private Map<String, VehicleLocationInfo> queryVehicleLocationBatch(List<String> truckNos) {
+        Map<String, VehicleLocationInfo> locationInfoMap = new HashMap<>();
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime thirtyMinutesAgo = now.minusMinutes(30);
+        if (CollectionUtils.isEmpty(truckNos)){
+            return locationInfoMap;
+        }
+        for (String truckNo : truckNos) {
+            try {
+                VehicleDataDTO vehicleDataDTO = new VehicleDataDTO();
+                vehicleDataDTO.setCarNo(truckNo);
+                BaseResult<VehicleReturnData> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
+                
+                VehicleLocationInfo locationInfo = new VehicleLocationInfo();
+                
+                if (result != null && result.getCode() == 200 && result.getData() != null) {
+                    VehicleReturnData vehicleData = result.getData();
+                    
+                    // 判断定位状态
+                    if (vehicleData.getTs() != null && vehicleData.getTs().isAfter(thirtyMinutesAgo)) {
+                        locationInfo.setLocationStatus(1);
+                    } else {
+                        locationInfo.setLocationStatus(0);
+                    }
+                    
+                    locationInfo.setLongitude(vehicleData.getLongitude());
+                    locationInfo.setLatitude(vehicleData.getLatitude());
+                    if (vehicleData.getTs() != null) {
+                        locationInfo.setLocationTime(vehicleData.getTs().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+                    }
+                } else {
+                    locationInfo.setLocationStatus(0);
+                }
+                
+                locationInfoMap.put(truckNo, locationInfo);
+            } catch (Exception e) {
+                log.warn("查询车辆定位信息异常, 车牌号: {}", truckNo, e);
+                VehicleLocationInfo locationInfo = new VehicleLocationInfo();
+                locationInfo.setLocationStatus(0);
+                locationInfoMap.put(truckNo, locationInfo);
+            }
+        }
+        
+        return locationInfoMap;
+    }
+    
+    /**
+     * 构建地图车辆VO
+     */
+    private MapVehicleVo buildMapVehicleVo(KwtWaybillOrder order,
+                                           Map<Long, KwtWaybillOrderSubtask> subtaskMap,
+                                           Map<String, KwtLogisticsOrderUnit> unitMap,
+                                           Map<Long, KwtLogisticsOrderGoods> goodsMap,
+                                           Map<String, VehicleLocationInfo> locationInfoMap) {
+        MapVehicleVo vo = new MapVehicleVo();
+        
+        // 车辆和司机信息
+        vo.setTruckNo(order.getTruckNo());
+        vo.setTruckId(order.getTruckId());
+        vo.setDriverName(order.getDriverName());
+        vo.setDriverPhone(order.getDriverPhone());
+        vo.setWOrderNo(order.getWOrderNo());
+        vo.setStatus(order.getStatus());
+        vo.setStatusDesc(CarWaybillEnum.getName(order.getStatus()));
+        
+        // 子运单信息
+        KwtWaybillOrderSubtask subtask = subtaskMap.get(order.getId());
+        if (subtask != null) {
+            vo.setLOrderNo(String.valueOf(subtask.getLOrderId()));
+            vo.setLoadAmount(subtask.getLoadAmount());
+            vo.setEntrustAmount(subtask.getEntrustAmount());
+            vo.setUnit(subtask.getUnit());
+            
+            // 装货重量/任务量
+            String loadWeight = String.format("%s%s / %s%s",
+                    subtask.getLoadAmount() != null ? subtask.getLoadAmount() : "0",
+                    subtask.getUnit() != null ? subtask.getUnit() : "",
+                    subtask.getEntrustAmount() != null ? subtask.getEntrustAmount() : "0",
+                    subtask.getUnit() != null ? subtask.getUnit() : "");
+            vo.setLoadWeight(loadWeight);
+            
+            // 托运单位
+            KwtLogisticsOrderUnit consignUnit = unitMap.get(subtask.getLOrderId() + "_1");
+            if (consignUnit != null) {
+                vo.setConsignUnit(consignUnit.getFirmName());
+            }
+            
+            // 承运单位
+            KwtLogisticsOrderUnit carrierUnit = unitMap.get(subtask.getLOrderId() + "_2");
+            if (carrierUnit != null) {
+                vo.setCarrierUnit(carrierUnit.getFirmName());
+            }
+            
+            // 商品信息
+            KwtLogisticsOrderGoods goods = goodsMap.get(subtask.getLOrderId());
+            if (goods != null) {
+                vo.setGoodsInfo(goods.getGoodsName());
+            }
+        }
+        
+        // 定位信息
+        VehicleLocationInfo locationInfo = locationInfoMap.get(order.getTruckNo());
+        if (locationInfo != null) {
+            vo.setLocationStatus(locationInfo.getLocationStatus());
+            vo.setLocationStatusDesc(locationInfo.getLocationStatus() == 1 ? "在线" : "离线");
+            vo.setLongitude(locationInfo.getLongitude());
+            vo.setLatitude(locationInfo.getLatitude());
+            vo.setLocation(locationInfo.getLocation());
+            vo.setLocationTime(locationInfo.getLocationTime());
+        } else {
+            vo.setLocationStatus(0);
+            vo.setLocationStatusDesc("离线");
+        }
+        
+        return vo;
+    }
+    
+    /**
+     * 车辆定位信息内部类
+     */
+    @Data
+    private static class VehicleLocationInfo {
+        private Integer locationStatus;
+        private String longitude;
+        private String latitude;
+        private String location;
+        private String locationTime;
+    }
+
+    @NotNull
+    private Set<Long> getAllEnt() {
+        Set<Long> allEnt = Sets.newHashSet();
+        //根据企业类型查询企业
+
+        allEnt.add( LoginUserHolder.getUserId());
+        EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(LoginUserHolder.getUserId());
+        if (Objects.nonNull(entCacheResDto)) {
+            EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntTreeById(entCacheResDto.getId());
+            List<EntCacheResDto> child = entCacheResDto1.getChild();
+            if (com.sckw.core.utils.CollectionUtils.isNotEmpty(child)) {
+                allEnt.addAll(child.stream()
+                        .map(EntCacheResDto::getId).toList());
+            }
+        }
+        return allEnt;
+    }
+}

+ 152 - 0
sql/2025/11/30/2025_11_30_cxf_creat.sql

@@ -0,0 +1,152 @@
+-- auto-generated definition
+create table kwt_logistics_order_unit
+(
+    id          bigint        not null comment '主键'
+        primary key,
+    l_order_id  bigint        not null comment '物流订单id(kwt_logistics_order的主键id)',
+    unit_type   int           not null comment '单位类型(1托运企业、2承运企业)',
+    top_ent_id  bigint        null comment '顶级企业ID',
+    ent_id      bigint        not null comment '企业id',
+    firm_name   varchar(100)  not null comment '企业名称',
+    contacts_id bigint        null comment '联系人ID',
+    contacts    varchar(40)   null comment '联系人姓名',
+    phone       varchar(40)   null comment '联系电话',
+    remark      varchar(400)  null comment '备注',
+    status      int default 0 not null comment '用户状态(0正常、1已锁)',
+    create_by   bigint        not null,
+    create_time datetime      not null,
+    update_by   bigint        not null,
+    update_time datetime      not null comment '更新时间',
+    del_flag    int default 0 not null comment '是否删除(0未删除,1删除)'
+)
+    comment '物流订单-托运企业/承运企业' row_format = DYNAMIC;
+
+-- auto-generated definition
+create table kwt_waybill_order
+(
+    id              bigint                                 not null comment '主键'
+        primary key,
+    ent_id          bigint                                 not null comment '企业id',
+    l_order_id      bigint                                 not null comment '物流订单id',
+    w_order_no      varchar(30)                            not null comment '编号',
+    type            int                                    not null comment '派车类型(1:趟次:2:循环)',
+    truck_id        bigint                                 null comment '车辆档案ID',
+    truck_no        varchar(20)                            not null comment '车牌号',
+    driver_id       bigint                                 null comment '司机id',
+    driver_name     varchar(40)                            null comment '司机姓名',
+    driver_phone    varchar(20)                            null comment '司机手机号',
+    driver_idcard   varchar(20)                            null comment '司机身份证号码',
+    remark          varchar(400)                           null comment '备注',
+    status          int      default 0                     not null comment '状态(1-接单,5-到达装货点,10-已装货,15-已离场,20-已卸货,25-已完成,30-审核驳回,99-已作废)',
+    create_by       bigint                                 not null,
+    create_time     datetime default CURRENT_TIMESTAMP     not null,
+    update_by       bigint   default -1                    not null,
+    update_time     datetime default CURRENT_TIMESTAMP     not null comment '更新时间',
+    del_flag        int      default 0                     not null comment '是否删除(0未删除,1删除)',
+    task_start_time datetime default '1000-01-01 00:00:00' not null comment '任务开始时间',
+    task_end_time   datetime default '1000-01-01 00:00:00' not null comment '任务结束时间'
+)
+    comment '车辆运单' row_format = DYNAMIC;
+
+-- auto-generated definition
+create table kwt_waybill_order_subtask
+(
+    id                 bigint                             not null comment '主键'
+        primary key,
+    ent_id             bigint                             not null comment '企业id',
+    l_order_id         bigint                             not null comment '物流订单id(kwt_logistics_order)',
+    w_order_id         bigint                             not null comment '物流订单id',
+    w_order_no         varchar(30)                        not null comment '编号',
+    unit               varchar(10)                        null comment '托量单位',
+    entrust_amount     decimal(10, 6)                     null comment '已委托量',
+    unload_amount      decimal(10, 6)                     null comment '卸货重量',
+    unload_time        datetime                           null comment '卸货时间',
+    load_amount        decimal(10, 6)                     null comment '装货重量',
+    load_time          datetime                           null comment '装货时间',
+    deficit_amount     decimal(10, 6)                     null comment '亏吨重量',
+    deficit_price      decimal(10, 4)                     null comment '亏吨扣款',
+    remark             varchar(400)                       null comment '备注',
+    status             int      default 0                 not null comment '状态(1-接单,5-到达装货点,10-已装货,15-已离场,20-已卸货,25-已完成,30-审核驳回,99-已作废)',
+    create_by          bigint                             not null,
+    create_time        datetime                           not null,
+    update_by          bigint   default -1                not null,
+    update_time        datetime default CURRENT_TIMESTAMP not null comment '更新时间',
+    del_flag           int      default 0                 not null comment '是否删除(0未删除,1删除)',
+    unload_url         varchar(255)                       null comment '卸货凭证',
+    unload_upload_time datetime                           null comment '凭证上传时间',
+    unload_operator    varchar(255)                       null comment '凭证上传操作人'
+)
+    comment '车辆运单-子运单' row_format = DYNAMIC;
+
+
+-- auto-generated definition
+create table kwt_logistics_order_goods
+(
+    id          bigint        not null comment '主键'
+        primary key,
+    l_order_id  bigint        not null comment '物流订单id',
+    l_order_no  varchar(64)   not null comment '物流订单编号',
+    goods_id    bigint        null comment '商品id',
+    goods_name  varchar(100)  null comment '商品名称',
+    goods_type  varchar(32)   null comment '商品类型',
+    sku_id      bigint        null comment 'sku',
+    remark      varchar(400)  null comment '备注',
+    status      int default 0 not null comment '用户状态(0正常、1已锁)',
+    create_by   bigint        not null,
+    create_time datetime      not null,
+    update_by   bigint        not null,
+    update_time datetime      not null comment '更新时间',
+    del_flag    int default 0 not null comment '是否删除(0未删除,1删除)'
+)
+    comment '物流订单-商品信息' row_format = DYNAMIC;
+
+-- auto-generated definition
+create table kwt_logistics_order
+(
+    id                  bigint                    not null comment '主键'
+        primary key,
+    ent_id              bigint                    not null comment '企业id',
+    t_order_id          bigint                    null comment '交易订单id(kwo_trade_order)',
+    t_order_no          varchar(30)               null comment '交易订单编号(kwo_trade_order)',
+    l_order_no          varchar(30)               not null comment '物流订单编号',
+    pid                 bigint                    null comment '分包上级物流订单id',
+    pids                varchar(100)              null comment '存放分包所有物流订单id使用“;”分隔',
+    type                varchar(10)               not null comment '物流订单类型(1 贸易订单生成物流订单、2 自建物流订单)',
+    level               varchar(255)              null comment '代表分包等级',
+    bind_status         varchar(255) charset utf8 null comment '对账绑定状态(0未绑定/解绑:1绑定)',
+    settlement_cycle    bigint                    null comment '结算周期(周结、月结、季结)',
+    billing_mode        varchar(255)              null comment '计费方式',
+    price               decimal(8, 2)             null comment '运价',
+    price_type          bigint                    null comment '运价方式(元/吨、元/车)',
+    amount              decimal(10, 6)            not null comment '已委托量(上游给他分配的量)',
+    unit                varchar(10)               not null comment '单位(吨、方、箱、件)',
+    loss                decimal(8, 2)             null comment '合理损耗',
+    loss_unit           varchar(20)               null comment '合理损耗单位(‰/kG)',
+    goods_price         decimal(11, 2)            null comment '商品价值(扣亏货值)((实装-实卸)-合理损耗)如果为负数,则为零',
+    goods_price_unit    varchar(20)               null comment '商品价值(扣亏货值)单位',
+    start_time          datetime                  null comment '计划开始时间',
+    end_time            datetime                  null comment '计划结束时间',
+    subcontract_amount  decimal(11, 6)            null comment '分包量(给下游承运商分包的量)',
+    entrust_amount      decimal(11, 6)            null comment '已委托量(自己承运,给下游司机分配的量)',
+    unload_amount       decimal(11, 6)            null comment '卸货量(自己承运总卸货量)',
+    load_amount         decimal(11, 6)            null comment '装货量(自己承运总装货量)',
+    ignore_amount       decimal(11, 6)            null comment '忽略剩余量',
+    deficit_amount      decimal(11, 6)            null comment '亏吨量(自己承运总亏吨量:装货量-卸货量)',
+    deficit_price       decimal(11, 2)            null comment '亏吨扣款(自己承运总亏吨扣款)',
+    load_time           datetime                  null comment '实际开始时间(装货)',
+    unload_time         datetime                  null comment '实际结束时间(卸货)',
+    total_take          int                       null comment '趟次(自己+下游承运总卸货量,算方式为趟次时,最终值以完结输入值为准)',
+    total_load_amount   decimal(11, 6)            null comment '装货-履约量(自己+下游承运总装货量)',
+    total_unload_amount decimal(11, 6)            null comment '卸货-履约量(自己+下游承运总卸货量)',
+    payment             bigint                    null comment '付款方式(预付款、线下支付、第三方支付)',
+    tax_rate            decimal(6)                null comment '发票税率(%)',
+    remark              varchar(200)              null comment '备注',
+    status              int default 0             not null comment '0,待签约,1待接单',
+    create_by           bigint                    not null,
+    create_time         datetime                  not null,
+    update_by           bigint                    not null,
+    update_time         datetime                  not null comment '更新时间',
+    del_flag            int default 0             not null comment '是否删除(0未删除,1删除)'
+)
+    comment '物流订单' row_format = DYNAMIC;
+