Explorar el Código

Merge remote-tracking branch 'origin/dev' into dev

czh hace 2 años
padre
commit
c387fc5480
Se han modificado 58 ficheros con 745 adiciones y 258 borrados
  1. 45 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/LogisticsOrderEnum.java
  2. 4 2
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/annotation/ExcelContext.java
  3. 5 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/annotation/ExcelSelected.java
  4. 14 4
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/DateUtil.java
  5. 1 1
      sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/model/TobleTop.java
  6. 12 4
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java
  7. 11 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java
  8. 2 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfDriverCardMapper.java
  9. 13 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfFleetDriverMapper.java
  10. 11 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfFleetTruckMapper.java
  11. 4 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfDriverCardDto.java
  12. 4 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfDriverLicenseDto.java
  13. 4 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfDriverQualificationDto.java
  14. 6 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfTransportLicenseDto.java
  15. 6 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfTruckLicenseDto.java
  16. 6 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverVo.java
  17. 16 3
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java
  18. 15 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java
  19. 92 0
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverCardMapper.xml
  20. 1 1
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml
  21. 10 0
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfFleetDriverMapper.xml
  22. 10 0
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfFleetTruckMapper.xml
  23. 2 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpTransportDemandMapper.java
  24. 15 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpWantBuyAddressMapper.java
  25. 2 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpWantBuyMapper.java
  26. 15 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpWantBuyTradingMapper.java
  27. 6 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrder.java
  28. 7 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderAddress.java
  29. 6 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderContract.java
  30. 5 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderGoods.java
  31. 6 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderTrack.java
  32. 6 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderUnit.java
  33. 7 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTransportDemand.java
  34. 18 9
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoWantBuy.java
  35. 83 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoWantBuyAddress.java
  36. 38 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoWantBuyTrading.java
  37. 6 8
      sckw-modules/sckw-product/src/main/java/com/sckw/product/controller/KwpGoodsController.java
  38. 4 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/GoodsListExport.java
  39. 5 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoods.java
  40. 6 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsAddress.java
  41. 6 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsAttribute.java
  42. 6 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsImage.java
  43. 5 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsPriceRange.java
  44. 6 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsSku.java
  45. 2 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/req/AddGoodsParam.java
  46. 4 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/req/GoodsImages.java
  47. 10 5
      sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java
  48. 5 7
      sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwOrderController.java
  49. 8 5
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwOrderService.java
  50. 40 113
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwTransportService.java
  51. 35 29
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/param/TradeOrderListExport.java
  52. 2 2
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/param/TradeOrderListStatisticParam.java
  53. 17 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/vo/CarWaybillVo.java
  54. 1 2
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/vo/ConsignOrderVo.java
  55. 31 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/vo/WaybillsCountVo.java
  56. 10 25
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ConsignOrderService.java
  57. 22 5
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/DriverService.java
  58. 6 6
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/WaybillManagementService.java

+ 45 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/LogisticsOrderEnum.java

@@ -1,20 +1,49 @@
 package com.sckw.core.model.enums;
 
+import com.sckw.core.common.enums.NumberConstant;
+
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @author lfdc
  * @description 物流订单-单据状态
  * @date 2023-07-07 14:07:23
  */
 public enum LogisticsOrderEnum {
+    /**
+     * 物流订单-待签约
+     */
     TO_BE_PLANNED(0, "waitingSigning", "0", "待签约"),
+    /**
+     * 物流订单-待接单
+     */
     PENDING_ORDER(1, "pendingOrder", "1", "待接单"),
+    /**
+     * 物流订单-待派车
+     */
     WAIT_DELIVERY(2, "waitDelivery", "2", "待派车"),
+    /**
+     * 物流订单-运输中
+     */
     IN_TRANSIT(3, "inTransit", "3", "运输中"),
+    /**
+     * 物流订单-已完成
+     */
     //    WAIT_LOADING(4, "waitLoading", "4", "待装货"),
 //    WAIT_UNLOADING(5, "waitUnLoading", "5", "待卸货"),
     HAVE_FINISHED(4, "haveFinished", "4", "已完成"),
+    /**
+     * 物流订单-已对账
+     */
     HAVE_RECONCILED(5, "haveReconciled", "5", "已对账"),
+    /**
+     * 物流订单-已结算
+     */
     HAVE_ALREADY_SETTLED(6, "haveAlreadySettled", "6", "已结算"),
+    /**
+     * 物流订单-已退回
+     */
     SEND_BACK(7, "sendBack", "7", "已退回");
 
     private final Integer code;
@@ -62,4 +91,20 @@ public enum LogisticsOrderEnum {
         }
         return null;
     }
+
+    public static List<Integer> getCodeList() {
+        List<Integer> codeList = new ArrayList<>(NumberConstant.SIXTEEN);
+        for (LogisticsOrderEnum value : LogisticsOrderEnum.values()) {
+            codeList.add(value.getCode());
+        }
+        return codeList;
+    }
+
+    public static List<String> getCodeStringList() {
+        List<String> codeList = new ArrayList<>(NumberConstant.SIXTEEN);
+        for (LogisticsOrderEnum value : LogisticsOrderEnum.values()) {
+            codeList.add(value.getStatus());
+        }
+        return codeList;
+    }
 }

+ 4 - 2
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/annotation/ExcelContext.java

@@ -3,8 +3,10 @@ package com.sckw.excel.annotation;
 import java.lang.annotation.*;
 
 /**
- *
- * 导出的文件全局属性
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-28 15:37:35
+ * @copyright
  */
 @Target({ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)

+ 5 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/annotation/ExcelSelected.java

@@ -4,6 +4,11 @@ import java.lang.annotation.*;
 
 /**
  * easy导出下拉框注解
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-28 15:37:35
+ * @copyright
  */
 
 /**

+ 14 - 4
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/DateUtil.java

@@ -9,6 +9,7 @@ import java.time.*;
 import java.time.format.DateTimeFormatter;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.GregorianCalendar;
 
 /**
  * @description: 时间工具类
@@ -70,6 +71,7 @@ public class DateUtil {
 
     /**
      * yyyy-MM-dd 转换成 LocalDate
+     *
      * @param str
      * @return
      */
@@ -79,6 +81,7 @@ public class DateUtil {
 
     /**
      * yyyy-MM-dd 转换成 LocalDateTime
+     *
      * @param str
      * @return
      */
@@ -296,6 +299,13 @@ public class DateUtil {
         return calendar.getTime();
     }
 
+    public static Date offsetDay(Date date, int offset) {
+        Calendar calendar = new GregorianCalendar();
+        calendar.setTime(date);
+        calendar.add(Calendar.DATE, offset);
+        return calendar.getTime();
+    }
+
     public static String getWeekOfDate(Date date, Lanagues language) {
         String name = "";
         Calendar calendar = Calendar.getInstance();
@@ -305,7 +315,7 @@ public class DateUtil {
             weekIndex = 0;
         }
 
-        switch(language) {
+        switch (language) {
             case CHINESE:
                 name = Week.getName(weekIndex);
                 break;
@@ -317,7 +327,7 @@ public class DateUtil {
     }
 
     public static Date LocalDateTimeToDate(LocalDateTime localDateTime) {
-       return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
+        return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
     }
 
     public static enum Week {
@@ -338,7 +348,7 @@ public class DateUtil {
             Week[] var2 = values();
             int var3 = var2.length;
 
-            for(int var4 = 0; var4 < var3; ++var4) {
+            for (int var4 = 0; var4 < var3; ++var4) {
                 Week week = var2[var4];
                 if (week.getIndex() == index) {
                     name = week.getName();
@@ -353,7 +363,7 @@ public class DateUtil {
             Week[] var2 = values();
             int var3 = var2.length;
 
-            for(int var4 = 0; var4 < var3; ++var4) {
+            for (int var4 = 0; var4 < var3; ++var4) {
                 Week week = var2[var4];
                 if (week.getIndex() == index) {
                     name = week.getEnName();

+ 1 - 1
sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/model/TobleTop.java

@@ -11,5 +11,5 @@ import lombok.Data;
 public class TobleTop {
     private String name;
     private String value;
-    private int total;
+    private Integer total;
 }

+ 12 - 4
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java

@@ -8,13 +8,11 @@ import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.easyexcel.RequestHolder;
 import com.sckw.excel.utils.ExcelUtil;
-import com.sckw.fleet.model.KwfDriver;
-import com.sckw.fleet.model.KwfDriverCard;
-import com.sckw.fleet.model.KwfDriverLicense;
-import com.sckw.fleet.model.KwfDriverQualification;
+import com.sckw.fleet.model.*;
 import com.sckw.fleet.model.dto.*;
 import com.sckw.fleet.model.vo.KwfDriverVo;
 import com.sckw.fleet.service.KwfDriverService;
@@ -60,11 +58,16 @@ public class KwfDriverController {
         //司机从业资格证
         KwfDriverQualification qualificationJson = driverService.findQualificationByKey(driver.getId());
 
+        //车队班组
+        KwfFleet fleet = driverService.findByFleetDriver(id, LoginUserHolder.getEntId());
+
         //数据组装
         JSONObject driverJson = JSONObject.parseObject(JSON.toJSONString(driver));
         driverJson.put("driverCard", cardJson);
         driverJson.put("driverLicense", licenseJson);
         driverJson.put("driverQualification", qualificationJson);
+        driverJson.put("fleetId", fleet.getId());
+        driverJson.put("fleetName", fleet.getName());
         return HttpResult.ok(driverJson);
     }
 
@@ -105,11 +108,16 @@ public class KwfDriverController {
         //司机从业资格证
         KwfDriverQualification qualificationJson = driverService.findQualificationByKey(driver.getId());
 
+        //车队班组
+        KwfFleet fleet = driverService.findByFleetDriver(id, LoginUserHolder.getEntId());
+
         //数据组装
         JSONObject driverJson = JSONObject.parseObject(JSON.toJSONString(driver));
         driverJson.put("driverCard", cardJson);
         driverJson.put("driverLicense", licenseJson);
         driverJson.put("driverQualification", qualificationJson);
+        driverJson.put("fleetId", fleet.getId());
+        driverJson.put("fleetName", fleet.getName());
         return HttpResult.ok(driverJson);
     }
 

+ 11 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java

@@ -8,6 +8,7 @@ import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.easyexcel.RequestHolder;
 import com.sckw.excel.utils.ExcelUtil;
@@ -55,10 +56,15 @@ public class KwfTruckController {
         //车辆道路运输许可证
         KwfTransportLicense transportLicense = truckService.findTransportLicenseByKey(id);
 
+        //车队班组
+        KwfFleet fleet = truckService.findByFleetTruck(id, LoginUserHolder.getEntId());
+
         //数据组装
         JSONObject truckJson = JSONObject.parseObject(JSON.toJSONString(truck));
         truckJson.put("truckLicense", truckLicense);
         truckJson.put("transportLicense", transportLicense);
+        truckJson.put("fleetId", fleet.getId());
+        truckJson.put("fleetName", fleet.getName());
         return HttpResult.ok(truckJson);
     }
 
@@ -91,10 +97,15 @@ public class KwfTruckController {
         //车辆道路运输许可证
         KwfTransportLicense transportLicense = truckService.findTransportLicenseByKey(id);
 
+        //车队班组
+        KwfFleet fleet = truckService.findByFleetTruck(id, LoginUserHolder.getEntId());
+
         //数据组装
         JSONObject truckJson = JSONObject.parseObject(JSON.toJSONString(truck));
         truckJson.put("truckLicense", truckLicense);
         truckJson.put("transportLicense", transportLicense);
+        truckJson.put("fleetId", fleet.getId());
+        truckJson.put("fleetName", fleet.getName());
         return HttpResult.ok(truckJson);
     }
 

+ 2 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfDriverCardMapper.java

@@ -12,6 +12,8 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface KwfDriverCardMapper extends BaseMapper<KwfDriverCard> {
 
+    int insert1(KwfDriverCard params);
+
     /**
      * 查询
      * @param driverId 司机id

+ 13 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfFleetDriverMapper.java

@@ -1,8 +1,12 @@
 package com.sckw.fleet.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sckw.fleet.model.KwfFleet;
 import com.sckw.fleet.model.KwfFleetDriver;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
 
 /**
  * @desc 车队-司机 Mapper 接口
@@ -18,4 +22,13 @@ public interface KwfFleetDriverMapper extends BaseMapper<KwfFleetDriver> {
      * @return
      */
     KwfFleetDriver findByTruckDriver(KwfFleetDriver params);
+
+    /**
+     * @param driverId 司机id
+     * @param entId 企业id
+     * @desc 查询车队班组
+     * @author zk
+     * @date 2023/7/20
+     **/
+    KwfFleet findByFleetDriver(@Param("driverId") Long driverId, @Param("entId") Long entId);
 }

+ 11 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfFleetTruckMapper.java

@@ -1,9 +1,11 @@
 package com.sckw.fleet.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sckw.fleet.model.KwfFleet;
 import com.sckw.fleet.model.KwfFleetTruck;
 import com.sckw.fleet.model.KwfTruckEnt;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * @desc 车队-车辆 Mapper 接口
@@ -19,4 +21,13 @@ public interface KwfFleetTruckMapper extends BaseMapper<KwfFleetTruck> {
      * @return
      */
     KwfFleetTruck findByTruckFleet(KwfFleetTruck params);
+
+    /**
+     * @param truckId 车辆id
+     * @param entId 企业id
+     * @desc 查询车队班组
+     * @author zk
+     * @date 2023/7/20
+     **/
+    KwfFleet findByFleetTruck(@Param("truckId") Long truckId, @Param("entId") Long entId);
 }

+ 4 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfDriverCardDto.java

@@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import jakarta.validation.constraints.Pattern;
 import jakarta.validation.constraints.Size;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.util.Date;
 
 /**
@@ -33,7 +35,8 @@ public class KwfDriverCardDto {
     /**
      * 有效日期
      */
-    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date expireTime;
 
     /**

+ 4 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfDriverLicenseDto.java

@@ -3,6 +3,8 @@ package com.sckw.fleet.model.dto;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import jakarta.validation.constraints.Size;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.util.Date;
 
 /**
@@ -37,7 +39,8 @@ public class KwfDriverLicenseDto {
     /**
      * 有效日期
      */
-    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date expireTime;
 
     /**

+ 4 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfDriverQualificationDto.java

@@ -3,6 +3,8 @@ package com.sckw.fleet.model.dto;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import jakarta.validation.constraints.Size;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.util.Date;
 
 /**
@@ -37,7 +39,8 @@ public class KwfDriverQualificationDto {
     /**
      * 有效日期
      */
-    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date expireTime;
 
     /**

+ 6 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfTransportLicenseDto.java

@@ -3,6 +3,8 @@ package com.sckw.fleet.model.dto;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import jakarta.validation.constraints.Size;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.util.Date;
 
 /**
@@ -44,13 +46,15 @@ public class KwfTransportLicenseDto {
     /**
      * 发证日期
      */
-    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date grantTime;
 
     /**
      * 有效期至
      */
-    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date expireTime;
 
     /**

+ 6 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfTruckLicenseDto.java

@@ -3,6 +3,8 @@ package com.sckw.fleet.model.dto;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import jakarta.validation.constraints.Size;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.util.Date;
 
 /**
@@ -44,13 +46,15 @@ public class KwfTruckLicenseDto {
     /**
      * 注册日期
      */
-    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date regTime;
 
     /**
      * 发证日期
      */
-    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date grantTime;
 
     /**

+ 6 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverVo.java

@@ -104,6 +104,12 @@ public class KwfDriverVo {
     @ExcelProperty(value = "企业名称", index = 12)
     private String firmName;
 
+    /**
+     * 车队班组
+     */
+    @ExcelIgnore
+    private String fleetId;
+
     /**
      * 车队班组
      */

+ 16 - 3
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java

@@ -20,6 +20,7 @@ import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -527,6 +528,18 @@ public class KwfDriverService {
         }
     }
 
+    /**
+     * @param driverId 司机id
+     * @param entId 企业id
+     * @desc 查询车队班组
+     * @author zk
+     * @date 2023/7/20
+     **/
+    public KwfFleet findByFleetDriver(Long driverId, Long entId) {
+        return fleetDriverDao.findByFleetDriver(driverId, entId);
+    }
+
+
     /**
      * @param params 参数
      * @desc: 修改密码
@@ -627,17 +640,17 @@ public class KwfDriverService {
     public void checkLicense(Long driverId) {
         //身份证
         KwfDriverCard card = this.findCarByKey(driverId);
-        if (card == null || StringUtils.isBlank(card)) {
+        if (card == null || (StringUtils.isBlank(card.getCertificateMain()) && StringUtils.isBlank(card.getCertificateRevolt()))) {
             return;
         }
         //司机驾驶证信息
         KwfDriverLicense license = this.findLicenseByKey(driverId);
-        if (license == null || StringUtils.isBlank(license.getDriverNo())) {
+        if (license == null || (StringUtils.isBlank(license.getCertificateMain()) && StringUtils.isBlank(license.getCertificateRevolt()))) {
             return;
         }
         //司机从业资格证
         KwfDriverQualification quali = this.findQualificationByKey(driverId);
-        if (quali == null || StringUtils.isBlank(quali.getQualiNo())) {
+        if (quali == null || (StringUtils.isBlank(quali.getCertificateMain()) && StringUtils.isBlank(quali.getCertificateRevolt()))) {
             return;
         }
         //更新数据

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

@@ -19,6 +19,7 @@ import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
 import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
@@ -435,6 +436,16 @@ public class KwfTruckService {
         }
     }
 
+    /**
+     * @param truckId 车辆id
+     * @param entId 企业id
+     * @desc 查询车队班组
+     * @author zk
+     * @date 2023/7/20
+     **/
+    public KwfFleet findByFleetTruck(Long truckId, Long entId){
+        return fleetTruckDao.findByFleetTruck(truckId, entId);
+    }
 
     /**
      * @param params 参数
@@ -463,12 +474,14 @@ public class KwfTruckService {
     public void checkLicense(Long truckId) {
         //车辆行驶证信息
         KwfTruckLicense license = this.findTruckLicenseByKey(truckId);
-        if (license == null || StringUtils.isBlank(license.getDrivingNo())) {
+        if (license == null || (StringUtils.isBlank(license.getCertificateMain())
+                && StringUtils.isBlank(license.getCertificateRevolt()))) {
             return;
         }
         //车辆道路运输许可证
         KwfTransportLicense transportLicense = this.findTransportLicenseByKey(truckId);
-        if (transportLicense == null || StringUtils.isBlank(transportLicense.getRoadTranNo())) {
+        if (transportLicense == null || (StringUtils.isBlank(transportLicense.getCertificateMain())
+                && StringUtils.isBlank(transportLicense.getCertificateRevolt()))) {
             return;
         }
         //更新数据

+ 92 - 0
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverCardMapper.xml

@@ -2,6 +2,98 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.fleet.dao.KwfDriverCardMapper">
 
+    <insert id="insert1" parameterType="com.sckw.fleet.model.KwfDriverCard">
+        INSERT INTO kwf_driver_card
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="null != driverId and '' != driverId">
+                driver_id,
+            </if>
+            <if test="null != idcard and '' != idcard">
+                idcard,
+            </if>
+            <if test="null != expireTime and '' != expireTime">
+                expire_time,
+            </if>
+            <if test="null != address and '' != address">
+                address,
+            </if>
+            <if test="null != certificateMain and '' != certificateMain">
+                certificate_main,
+            </if>
+            <if test="null != certificateRevolt and '' != certificateRevolt">
+                certificate_revolt,
+            </if>
+            <if test="null != remark and '' != remark">
+                remark,
+            </if>
+            <if test="null != status and '' != status">
+                status,
+            </if>
+            <if test="null != createBy and '' != createBy">
+                create_by,
+            </if>
+            <if test="null != createTime and '' != createTime">
+                create_time,
+            </if>
+            <if test="null != updateBy and '' != updateBy">
+                update_by,
+            </if>
+            <if test="null != updateTime and '' != updateTime">
+                update_time,
+            </if>
+            <if test="null != delFlag and '' != delFlag">
+                del_flag
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="null != driverId and '' != driverId">
+                #{driverId},
+            </if>
+            <if test="null != idcard and '' != idcard">
+                #{idcard},
+            </if>
+            <if test="null != expireTime and '' != expireTime">
+                #{expireTime},
+            </if>
+            <if test="null != address and '' != address">
+                #{address},
+            </if>
+            <if test="null != certificateMain and '' != certificateMain">
+                #{certificateMain},
+            </if>
+            <if test="null != certificateRevolt and '' != certificateRevolt">
+                #{certificateRevolt},
+            </if>
+            <if test="null != remark and '' != remark">
+                #{remark},
+            </if>
+            <if test="null != status and '' != status">
+                #{status},
+            </if>
+            <if test="null != createBy and '' != createBy">
+                #{createBy},
+            </if>
+            <if test="null != createTime and '' != createTime">
+                #{createTime},
+            </if>
+            <if test="null != updateBy and '' != updateBy">
+                #{updateBy},
+            </if>
+            <if test="null != updateTime and '' != updateTime">
+                #{updateTime},
+            </if>
+            <if test="null != delFlag and '' != delFlag">
+                #{delFlag}
+            </if>
+        </trim>
+    </insert>
+
     <select id="findByDriverId" resultType="com.sckw.fleet.model.KwfDriverCard" parameterType="java.lang.Long" >
         SELECT
             id, driver_id driverId, idcard, expire_time expireTime, address, certificate_main certificateMain,

+ 1 - 1
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml

@@ -56,7 +56,7 @@
         dr.id, dr.name, dr.phone, dr.idcard, dr.status, drc.expire_time idcardExpireTime, drc.address, drl.driver_no driverNo,
         drl.type licenseType, drl.expire_time licenseExpireTime, drl.grant_unit licenseGrantUnit,
         drq.quali_no qualiNo, dr.ent_id entId, dr.create_by createBy, dr.create_time createTime,
-        dr.update_time updateTime, dr.remark, tr.truck_no truckNo, fl.name fleetName
+        dr.update_time updateTime, dr.remark, tr.truck_no truckNo, fl.id fleetId, fl.name fleetName
         from kwf_driver dr
         left join kwf_driver_ent dre on dre.driver_id = dr.id
         left join kwf_driver_card drc on drc.driver_id = dr.id and drc.del_flag = 0

+ 10 - 0
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfFleetDriverMapper.xml

@@ -10,4 +10,14 @@
         and driver_id = #{driverId, jdbcType=VARCHAR}
         and ent_id = #{entId, jdbcType=VARCHAR}
     </select>
+
+    <select id="findByFleetDriver" resultType="com.sckw.fleet.model.KwfFleet" >
+        SELECT
+        fleet_id id, fl.name
+        FROM kwf_fleet_driver fld
+        left join kwf_fleet fl on fl.id = fld.fleet_id
+        where fld.del_flag = 0
+        and driver_id = #{driverId, jdbcType=VARCHAR}
+        and fld.ent_id = #{entId, jdbcType=VARCHAR}
+    </select>
 </mapper>

+ 10 - 0
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfFleetTruckMapper.xml

@@ -10,4 +10,14 @@
         and truck_id = #{truckId, jdbcType=VARCHAR}
         and ent_id = #{entId, jdbcType=VARCHAR}
     </select>
+
+    <select id="findByFleetTruck" resultType="com.sckw.fleet.model.KwfFleet" >
+        SELECT
+        fleet_id id, fl.name
+        FROM kwf_fleet_truck flt
+        left join kwf_fleet fl on fl.id = flt.fleet_id
+        where flt.del_flag = 0
+        and truck_id = #{truckId, jdbcType=VARCHAR}
+        and flt.ent_id = #{entId, jdbcType=VARCHAR}
+    </select>
 </mapper>

+ 2 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpTransportDemandMapper.java

@@ -1,7 +1,7 @@
 package com.sckw.order.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.sckw.order.model.KwpTransportDemand;
+import com.sckw.order.model.KwoTransportDemand;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -10,5 +10,5 @@ import org.apache.ibatis.annotations.Mapper;
  * @date: 2023-06-25 14:45
  */
 @Mapper
-public interface KwpTransportDemandMapper extends BaseMapper<KwpTransportDemand> {
+public interface KwpTransportDemandMapper extends BaseMapper<KwoTransportDemand> {
 }

+ 15 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpWantBuyAddressMapper.java

@@ -0,0 +1,15 @@
+package com.sckw.order.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sckw.order.model.KwoWantBuyAddress;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @desc: 求购收货地址mapper
+ * @author: yzc
+ * @date: 2023-06-25 14:45
+ */
+@Mapper
+public interface KwpWantBuyAddressMapper extends BaseMapper<KwoWantBuyAddress> {
+
+}

+ 2 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpWantBuyMapper.java

@@ -1,7 +1,7 @@
 package com.sckw.order.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.sckw.order.model.KwpWantBuy;
+import com.sckw.order.model.KwoWantBuy;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -10,6 +10,6 @@ import org.apache.ibatis.annotations.Mapper;
  * @date: 2023-06-25 14:45
  */
 @Mapper
-public interface KwpWantBuyMapper extends BaseMapper<KwpWantBuy> {
+public interface KwpWantBuyMapper extends BaseMapper<KwoWantBuy> {
 
 }

+ 15 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpWantBuyTradingMapper.java

@@ -0,0 +1,15 @@
+package com.sckw.order.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sckw.order.model.KwoWantBuyTrading;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @desc: 求购支付方式mapper
+ * @author: yzc
+ * @date: 2023-06-25 14:45
+ */
+@Mapper
+public interface KwpWantBuyTradingMapper extends BaseMapper<KwoWantBuyTrading> {
+
+}

+ 6 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrder.java

@@ -7,6 +7,8 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 
@@ -20,7 +22,10 @@ import java.time.LocalDate;
 @ToString
 @Accessors(chain = true)
 @TableName("kwo_trade_order")
-public class KwoTradeOrder extends BaseModel {
+public class KwoTradeOrder extends BaseModel implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -4156986025493740589L;
 
     private Long entId;
 

+ 7 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderAddress.java

@@ -7,6 +7,9 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
  * @desc: 交易订单装卸货地址信息
  * @author: yzc
@@ -17,7 +20,10 @@ import lombok.experimental.Accessors;
 @ToString
 @Accessors(chain = true)
 @TableName("kwo_trade_order_address")
-public class KwoTradeOrderAddress extends BaseModel {
+public class KwoTradeOrderAddress extends BaseModel implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -8603636665614208263L;
 
     /**
      * 交易订单id

+ 6 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderContract.java

@@ -7,6 +7,9 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
  * @desc: 交易订单合同(采购合同/销售合同)
  * @author: yzc
@@ -17,8 +20,10 @@ import lombok.experimental.Accessors;
 @ToString
 @Accessors(chain = true)
 @TableName("kwo_trade_order_contract")
-public class KwoTradeOrderContract extends BaseModel {
+public class KwoTradeOrderContract extends BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = -3482504164031633290L;
     /**
      * 合同id
      */

+ 5 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderGoods.java

@@ -7,6 +7,8 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
 import java.math.BigDecimal;
 
 /**
@@ -19,8 +21,10 @@ import java.math.BigDecimal;
 @ToString
 @Accessors(chain = true)
 @TableName("kwo_trade_order_goods")
-public class KwoTradeOrderGoods extends BaseModel {
+public class KwoTradeOrderGoods extends BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = -4889876395927682008L;
     /**
      * 交易订单id
      */

+ 6 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderTrack.java

@@ -7,6 +7,9 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
  * @desc: 交易订单状态记录信息
  * @author: yzc
@@ -17,8 +20,10 @@ import lombok.experimental.Accessors;
 @ToString
 @Accessors(chain = true)
 @TableName("kwo_trade_order_track")
-public class KwoTradeOrderTrack extends BaseModel {
+public class KwoTradeOrderTrack extends BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = -6808166849168284019L;
     /**
      * 交易订单id
      */

+ 6 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderUnit.java

@@ -7,6 +7,9 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
  * @desc: 交易订单采购/销售企业信息
  * @author: yzc
@@ -17,8 +20,10 @@ import lombok.experimental.Accessors;
 @ToString
 @Accessors(chain = true)
 @TableName("kwo_trade_order_unit")
-public class KwoTradeOrderUnit extends BaseModel {
+public class KwoTradeOrderUnit extends BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = 5594999834090510304L;
     /**
      * 交易订单id
      */

+ 7 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwpTransportDemand.java → sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTransportDemand.java

@@ -7,6 +7,8 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
 import java.math.BigDecimal;
 
 /**
@@ -18,8 +20,11 @@ import java.math.BigDecimal;
 @Setter
 @ToString
 @Accessors(chain = true)
-@TableName("kwp_transport_demand")
-public class KwpTransportDemand extends BaseModel {
+@TableName("kwo_transport_demand")
+public class KwoTransportDemand extends BaseModel implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -20316838934950876L;
 
     /**
      * 企业id

+ 18 - 9
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwpWantBuy.java → sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoWantBuy.java

@@ -7,6 +7,8 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
 import java.math.BigDecimal;
 
 /**
@@ -18,9 +20,11 @@ import java.math.BigDecimal;
 @Setter
 @ToString
 @Accessors(chain = true)
-@TableName("kwp_want_buy")
-public class KwpWantBuy extends BaseModel {
+@TableName("kwo_want_buy")
+public class KwoWantBuy extends BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = -6542926857955860014L;
     /**
      * 企业id
      */
@@ -39,18 +43,13 @@ public class KwpWantBuy extends BaseModel {
     /**
      * 尺寸大小
      */
-    private String size;
+    private String spec;
 
     /**
      * 单位(吨、方、件、箱、其他)
      */
     private String unit;
 
-    /**
-     * 交易方式(预付款、货到付款、线下付款)
-     */
-    private String trading;
-
     /**
      * 求购单价(元)
      */
@@ -59,5 +58,15 @@ public class KwpWantBuy extends BaseModel {
     /**
      * 求购总量
      */
-    private BigDecimal totalNum;
+    private BigDecimal amount;
+
+    /**
+     * 联系人姓名
+     */
+    private String contacts;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
 }

+ 83 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoWantBuyAddress.java

@@ -0,0 +1,83 @@
+package com.sckw.order.model;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.sckw.core.model.base.BaseModel;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @desc: 求购收货地址信息
+ * @author: yzc
+ * @date: 2023-06-25 9:31
+ */
+@Getter
+@Setter
+@ToString
+@Accessors(chain = true)
+@TableName("kwo_want_buy_address")
+public class KwoWantBuyAddress extends BaseModel implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -4800311939560885399L;
+
+    /**
+     * 求购id
+     */
+    private Long wantBuyId;
+
+    /**
+     * 地址名称
+     */
+    private String name;
+
+    /**
+     * 地址类型
+     */
+    private String type;
+
+    /**
+     * 联系人姓名
+     */
+    private String contacts;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
+
+    /**
+     * 所在地区
+     */
+    private Integer cityCode;
+
+    /**
+     * 所属区域名称
+     */
+    private String cityName;
+
+    /**
+     * 详细地址
+     */
+    private String detailAddress;
+
+    /**
+     * 纬度
+     */
+    private String lat;
+
+    /**
+     * 经度
+     */
+    private String lng;
+
+    /**
+     * 电子围栏
+     */
+    private String fence;
+
+}

+ 38 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoWantBuyTrading.java

@@ -0,0 +1,38 @@
+package com.sckw.order.model;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.sckw.core.model.base.BaseModel;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @desc: 求购支付方式信息
+ * @author: yzc
+ * @date: 2023-06-25 9:31
+ */
+@Getter
+@Setter
+@ToString
+@Accessors(chain = true)
+@TableName("kwo_want_buy_trading")
+public class KwoWantBuyTrading extends BaseModel implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -7895014107811238535L;
+    /**
+     * 求购id
+     */
+    private Long wantBuyId;
+
+    /**
+     * 支付方式
+     */
+    private String trading;
+
+
+}

+ 6 - 8
sckw-modules/sckw-product/src/main/java/com/sckw/product/controller/KwpGoodsController.java

@@ -1,8 +1,8 @@
 package com.sckw.product.controller;
 
+import com.sckw.core.exception.BusinessException;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.web.response.HttpResult;
-import com.sckw.excel.easyexcel.RequestHolder;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.product.model.GoodsListExport;
 import com.sckw.product.model.vo.req.*;
@@ -62,7 +62,7 @@ public class KwpGoodsController {
      */
     @GetMapping("/detail")
     public HttpResult detail(@RequestParam Long id) {
-        return HttpResult.ok(kwpGoodsService.detail(id,false));
+        return HttpResult.ok(kwpGoodsService.detail(id, false));
     }
 
     /**
@@ -111,14 +111,12 @@ public class KwpGoodsController {
      * @return: com.sckw.core.web.response.HttpResult
      */
     @PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
-    public HttpResult export(@RequestBody ExportGoodsListParam params) {
-        HttpServletResponse response = RequestHolder.getResponse();
+    public void export(@RequestBody ExportGoodsListParam params, HttpServletResponse response) {
         List<GoodsListExport> list = kwpGoodsService.export(params);
-        if (CollectionUtils.isNotEmpty(list)) {
-            ExcelUtil.download(response, GoodsListExport.class, list);
-            return HttpResult.ok();
+        if (CollectionUtils.isEmpty(list)) {
+            throw new BusinessException("导出数据为空!");
         }
-        return HttpResult.error("没有可导出的数据");
+        ExcelUtil.downData(response, GoodsListExport.class, list);
     }
 
 

+ 4 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/GoodsListExport.java

@@ -5,6 +5,7 @@ import com.sckw.excel.annotation.ExcelContext;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
 import java.io.Serializable;
 
 /**
@@ -17,6 +18,9 @@ import java.io.Serializable;
 @ExcelContext(fileName = "商品列表信息", sheetName = "商品列表信息")
 public class GoodsListExport implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = 6833195135537265912L;
+
     @ExcelProperty(value = "上架状态", index = 0)
     private String statusLabel;
 

+ 5 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoods.java

@@ -8,6 +8,8 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -21,8 +23,10 @@ import java.util.Date;
 @ToString
 @Accessors(chain = true)
 @TableName("kwp_goods")
-public class KwpGoods extends BaseModel {
+public class KwpGoods extends BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = -4571752839456202179L;
     /**
      * 企业id
      */

+ 6 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsAddress.java

@@ -7,6 +7,9 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
  * @desc: 商品地址信息
  * @author: yzc
@@ -17,8 +20,10 @@ import lombok.experimental.Accessors;
 @ToString
 @Accessors(chain = true)
 @TableName("kwp_goods_address")
-public class KwpGoodsAddress extends BaseModel {
+public class KwpGoodsAddress extends BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = -3900287269028978124L;
     /**
      * 商品id
      */

+ 6 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsAttribute.java

@@ -7,6 +7,9 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
  * @desc: 商品-参数类目
  * @author: yzc
@@ -17,8 +20,10 @@ import lombok.experimental.Accessors;
 @ToString
 @Accessors(chain = true)
 @TableName("kwp_goods_attribute")
-public class KwpGoodsAttribute extends BaseModel {
+public class KwpGoodsAttribute extends BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = 1003536970271997258L;
     /**
      * 商品id
      */

+ 6 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsImage.java

@@ -7,6 +7,9 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
  * @desc: 商品-图片
  * @author: yzc
@@ -17,8 +20,10 @@ import lombok.experimental.Accessors;
 @ToString
 @Accessors(chain = true)
 @TableName("kwp_goods_image")
-public class KwpGoodsImage extends BaseModel {
+public class KwpGoodsImage extends BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = 3897772508943943613L;
     /**
      * 商品id
      */

+ 5 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsPriceRange.java

@@ -7,6 +7,8 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
 import java.math.BigDecimal;
 
 /**
@@ -19,8 +21,10 @@ import java.math.BigDecimal;
 @ToString
 @Accessors(chain = true)
 @TableName("kwp_goods_price_range")
-public class KwpGoodsPriceRange extends BaseModel {
+public class KwpGoodsPriceRange extends BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = 234896343045075865L;
     /**
      * 商品id
      */

+ 6 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsSku.java

@@ -7,6 +7,9 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
  * @desc: 商品-规格(sku)
  * @author: yzc
@@ -17,8 +20,10 @@ import lombok.experimental.Accessors;
 @ToString
 @Accessors(chain = true)
 @TableName("kwp_goods_sku")
-public class KwpGoodsSku extends BaseModel {
+public class KwpGoodsSku extends BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = -6249704905372870133L;
     /**
      * 商品code
      */

+ 2 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/req/AddGoodsParam.java

@@ -60,6 +60,7 @@ public class AddGoodsParam {
      * 参数目录
      */
     @Size(max = 10, message = "参数目录最多支持10个")
+    @Valid
     private List<GoodsAttributes> attributes;
 
     /**
@@ -123,6 +124,7 @@ public class AddGoodsParam {
      * 商品详情图片
      */
     @Size(max = 5, message = "商品详情图片最多支持5张")
+    @Valid
     private List<GoodsImages> images;
 
 }

+ 4 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/req/GoodsImages.java

@@ -1,8 +1,10 @@
 package com.sckw.product.model.vo.req;
 
+import jakarta.validation.constraints.NotNull;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
+import org.apache.logging.log4j.core.config.plugins.validation.constraints.NotBlank;
 
 /**
  * @desc: 商品图片
@@ -17,10 +19,12 @@ public class GoodsImages {
     /**
      * 图片地址
      */
+    @NotBlank(message = "图片地址不能为空")
     private String image;
 
     /**
      * 图片排序
      */
+    @NotNull(message = "图片排序不能为空")
     private Integer sort;
 }

+ 10 - 5
sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java

@@ -464,8 +464,10 @@ public class KwpGoodsService {
         if (CollectionUtils.isNotEmpty(params.getIds())) {
             wrapper.in(KwpGoods::getId, params.getIds());
         } else {
+            if (Objects.nonNull(params.getEndCreateTime())){
+                wrapper.le(KwpGoods::getCreateTime, DateUtil.offsetDay(params.getEndCreateTime(), 1));
+            }
             wrapper.ge(Objects.nonNull(params.getStartCreateTime()), KwpGoods::getCreateTime, params.getStartCreateTime())
-                    .le(Objects.nonNull(params.getEndCreateTime()), KwpGoods::getCreateTime, params.getEndCreateTime())
                     .eq(StringUtils.isNotBlank(params.getTrading()), KwpGoods::getTrading, params.getTrading())
                     .eq(StringUtils.isNotBlank(params.getGoodsType()), KwpGoods::getGoodsType, params.getGoodsType())
                     .eq(Objects.nonNull(params.getStatus()) && isPage, KwpGoods::getStatus, params.getStatus());
@@ -533,9 +535,10 @@ public class KwpGoodsService {
         List<GoodsListExport> list = new ArrayList<>();
         goodsLists.forEach(e -> {
             GoodsListExport export = BeanUtils.copyProperties(e, GoodsListExport.class);
-            export.setHighestPrice(String.valueOf(e.getHighestPrice())).setLowestPrice(String.valueOf(e.getLowestPrice()))
+            export.setHighestPrice(Objects.isNull(e.getHighestPrice()) ? null : String.valueOf(e.getHighestPrice()))
+                    .setLowestPrice(Objects.isNull(e.getLowestPrice()) ? null : String.valueOf(e.getLowestPrice()))
                     .setAddedTime(Objects.isNull(e.getAddedTime()) ? null : DateUtil.getDateTime(e.getAddedTime()))
-                    .setAddedTime(Objects.isNull(e.getShelfTime()) ? null : DateUtil.getDateTime(e.getShelfTime()));
+                    .setShelfTime(Objects.isNull(e.getShelfTime()) ? null : DateUtil.getDateTime(e.getShelfTime()));
             list.add(export);
         });
         return list;
@@ -638,8 +641,10 @@ public class KwpGoodsService {
                 .eq(KwpGoods::getStatus, GoodsStatusEnum.PUT_ON_SHELVES.getCode()).eq(KwpGoods::getDelFlag, Global.NO);
         if (Objects.nonNull(params.getAreaCode()) && Objects.nonNull(params.getAreaLevel())) {
             switch (params.getAreaLevel()) {
-                case 1 -> wrapper.likeRight(KwpGoods::getAreaCode, String.valueOf(params.getAreaCode()).substring(0, 2));
-                case 2 -> wrapper.likeRight(KwpGoods::getAreaCode, String.valueOf(params.getAreaCode()).substring(0, 4));
+                case 1 ->
+                        wrapper.likeRight(KwpGoods::getAreaCode, String.valueOf(params.getAreaCode()).substring(0, 2));
+                case 2 ->
+                        wrapper.likeRight(KwpGoods::getAreaCode, String.valueOf(params.getAreaCode()).substring(0, 4));
                 case 3 -> wrapper.eq(KwpGoods::getAreaCode, params.getAreaCode());
             }
         }

+ 5 - 7
sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwOrderController.java

@@ -1,8 +1,8 @@
 package com.sckw.report.controller;
 
+import com.sckw.core.exception.BusinessException;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.web.response.HttpResult;
-import com.sckw.excel.easyexcel.RequestHolder;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.report.service.KwOrderService;
 import com.sckw.report.service.param.*;
@@ -70,14 +70,12 @@ public class KwOrderController {
      * @return: com.sckw.core.web.response.HttpResult
      */
     @PostMapping(value = "/tradeOrderExport", produces = MediaType.APPLICATION_JSON_VALUE)
-    public HttpResult export(@RequestBody @Validated TradeOrderListExportParam params) {
-        HttpServletResponse response = RequestHolder.getResponse();
+    public void export(@RequestBody @Validated TradeOrderListExportParam params, HttpServletResponse response) {
         List<TradeOrderListExport> list = orderService.export(params);
-        if (CollectionUtils.isNotEmpty(list)) {
-            ExcelUtil.download(response, TradeOrderListExport.class, list);
-            return HttpResult.ok();
+        if (CollectionUtils.isEmpty(list)) {
+            throw new BusinessException("导出数据为空!");
         }
-        return HttpResult.error("没有可导出的数据");
+        ExcelUtil.downData(response, TradeOrderListExport.class, list);
     }
 
     /**

+ 8 - 5
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwOrderService.java

@@ -120,11 +120,12 @@ public class KwOrderService {
             andCriteria.and("supplyTopEntId").is(entId);
         }
         //日期范围
-        if (Objects.nonNull(params.getStartCreateTime())) {
+        if (Objects.nonNull(params.getStartCreateTime()) && Objects.nonNull(params.getEndCreateTime())) {
+            andCriteria.and("createTime").gte(params.getStartCreateTime()).lte(DateUtil.offsetDay(params.getEndCreateTime(), 1));
+        } else if (Objects.nonNull(params.getStartCreateTime())) {
             andCriteria.and("createTime").gte(params.getStartCreateTime());
-        }
-        if (Objects.nonNull(params.getEndCreateTime())) {
-            andCriteria.and("createTime").lte(params.getEndCreateTime());
+        } else if (Objects.nonNull(params.getEndCreateTime())) {
+            andCriteria.and("createTime").lte(DateUtil.offsetDay(params.getEndCreateTime(), 1));
         }
         //装卸货地址
         if (StringUtils.isNotBlank(params.getShippingAddressCode())) {
@@ -250,8 +251,10 @@ public class KwOrderService {
                     .setSource(DictEnum.getLabel(DictTypeEnum.TORDER_SOURCE.getType(), e.getSource()))
                     .setUnitPrice(String.valueOf(e.getUnitPrice())).setPrice(String.valueOf(e.getPrice()))
                     .setAmount(String.valueOf(e.getAmount())).setActualAmount(String.valueOf(e.getActualAmount()))
+                    .setActualAmount(Objects.isNull(e.getActualAmount()) ? "0.00" : String.valueOf(e.getActualAmount()))
                     .setStartTime(Objects.isNull(e.getStartTime()) ? null : DateUtil.dateToStr(e.getStartTime()))
-                    .setAddedTime(Objects.isNull(e.getEndTime()) ? null : DateUtil.dateToStr(e.getEndTime()));
+                    .setAddedTime(Objects.isNull(e.getEndTime()) ? null : DateUtil.dateToStr(e.getEndTime()))
+                    .setCreateTime(DateUtil.getDateTime(e.getCreateTime()));
             list.add(export);
         });
         return list;

+ 40 - 113
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwTransportService.java

@@ -17,6 +17,7 @@ import com.sckw.report.service.param.ConsignOrderQuery;
 import com.sckw.report.service.param.WaybillOrderQuery;
 import com.sckw.report.service.vo.CarWaybillVo;
 import com.sckw.report.service.vo.ConsignOrderVo;
+import com.sckw.report.service.vo.WaybillsCountVo;
 import com.sckw.transport.api.dubbo.TransportDubboService;
 import com.sckw.transport.api.model.dto.vo.KwtLogisticsOrderVO;
 import lombok.extern.slf4j.Slf4j;
@@ -335,45 +336,7 @@ public class KwTransportService {
      * @date 2023/07/21
      */
     public HttpResult getWaybillOrders(WaybillOrderQuery query) throws ParseException {
-        // 模糊匹配
-        // 根据条件查询所有并排序,且分页
-        // 设置模糊查询匹配规则  忽略大小写
-        // 创建条件对象
-        Criteria criteria = new Criteria();
-        criteria.and("entId").is(LoginUserHolder.getEntId());
-        criteria.and("delFlag").is(NumberConstant.ZERO);
-        // 装载时间
-        if (StringUtils.isNotBlank(query.getStartLoadTime()) && StringUtils.isNotEmpty(query.getEndLoadTime())) {
-            criteria.andOperator(Criteria.where("loadTime").gte(query.getStartLoadTime()), Criteria.where("loadTime")
-                    .lte(query.getEndLoadTime()));
-        }
-        // 派车时间
-        if (StringUtils.isNotBlank(query.getStartSendCarTime()) && StringUtils.isNotEmpty(query.getEndSendCarTime())) {
-            criteria.andOperator(Criteria.where("sendCarTime").gte(query.getStartSendCarTime()), Criteria.where("sendCarTime")
-                    .lte(query.getEndSendCarTime()));
-        }
-        // 卸货时间
-        if (StringUtils.isNotBlank(query.getStartUnloadTime()) && StringUtils.isNotEmpty(query.getEndUnloadTime())) {
-            criteria.andOperator(Criteria.where("unloadTime").gte(query.getStartUnloadTime()), Criteria.where("unloadTime")
-                    .lte(query.getEndUnloadTime()));
-        }
-        // 多条件模糊查询
-        Criteria c1 = new Criteria();
-        Criteria c2 = new Criteria();
-        Criteria c3 = new Criteria();
-        Criteria c4 = new Criteria();
-        Criteria c5 = new Criteria();
-        Criteria c6 = new Criteria();
-        if (StringUtils.isNotBlank(query.getKeywords())) {
-            Pattern pattern = Pattern.compile("^.*" + query.getKeywords() + ".*$", Pattern.CASE_INSENSITIVE);
-            c1 = Criteria.where("wOrderNo").regex(pattern);
-            c2 = Criteria.where("truckNo").regex(pattern);
-            c3 = Criteria.where("driverName").regex(pattern);
-            c4 = Criteria.where("firmName").regex(pattern);
-            c5 = Criteria.where("loadAddress").regex(pattern);
-            c6 = Criteria.where("unloadAddress").regex(pattern);
-            criteria.orOperator(c1, c2, c3, c4, c5, c6);
-        }
+        Criteria criteria = buildWaybillOrdersQuery(query);
         Query queryFormat = new Query(criteria);
         // in查询
         if (CollectionUtils.isNotEmpty(query.getIds())) {
@@ -394,17 +357,14 @@ public class KwTransportService {
     }
 
     /**
-     * 运单管理-运单列表 top 统计
-     *
-     * @param query 查询
-     * @return {@link HttpResult }
-     * @author jc
-     * @date 2023/07/21
+     *  构造运单关联查询条件
+     * @param query
+     * @return
      */
-    public HttpResult getWayBillStatistics(WaybillOrderQuery query){
-        //模糊匹配
-        //根据条件查询所有并排序,且分页
-        //设置模糊查询匹配规则  忽略大小写
+    public Criteria buildWaybillOrdersQuery(WaybillOrderQuery query) {
+        // 模糊匹配
+        // 根据条件查询所有并排序,且分页
+        // 设置模糊查询匹配规则  忽略大小写
         // 创建条件对象
         Criteria criteria = new Criteria();
         criteria.and("entId").is(LoginUserHolder.getEntId());
@@ -445,6 +405,19 @@ public class KwTransportService {
             c6 = Criteria.where("unloadAddress").regex(pattern);
             criteria.orOperator(c1, c2, c3, c4, c5, c6);
         }
+        return criteria;
+    }
+
+    /**
+     * 运单管理-运单列表 top 统计
+     *
+     * @param query 查询
+     * @return {@link HttpResult }
+     * @author jc
+     * @date 2023/07/21
+     */
+    public HttpResult getWayBillStatistics(WaybillOrderQuery query){
+        Criteria criteria = buildWaybillOrdersQuery(query);
         Aggregation aggregation = Aggregation.newAggregation(
                 Aggregation.match(criteria),
                 Aggregation.group("status").count().as("total"),
@@ -483,76 +456,22 @@ public class KwTransportService {
      */
     public HttpResult wayBillTotalCount(WaybillOrderQuery query){
         // 统计项字段
-        Criteria criteria = new Criteria();
-        criteria.and("entId").is(LoginUserHolder.getEntId());
-        criteria.and("delFlag").is(NumberConstant.ZERO);
-
-        if (StringUtils.isNotBlank(query.getStatus())) {
-            criteria.and("status").is(query.getStatus());
-        }
-        // 装载时间
-        if (StringUtils.isNotBlank(query.getStartLoadTime()) && StringUtils.isNotEmpty(query.getEndLoadTime())) {
-            criteria.andOperator(Criteria.where("loadTime").gte(query.getStartLoadTime()), Criteria.where("loadTime")
-                    .lte(query.getEndLoadTime()));
-        }
-        // 派车时间
-        if (StringUtils.isNotBlank(query.getStartSendCarTime()) && StringUtils.isNotEmpty(query.getEndSendCarTime())) {
-            criteria.andOperator(Criteria.where("sendCarTime").gte(query.getStartSendCarTime()), Criteria.where("sendCarTime")
-                    .lte(query.getEndSendCarTime()));
-        }
-        // 卸货时间
-        if (StringUtils.isNotBlank(query.getStartUnloadTime()) && StringUtils.isNotEmpty(query.getEndUnloadTime())) {
-            criteria.andOperator(Criteria.where("unloadTime").gte(query.getStartUnloadTime()), Criteria.where("unloadTime")
-                    .lte(query.getEndUnloadTime()));
-        }
-        // 多条件模糊查询
-        Criteria c1 = new Criteria();
-        Criteria c2 = new Criteria();
-        Criteria c3 = new Criteria();
-        Criteria c4 = new Criteria();
-        Criteria c5 = new Criteria();
-        Criteria c6 = new Criteria();
-        if (StringUtils.isNotBlank(query.getKeywords())) {
-            Pattern pattern = Pattern.compile("^.*" + query.getKeywords() + ".*$", Pattern.CASE_INSENSITIVE);
-            c1 = Criteria.where("wOrderNo").regex(pattern);
-            c2 = Criteria.where("truckNo").regex(pattern);
-            c3 = Criteria.where("driverName").regex(pattern);
-            c4 = Criteria.where("firmName").regex(pattern);
-            c5 = Criteria.where("loadAddress").regex(pattern);
-            c6 = Criteria.where("unloadAddress").regex(pattern);
-            criteria.orOperator(c1, c2, c3, c4, c5, c6);
-        }
+        Criteria criteria = buildWaybillOrdersQuery(query);
         Aggregation aggregation = Aggregation.newAggregation(
                 Aggregation.match(criteria),
-                Aggregation.group("status").count().as("total"),
-                Aggregation.project("total").and("value").previousOperation()
+                Aggregation.group("id").count().as("countTotal")
+                        .sum("entrustAmount").as("entrustTotal")
+                        .sum("loadAmount").as("loadTotal")
+                        .sum("unloadAmount").as("unloadTotal"),
+                Aggregation.project("countTotal", "entrustTotal", "loadTotal", "unloadTotal")
         );
-        AggregationResults<TobleTop> outputTypeCount = mongoTemplate.aggregate(aggregation, SckwWaybillOrder.class, TobleTop.class);
-        List<TobleTop> results = outputTypeCount.getMappedResults();
-        // 填充默认值
-        List<TobleTop> list = new ArrayList<>();
-        for (CarWaybillEnum status:CarWaybillEnum.values()) {
-            TobleTop top = new TobleTop();
-            top.setName(status.getDestination());
-            top.setValue(String.valueOf(status.getCode()));
-            top.setTotal(0);
-            if(CollectionUtils.isNotEmpty(results)) {
-                for (TobleTop result:results) {
-                    if(StringUtils.isNotEmpty(result.getValue()) && String.valueOf(result.getValue()).equals(String.valueOf(status.getCode()))) {
-                        top.setTotal(result.getTotal());
-                        continue;
-                    }
-                }
-            }
-            list.add(top);
-        }
-
-        // 查询结果
-        return HttpResult.ok(list);
+        AggregationResults<WaybillsCountVo> outputTypeCount = mongoTemplate.aggregate(aggregation, SckwWaybillOrder.class, WaybillsCountVo.class);
+        List<WaybillsCountVo> results = outputTypeCount.getMappedResults();
+        return HttpResult.ok(results);
     }
 
     /**
-     * 处理运单查询结果
+     * 运单处理运单查询结果
      * @param list
      * @param returnList
      */
@@ -584,6 +503,14 @@ public class KwTransportService {
                     null : DateUtil.getDateTime(waybillOrder.getLoadTime()));
             vo.setUnloadTime(waybillOrder.getUnloadTime() == null ?
                     null :DateUtil.getDateTime(waybillOrder.getUnloadTime()));
+            vo.setCreateTime(waybillOrder.getCreateTime() == null ?
+                    null : DateUtil.getDateTime(waybillOrder.getCreateTime()));
+            vo.setUpdateTime(waybillOrder.getUpdateTime() == null ?
+                    null :DateUtil.getDateTime(waybillOrder.getUpdateTime()));
+            vo.setDeficitAmount(waybillOrder.getDeficitAmount() == null ?
+                    null :String.valueOf(waybillOrder.getDeficitAmount()));
+            vo.setGoodsPriceUnit(waybillOrder.getGoodsPriceUnit() == null ?
+                    null :String.valueOf(waybillOrder.getGoodsPriceUnit()));
             returnList.add(vo);
         }
     }

+ 35 - 29
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/param/TradeOrderListExport.java

@@ -5,6 +5,9 @@ import com.sckw.excel.annotation.ExcelContext;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
  * @desc: 交易列表信息导出对象
  * @author: yzc
@@ -13,83 +16,86 @@ import lombok.experimental.Accessors;
 @Data
 @Accessors(chain = true)
 @ExcelContext(fileName = "交易列表信息", sheetName = "交易列表信息")
-public class TradeOrderListExport {
-    @ExcelProperty(value = "上架状态", index = 0)
+public class TradeOrderListExport implements Serializable {
+    @Serial
+    private static final long serialVersionUID = -5895230502149598364L;
+
+    @ExcelProperty(value = "上架状态" )
     private String status;
 
-    @ExcelProperty(value = "订单编号", index = 1)
+    @ExcelProperty(value = "订单编号" )
     private String tOrderNo;
 
-    @ExcelProperty(value = "采购单位", index = 2)
+    @ExcelProperty(value = "采购单位")
     private String procureFirmName;
 
-    @ExcelProperty(value = "销售单位", index = 3)
+    @ExcelProperty(value = "销售单位")
     private String supplyFirmName;
 
-    @ExcelProperty(value = "交付类型", index = 4)
+    @ExcelProperty(value = "交付类型" )
     private String deliveryType;
 
-    @ExcelProperty(value = "提货方式", index = 5)
+    @ExcelProperty(value = "提货方式" )
     private String pickupType;
 
-    @ExcelProperty(value = "托运状态", index = 6)
+    @ExcelProperty(value = "托运状态")
     private String consignmentStatus;
 
-    @ExcelProperty(value = "下单方式", index = 7)
+    @ExcelProperty(value = "下单方式" )
     private String source;
 
-    @ExcelProperty(value = "付款类型", index = 8)
+    @ExcelProperty(value = "付款类型")
     private String trading;
 
-    @ExcelProperty(value = "关联合同", index = 9)
+    @ExcelProperty(value = "关联合同")
     private String contractNo;
 
-    @ExcelProperty(value = "承包方式", index = 10)
+    @ExcelProperty(value = "承包方式")
     private String contractSigningWay;
 
-    @ExcelProperty(value = "商品名称", index = 11)
-    private String manageName;
+    @ExcelProperty(value = "商品名称")
+    private String goodsName;
 
-    @ExcelProperty(value = "规格", index = 12)
+    @ExcelProperty(value = "规格")
     private String goodsSpec;
 
-    @ExcelProperty(value = "上架时间", index = 13)
+    @ExcelProperty(value = "上架时间")
     private String addedTime;
 
-    @ExcelProperty(value = "单价/元", index = 14)
+    @ExcelProperty(value = "单价/元")
     private String unitPrice;
 
-    @ExcelProperty(value = "订单金额", index = 15)
+    @ExcelProperty(value = "订单金额")
     private String price;
 
-    @ExcelProperty(value = "订单目标", index = 16)
+    @ExcelProperty(value = "订单目标")
     private String amount;
 
-    @ExcelProperty(value = "已履约量", index = 17)
+    @ExcelProperty(value = "已履约量")
     private String actualAmount;
 
-    @ExcelProperty(value = "归属项目", index = 14)
+    @ExcelProperty(value = "归属项目")
     private String projectName;
 
-    @ExcelProperty(value = "装货地点", index = 15)
+    @ExcelProperty(value = "装货地点")
     private String loadCityName;
 
-    @ExcelProperty(value = "卸货地点", index = 16)
+    @ExcelProperty(value = "卸货地点")
     private String unloadCityName;
 
-    @ExcelProperty(value = "计划开始时间", index = 17)
+    @ExcelProperty(value = "计划开始时间")
     private String startTime;
 
-    @ExcelProperty(value = "计划结束时间", index = 17)
+    @ExcelProperty(value = "计划结束时间")
     private String endTime;
 
-    @ExcelProperty(value = "备注", index = 14)
+    @ExcelProperty(value = "备注")
     private String remark;
 
-    @ExcelProperty(value = "创造人", index = 15)
-    private String creatByName;
+    @ExcelProperty(value = "创造人")
+    private String createByName;
 
-    @ExcelProperty(value = "创建时间", index = 16)
+    @ExcelProperty(value = "创建时间")
     private String createTime;
 
 }

+ 2 - 2
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/param/TradeOrderListStatisticParam.java

@@ -34,13 +34,13 @@ public class TradeOrderListStatisticParam {
     /**
      * 创建时间开始(yyyy-MM-dd)
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date startCreateTime;
 
     /**
      * 创建时间结束(yyyy-MM-dd)
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date endCreateTime;
 
     /**

+ 17 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/vo/CarWaybillVo.java

@@ -95,7 +95,24 @@ public class CarWaybillVo implements Serializable {
      */
     private String unloadTime;
 
+    /**
+     * 亏吨重量
+     */
+    private String deficitAmount;
+
+    /**
+     * 扣亏损值(合理损耗-(实装-实卸))-单位
+     */
+    private String goodsPriceUnit;
+
+    /**
+     * 创建时间
+     */
     private String createTime;
+
+    /**
+     * 更新时间
+     */
     private String updateTime;
 
 }

+ 1 - 2
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/vo/ConsignOrderVo.java

@@ -1,7 +1,6 @@
 package com.sckw.report.service.vo;
 
 import com.alibaba.excel.annotation.ExcelProperty;
-import com.sckw.core.model.page.PageResult;
 import com.sckw.excel.annotation.ExcelContext;
 import lombok.Data;
 
@@ -14,7 +13,7 @@ import java.io.Serializable;
  */
 @Data
 @ExcelContext(fileName = "托运订单列表", sheetName = "托运订单列表")
-public class ConsignOrderVo extends PageResult implements Serializable {
+public class ConsignOrderVo implements Serializable {
     /**
      * 结算周期
      */

+ 31 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/vo/WaybillsCountVo.java

@@ -0,0 +1,31 @@
+package com.sckw.report.service.vo;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @author jc
+ * @description 运单列表 统计行数据
+ * @date 2023-07-10 12:07:40
+ */
+@Data
+@Accessors(chain = true)
+public class WaybillsCountVo {
+    /**
+     * 总计条数
+     */
+    private String countTotal;
+    /**
+     * 总计托运量
+     */
+    private String entrustTotal;
+    /**
+     * 总计实际装载量
+     */
+    private String loadTotal;
+    /**
+     * 总计实际卸货量
+     */
+    private String unloadTotal;
+
+}

+ 10 - 25
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ConsignOrderService.java

@@ -8,17 +8,17 @@ import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.DateUtil;
+import com.sckw.mongo.model.SckwWaybillOrder;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.transport.dao.*;
 import com.sckw.transport.model.*;
 import com.sckw.transport.model.dto.OrderDTO;
-import com.sckw.transport.model.param.ConsignOrderQuery;
 import com.sckw.transport.model.vo.CarDataVO;
 import com.sckw.transport.model.vo.CarWaybillVO;
-import com.sckw.transport.model.vo.ConsignOrderVO;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.mongodb.core.MongoTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
 
@@ -39,6 +39,9 @@ public class ConsignOrderService {
     @DubboReference(version = "2.0.0", group = "design", check = false)
     RemoteSystemService remoteSystemService;
 
+    @Autowired
+    public MongoTemplate mongoTemplate;
+
     @Autowired
     public KwtLogisticsOrderMapper kwtLogisticsOrderMapper;
 
@@ -60,25 +63,6 @@ public class ConsignOrderService {
     @Autowired
     public KwtLogisticsOrderCirculateMapper kwtLogisticsOrderCirculateMapper;
 
-    public HttpResult list(ConsignOrderQuery query) {
-//        ConsignOrderVo consignOrderVo = new ConsignOrderVo();
-//        LambdaQueryWrapper<KwtLogisticsOrder> wrapper = new LambdaQueryWrapper<>();
-////        kwtLogisticsOrderMapper.selectPage(new Page<>(query.getPage(), query.getPageSize()),
-////                wrapper.like(StringUtils.isNotBlank(query.getKeywords()),KwtLogisticsOrder::getLOrderNo,query.getKeywords())
-////                        .like(StringUtils.isNotBlank(query.getKeywords()),KwtLogisticsOrder::getc))
-//        List<KwtLogisticsOrder> kwtLogisticsOrders = kwtLogisticsOrderMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrder>().like(StringUtils.isNotBlank(query.getKeywords()), KwtLogisticsOrder::getLOrderNo, query.getKeywords()));
-//        List<Long> ids = kwtLogisticsOrders.stream().map(KwtLogisticsOrder::getId).collect(Collectors.toList());
-//        List<KwtLogisticsOrderUnit> list = kwtLogisticsOrderUnitMapper.selectCompanyBylOrderId(ids, NumberConstant.ONE);
-        return null;
-    }
-
-    public HttpResult statistics(ConsignOrderQuery query) {
-        return null;
-    }
-
-    public List<ConsignOrderVO> export(ConsignOrderQuery query) {
-        return new ArrayList<ConsignOrderVO>();
-    }
 
     public HttpResult getCarWaybillByOrder(OrderDTO orderDto) {
         List<CarWaybillVO> returnList = new ArrayList<>();
@@ -113,13 +97,14 @@ public class ConsignOrderService {
                 }
                 carWaybillVo.setId(String.valueOf(kwtWaybillOrder.getId()));
                 carWaybillVo.setWaybillNumber(order.getLOrderNo());
-                carWaybillVo.setTruckNo(kwtWaybillOrder == null ? null : kwtWaybillOrder.getTruckNo());
+                carWaybillVo.setTruckNo(kwtWaybillOrder.getTruckNo());
                 carWaybillVo.setStatus(track == null ? null : String.valueOf(track.getStatus()));
                 carWaybillVo.setWaybillType(kwtWaybillOrder.getType());
-                //todo 调用司机服务 dubbo
-                carWaybillVo.setDriverName(null);
+                carWaybillVo.setDriverName(kwtWaybillOrder.getDriverName());
                 //todo 取mongo
-                carWaybillVo.setConsignMotorcade(null);
+                SckwWaybillOrder sckwWaybillOrder = mongoTemplate.findById(kwtWaybillOrder.getId(), SckwWaybillOrder.class);
+                /** 2023-07-24 原值为承运车队-去除后更换展示为承运公司*/
+                carWaybillVo.setConsignMotorcade(sckwWaybillOrder == null ? null : sckwWaybillOrder.getCarrierFirmName());
                 carWaybillVo.setSendCarWeigh(kwtWaybillOrder.getEntrustAmount() == null ? null : String.valueOf(kwtWaybillOrder.getEntrustAmount()));
                 if (circulate != null) {
                     carWaybillVo.setSendCarDate(circulate.getCreateTime() == null ? null : DateUtil.getDateTime(circulate.getCreateTime()));

+ 22 - 5
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/DriverService.java

@@ -11,6 +11,7 @@ import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ValidUtil;
+import com.sckw.fleet.api.RemoteFleetService;
 import com.sckw.mongo.enums.BusinessTypeEnum;
 import com.sckw.mongo.model.SckwWaybillOrder;
 import com.sckw.mongo.model.TobleTop;
@@ -50,6 +51,9 @@ public class DriverService {
     @DubboReference(version = "2.0.0", group = "design", check = false)
     RemoteSystemService remoteSystemService;
 
+    @DubboReference(version = "2.0.0", group = "design", check = false)
+    RemoteFleetService remoteFleetService;
+
     @Autowired
     MongoTemplate mongoTemplate;
 
@@ -178,6 +182,12 @@ public class DriverService {
         return HttpResult.ok(orderVOList);
     }
 
+    /**
+     * 组装循环单据信息
+     * @param id
+     * @param loopStatus
+     * @param orderVOList
+     */
     private void loopPackageData(Long id, List<Long> loopStatus, List<WaybillOrderVO> orderVOList) {
         if (CollectionUtils.isEmpty(loopStatus)) {
             List<KwtLogisticsOrderCirculate> list = logisticsOrderCirculateMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrderCirculate>()
@@ -211,10 +221,11 @@ public class DriverService {
                         vo.setCreateTime(waybill.getCreateTime());
                         vo.setStartTime(waybill.getStartTime());
                         vo.setEndTime(waybill.getEndTime());
-                        //todo 查询车队服务dubbo
-//                    vo.setFleetName();
-//                    vo.setFleetId();
-//                    vo.setTruckFleetName();
+                        /**查询车队服务dubbo 2023-07-24 司机端不展示 车队信息改为展示物流公司*/
+//                        remoteFleetService.findTruck()
+//                        vo.setFleetName();
+//                        vo.setFleetId();
+//                        vo.setTruckFleetName();
                         vo.setEntrustAmount(waybill.getEntrustAmount());
                         vo.setType(waybill.getType());
                         vo.setTruckNo(waybill.getTruckNo());
@@ -251,7 +262,7 @@ public class DriverService {
                         vo.setCreateTime(waybill.getCreateTime());
                         vo.setStartTime(waybill.getStartTime());
                         vo.setEndTime(waybill.getEndTime());
-                        //todo 查询车队服务dubbo
+                        /**查询车队服务dubbo 2023-07-24 司机端不展示 车队信息改为展示物流公司*/
 //                    vo.setFleetName();
 //                    vo.setFleetId();
 //                    vo.setTruckFleetName();
@@ -265,6 +276,12 @@ public class DriverService {
         }
     }
 
+    /**
+     * 趟次展示数据组装
+     * @param id
+     * @param tripStatus
+     * @param orderVOList
+     */
     private void tripPackageData(Long id, List<Long> tripStatus, List<WaybillOrderVO> orderVOList) {
         List<Long> list = waybillOrderMapper.selectDriverOrder(id, tripStatus);
         if (CollectionUtils.isNotEmpty(list)) {

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

@@ -83,13 +83,13 @@ public class WaybillManagementService {
         waybillDataVO.setTransportMessage(kwtWaybillOrder);
 
         // 车辆信息
-//        Map<Long, RTruckVo> trucks  = remoteFleetService.findTruck(kwtWaybillOrder.getTruckNo());
+        Map<Long, RTruckVo> trucks  = remoteFleetService.findTruck(kwtWaybillOrder.getTruckNo());
         WaybillCarVO waybillCarVO = new WaybillCarVO();
-//        if(CollectionUtils.isNotEmpty(trucks)) {
-//            waybillCarVO.setType(trucks.get(0).getTruckNo());
-//            waybillCarVO.setTruckId(trucks.get(0).getId());
-//            waybillCarVO.setTrailerNo(trucks.get(0).getTrailerNo());
-//        }
+        if(CollectionUtils.isNotEmpty(trucks)) {
+            waybillCarVO.setType(trucks.get(0).getTruckType());
+            waybillCarVO.setTruckId(String.valueOf(trucks.get(0).getId()));
+            waybillCarVO.setTrailerNo(trucks.get(0).getTrailerNo());
+        }
         waybillCarVO.setDriverId(String.valueOf(kwtWaybillOrder.getDriverId()))
             .setTruckNo(kwtWaybillOrder.getTruckNo())
             .setDriverName(kwtWaybillOrder.getDriverName())