Răsfoiți Sursa

设置停止接单查询
设置停止接单提交

lengfaqiang 2 ani în urmă
părinte
comite
bc40ea1b9b
18 a modificat fișierele cu 678 adăugiri și 42 ștergeri
  1. 1 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/NumberConstant.java
  2. 18 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/RegularUtils.java
  3. 9 1
      sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/dubbo/TransportDubboService.java
  4. 86 0
      sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/model/dto/vo/LogisticsOrderVO.java
  5. 5 0
      sckw-modules/sckw-transport/pom.xml
  6. 34 15
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/AcceptCarriageOrderController.java
  7. 9 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtLogisticsOrderCirculateMapper.java
  8. 19 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtLogisticsOrderMapper.java
  9. 2 2
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/SubcontractConsignmentDTO.java
  10. 41 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/param/DriverParam.java
  11. 14 4
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/param/LogisticsConsignmentParam.java
  12. 69 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/DriverListVo.java
  13. 129 8
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/AcceptCarriageOrderService.java
  14. 23 5
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/LogisticsConsignmentService.java
  15. 33 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/dubbo/TransportDubboServiceImpl.java
  16. 44 1
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderCirculateMapper.xml
  17. 129 0
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml
  18. 13 6
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderMapper.xml

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

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

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

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

@@ -96,6 +96,11 @@
             <artifactId>sckw-order-api</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-fleet-api</artifactId>
+        </dependency>
+
         <!-- validation -->
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 34 - 15
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/AcceptCarriageOrderController.java

@@ -7,6 +7,7 @@ import com.sckw.transport.model.dto.DocumentParamDTO;
 import com.sckw.transport.model.dto.OrderDTO;
 import com.sckw.transport.model.dto.OrderTakingDTO;
 import com.sckw.transport.model.dto.SubcontractConsignmentDTO;
+import com.sckw.transport.model.param.DriverParam;
 import com.sckw.transport.model.param.LogisticsOrderParam;
 import com.sckw.transport.service.AcceptCarriageOrderService;
 import com.sckw.transport.service.TransportCommonService;
@@ -18,6 +19,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 /**
  * @author lfdc
  * @description 承运订单controller
@@ -112,21 +115,6 @@ public class AcceptCarriageOrderController {
         }
     }
 
-//    /**
-//     * 承运订单-提交派车
-//     *
-//     * @param sendCarDTO 请求参数
-//     * @return
-//     */
-//    @RequestMapping(value = "/commitSendCar", method = RequestMethod.POST)
-//    public HttpResult commitSendCar(@Validated @RequestBody SendCarDTO sendCarDTO) {
-//        try {
-//            return acceptCarriageOrderService.commitSendCar(sendCarDTO);
-//        } catch (Exception e) {
-//            log.error("派车 error:{}", e.getMessage(), e);
-//            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
-//        }
-//    }
 
     /**
      * 承运订单-获取运单详情
@@ -164,4 +152,35 @@ public class AcceptCarriageOrderController {
             return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
         }
     }
+
+    /**
+     * 承运订单-设置停止接单-查询
+     *
+     * @return
+     */
+    @RequestMapping(value = "/stopDocumentDetail", method = RequestMethod.POST)
+    public HttpResult stopDocumentDetail(@Validated @RequestBody DriverParam driverParam) {
+        try {
+            return acceptCarriageOrderService.stopDocumentDetail(driverParam);
+        } catch (Exception e) {
+            log.error("承运订单-设置停止接单-查询 error:{}", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
+    /**
+     * 承运订单-设置停止接单-提交
+     *
+     * @param ids 车辆运单id
+     * @return
+     */
+    @RequestMapping(value = "/stopDocumentCommit", method = RequestMethod.POST)
+    public HttpResult stopDocumentCommit(@NotBlank(message = "车辆运单id不能为空") @RequestBody List<String> ids,@NotBlank(message = "物流订单id不能为空") String lOrderId) {
+        try {
+            return acceptCarriageOrderService.stopDocumentCommit(ids,lOrderId);
+        } catch (Exception e) {
+            log.error("承运订单-设置停止接单-提交 error:{}", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
 }

+ 9 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtLogisticsOrderCirculateMapper.java

@@ -37,4 +37,13 @@ public interface KwtLogisticsOrderCirculateMapper extends BaseMapper<KwtLogistic
      * @date 2023/7/20
      **/
     KwtLogisticsOrderCirculate findCirculate(@Param("lOrderId") Long lOrderId, @Param("truckNo") String truckNo, @Param("driverId") Long driverId);
+
+    /**
+     * 通过物流订单id和车辆运单id查询循环单据进行停止接单
+     * @param lOrderId
+     * @param ids
+     * @return
+     */
+    List<Long> selectEntityBylOrderIdAndOrderIds(@Param("lOrderId") String lOrderId, @Param("ids") List<String> ids);
+
 }

+ 19 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtLogisticsOrderMapper.java

@@ -2,8 +2,11 @@ package com.sckw.transport.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.transport.api.model.dto.vo.LogisticsOrderDTO;
+import com.sckw.transport.api.model.dto.vo.LogisticsOrderVO;
 import com.sckw.transport.model.KwtLogisticsOrder;
+import com.sckw.transport.model.param.DriverParam;
 import com.sckw.transport.model.param.LogisticsOrderParam;
+import com.sckw.transport.model.vo.DriverListVo;
 import com.sckw.transport.model.vo.SubcontractConsignmentVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -73,4 +76,20 @@ public interface KwtLogisticsOrderMapper extends BaseMapper<KwtLogisticsOrder> {
      * @return
      */
     List<SubcontractConsignmentVO> getSubcontractConsignment(@Param("lOrderId") String lOrderId, @Param("page") Integer page, @Param("pageSize") Integer pageSize);
+
+    List<Map> countSubcontractConsignmentById(@Param("lOrderId") String lOrderId);
+
+    /**
+     * 通过物流订单查看单据下运力司机数据
+     * @param driverParam
+     * @return
+     */
+    List<DriverListVo> selectDriverListById(@Param("driverParam") DriverParam driverParam);
+
+    /**
+     *
+     * @param ids
+     * @return
+     */
+    List<LogisticsOrderVO> selectLogisticOrderList(@Param("ids") List<String> ids);
 }

+ 2 - 2
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/SubcontractConsignmentDTO.java

@@ -57,7 +57,7 @@ public class SubcontractConsignmentDTO {
     /**
      * 合理损耗
      */
-    @NotNull(message = "合理损耗不能为空")
+//    @NotNull(message = "合理损耗不能为空")
     private Long loss;
     /**
      * 合理损耗单位
@@ -67,7 +67,7 @@ public class SubcontractConsignmentDTO {
     /**
      * 商品价值(扣亏货值)
      */
-    @NotNull(message = "扣亏货值不能为空")
+//    @NotNull(message = "扣亏货值不能为空")
     private Long goodsPrice;
     /**
      * 商品价值(扣亏货值)单位

+ 41 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/param/DriverParam.java

@@ -0,0 +1,41 @@
+package com.sckw.transport.model.param;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+/**
+ * @author lfdc
+ * @description 司机查询
+ * @date 2023-07-21 13:07:44
+ */
+@Data
+public class DriverParam {
+    /**
+     * 物流订单id
+     */
+    @NotBlank(message = "物流订单id不能为空")
+    @JsonProperty("lOrderId")
+    private String lOrderId;
+    /**
+     * 车牌号
+     */
+    @JsonProperty("truckNo")
+    private String truckNo;
+    /**
+     * 司机id
+     */
+    @JsonProperty("driverId")
+    private String driverId;
+    /**
+     * 司机姓名
+     */
+    @JsonProperty("driverName")
+    private String driverName;
+    /**
+     * 司机电话
+     */
+    @JsonProperty("driverPhone")
+    private String driverPhone;
+
+}

+ 14 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/param/LogisticsConsignmentParam.java

@@ -2,6 +2,7 @@ package com.sckw.transport.model.param;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import jakarta.validation.constraints.DecimalMin;
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotNull;
 import lombok.Data;
@@ -29,8 +30,9 @@ public class LogisticsConsignmentParam {
      */
     private Long carryingCapacity;
     /**
-     * 分配承运量使用的单位
+     * 分配承运量使用的单位(吨、方、箱、件))
      */
+    @NotNull(message = "分配承运量单位不能为空")
     private String carryingCapacityUnit;
 
     /**
@@ -58,7 +60,8 @@ public class LogisticsConsignmentParam {
     /**
      * 合理损耗
      */
-    @NotNull(message = "合理损耗不能为空")
+//    @NotNull(message = "合理损耗不能为空")
+//    @DecimalMin(value = "0.00",message = "必须为大于0的正整数")
     private Long loss;
     /**
      * 合理损耗单位
@@ -68,7 +71,8 @@ public class LogisticsConsignmentParam {
     /**
      * 商品价值(扣亏货值)
      */
-    @NotNull(message = "扣亏货值不能为空")
+//    @NotNull(message = "扣亏货值不能为空")
+//    @DecimalMin(value = "0.00",message = "必须为大于0的正整数")
     private Long goodsPrice;
     /**
      * 商品价值(扣亏货值)单位
@@ -172,6 +176,7 @@ public class LogisticsConsignmentParam {
      * 运价
      */
     @NotNull(message = "运价不能为空")
+    @DecimalMin(value = "0.00",message = "运价必须为大于0的正整数")
     private Long price;
     /**
      * 运价方式
@@ -197,10 +202,15 @@ public class LogisticsConsignmentParam {
      */
     @NotNull(message = "税率不能为空")
     private Long taxRate;
+//    /**
+//     * 税率类型
+//     */
+//    @NotNull(message = "税率类型不能为空")
+//    private String taxRateType;
     /**
      * 备注
      */
-    @Length(max = 200,message = "单据编号长度错误最大长度:{max}")
+    @Length(max = 100,message = "单据编号长度错误最大长度:{max}")
     private String remark;
     /**
      * 计费方式

+ 69 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/DriverListVo.java

@@ -0,0 +1,69 @@
+package com.sckw.transport.model.vo;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lfdc
+ * @description 司机数据VO
+ * @date 2023-07-21 14:07:08
+ */
+@NoArgsConstructor
+@Data
+public class DriverListVo {
+
+    /**
+     * 司机姓名
+     */
+    private String driverName;
+
+    /**
+     * 司机iD
+     */
+    private String driverId;
+
+    /**
+     * 司机电话
+     */
+    private String driverPhone;
+
+    /**
+     * 司机身份证号码
+     */
+    private String driverIdCard;
+
+    /**
+     * 运力状态
+     */
+    private String transportStatus;
+
+    /**
+     * 运输次数
+     */
+    private Integer count;
+
+    /**
+     * 车牌号
+     */
+    private String truckNo;
+
+    /**
+     * 车辆类型
+     */
+    private String carType;
+
+    /**
+     * 物流订单id
+     */
+    private String lOrderId;
+
+    /**
+     * 车辆运单id
+     */
+    private String wOrderId;
+
+    /**
+     * 车辆运单编号
+     */
+    private String wOrderNo;
+}

+ 129 - 8
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/AcceptCarriageOrderService.java

@@ -16,10 +16,14 @@ import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.IdWorker;
+import com.sckw.core.utils.RegularUtils;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.excel.utils.ValidUtil;
+import com.sckw.fleet.api.RemoteFleetService;
+import com.sckw.fleet.api.model.vo.RTruckVo;
 import com.sckw.mongo.enums.BusinessTypeEnum;
 import com.sckw.mongo.model.SckwLogisticsOrder;
 import com.sckw.mongo.model.SckwWaybillOrder;
@@ -28,11 +32,13 @@ import com.sckw.product.api.dubbo.GoodsInfoService;
 import com.sckw.product.api.model.KwpGoods;
 import com.sckw.stream.model.SckwBusSum;
 import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.SysDictResDto;
 import com.sckw.transport.dao.*;
 import com.sckw.transport.model.*;
 import com.sckw.transport.model.dto.OrderTakingDTO;
 import com.sckw.transport.model.dto.SubcontractConsignmentDTO;
 import com.sckw.transport.model.param.AcceptCarriageOrderQuery;
+import com.sckw.transport.model.param.DriverParam;
 import com.sckw.transport.model.vo.*;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
@@ -45,9 +51,8 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @author lfdc
@@ -66,6 +71,9 @@ public class AcceptCarriageOrderService {
     @DubboReference(version = "2.0.0", group = "design", check = false, timeout = 8000)
     GoodsInfoService goodsInfoService;
 
+    @DubboReference(version = "2.0.0", group = "design", check = false, timeout = 8000)
+    RemoteFleetService fleetService;
+
     @Resource
     private StreamBridge streamBridge;
 
@@ -798,19 +806,42 @@ public class AcceptCarriageOrderService {
         return HttpResult.ok(vo);
     }
 
+    /**
+     * 获取承运订单-分包托运列表数据
+     *
+     * @param lOrderId
+     * @param page
+     * @param pageSize
+     * @return
+     */
     public HttpResult getSubcontractConsignment(String lOrderId, Integer page, Integer pageSize) {
         Integer newPage = page - 1;
         List<SubcontractConsignmentVO> list = logisticsOrderMapper.getSubcontractConsignment(lOrderId, newPage, pageSize);
+
         //联查数据
+        /**运价方式*/
+        Map<String, String> priceDictData = getDictData(DictTypeEnum.PRICE_TYPE.getType());
+        /**车载计算方式*/
+        Map<String, String> weightDictData = getDictData(DictTypeEnum.WEIGHT_CAR.getType());
+        /**签约方式*/
+        Map<String, String> singDictData = getDictData(DictTypeEnum.SIGNING_TYPE.getType());
+        /**计费方式*/
+        Map<String, String> chargingDictData = getDictData(DictTypeEnum.CHARGING_TYPE.getType());
+        /**结算周期*/
+        Map<String, String> settlementDictData = getDictData(DictTypeEnum.SETTLEMENT_CYCLE.getType());
         if (CollectionUtils.isNotEmpty(list)) {
             for (SubcontractConsignmentVO subcontractConsignmentVO : list) {
-//                subcontractConsignmentVO.setPriceType(getDictData(DictEnum.PRICE_TYPE_0.getType(), subcontractConsignmentVO.getPriceType()));
-//                subcontractConsignmentVO.setLossUnit(getDictData(DictEnum.TRANSPORT_TYPE_0.getType(), subcontractConsignmentVO.getLossUnit()));
-//                subcontractConsignmentVO.setGoodsPriceUnit(getDictData(DictEnum.PRICE_TYPE_0.getType(), subcontractConsignmentVO.getGoodsPriceUnit()));
-//                subcontractConsignmentVO.setContractSigningWay(getDictData(DictEnum.CONTRACT_STATUS_1.getType(), subcontractConsignmentVO.getContractSigningWay()));
+                subcontractConsignmentVO.setPriceType(priceDictData == null ? null : priceDictData.get(subcontractConsignmentVO.getPriceType()));
+                subcontractConsignmentVO.setLossUnit(weightDictData == null ? null : weightDictData.get(subcontractConsignmentVO.getLossUnit()));
+                subcontractConsignmentVO.setGoodsPriceUnit(priceDictData == null ? null : priceDictData.get(subcontractConsignmentVO.getGoodsPriceUnit()));
+//                subcontractConsignmentVO.setContractSigningWay(singDictData == null ? null : singDictData.get(subcontractConsignmentVO.getContractSigningWay()));
+                subcontractConsignmentVO.setBillingMode(chargingDictData == null ? null : chargingDictData.get(subcontractConsignmentVO.getBillingMode()));
+                subcontractConsignmentVO.setSettlementCycle(settlementDictData == null ? null : settlementDictData.get(subcontractConsignmentVO.getSettlementCycle()));
             }
         }
-        return null;
+        /**页面数据统计*/
+//        List<Map> countList = logisticsOrderMapper.countSubcontractConsignmentById(lOrderId);
+        return HttpResult.ok(list);
     }
 
     public String getDictData(String type, String value) {
@@ -824,4 +855,94 @@ public class AcceptCarriageOrderService {
         }
     }
 
+    public Map<String, String> getDictData(String type) {
+        Map<String, String> maps = new HashMap<>(NumberConstant.SIXTEEN);
+        List<SysDictResDto> list = remoteSystemService.queryDictByType(type);
+        if (CollectionUtils.isNotEmpty(list)) {
+            maps = list.stream().collect(Collectors.toMap(SysDictResDto::getValue, SysDictResDto::getLabel, (key1, key2) -> key2));
+        }
+        return maps;
+    }
+
+    /**
+     * 设置停止接单数据查询
+     *
+     * @param driverParam
+     * @return
+     */
+    public HttpResult stopDocumentDetail(DriverParam driverParam) {
+        HttpResult result = new HttpResult();
+        result.setCode(HttpStatus.SUCCESS_CODE);
+        HttpResult httpResult = ValidUtil.serviceValid(driverParam);
+        if (HttpStatus.SUCCESS_CODE != httpResult.getCode()) {
+            result.setMsg(httpResult.getMsg());
+            return result;
+        }
+        /**请求参数校验*/
+        checkParam(driverParam);
+        List<DriverListVo> list = logisticsOrderMapper.selectDriverListById(driverParam);
+        for (DriverListVo driverListVo : list) {
+            Map<Long, RTruckVo> truck = fleetService.findTruck(driverListVo.getTruckNo());
+            if (!ObjectUtils.isEmpty(truck)) {
+                driverListVo.setCarType(truck.get(driverListVo.getDriverId()).getTruckType());
+            }
+        }
+        result.setData(list);
+        return result;
+    }
+
+    private void checkParam(DriverParam driverParam) {
+        if (StringUtils.isNotBlank(driverParam.getDriverName())) {
+            if (driverParam.getTruckNo().trim().length() > NumberConstant.TWENTY_FOUR) {
+                throw new RuntimeException("司机姓名位数不正确");
+            }
+            if (!RegularUtils.matchs(RegularUtils.CHINESE, driverParam.getDriverName())) {
+                throw new RuntimeException("司机姓名格式不正确");
+            }
+        }
+        if (StringUtils.isNotBlank(driverParam.getTruckNo())) {
+            int length = driverParam.getTruckNo().trim().length();
+            if (driverParam.getTruckNo().trim().length() > NumberConstant.EIGHT||driverParam.getTruckNo().trim().length()<NumberConstant.SEVEN) {
+                throw new RuntimeException("车牌号位数不正确");
+            }
+            if (driverParam.getTruckNo().trim().length() == NumberConstant.EIGHT) {
+                if (!RegularUtils.matchs(RegularUtils.TRUCK_NUMBER_SIX, driverParam.getTruckNo())) {
+                    throw new RuntimeException("车牌号格式不正确");
+                }
+            } else if (driverParam.getTruckNo().trim().length() == NumberConstant.SEVEN) {
+                if (!RegularUtils.matchs(RegularUtils.TRUCK_NUMBER_FIVE, driverParam.getTruckNo())) {
+                    throw new RuntimeException("车牌号格式不正确");
+                }
+            }
+
+        }
+        if (StringUtils.isNotBlank(driverParam.getDriverPhone())) {
+            if (driverParam.getDriverPhone().trim().length() > NumberConstant.TEN) {
+                throw new RuntimeException("手机号不正确");
+            }
+            if (!RegularUtils.matchs(RegularUtils.PHONE_REG, driverParam.getDriverPhone())) {
+                throw new RuntimeException("手机号格式不正确");
+            }
+        }
+    }
+
+    /**
+     * 设置停止接单
+     *
+     * @param ids
+     * @param lOrderId
+     * @return
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public HttpResult stopDocumentCommit(List<String> ids, String lOrderId) {
+        List<Long> wOrderIds = logisticsOrderCirculateMapper.selectEntityBylOrderIdAndOrderIds(lOrderId, ids);
+        if (CollectionUtils.isNotEmpty(wOrderIds)) {
+            wOrderIds.forEach(wOrderId -> {
+                logisticsOrderCirculateMapper.update(null, new LambdaUpdateWrapper<KwtLogisticsOrderCirculate>()
+                        .set(KwtLogisticsOrderCirculate::getStatus, NumberConstant.ONE)
+                        .eq(KwtLogisticsOrderCirculate::getWOrderId, wOrderId));
+            });
+        }
+        return HttpResult.ok();
+    }
 }

+ 23 - 5
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/LogisticsConsignmentService.java

@@ -13,6 +13,7 @@ import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ValidUtil;
+import com.sckw.fleet.api.RemoteFleetService;
 import com.sckw.mongo.enums.BusinessTypeEnum;
 import com.sckw.mongo.model.SckwLogisticsOrder;
 import com.sckw.order.api.dubbo.TradeOrderInfoService;
@@ -61,6 +62,9 @@ public class LogisticsConsignmentService {
     @DubboReference(version = "2.0.0", group = "design", check = false, timeout = 6000)
     TradeOrderInfoService tradeOrderInfoService;
 
+    @DubboReference(version = "2.0.0", group = "design", check = false, timeout = 6000)
+    RemoteFleetService remoteFleetService;
+
     @Autowired
     public KwtLogisticsOrderGoodsMapper kwtLogisticsOrderGoodsMapper;
 
@@ -86,19 +90,34 @@ public class LogisticsConsignmentService {
     @Transactional(rollbackFor = Exception.class)
     public HttpResult purchaseLogisticsConsignment(LogisticsConsignmentParam bo) {
         HttpResult httpResult = ValidUtil.serviceValid(bo);
-        if (!String.valueOf(HttpStatus.SUCCESS_CODE).equals(httpResult.getCode())) {
+        if (HttpStatus.SUCCESS_CODE != httpResult.getCode()) {
             return HttpResult.error(httpResult.getMsg());
         }
+        checkParamData(bo);
         logisticsConsignmentInsert(bo);
         return HttpResult.ok();
     }
 
+    private void checkParamData(LogisticsConsignmentParam bo) {
+        if (!ObjectUtils.isEmpty(bo.getLoss())) {
+            if (NumberConstant.ZERO > bo.getLoss()) {
+                throw new RuntimeException("合理损耗填写时,必须大于0");
+            }
+        }
+        if (!ObjectUtils.isEmpty(bo.getGoodsPrice())) {
+            if (NumberConstant.ZERO > bo.getGoodsPrice()) {
+                throw new RuntimeException("扣亏货值填写时,必须大于0");
+            }
+        }
+    }
+
     @Transactional(rollbackFor = Exception.class)
     public HttpResult sellLogisticsConsignment(LogisticsConsignmentParam bo) {
         HttpResult httpResult = ValidUtil.serviceValid(bo);
-        if (!String.valueOf(HttpStatus.SUCCESS_CODE).equals(httpResult.getCode())) {
+        if (HttpStatus.SUCCESS_CODE != httpResult.getCode()) {
             return HttpResult.error(httpResult.getMsg());
         }
+        checkParamData(bo);
         logisticsConsignmentInsert(bo);
         return HttpResult.ok();
     }
@@ -338,13 +357,11 @@ public class LogisticsConsignmentService {
         order.setPid(null);
         order.setSettlementCycle(bo.getSettlementCycle());
         order.setPrice(new BigDecimal(bo.getPrice()));
-//        order.setPriceType(Long.parseLong(bo.getPriceType()));
         order.setPriceType(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getPriceType()) == null ?
                 null : Long.parseLong(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getPriceType()).getValue()));
-//        order.setPriceType(Long.parseLong(new ConvertDictTypeUtils().getDictType(LogisticsTypeEnum.PRICE_TYPE_0, bo.getPriceType())));
         order.setAmount(tradeOrder.getAmount());
         order.setBillingMode(bo.getBillingMode());
-//        order.setUnit(tradeOrder.getUnit());
+        order.setUnit(bo.getCarryingCapacityUnit());
         order.setLoss(new BigDecimal(bo.getLoss()));
         order.setLossUnit(bo.getLossUnit());
         order.setLossUnit(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.UNIT_TYPE.getType(), bo.getLossUnit()) == null ?
@@ -364,6 +381,7 @@ public class LogisticsConsignmentService {
         order.setUpdateTime(new Date());
         order.setStatus(LogisticsOrderEnum.PENDING_ORDER.getCode());
         BigDecimal decimal = new BigDecimal(NumberConstant.ZERO);
+        /**补充默认值*/
         order.setEntrustAmount(decimal);
         order.setSubcontractAmount(decimal);
         order.setLoadAmount(decimal);

+ 33 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/dubbo/TransportDubboServiceImpl.java

@@ -1,14 +1,19 @@
 package com.sckw.transport.service.dubbo;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.transport.api.dubbo.TransportDubboService;
 import com.sckw.transport.api.model.dto.vo.KwtLogisticsOrderVO;
+import com.sckw.transport.api.model.dto.vo.LogisticsOrderVO;
 import com.sckw.transport.dao.KwtLogisticsOrderGoodsMapper;
 import com.sckw.transport.dao.KwtLogisticsOrderMapper;
 import com.sckw.transport.dao.KwtLogisticsOrderUnitMapper;
+import com.sckw.transport.dao.KwtWaybillOrderMapper;
 import com.sckw.transport.model.KwtLogisticsOrder;
+import com.sckw.transport.model.KwtLogisticsOrderUnit;
+import com.sckw.transport.model.KwtWaybillOrder;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.annotation.DubboService;
 import org.springframework.beans.BeanUtils;
@@ -39,6 +44,9 @@ public class TransportDubboServiceImpl implements TransportDubboService {
     @Autowired
     private KwtLogisticsOrderGoodsMapper logisticsOrderGoodsMapper;
 
+    @Autowired
+    private KwtWaybillOrderMapper waybillOrderMapper;
+
     /**
      * 对账管理-ids查询
      *
@@ -57,4 +65,29 @@ public class TransportDubboServiceImpl implements TransportDubboService {
         }
         return list;
     }
+
+    /**
+     * 对账页面数据接口
+     *
+     * @param ids
+     * @return
+     */
+    @Override
+    public List<LogisticsOrderVO> getAcceptCarriageOrderList(List<String> ids) {
+        List<LogisticsOrderVO> list = logisticsOrderMapper.selectLogisticOrderList(ids);
+        if (CollectionUtils.isNotEmpty(list)) {
+            for (LogisticsOrderVO logisticsOrderVO : list) {
+                KwtLogisticsOrderUnit orderUnit = logisticsOrderUnitMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrderUnit>()
+                        .eq(KwtLogisticsOrderUnit::getLOrderId, logisticsOrderVO.getLOrderId())
+                        .eq(KwtLogisticsOrderUnit::getUnitType, NumberConstant.ONE));
+                KwtLogisticsOrderUnit orderUnit1 = logisticsOrderUnitMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrderUnit>()
+                        .eq(KwtLogisticsOrderUnit::getLOrderId, logisticsOrderVO.getLOrderId())
+                        .eq(KwtLogisticsOrderUnit::getUnitType, NumberConstant.TWO));
+                logisticsOrderVO.setCarrierCompany(orderUnit1 == null ? null : orderUnit1.getFirmName());
+                logisticsOrderVO.setConsignCompany(orderUnit == null ? null : orderUnit.getFirmName());
+                logisticsOrderVO.setCount(waybillOrderMapper.selectCount(new LambdaQueryWrapper<KwtWaybillOrder>().eq(KwtWaybillOrder::getLOrderId, logisticsOrderVO.getLOrderId())));
+            }
+        }
+        return list;
+    }
 }

+ 44 - 1
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderCirculateMapper.xml

@@ -1,7 +1,29 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.transport.dao.KwtLogisticsOrderCirculateMapper">
-
+    <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtLogisticsOrderCirculate">
+        <id column="id" jdbcType="BIGINT" property="id" />
+        <result column="ent_id" jdbcType="BIGINT" property="entId" />
+        <result column="l_order_id" jdbcType="BIGINT" property="lOrderId" />
+        <result column="w_order_id" jdbcType="BIGINT" property="wOrderId" />
+        <result column="truck_no" jdbcType="VARCHAR" property="truckNo" />
+        <result column="driver_id" jdbcType="BIGINT" property="driverId" />
+        <result column="type" jdbcType="BIGINT" property="type" />
+        <result column="actual_amount" jdbcType="DECIMAL" property="actualAmount" />
+        <result column="entrust_amount" jdbcType="DECIMAL" property="entrustAmount" />
+        <result column="entrust_date" jdbcType="TIMESTAMP" property="entrustDate" />
+        <result column="remark" jdbcType="VARCHAR" property="remark" />
+        <result column="status" jdbcType="INTEGER" property="status" />
+        <result column="create_by" jdbcType="BIGINT" property="createBy" />
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+        <result column="update_by" jdbcType="BIGINT" property="updateBy" />
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+        <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
+    </resultMap>
+    <sql id="Base_Column_List">
+        id, ent_id, l_order_id, w_order_id, truck_no,type, driver_id, actual_amount, entrust_amount,
+    entrust_date, remark, `status`, create_by, create_time, update_by, update_time, del_flag
+    </sql>
     <select id="selectDriverOrderByStatus" resultType="java.lang.Long">
         SELECT b.w_order_id as wOrderId
         FROM kwt_waybill_order a
@@ -31,4 +53,25 @@
         and truck_no = #{truckNo, jdbcType=VARCHAR}
         and driver_id = #{driverId, jdbcType=BIGINT}
     </select>
+
+    <select id="selectEntityBylOrderIdAndOrderIds" resultMap="BaseResultMap">
+        SELECT
+            DISTINCT b.id
+        FROM
+            kwt_waybill_order b,
+            kwt_logistics_order_contract c
+        WHERE
+            b.del_flag = 0
+          AND b.type = '2'
+          AND c.`status` = '0'
+        <if test="lOrderId != null and lOrderId != ''">
+            b.l_order_id=#{l_order_id}
+        </if>
+        <if test="ids != null and ids.size()>0">
+            AND b.id IN
+            <foreach collection="ids" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+    </select>
 </mapper>

+ 129 - 0
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml

@@ -225,4 +225,133 @@
         ORDER BY a.create_time
             limit #{page}, #{pageSize}
     </select>
+
+    <select id="countSubcontractConsignmentById" resultType="java.util.Map">
+        SELECT COUNT(0)           as total,
+               a.id,
+               a.pid,
+               a.`status`         as status,
+               a.l_order_no       as consignOrderNo,
+               c.firm_name        as carrierContacts,
+               d.goods_name       as goodsName,
+               a.amount           as amount,
+               a.price,
+               a.price_type       as priceType,
+               e.detail_address   as loadAddress,
+               f.detail_address   as unloadAddress,
+               a.billing_mode     as billingMode,
+               a.loss,
+               a.loss_unit        as lossUnit,
+               a.goods_price      as goodsPrice,
+               a.goods_price_unit as goodsPriceUnit,
+               a.settlement_cycle as settlementCycle,
+               c.contacts         as carrierContacts,
+               c.phone            as carrierPhone,
+               b.firm_name        as consignCompany,
+               b.contacts         as consignContacts,
+               b.phone            as consignPhone,
+               e.contacts         as loadContacts,
+               e.phone            as loadContacts,
+               f.contacts         as unloadContacts,
+               f.phone            as unloadPhone,
+               a.start_time       as shipmentsDate,
+               a.end_time         as receiveGoodsDate,
+               a.remark,
+               a.create_by        as createBy,
+               a.create_time      as createTime,
+               g.contract_id      as contractId
+        FROM kwt_logistics_order a
+                 LEFT JOIN kwt_logistics_order_unit b ON a.id = b.l_order_id
+            AND b.unit_type = 1
+                 LEFT JOIN kwt_logistics_order_unit c ON a.id = c.l_order_id
+            AND c.unit_type = 2
+                 LEFT JOIN kwt_logistics_order_goods d ON a.id = d.l_order_id
+                 LEFT JOIN kwt_logistics_order_address e ON a.id = e.l_order_id
+            AND e.address_type = 1
+                 LEFT JOIN kwt_logistics_order_address f ON a.id = f.l_order_id
+            AND f.address_type = 2
+                 LEFT JOIN kwt_logistics_order_contract g ON a.id = g.l_order_id
+        WHERE a.del_flag = 0
+          AND b.del_flag = 0
+          AND c.del_flag = 0
+          AND e.del_flag = 0
+          AND f.del_flag = 0
+          and a.pid = #{lOrderId}
+        ORDER BY a.create_time
+    </select>
+
+    <select id="selectDriverListById" resultType="com.sckw.transport.model.vo.DriverListVo">
+        SELECT a.id AS lOrderId,
+        b.driver_id AS driverId,
+        b.id AS wOrderId,
+        b.w_order_no AS wOrderNo,
+        b.driver_name AS driverName,
+        b.driver_phone AS driverPhone,
+        b.driver_idcard AS driverIdCard,
+        b.truck_no AS truckNo,
+        COUNT( b.id ) AS count,
+        b.`status` as transportStatus
+        FROM
+        kwt_waybill_order b,
+        kwt_logistics_order_circulate c,
+        kwt_logistics_order a
+        WHERE
+        a.id = c.l_order_id
+        AND a.id = b.l_order_id
+        AND a.del_flag = 0
+        AND b.del_flag = 0
+        AND b.type = '2'
+        AND c.`status` = '0'
+        <if test="lOrderId != null and lOrderId != ''">
+            AND a.id ={lOrderId}
+        </if>
+        <if test="driverName != null and driverName != ''">
+            and b.driver_name like concat('%',#{driverName},'%')
+        </if>
+        <if test="driverPhone != null and driverPhone != ''">
+            AND b.driver_phone ={driverPhone}
+        </if>
+        <if test="truckNo != null and truckNo != ''">
+            AND b.truck_no ={truckNo}
+        </if>
+        GROUP BY b.truck_no
+    </select>
+
+    <select id="selectLogisticOrderList" resultType="com.sckw.transport.api.model.dto.vo.LogisticsOrderVO">
+        SELECT
+        a.id as lOrderId,
+        a.l_order_no as lOrderNO,
+        a.t_order_id as tOrderId,
+        a.t_order_no as tOrderNO,
+        a.payment as payment,
+        a.billing_mode as billingMode,
+        c.contract_id as contractId,
+        b.goods_name as goodsName,
+        a.amount ,
+        a.price,
+        a.goods_price as goodsPrice,
+        a.loss ,
+        a.load_amount as loadAmount,
+        a.unload_amount as unloadAmount,
+        a.start_time as startTime,
+        a.end_time AS endTime,
+        a.create_time AS createTime,
+        a.create_by AS createBy,
+        a.update_by AS updateBy,
+        a.update_time AS updateTime
+        FROM
+        kwt_logistics_order a
+        LEFT JOIN kwt_logistics_order_goods b ON a.id = b.l_order_id
+        LEFT JOIN kwt_logistics_order_contract c ON a.id=c.l_order_id
+        a.del_flag = 0
+        <where>
+            <if test="ids != null and ids.size() > 0">
+                and a.id in
+                <foreach collection="ids" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        ORDER BY a.create_time DESC
+    </select>
 </mapper>

+ 13 - 6
sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderMapper.xml

@@ -9,6 +9,9 @@
         <result column="truck_no" jdbcType="VARCHAR" property="truckNo"/>
         <result column="type" jdbcType="VARCHAR" property="type"/>
         <result column="driver_id" jdbcType="BIGINT" property="driverId"/>
+        <result column="driver_name" jdbcType="VARCHAR" property="driverName"/>
+        <result column="driver_phone" jdbcType="VARCHAR" property="driverPhone"/>
+        <result column="driver_idcard" jdbcType="VARCHAR" property="driverIdcard"/>
         <result column="entrust_amount" jdbcType="DECIMAL" property="entrustAmount"/>
         <result column="unload_amount" jdbcType="DECIMAL" property="unloadAmount"/>
         <result column="load_amount" jdbcType="DECIMAL" property="loadAmount"/>
@@ -30,12 +33,16 @@
     update_time, del_flag,start_time,end_time
     </sql>
     <select id="selectWaybillOrderCarList" resultType="com.sckw.transport.model.dto.OrderCarDTO">
-        SELECT a.id         as wOrderId,
-               a.w_order_no as wOrderNo,
-               a.l_order_id as lOrderId,
-               b.l_order_no as lOrderNo,
-               b.t_order_id as tOrderId,
-               b.t_order_no as tOrderNo
+        SELECT a.id               as wOrderId,
+               a.w_order_no       as wOrderNo,
+               a.driver_id        as driverId,
+               a.driver_name      as driverName,
+               a.driver_phone     as driverPhone,
+               a.driver_idcard    as driverIdcard,
+               a.l_order_id       as lOrderId,
+               b.l_order_no       as lOrderNo,
+               b.t_order_id       as tOrderId,
+               b.t_order_no       as tOrderNo
         FROM kwt_waybill_order a
                  LEFT JOIN kwt_logistics_order b ON a.l_order_id = b.id
         WHERE a.del_flag = '0'