Преглед на файлове

Merge branch 'dev' into dev-xcq

xucaiqin преди 2 години
родител
ревизия
e1e968a8a5
променени са 100 файла, в които са добавени 1269 реда и са изтрити 239 реда
  1. 4 0
      sckw-auth/pom.xml
  2. 14 4
      sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java
  3. 0 25
      sckw-auth/src/main/java/com/sckw/auth/controller/ExceptionController.java
  4. 40 0
      sckw-auth/src/main/java/com/sckw/auth/model/vo/req/GetRegisterSmsReqVo.java
  5. 9 0
      sckw-auth/src/main/java/com/sckw/auth/service/IAuthService.java
  6. 14 4
      sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java
  7. 1 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/NumberConstant.java
  8. 3 3
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java
  9. 17 11
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/ExceptionFilterConfig.java
  10. 6 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/LoginFilter.java
  11. 9 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillEnum.java
  12. 54 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/LogisticsOrderEnum.java
  13. 18 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/RegularUtils.java
  14. 6 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java
  15. 2 2
      sckw-common/sckw-common-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  16. 4 2
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/annotation/ExcelContext.java
  17. 5 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/annotation/ExcelSelected.java
  18. 14 4
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/DateUtil.java
  19. 2 2
      sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/model/SckwTradeOrder.java
  20. 1 1
      sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/model/TobleTop.java
  21. 1 0
      sckw-modules-api/pom.xml
  22. 5 0
      sckw-modules-api/sckw-fleet-api/src/main/java/com/sckw/fleet/api/model/vo/RTruckVo.java
  23. 2 2
      sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/ContractSignCompletedParam.java
  24. 2 2
      sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/UpdateOrderAmountParam.java
  25. 2 2
      sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/UpdateOrderStatusParam.java
  26. 1 1
      sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/model/GoodsDetail.java
  27. 1 1
      sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/model/KwpGoods.java
  28. 9 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java
  29. 8 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java
  30. 9 1
      sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/dubbo/TransportDubboService.java
  31. 86 0
      sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/model/dto/vo/LogisticsOrderVO.java
  32. 6 0
      sckw-modules/sckw-contract/pom.xml
  33. 6 0
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractLogisticsGoods.java
  34. 6 1
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/vo/req/LogisticsGoodsInfoReqVo.java
  35. 15 0
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/vo/req/QueryListReqVo.java
  36. 6 5
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsService.java
  37. 2 2
      sckw-modules/sckw-contract/src/main/resources/bootstrap-dev.yml
  38. 9 0
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractTradeMapper.xml
  39. 12 4
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java
  40. 11 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java
  41. 2 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfDriverCardMapper.java
  42. 13 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfFleetDriverMapper.java
  43. 11 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfFleetTruckMapper.java
  44. 4 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfDriverCardDto.java
  45. 4 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfDriverLicenseDto.java
  46. 4 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfDriverQualificationDto.java
  47. 6 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfTransportLicenseDto.java
  48. 6 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfTruckLicenseDto.java
  49. 6 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverVo.java
  50. 16 3
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java
  51. 15 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java
  52. 92 0
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverCardMapper.xml
  53. 1 1
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml
  54. 10 0
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfFleetDriverMapper.xml
  55. 10 0
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfFleetTruckMapper.xml
  56. 14 2
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/controller/KwmCooperateManageController.java
  57. 23 0
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/vo/res/FindEntCooperateResVo.java
  58. 1 1
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmAddressService.java
  59. 62 4
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmCooperateManageService.java
  60. 5 0
      sckw-modules/sckw-order/pom.xml
  61. 2 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpTransportDemandMapper.java
  62. 15 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpWantBuyAddressMapper.java
  63. 2 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpWantBuyMapper.java
  64. 15 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpWantBuyTradingMapper.java
  65. 11 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/dubbo/TradeOrderInfoServiceImpl.java
  66. 6 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrder.java
  67. 7 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderAddress.java
  68. 6 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderContract.java
  69. 5 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderGoods.java
  70. 6 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderTrack.java
  71. 6 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTradeOrderUnit.java
  72. 7 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoTransportDemand.java
  73. 18 9
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoWantBuy.java
  74. 83 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoWantBuyAddress.java
  75. 38 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/KwoWantBuyTrading.java
  76. 2 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/GoodsInfo.java
  77. 3 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/GoodsInfoDetailRes.java
  78. 23 8
      sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java
  79. 6 8
      sckw-modules/sckw-product/src/main/java/com/sckw/product/controller/KwpGoodsController.java
  80. 4 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/GoodsListExport.java
  81. 6 2
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoods.java
  82. 6 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsAddress.java
  83. 6 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsAttribute.java
  84. 6 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsImage.java
  85. 5 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsPriceRange.java
  86. 6 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/KwpGoodsSku.java
  87. 12 8
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/req/AddGoodsParam.java
  88. 4 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/req/GoodsImages.java
  89. 1 2
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/req/UpdateGoodsParam.java
  90. 1 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/GoodsDetail.java
  91. 1 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/GoodsList.java
  92. 15 10
      sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java
  93. 5 7
      sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwOrderController.java
  94. 37 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwTransportController.java
  95. 8 5
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwOrderService.java
  96. 115 25
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwTransportService.java
  97. 35 29
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/param/TradeOrderListExport.java
  98. 2 2
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/param/TradeOrderListStatisticParam.java
  99. 1 2
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/param/TradeOrderStatementList.java
  100. 5 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/param/WaybillOrderQuery.java

+ 4 - 0
sckw-auth/pom.xml

@@ -47,6 +47,10 @@
             <groupId>com.sckw</groupId>
             <artifactId>sckw-system-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-message-api</artifactId>
+        </dependency>
 
     </dependencies>
     <build>

+ 14 - 4
sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java

@@ -1,9 +1,6 @@
 package com.sckw.auth.controller;
 
-import com.sckw.auth.model.vo.req.ForgetPasswordReqVo;
-import com.sckw.auth.model.vo.req.LoginReqVo;
-import com.sckw.auth.model.vo.req.RegisterReqVo;
-import com.sckw.auth.model.vo.req.UpdatePasswordReqVo;
+import com.sckw.auth.model.vo.req.*;
 import com.sckw.auth.service.IAuthService;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.web.constant.HttpStatus;
@@ -96,5 +93,18 @@ public class AuthController {
         return HttpResult.ok(HttpStatus.MSG_001);
     }
 
+    /**
+     * @desc: 获取验证码
+     * @param: reqVo 入参
+     * @author: czh
+     * @date 2023/7/23
+     * @return HttpResult
+     */
+    @PostMapping("getRegisterSms")
+    public HttpResult getRegisterSms(@Valid @RequestBody GetRegisterSmsReqVo reqVo,
+                                   @RequestHeader(name = "System-Type", required = true) int systemType) {
+        reqVo.setSystemType(systemType);
+        return HttpResult.ok(authService.getRegisterSms(reqVo));
+    }
 
 }

+ 0 - 25
sckw-auth/src/main/java/com/sckw/auth/controller/ExceptionController.java

@@ -1,25 +0,0 @@
-package com.sckw.auth.controller;
-
-import com.sckw.core.web.response.HttpResult;
-import jakarta.servlet.http.HttpServletRequest;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author czh
- * @desc TODO
- * @date 2023/6/14
- */
-@RestController
-@RequestMapping("/error")
-public class ExceptionController {
-
-    /**
-     * 重新抛出异常
-     */
-    @PostMapping("/throwError")
-    public HttpResult exception(HttpServletRequest request) {
-        return HttpResult.error(Integer.parseInt(request.getAttribute("code").toString()), request.getAttribute("message").toString());
-    }
-}

+ 40 - 0
sckw-auth/src/main/java/com/sckw/auth/model/vo/req/GetRegisterSmsReqVo.java

@@ -0,0 +1,40 @@
+package com.sckw.auth.model.vo.req;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+@Data
+public class GetRegisterSmsReqVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -6344151610477939870L;
+
+    /**
+     * 企业名称
+     */
+    @NotBlank(message = "企业名称不能为空")
+    private String entName;
+
+    /**
+     * 企业代表人
+     */
+    @NotBlank(message = "企业代表人不能为空")
+    private String name;
+
+    /**
+     * 手机号
+     */
+    @NotBlank(message = "联系电话不能为空")
+    private String phone;
+
+    /**
+     * 系统类型(1运营端、2企业开户)
+     */
+    private Integer systemType;
+
+
+
+}

+ 9 - 0
sckw-auth/src/main/java/com/sckw/auth/service/IAuthService.java

@@ -47,4 +47,13 @@ public interface IAuthService {
      * @date: 2023/7/3
      */
     void resetPassword(Long id);
+
+    /**
+     * @desc: 获取验证码
+     * @param: reqVo 入参
+     * @author: czh
+     * @date 2023/7/23
+     * @return String
+     */
+    String getRegisterSms(GetRegisterSmsReqVo reqVo);
 }

+ 14 - 4
sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java

@@ -2,10 +2,7 @@ package com.sckw.auth.service.impl;
 
 import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSON;
-import com.sckw.auth.model.vo.req.ForgetPasswordReqVo;
-import com.sckw.auth.model.vo.req.LoginReqVo;
-import com.sckw.auth.model.vo.req.RegisterReqVo;
-import com.sckw.auth.model.vo.req.UpdatePasswordReqVo;
+import com.sckw.auth.model.vo.req.*;
 import com.sckw.auth.model.vo.res.DeptInfoResVo;
 import com.sckw.auth.model.vo.res.EntInfoResVo;
 import com.sckw.auth.model.vo.res.LoginResVo;
@@ -15,6 +12,7 @@ import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.model.EntCertificateInfo;
 import com.sckw.core.web.model.LoginEntInfo;
 import com.sckw.core.web.model.LoginUserInfo;
+import com.sckw.message.api.dubbo.SmsInfoService;
 import com.sckw.system.api.model.dto.req.ForgetPasswordReqDto;
 import com.sckw.system.api.model.dto.req.UpdatePasswordReqDto;
 import com.sckw.system.api.model.dto.req.UserLoginReqDto;
@@ -49,6 +47,9 @@ public class AuthServiceImpl implements IAuthService {
     @DubboReference(version = "2.0.0", group = "design", check = false)
     private RemoteUserService remoteUserService;
 
+    @DubboReference(version = "2.0.0", group = "design", check = false)
+    private SmsInfoService smsInfoService;
+
 
     @Override
     public LoginResVo login(LoginReqVo reqDto) throws SystemException {
@@ -194,6 +195,15 @@ public class AuthServiceImpl implements IAuthService {
         remoteUserService.resetPassword(id);
     }
 
+    @Override
+    public String getRegisterSms(GetRegisterSmsReqVo reqVo) {
+        String code = "";
+        remoteUserService.checkRegisterParam(reqVo.getEntName(), reqVo.getPhone(), reqVo.getSystemType());
+        String key = Global.USER_LOGIN_CAPTCHA + reqVo.getPhone() + Global.COLON + reqVo.getSystemType();
+        RedissonUtils.put(key, code, 30L);
+        return code;
+    }
+
 
     static class AsyncProcess implements Runnable {
 

+ 1 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/NumberConstant.java

@@ -18,6 +18,7 @@ public final class NumberConstant {
     public static final int EIGHT = 8;
     public static final int NINE = 9;
     public static final int TEN = 10;
+    public static final int ELEVEN = 11;
     public static final int TWELVE = 12;
     public static final int THREETEEN = 13;
     public static final int FOURTEEN = 14;

+ 3 - 3
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java

@@ -26,9 +26,9 @@ public enum DictEnum {
     UNIT_TYPE_2("unit_type","2", "箱"),
     UNIT_TYPE_3("unit_type","3", "件"),
     UNIT_TYPE_4("unit_type","4", "其他"),
-    TAX_RATE_0("tax_rate","13.00", "13%"),
-    TAX_RATE_1("tax_rate","11.00", "11%"),
-    TAX_RATE_2("tax_rate","10.00", "10%"),
+    TAX_RATE_0("tax_rate","13", "13%"),
+    TAX_RATE_1("tax_rate","11", "11%"),
+    TAX_RATE_2("tax_rate","10", "10%"),
     TRADE_TYPE_0("trade_type", "0", "预付款"),
     TRADE_TYPE_1("trade_type", "1", "货到付款"),
     TRADE_TYPE_2("trade_type", "2", "线下付款"),

+ 17 - 11
sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/ExceptionFilterConfig.java

@@ -2,31 +2,37 @@ package com.sckw.core.filter;
 
 import com.sckw.core.exception.SystemException;
 import jakarta.servlet.*;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
+import org.springframework.web.filter.OncePerRequestFilter;
+import org.springframework.web.servlet.HandlerExceptionResolver;
 
 import java.io.IOException;
 
 /**
  * @author czh
- * @desc TODO
+ * @desc 过滤器的异常抛出
  * @date 2023/6/14
  */
 @Component
 @Slf4j
-public class ExceptionFilterConfig implements Filter {
+public class ExceptionFilterConfig extends OncePerRequestFilter {
+
+    @Autowired
+    @Qualifier("handlerExceptionResolver")
+    private HandlerExceptionResolver resolver;
+
     @Override
-    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
+    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
         try {
-            filterChain.doFilter(servletRequest, servletResponse);
+            filterChain.doFilter(request, response);
         } catch (SystemException e) {
-            // 传递异常信息
-//            servletRequest.setAttribute("code", e.getCode());
-//            servletRequest.setAttribute("message", e.getMessage());
-//            // 指定处理该请求的处理器
-//            RequestDispatcher requestDispatcher = servletRequest.getRequestDispatcher("/error/throwError");
-//            requestDispatcher.forward(servletRequest, servletResponse);
-            log.error("请求异常:", e);
+            // 会交到 Springmvc的全局异常处理器那里
+            resolver.resolveException(request, response, null, e);
         }
     }
 }

+ 6 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/LoginFilter.java

@@ -64,6 +64,7 @@ public class LoginFilter implements Filter {
      */
     @Override
     public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws ServletException, IOException, SystemException{
+
         HttpServletRequest request = (HttpServletRequest) servletRequest;
         String requestUri = request.getRequestURI();
         /*1、不用token的接口直接放行*/
@@ -91,7 +92,7 @@ public class LoginFilter implements Filter {
         String systemType = request.getHeader(RequestConstant.SYSTEM_TYPE);
         String userInfo = RedissonUtils.getString(Global.getFullUserLoginKey(Integer.parseInt(systemType), Long.parseLong(key), clientType));
         if (StringUtils.isBlank(userInfo)) {
-            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ACCOUNT_NOT_EXISTS);
+            throw new SystemException(HttpStatus.UN_LOGIN_CODE, HttpStatus.UN_LOGIN_MESSAGE);
         }
 
         //将redis里的用户信息存入内存中,避免业务操作多次从redis获取值*/
@@ -113,7 +114,10 @@ public class LoginFilter implements Filter {
         }
 
         /*4、企业信息等校验*/
-        checkEntInfo(loginUserInfo);
+        //特殊处理,认证接口不校验资质
+        if (!"/kwsEnt/register".equals(requestUri)) {
+            checkEntInfo(loginUserInfo);
+        }
 
         RedissonUtils.putString(Global.getFullUserLoginKey(Integer.parseInt(systemType), Long.parseLong(key), clientType), JSON.toJSONString(loginUserInfo), Global.PC_TOKEN_EXPIRE);
         filterChain.doFilter(servletRequest, servletResponse);

+ 9 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillEnum.java

@@ -52,4 +52,13 @@ public enum CarWaybillEnum {
         }
         return null;
     }
+
+    public static String getName(Integer code) {
+        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
+            if (waybillEnum.getCode().equals(code)) {
+                return waybillEnum.getDestination();
+            }
+        }
+        return null;
+    }
 }

+ 54 - 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;
@@ -53,4 +82,29 @@ public enum LogisticsOrderEnum {
         }
         return null;
     }
+
+    public static String getName(Integer code) {
+        for (LogisticsOrderEnum logisticsOrderEnum : LogisticsOrderEnum.values()) {
+            if (logisticsOrderEnum.getCode().equals(code)) {
+                return logisticsOrderEnum.getDestination();
+            }
+        }
+        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;
+    }
 }

+ 18 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/RegularUtils.java

@@ -47,6 +47,24 @@ public class RegularUtils {
      * 身份证
      */
     public static final String IDCARD = "(^\\d{18}$)|(^\\d{15}$)";
+    /**
+     * 车牌号
+     */
+//    public static final String TRUCK_NUMBER = "^[京津沪冀晋辽吉黑苏浙皖闽赣鲁豫鄂湘粤桂琼川黔云渝藏陕陇青宁新闽粤晋琼使领A_Z]{1}[A_Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$";
+//    public static final String TRUCK_NUMBER = "^[京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼川贵云渝藏陕甘青宁新]{1}[A-Z]{1}[DF]{1}[0-9a-zA-Z]{5}$";
+    /**
+     * 车牌校验  五位数车牌
+     */
+    public static final String TRUCK_NUMBER_FIVE = "^[京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼川贵云渝藏陕甘青宁新使]{1}[a-zA-Z]{1}[0-9a-zA-Z]{5}$";
+
+    /**
+     * 车牌校验  六位数车牌
+     */
+    public static final String TRUCK_NUMBER_SIX = "^[京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼川贵云渝藏陕甘青宁新使]{1}[a-zA-Z]{1}[0-9a-zA-Z]{6}$";
+    /**
+     * 中文汉字
+     */
+    public static final String CHINESE = "^[\\u4e00-\\u9fa5]{2,4}$";
 
     /**
      * @description 校验

+ 6 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java

@@ -118,6 +118,7 @@ public class HttpStatus {
     public static final int QUERY_FAIL_CODE = 60602;
     public static final String ACCOUNT_NOT_EXISTS = "用户信息不存在或已失效";
     public static final String ENT_NOT_EXISTS = "企业信息不存在或已失效";
+    public static final String DEPT_NOT_EXISTS = "机构信息不存在或已失效";
     public static final String ENTCERTIFICATES_NOT_EXISTS = "未查询到企业资质信息";
     public static final String ENTCERTIFICATES_INVAILD = "企业资质已失效";
     public static final String ROLE_NOT_EXISTS = "未查询到关联的角色";
@@ -156,5 +157,10 @@ public class HttpStatus {
     public static final String MSG_020 = "当前机构还存在员工数据,不能删除!";
     public static final String MSG_021 = "不能重复设置默认地址!";
     public static final String MSG_022 = "只能对草稿进行删除!";
+    public static final String MSG_023 = "解除成功!";
+    public static final String MSG_024 = "名称不能重复!";
+    public static final String MSG_025 = "禁止删除本人信息!";
+    public static final String MSG_026 = "资质认证审核中,请等待审核后再提交!";
+    public static final String MSG_027 = "一级机构不能删除!";
 
 }

+ 2 - 2
sckw-common/sckw-common-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -2,6 +2,6 @@ com.sckw.core.aspect.DaoAspect
 com.sckw.core.exception.GlobalSystemExceptionHandler
 com.sckw.core.web.config.CustomConfig
 com.sckw.core.filter.LoginFilter
-#com.sckw.core.filter.ExceptionFilterConfig
 com.sckw.core.config.MybatisPlusConfig
-com.sckw.core.config.JacksonConfig
+com.sckw.core.config.JacksonConfig
+com.sckw.core.filter.ExceptionFilterConfig

+ 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();

+ 2 - 2
sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/model/SckwTradeOrder.java

@@ -149,9 +149,9 @@ public class SckwTradeOrder {
     private String goodsSpec;
 
     /**
-     * 商品发票税率(%)
+     * 商品发票税率
      */
-    private BigDecimal goodsTaxRate;
+    private String goodsTaxRate;
 
     /**
      * 商品所属项目名称

+ 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;
 }

+ 1 - 0
sckw-modules-api/pom.xml

@@ -26,6 +26,7 @@
         <module>sckw-product-api</module>
         <module>sckw-order-api</module>
         <module>sckw-fleet-api</module>
+        <module>sckw-contract-api</module>
         <module>sckw-payment-api</module>
     </modules>
 

+ 5 - 0
sckw-modules-api/sckw-fleet-api/src/main/java/com/sckw/fleet/api/model/vo/RTruckVo.java

@@ -51,4 +51,9 @@ public class RTruckVo implements Serializable {
      * 车辆业务状态
      */
     private Integer businessStatus;
+
+    /**
+     * 车辆类型
+     */
+    private String truckType;
 }

+ 2 - 2
sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/ContractSignCompletedParam.java

@@ -26,12 +26,12 @@ public class ContractSignCompletedParam implements Serializable {
 
 
     /**
-     * 更新用户id
+     * 更新用户id 需传,订单状态变化记录需要
      */
     private Long updateBy;
 
     /**
-     * 更新者姓名
+     * 更新用户姓名 需传,订单状态变化记录需要
      */
     private String updateByName;
 }

+ 2 - 2
sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/UpdateOrderAmountParam.java

@@ -37,12 +37,12 @@ public class UpdateOrderAmountParam implements Serializable {
     private BigDecimal actualAmount;
 
     /**
-     * 更新用户id
+     * 更新用户id 需传,订单状态变化记录需要
      */
     private Long updateBy;
 
     /**
-     * 更新者姓名
+     * 更新者姓名 需传,订单状态变化记录需要
      */
     private String updateByName;
 

+ 2 - 2
sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/UpdateOrderStatusParam.java

@@ -30,12 +30,12 @@ public class UpdateOrderStatusParam implements Serializable {
     private Integer status;
 
     /**
-     * 更新用户id
+     * 更新用户id 需传,订单状态变化记录需要
      */
     private Long updateBy;
 
     /**
-     * 更新者姓名
+     * 更新者姓名 需传,订单状态变化记录需要
      */
     private String updateByName;
 

+ 1 - 1
sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/model/GoodsDetail.java

@@ -93,7 +93,7 @@ public class GoodsDetail implements Serializable {
     /**
      * 发票税率(%)
      */
-    private BigDecimal taxRate;
+    private String taxRate;
 
     /**
      * 发票税率label

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

@@ -76,7 +76,7 @@ public class KwpGoods extends BaseModel implements Serializable {
     /**
      * 发票税率(%)
      */
-    private BigDecimal taxRate;
+    private String taxRate;
 
     /**
      * 交易方式(合同采购、直接采购、预付款、货到付款、到款发货)

+ 9 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java

@@ -84,6 +84,15 @@ public interface RemoteSystemService {
      */
     List<EntCacheResDto> queryEntCacheByIds(List<Long> entIds);
 
+    /**
+     * @param entIds 企业id
+     * @return Map
+     * @desc: 从缓存批量主体机构信息
+     * @author: czh
+     * @date: 2023/7/22
+     */
+    Map<Long, List<EntCacheResDto>> queryEntDeptCacheByIds(List<Long> entIds);
+
     /**
      * @desc: 从缓存批量查企业信息
      * @author: yzc

+ 8 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java

@@ -159,4 +159,12 @@ public interface RemoteUserService {
      */
     Map<Long, SysDictResDto> querySysDictByIds(List<Long> ids);
 
+    /**
+     * @desc: 校验注册的入参
+     * @param: entName 企业名  phone联系电话  systemType系统类型
+     * @author: czh
+     * @date 2023/7/23
+     */
+    void checkRegisterParam(String entName, String phone, Integer systemType);
+
 }

+ 9 - 1
sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/dubbo/TransportDubboService.java

@@ -1,6 +1,7 @@
 package com.sckw.transport.api.dubbo;
 
 import com.sckw.transport.api.model.dto.vo.KwtLogisticsOrderVO;
+import com.sckw.transport.api.model.dto.vo.LogisticsOrderVO;
 
 import java.util.List;
 
@@ -15,9 +16,16 @@ import java.util.List;
 public interface TransportDubboService {
 
     /**
-     * 根据id 获取详情
+     * 根据id 获取主表详情
      * @param ids
      * @return
      */
     List<KwtLogisticsOrderVO> getAcceptCarriageOrderDetail(List<String> ids);
+
+    /**
+     * 根据id 对账页面需要的数据
+     * @param ids
+     * @return
+     */
+    List<LogisticsOrderVO> getAcceptCarriageOrderList(List<String> ids);
 }

+ 86 - 0
sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/model/dto/vo/LogisticsOrderVO.java

@@ -0,0 +1,86 @@
+package com.sckw.transport.api.model.dto.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author lfdc
+ * @description 对账页面需要数据vo
+ * @date 2023-07-21 17:07:15
+ */
+@Data
+public class LogisticsOrderVO {
+
+    /**
+     * 物流订单id
+     */
+    private String lOrderId;
+    /**
+     * 物流订单编号
+     */
+    private String lOrderNO;
+
+    /**
+     * 销售订单id
+     */
+    private String tOrderId;
+    /**
+     * 销售订单编号
+     */
+    private String tOrderNO;
+    /**
+     * 付款方式
+     */
+    private String payment;
+    /**
+     * 运输趟次
+     */
+    private Long count;
+    /**
+     * 计费方式
+     */
+    private String billingMode;
+    /**
+     * 合同
+     */
+    private String contract;
+    /**
+     * 合同编号
+     */
+    private String contractNo;
+    /**
+     * 合同名称
+     */
+    private String contractName;
+    /**
+     * 承运单位
+     */
+    private String carrierCompany;
+    /**
+     * 托运单位
+     */
+    private String consignCompany;
+    /**
+     * 商品名称
+     */
+    private String goodsName;
+    /**
+     * 计划量
+     */
+    private String amount;
+    /**
+     * 运价
+     */
+    private BigDecimal price;
+
+    /**
+     * 扣亏损值
+     */
+    private BigDecimal goodsPrice;
+    private BigDecimal loss;
+    private BigDecimal unloadAmount;
+    private BigDecimal loadAmount;
+
+
+}

+ 6 - 0
sckw-modules/sckw-contract/pom.xml

@@ -62,6 +62,12 @@
             <version>1.0.0</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-contract-api</artifactId>
+            <version>1.0.0</version>
+            <scope>compile</scope>
+        </dependency>
 
     </dependencies>
     <build>

+ 6 - 0
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractLogisticsGoods.java

@@ -30,6 +30,12 @@ public class KwcContractLogisticsGoods implements Serializable {
      */
     private Long goodsId;
 
+
+    /**
+     * 商品名
+     */
+    private String goodsName;
+
     /**
      * sku
      */

+ 6 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/vo/req/LogisticsGoodsInfoReqVo.java

@@ -21,9 +21,14 @@ public class LogisticsGoodsInfoReqVo implements Serializable {
     /**
      * 商品id
      */
-    @NotNull(message = "商品不能为空")
+//    @NotNull(message = "商品不能为空")
     private Long goodsId;
 
+    /**
+     * 商品名
+     */
+    private String goodsName;
+
     /**
      * 运量
      */

+ 15 - 0
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/vo/req/QueryListReqVo.java

@@ -48,4 +48,19 @@ public class QueryListReqVo extends PageRequest implements Serializable {
      */
     private Integer entType;
 
+    /**
+     * 签约方式
+     */
+    private Integer signingWay;
+
+    /**
+     * 付款方式
+     */
+    private Integer charging;
+
+    /**
+     * 交易方式
+     */
+    private Integer trading;
+
 }

+ 6 - 5
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsService.java

@@ -191,7 +191,7 @@ public class KwcContractLogisticsService {
         List<KwcContractLogisticsGoods> kwcContractLogisticsGoodsList = kwcContractLogisticsGoodsService.queryGoodsInfoByContractId(kwcContractLogistics.getId());
         if (CollectionUtils.isNotEmpty(kwcContractLogisticsGoodsList)) {
             List<Long> goodsIdList = kwcContractLogisticsGoodsList.stream().map(KwcContractLogisticsGoods::getGoodsId).toList();
-            Map<Long, KwpGoods> goodsMap = goodsInfoService.getGoodsByIds(goodsIdList);
+//            Map<Long, KwpGoods> goodsMap = goodsInfoService.getGoodsByIds(goodsIdList);
 
             String keys = "";
            for (KwcContractLogisticsGoods item :kwcContractLogisticsGoodsList){
@@ -214,10 +214,11 @@ public class KwcContractLogisticsService {
                 logisticsGoodsInfoResVo.setDeficitUnit(kwcContractLogisticsGoods.getDeficitUnit());
                 logisticsGoodsInfoResVo.setGoodsId(kwcContractLogisticsGoods.getGoodsId());
                 logisticsGoodsInfoResVo.setId(kwcContractLogisticsGoods.getId());
-                KwpGoods kwpGoods = goodsMap.get(kwcContractLogisticsGoods.getGoodsId());
-                if (Objects.nonNull(kwpGoods)) {
-                    logisticsGoodsInfoResVo.setGoodsName(kwpGoods.getName());
-                }
+                logisticsGoodsInfoResVo.setGoodsName(kwcContractLogisticsGoods.getGoodsName());
+//                KwpGoods kwpGoods = goodsMap.get(kwcContractLogisticsGoods.getGoodsId());
+//                if (Objects.nonNull(kwpGoods)) {
+//                    logisticsGoodsInfoResVo.setGoodsName(kwpGoods.getName());
+//                }
                 logisticsGoodsInfoResVo.setLoss(kwcContractLogisticsGoods.getLoss());
                 logisticsGoodsInfoResVo.setLossUnit(kwcContractLogisticsGoods.getLossUnit());
 

+ 2 - 2
sckw-modules/sckw-contract/src/main/resources/bootstrap-dev.yml

@@ -5,7 +5,7 @@ spring:
         # 服务注册地址
         server-addr: 10.10.10.230:8848
         # 命名空间
-        namespace: sckw_zk
+        namespace: sckw-service-platform-dev
         # 共享配置
         group: sckw-service-platform
       config:
@@ -14,7 +14,7 @@ spring:
         # 配置文件格式
         file-extension: yaml
         # 命名空间
-        namespace: sckw_zk
+        namespace: sckw-service-platform-dev
         # 共享配置
         group: sckw-service-platform
         #可以读多个配置文件  需要在同一个命名空间下面可以是不同的组

+ 9 - 0
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractTradeMapper.xml

@@ -85,5 +85,14 @@
                 #{item}
             </foreach>
         </if>
+        <if test="trading != null">
+            and a.trading = #{trading}
+        </if>
+        <if test="signingWay != null">
+            and a.signing_way = #{signingWay}
+        </if>
+        <if test="charging != null">
+            and a.charging = #{charging}
+        </if>
     </select>
 </mapper>

+ 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>

+ 14 - 2
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/controller/KwmCooperateManageController.java

@@ -71,7 +71,7 @@ public class KwmCooperateManageController {
     @PostMapping("dissolve")
     public HttpResult dissolve(@Valid @RequestBody IdsReqVo reqVo) throws SystemException {
         kwmCooperateManageService.dissolve(reqVo.getIds());
-        return HttpResult.ok(HttpStatus.MSG_010);
+        return HttpResult.ok(HttpStatus.MSG_023);
     }
 
     /**
@@ -84,7 +84,7 @@ public class KwmCooperateManageController {
     @PostMapping("delete")
     public HttpResult delete(@Valid @RequestBody IdsReqVo reqVo) throws SystemException {
         kwmCooperateManageService.delete(reqVo.getIds());
-        return HttpResult.ok(HttpStatus.MSG_007);
+        return HttpResult.ok(HttpStatus.MSG_008);
     }
 
     /**
@@ -110,4 +110,16 @@ public class KwmCooperateManageController {
         return HttpResult.ok(kwmCooperateManageService.findListGroup(reqVo));
     }
 
+    /**
+     * @param reqVo 企业id
+     * @return HttpResult
+     * @desc: 查询企业的合作单位
+     * @author: czh
+     * @date: 2023/7/22
+     */
+    @PostMapping("findEntCooperate")
+    public HttpResult findEntCooperate(@RequestBody IdsReqVo reqVo) throws SystemException {
+        return HttpResult.ok(kwmCooperateManageService.findEntCooperate(reqVo.getId()));
+    }
+
 }

+ 23 - 0
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/vo/res/FindEntCooperateResVo.java

@@ -0,0 +1,23 @@
+package com.sckw.manage.model.vo.res;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author czh
+ * @desc 合作企业
+ * @date 2023/7/22
+ */
+@Data
+public class FindEntCooperateResVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -3663266782855234702L;
+
+    private Long entId;
+
+    private String entName;
+
+}

+ 1 - 1
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmAddressService.java

@@ -124,7 +124,7 @@ public class KwmAddressService {
      */
     public void bindDefault(BindDefaultReqVo reqVo) {
         KwmAddress kwmAddress = kwmAddressMapper.selectById(reqVo.getId());
-        if (Objects.isNull(kwmAddress) || kwmAddress.getDefaultType() == Global.YES) {
+        if (Objects.isNull(kwmAddress)) {
             throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ADDRESS_NOT_EXISTS);
         }
 

+ 62 - 4
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmCooperateManageService.java

@@ -3,6 +3,7 @@ package com.sckw.manage.service;
 import java.io.IOException;
 import java.util.Date;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.SystemException;
@@ -23,10 +24,10 @@ import com.sckw.manage.model.entity.KwmCooperate;
 import com.sckw.manage.model.vo.req.BindManagerReqVo;
 import com.sckw.manage.model.vo.req.CooperateManageQueryReqVo;
 import com.sckw.manage.model.vo.res.CooperateManageQueryResVo;
+import com.sckw.manage.model.vo.res.FindEntCooperateResVo;
 import com.sckw.manage.model.vo.res.FindListGroupResVo;
 import com.sckw.manage.model.vo.res.QueryDetailResVo;
 import com.sckw.system.api.RemoteSystemService;
-import com.sckw.system.api.RemoteUserService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import lombok.extern.slf4j.Slf4j;
@@ -55,9 +56,6 @@ public class KwmCooperateManageService {
     @DubboReference(version = "2.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
 
-    @DubboReference(version = "2.0.0", group = "design", check = false)
-    private RemoteUserService remoteUserService;
-
 
     /**
      * @param reqVo 分页入参
@@ -183,6 +181,9 @@ public class KwmCooperateManageService {
         //todo 判断是否可以解除(若和所选企业有未完结的业务单据(销售订单/采购订单、托运订单/承运订单、对账单、结算单),不支持解除合作)
         //提示:您与所选企业存在未完结业务,当前无法删除!
         List<KwmCooperate> kwmCooperates = kwmCooperateMapper.selectBatchIds(Arrays.asList(ids.split(Global.COMMA)));
+        if (CollectionUtils.isEmpty(kwmCooperates)) {
+            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.COOPERATE_NOT_EXISTS);
+        }
         Long userId = LoginUserHolder.getUserId();
         Date date = new Date();
         kwmCooperates.forEach(item -> {
@@ -273,4 +274,61 @@ public class KwmCooperateManageService {
         commonBusinessService.fillGroup(result, list);
         return result;
     }
+
+
+    /**
+     * @param id 企业id
+     * @return FindEntCooperateResVo
+     * @desc: 查询企业的合作单位
+     * @author: czh
+     * @date: 2023/7/22
+     */
+    public List<FindEntCooperateResVo> findEntCooperate(Long id) {
+        LambdaQueryWrapper<KwmCooperate> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(KwmCooperate::getInviterEntId, id).or().
+                eq(KwmCooperate::getInviteeEntId, id).and(
+                        wp -> wp.eq(KwmCooperate::getDelFlag, Global.NO).
+                                eq(KwmCooperate::getStatus, CooperateStatusEnum.OK.getCode())
+                );
+        List<KwmCooperate> kwmCooperates = kwmCooperateMapper.selectList(wrapper);
+        if (CollectionUtils.isEmpty(kwmCooperates)) {
+            return Collections.emptyList();
+        }
+
+        //装对方企业的id
+        List<Long> targetEntIdList = new ArrayList<>();
+        kwmCooperates.forEach(item -> targetEntIdList.add(item.getInviterEntId().equals(id) ? item.getInviteeEntId() : item.getInviterEntId()));
+
+        List<EntCacheResDto> entCacheResDtos = remoteSystemService.queryEntCacheByIds(targetEntIdList);
+        if (CollectionUtils.isEmpty(entCacheResDtos)) {
+            return Collections.emptyList();
+        }
+
+        //装对方企业信息
+        List<FindEntCooperateResVo> list = new ArrayList<>();
+        entCacheResDtos.forEach(item -> {
+            FindEntCooperateResVo findEntCooperateResVo = new FindEntCooperateResVo();
+            findEntCooperateResVo.setEntId(item.getId());
+            findEntCooperateResVo.setEntName(item.getFirmName());
+            list.add(findEntCooperateResVo);
+        });
+
+        //装对方企业的主体单位
+        Map<Long, List<EntCacheResDto>> longListMap = remoteSystemService.queryEntDeptCacheByIds(targetEntIdList);
+        List<Long> longs = list.stream().map(FindEntCooperateResVo::getEntId).toList();
+        longs.forEach(item -> {
+            List<EntCacheResDto> entCacheResDtos1 = longListMap.get(item);
+            if (CollectionUtils.isEmpty(entCacheResDtos1)) {
+                return;
+            }
+            entCacheResDtos1.forEach(x -> {
+                FindEntCooperateResVo findEntCooperateResVo = new FindEntCooperateResVo();
+                findEntCooperateResVo.setEntId(x.getId());
+                findEntCooperateResVo.setEntName(x.getFirmName());
+                list.add(findEntCooperateResVo);
+            });
+        });
+        return list;
+    }
+
 }

+ 5 - 0
sckw-modules/sckw-order/pom.xml

@@ -77,6 +77,11 @@
             <artifactId>sckw-product-api</artifactId>
             <version>1.0.0</version>
         </dependency>
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-contract-api</artifactId>
+            <version>1.0.0</version>
+        </dependency>
 
     </dependencies>
 

+ 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> {
+
+}

+ 11 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/dubbo/TradeOrderInfoServiceImpl.java

@@ -3,8 +3,10 @@ package com.sckw.order.dubbo;
 import com.alibaba.fastjson2.JSON;
 import com.google.common.collect.Lists;
 import com.sckw.core.common.enums.enums.DictEnum;
+import com.sckw.core.exception.BusinessException;
 import com.sckw.core.utils.BeanUtils;
 import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.mongo.model.SckwTradeOrder;
 import com.sckw.order.api.dubbo.TradeOrderInfoService;
@@ -59,6 +61,9 @@ public class TradeOrderInfoServiceImpl implements TradeOrderInfoService {
     @Override
     @Transactional(rollbackFor = Exception.class)
     public HttpResult updateOrderStatus(UpdateOrderStatusParam param) {
+        if (Objects.isNull(param.getUpdateBy()) || StringUtils.isBlank(param.getUpdateByName())) {
+            return HttpResult.error("操作人信息不能为空!");
+        }
         KwoTradeOrder order = kwoTradeOrderService.getById(param.getTOrderId());
         if (Objects.isNull(order)) {
             return HttpResult.error("订单不存在!");
@@ -94,6 +99,9 @@ public class TradeOrderInfoServiceImpl implements TradeOrderInfoService {
     @Override
     @Transactional(rollbackFor = Exception.class)
     public HttpResult updateOrderAmount(UpdateOrderAmountParam param) {
+        if (Objects.isNull(param.getUpdateBy()) || StringUtils.isBlank(param.getUpdateByName())) {
+            return HttpResult.error("操作人信息不能为空!");
+        }
         Long id = param.getTOrderId();
         Long updateBy = param.getUpdateBy();
         String lockKey = String.format(RedisConstant.GOODS_UPDATE_AMOUNT_KEY, id);
@@ -143,6 +151,9 @@ public class TradeOrderInfoServiceImpl implements TradeOrderInfoService {
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void contractSignCompleted(ContractSignCompletedParam param) {
+        if (Objects.isNull(param.getUpdateBy()) || StringUtils.isBlank(param.getUpdateByName())) {
+            throw new BusinessException("操作人信息不能为空!");
+        }
         Long contractId = param.getContractId();
         Long updateBy = param.getUpdateBy();
         List<KwoTradeOrderContract> contracts = kwoTradeOrderContractService.getByContractId(contractId);

+ 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;
+
+
+}

+ 2 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/GoodsInfo.java

@@ -47,8 +47,8 @@ public class GoodsInfo {
     /**
      * 商品发票税率(%)
      */
-    @NotNull(message = "商品发票税率不能为空")
-    private BigDecimal goodsTaxRate;
+    @NotBlank(message = "商品发票税率不能为空")
+    private String goodsTaxRate;
 
     /**
      * 商品尺寸大小

+ 3 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/GoodsInfoDetailRes.java

@@ -6,6 +6,7 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
 import java.io.Serializable;
 
 /**
@@ -19,6 +20,8 @@ import java.io.Serializable;
 @Accessors(chain = true)
 public class GoodsInfoDetailRes extends GoodsInfo implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = 1427251412395875742L;
     /**
      * 商品类型label
      */

+ 23 - 8
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java

@@ -3,6 +3,8 @@ package com.sckw.order.serivce;
 import com.alibaba.fastjson2.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.sckw.contract.api.RemoteContractService;
+import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
 import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
@@ -53,6 +55,9 @@ public class KwoTradeOrderService {
     @DubboReference(version = "2.0.0", group = "design", check = false)
     private GoodsInfoService goodsInfoService;
 
+    @DubboReference(version = "2.0.0", group = "design", check = false)
+    private RemoteContractService remoteContractService;
+
     private final KwoTradeOrderMapper kwoTradeOrderMapper;
     private final StreamBridge streamBridge;
     private final KwoTradeOrderAddressService kwoTradeOrderAddressService;
@@ -117,7 +122,9 @@ public class KwoTradeOrderService {
             Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntTreeByIds(entIds);
             unitInfos.forEach(e -> {
                 KwoTradeOrderUnit unit = BeanUtils.copyProperties(e, KwoTradeOrderUnit.class);
-                unit.setTOrderId(id).setTOrderNo(tOrderNo).setTopEntId(entMap.get(e.getEntId()).getId());
+                //todo:目前获取顶级企业dubbo接口有bug,暂时取自身企业id
+//                unit.setTOrderId(id).setTOrderNo(tOrderNo).setTopEntId(entMap.get(e.getEntId()).getId());
+                unit.setTOrderId(id).setTOrderNo(tOrderNo).setTopEntId(e.getEntId());
                 list.add(unit);
                 if (Objects.equals(e.getUnitType(), DictEnum.TORDER_UNIT_TYPE_1.getValue())) {
                     order.setSupplyEntId(e.getEntId()).setSupplyTopEntId(e.getEntId()).setSupplyFirmName(e.getFirmName())
@@ -314,7 +321,7 @@ public class KwoTradeOrderService {
                 GoodsInfoDetailRes goodsDetail = new GoodsInfoDetailRes();
                 goodsDetail.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), goods.getGoodsType()))
                         .setGoodsUnitLabel(DictEnum.getLabel(DictTypeEnum.UNIT_TYPE.getType(), goods.getUnit()))
-                        .setGoodsTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), String.valueOf(goods.getTaxRate())))
+                        .setGoodsTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), goods.getTaxRate()))
                         .setGoodsId(goods.getId()).setGoodsCode(goods.getCode()).setGoodsName(goods.getName())
                         .setGoodsType(goods.getGoodsType()).setGoodsTaxRate(goods.getTaxRate()).setGoodsSpec(goods.getSpec())
                         .setUnit(goods.getUnit()).setPriceRangeId(orderGoods.getPriceRangeId()).setUnitPrice(orderGoods.getUnitPrice())
@@ -347,7 +354,12 @@ public class KwoTradeOrderService {
         KwoTradeOrderContract contract = kwoTradeOrderContractService.getByOrderId(id);
         if (Objects.nonNull(contract)) {
             ContractInfo contractInfo = BeanUtils.copyProperties(contract, ContractInfo.class);
-            //todo:获取合同信息
+            Map<Long, ContractCommonInfoResDto> contractMap = remoteContractService.queryContractBaseInfo(List.of(contractInfo.getContractId()));
+            ContractCommonInfoResDto contractRes = contractMap.get(contractInfo.getContractId());
+            if (Objects.nonNull(contractRes)) {
+                contractInfo.setContractName(contractRes.getContactName());
+                contractInfo.setContractSigningWay(contractRes.getSigningWayName());
+            }
             detail.setContractInfo(contractInfo);
         }
         return detail;
@@ -430,6 +442,9 @@ public class KwoTradeOrderService {
         }
         ContractInfo contractInfo = param.getContractInfo();
         if (Objects.equals(source, DictEnum.TORDER_SOURCE_2.getValue())) {
+            if (StringUtils.isBlank(param.getDeliveryType())) {
+                throw new BusinessException("交付类型不能为空!");
+            }
             if (Objects.isNull(contractInfo)) {
                 throw new BusinessException("代客下单合同信息不能为空");
             }
@@ -465,8 +480,8 @@ public class KwoTradeOrderService {
         if (StringUtils.isBlank(goodsInfo.getGoodsType())) {
             throw new BusinessException("商品类型不能为空!");
         }
-        if (Objects.isNull(goodsInfo.getGoodsTaxRate()) || goodsInfo.getGoodsTaxRate().compareTo(BigDecimal.ZERO) < 0) {
-            throw new BusinessException("商品发票税率不能为空且不能为负数!");
+        if (StringUtils.isBlank(goodsInfo.getGoodsTaxRate())) {
+            throw new BusinessException("商品发票税率不能为空!");
         }
         if (StringUtils.isBlank(goodsInfo.getGoodsSpec())) {
             throw new BusinessException("商品尺寸大小不能为空!");
@@ -693,7 +708,7 @@ public class KwoTradeOrderService {
         KwoTradeOrderTrack track = new KwoTradeOrderTrack();
         track.setTOrderId(order.getId()).setTOrderNo(order.getTOrderNo()).setRemark(param.getRemark()).setStatus(order.getStatus());
         kwoTradeOrderTrackService.insert(track);
-        if (param.getActualAmount().compareTo(order.getActualAmount()) != 0) {
+        if (param.getActualAmount().compareTo(order.getAmount()) != 0) {
             KwoTradeOrderGoods goods = kwoTradeOrderGoodsService.getByOrderId(param.getId());
             if (Objects.isNull(goods)) {
                 throw new BusinessException("商品信息异常!");
@@ -707,8 +722,8 @@ public class KwoTradeOrderService {
         }
         //mongodb更新订单状态
         SckwTradeOrder updateParam = new SckwTradeOrder();
-        updateParam.setTOrderId(order.getId()).setStatus(order.getStatus()).setUpdateBy(LoginUserHolder.getUserId())
-                .setUpdateByName(LoginUserHolder.getUserName()).setUpdateTime(new Date());
+        updateParam.setTOrderId(order.getId()).setActualAmount(order.getActualAmount()).setStatus(order.getStatus())
+                .setUpdateBy(LoginUserHolder.getUserId()).setUpdateByName(LoginUserHolder.getUserName()).setUpdateTime(new Date());
         saveMongoDb(3, updateParam);
 
     }

+ 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;
 

+ 6 - 2
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
      */
@@ -71,7 +75,7 @@ public class KwpGoods extends BaseModel {
     /**
      * 发票税率(%)
      */
-    private BigDecimal taxRate;
+    private String taxRate;
 
     /**
      * 交易方式(合同采购、直接采购、预付款、货到付款、到款发货)

+ 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
      */

+ 12 - 8
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/req/AddGoodsParam.java

@@ -1,7 +1,10 @@
 package com.sckw.product.model.vo.req;
 
 import jakarta.validation.Valid;
-import jakarta.validation.constraints.*;
+import jakarta.validation.constraints.DecimalMin;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
@@ -30,7 +33,7 @@ public class AddGoodsParam {
     /**
      * 商品类型
      */
-    @NotNull(message = "商品类型不能为空")
+    @NotBlank(message = "商品类型不能为空")
     private String goodsType;
 
     /**
@@ -50,32 +53,32 @@ public class AddGoodsParam {
      * 库存数量
      */
     @NotNull(message = "库存数量不能为空")
-    @DecimalMin(value = "0.00",message = "库存数量最小为零")
+    @DecimalMin(value = "0.00", message = "库存数量最小为零")
     private BigDecimal amount;
 
     /**
      * 参数目录
      */
     @Size(max = 10, message = "参数目录最多支持10个")
+    @Valid
     private List<GoodsAttributes> attributes;
 
     /**
      * 发票税率(%)
      */
-    @NotNull(message = "发票税率不能为空")
-    @DecimalMin(value = "0.00",message = "发票税率最小为零")
-    private BigDecimal taxRate;
+    @NotBlank(message = "发票税率不能为空")
+    private String taxRate;
 
     /**
      * 交易方式(合同采购、直接采购、预付款、货到付款、到款发货)
      */
-    @NotNull(message = "交易方式不能为空")
+    @NotBlank(message = "交易方式不能为空")
     private String trading;
 
     /**
      * 预付款最低限额(万元)
      */
-    @DecimalMin(value = "0.00",message = "预付款最低限额最小为零")
+    @DecimalMin(value = "0.00", message = "预付款最低限额最小为零")
     private BigDecimal advancePrice;
 
     /**
@@ -121,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;
 }

+ 1 - 2
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/req/UpdateGoodsParam.java

@@ -63,8 +63,7 @@ public class UpdateGoodsParam {
     /**
      * 发票税率(%)
      */
-    @DecimalMin(value = "0.00",message = "发票税率最小为零")
-    private BigDecimal taxRate;
+    private String taxRate;
 
     /**
      * 交易方式(合同采购、直接采购、预付款、货到付款、到款发货)

+ 1 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/GoodsDetail.java

@@ -89,7 +89,7 @@ public class GoodsDetail {
     /**
      * 发票税率(%)
      */
-    private BigDecimal taxRate;
+    private String taxRate;
 
     /**
      * 发票税率label

+ 1 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/GoodsList.java

@@ -68,7 +68,7 @@ public class GoodsList {
     /**
      * 发票税率(%)
      */
-    private BigDecimal taxRate;
+    private String taxRate;
 
     /**
      * 发票税率label

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

@@ -181,7 +181,7 @@ public class KwpGoodsService {
         detail.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), detail.getGoodsType()))
                 .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), detail.getTrading()))
                 .setUnitLabel(DictEnum.getLabel(DictTypeEnum.UNIT_TYPE.getType(), detail.getUnit()))
-                .setTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), String.valueOf(detail.getTaxRate())))
+                .setTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), detail.getTaxRate()))
                 .setStatusLabel(DictEnum.getLabel(DictTypeEnum.GOODS_STATUS.getType(), String.valueOf(detail.getStatus())));
         //商品图片信息
         List<KwpGoodsImage> goodsImages = kwpGoodsImageService.getByGoodsId(id);
@@ -305,8 +305,8 @@ public class KwpGoodsService {
         if (Objects.isNull(param.getAmount()) || param.getAmount().compareTo(BigDecimal.ZERO) < 0) {
             throw new BusinessException("库存数量不能为空且最小为零!");
         }
-        if (Objects.isNull(param.getTaxRate()) || param.getTaxRate().compareTo(BigDecimal.ZERO) < 0) {
-            throw new BusinessException("发票税率不能为空最小为零!");
+        if (StringUtils.isBlank(param.getTaxRate())) {
+            throw new BusinessException("发票税率不能为空!");
         }
         if (StringUtils.isBlank(param.getTrading())) {
             throw new BusinessException("交易方式不能为空!");
@@ -438,7 +438,7 @@ public class KwpGoodsService {
                     .setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), goodsList.getGoodsType()))
                     .setUnitLabel(DictEnum.getLabel(DictTypeEnum.UNIT_TYPE.getType(), goodsList.getUnit()))
                     .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), goodsList.getTrading()))
-                    .setTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), String.valueOf(goodsList.getTaxRate())))
+                    .setTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), goodsList.getTaxRate()))
                     .setManageName(Objects.nonNull(manager) ? manager.getName() : null)
                     .setPhone(Objects.nonNull(manager) ? manager.getPhone() : null)
                     .setSupplyEnt(Objects.nonNull(entMap.get(e.getSupplyEntId())) ? entMap.get(e.getSupplyEntId()) : null)
@@ -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());
             }
         }
@@ -683,7 +688,7 @@ public class KwpGoodsService {
                     .setPrice(CollectionUtils.isEmpty(priceRanges) ? null : priceRanges.get(0).getPrice())
                     .setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), e.getGoodsType()))
                     .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), e.getTrading()))
-                    .setTradingLabel(DictEnum.getLabel(DictTypeEnum.UNIT_TYPE.getType(), e.getUnit()))
+                    .setUnitLabel(DictEnum.getLabel(DictTypeEnum.UNIT_TYPE.getType(), e.getUnit()))
                     .setSupplyEnt(entMap.get(e.getSupplyEntId()));
             result.add(materials);
         });

+ 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);
     }
 
     /**

+ 37 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwTransportController.java

@@ -114,6 +114,43 @@ public class KwTransportController {
         }
         return httpResult;
     }
+
+    /**
+     * 运单管理-运单列表 top 统计
+     *
+     * @param query
+     * @return {@link HttpResult }
+     * @author jc
+     * @date 2023/07/21
+     */
+    @RequestMapping(value = "/getWayBillStatistics", method = RequestMethod.POST)
+    public HttpResult wayBillStatistics(@Validated @RequestBody WaybillOrderQuery query) {
+        try {
+            return transportService.getWayBillStatistics(query);
+        } catch (Exception e) {
+            log.error("运单管理-运单列表top统计失败:{}", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
+    /**
+     * 运单管理-运单列表 列表统计数据项
+     * 【还需要修改】
+     * @param query
+     * @return {@link HttpResult }
+     * @author jc
+     * @date 2023/07/21
+     */
+    @RequestMapping(value = "/wayBillTotalCount", method = RequestMethod.POST)
+    public HttpResult wayBillTotalCount(@Validated @RequestBody WaybillOrderQuery query) {
+        try {
+            return transportService.wayBillTotalCount(query);
+        } catch (Exception e) {
+            log.error("运单管理-运单列表top统计失败:{}", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
     /**
      * 承运订单-获取分包托运列表
      *

+ 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;

+ 115 - 25
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;
@@ -328,17 +329,50 @@ public class KwTransportService {
 
     /**
      * 获取运单列表
+     *
      * @param query
-     * @return
-     * @throws ParseException
+     * @return {@link HttpResult }
+     * @author jc
+     * @date 2023/07/21
      */
     public HttpResult getWaybillOrders(WaybillOrderQuery query) throws ParseException {
+        Criteria criteria = buildWaybillOrdersQuery(query);
+        Query queryFormat = new Query(criteria);
+        // in查询
+        if (CollectionUtils.isNotEmpty(query.getIds())) {
+            queryFormat.addCriteria(Criteria.where("wOrderId").in(query.getIds()));
+        }
+        // 总记录数
+        long total = mongoTemplate.count(queryFormat, SckwWaybillOrder.class);
+        queryFormat.with(PageRequest.of(query.getPage() - 1, query.getPageSize(),
+                Sort.by(Sort.Order.desc("createTime"))));
+        // 执行查询
+        List<SckwWaybillOrder> list = mongoTemplate.find(queryFormat, SckwWaybillOrder.class);
+        List<CarWaybillVo> returnList = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(list)) {
+            packageWayBillReturnList(list, returnList);
+        }
+        PageResult build = PageResult.build(query.getPage(), query.getPageSize(), total, returnList);
+        return HttpResult.ok(build);
+    }
+
+    /**
+     *  构造运单关联查询条件
+     * @param query
+     * @return
+     */
+    public Criteria buildWaybillOrdersQuery(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")
@@ -354,7 +388,6 @@ public class KwTransportService {
             criteria.andOperator(Criteria.where("unloadTime").gte(query.getStartUnloadTime()), Criteria.where("unloadTime")
                     .lte(query.getEndUnloadTime()));
         }
-        criteria.and("delFlag").is(String.valueOf(NumberConstant.ZERO));
         // 多条件模糊查询
         Criteria c1 = new Criteria();
         Criteria c2 = new Criteria();
@@ -372,27 +405,73 @@ public class KwTransportService {
             c6 = Criteria.where("unloadAddress").regex(pattern);
             criteria.orOperator(c1, c2, c3, c4, c5, c6);
         }
-        Query queryFormat = new Query(criteria);
-        // in查询
-        if (CollectionUtils.isNotEmpty(query.getIds())) {
-            queryFormat.addCriteria(Criteria.where("wOrderId").in(query.getIds()));
-        }
-        // 总记录数
-        long total = mongoTemplate.count(queryFormat, SckwWaybillOrder.class);
-        queryFormat.with(PageRequest.of(query.getPage() - 1, query.getPageSize(),
-                Sort.by(Sort.Order.desc("createTime"))));
-        // 执行查询
-        List<SckwWaybillOrder> list = mongoTemplate.find(queryFormat, SckwWaybillOrder.class);
-        List<CarWaybillVo> returnList = new ArrayList<>();
-        if (CollectionUtils.isNotEmpty(list)) {
-            packageWayBillReturnList(list, returnList);
+        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"),
+                Aggregation.project("total").and("value").previousOperation()
+        );
+        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);
         }
-        PageResult build = PageResult.build(query.getPage(), query.getPageSize(), total, returnList);
-        return HttpResult.ok(build);
+        // 查询结果
+        return HttpResult.ok(list);
+    }
+
+    /**
+     * 运单管理-运单列表 列表统计数据项
+     *
+     * @param query 查询
+     * @return {@link HttpResult }
+     * @author jc
+     * @date 2023/07/21
+     */
+    public HttpResult wayBillTotalCount(WaybillOrderQuery query){
+        // 统计项字段
+        Criteria criteria = buildWaybillOrdersQuery(query);
+        Aggregation aggregation = Aggregation.newAggregation(
+                Aggregation.match(criteria),
+                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<WaybillsCountVo> outputTypeCount = mongoTemplate.aggregate(aggregation, SckwWaybillOrder.class, WaybillsCountVo.class);
+        List<WaybillsCountVo> results = outputTypeCount.getMappedResults();
+        return HttpResult.ok(results);
     }
 
     /**
-     * 处理运单查询结果
+     * 运单处理运单查询结果
      * @param list
      * @param returnList
      */
@@ -407,9 +486,12 @@ public class KwTransportService {
             vo.setDriverName(waybillOrder.getDriverName() == null ?
                     null : String.valueOf(waybillOrder.getDriverName()));
             vo.setType(String.valueOf(waybillOrder.getType()));
-            vo.setSendCarTime(String.valueOf(waybillOrder.getCreateTime()));
-            vo.setStartTime(String.valueOf(waybillOrder.getStartTime()));
-            vo.setEndTime(String.valueOf(waybillOrder.getEndTime()));
+            vo.setSendCarTime(waybillOrder.getCreateTime() == null ?
+                    null : DateUtil.getDateTime(waybillOrder.getCreateTime()));
+            vo.setStartTime(waybillOrder.getStartTime() == null ?
+                    null : DateUtil.getDateTime(waybillOrder.getStartTime()));
+            vo.setEndTime(waybillOrder.getEndTime() == null ?
+                    null : DateUtil.getDateTime(waybillOrder.getEndTime()));
             vo.setEntrustAmount(String.valueOf(waybillOrder.getEntrustAmount()));
             vo.setLoadingAddress(waybillOrder.getLoadDetailAddress());
             vo.setUnloadingAddress(waybillOrder.getUnloadDetailAddress());
@@ -418,9 +500,17 @@ public class KwTransportService {
             vo.setUnloadAmount(waybillOrder.getUnloadAmount() == null ?
                     null : String.valueOf(waybillOrder.getUnloadAmount()));
             vo.setLoadTime(waybillOrder.getLoadTime() == null ?
-                    null : String.valueOf(waybillOrder.getLoadTime()));
+                    null : DateUtil.getDateTime(waybillOrder.getLoadTime()));
             vo.setUnloadTime(waybillOrder.getUnloadTime() == null ?
-                    null :String.valueOf(waybillOrder.getUnloadTime()));
+                    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;
 
     /**

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

@@ -9,7 +9,6 @@ import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
 
-import java.math.BigDecimal;
 import java.time.LocalDate;
 
 /**
@@ -55,7 +54,7 @@ public class TradeOrderStatementList extends PageRequest {
     /**
      * 商品税率
      */
-    private BigDecimal goodsTaxRate;
+    private String goodsTaxRate;
 
     /**
      * 商品名称

+ 5 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/param/WaybillOrderQuery.java

@@ -58,4 +58,9 @@ public class WaybillOrderQuery extends PageRequest implements Serializable {
      * 关键字搜索
      */
     private String keywords;
+
+    /**
+     * 运单状态
+     */
+    private String status;
 }

Някои файлове не бяха показани, защото твърде много файлове са промени