Przeglądaj źródła

销售订单-物流托运代码提交

lengfaqiang 2 lat temu
rodzic
commit
3c21650ce1
42 zmienionych plików z 848 dodań i 1944 usunięć
  1. 4 0
      sckw-common/sckw-common-mongo/pom.xml
  2. 30 0
      sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/enums/BusinessTypeEnum.java
  3. 10 4
      sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/model/SckwLogisticsOrder.java
  4. 2 2
      sckw-modules/sckw-system/src/main/resources/bootstrap-dev.yml
  5. 10 0
      sckw-modules/sckw-transport/pom.xml
  6. 33 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/ConsignOrderController.java
  7. 0 15
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwoProjectOrderMapper.java
  8. 0 15
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwoTradeOrderGoodsMapper.java
  9. 0 15
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwoTradeOrderTrackMapper.java
  10. 0 15
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwoTradeOrderUnitMapper.java
  11. 0 14
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwpTransportDemandMapper.java
  12. 0 15
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwpWantBuyMapper.java
  13. 0 10
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtLogisticsOrderTrackMapper.java
  14. 0 32
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwoProjectOrder.java
  15. 1 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwoTradeOrderAddress.java
  16. 0 37
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwoTradeOrderContract.java
  17. 0 59
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwoTradeOrderGoods.java
  18. 0 32
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwoTradeOrderTrack.java
  19. 0 57
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwoTradeOrderUnit.java
  20. 0 73
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwpTransportDemand.java
  21. 0 63
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwpWantBuy.java
  22. 1 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtLogisticsOrderAddress.java
  23. 28 4
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtLogisticsOrderCirculate.java
  24. 1 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtLogisticsOrderTrack.java
  25. 1 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtLogisticsOrderUnit.java
  26. 10 5
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtWaybillOrder.java
  27. 5 3
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtWaybillOrderTicket.java
  28. 2 2
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtWaybillOrderTrack.java
  29. 19 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/OrderDto.java
  30. 18 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/param/LogisticsConsignmentParam.java
  31. 39 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/CarDataVo.java
  32. 2 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/CarWaybillVo.java
  33. 4 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/ConsignOrderVo.java
  34. 111 3
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ConsignOrderService.java
  35. 166 24
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/LogisticsConsignmentService.java
  36. 27 278
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderAddressMapper.xml
  37. 42 397
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml
  38. 15 137
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderTrackMapper.xml
  39. 15 203
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderUnitMapper.xml
  40. 232 231
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderMapper.xml
  41. 19 194
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderTicketMapper.xml
  42. 1 1
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderTrackMapper.xml

+ 4 - 0
sckw-common/sckw-common-mongo/pom.xml

@@ -26,5 +26,9 @@
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-annotation</artifactId>
+        </dependency>
     </dependencies>
 </project>

+ 30 - 0
sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/enums/BusinessTypeEnum.java

@@ -0,0 +1,30 @@
+package com.sckw.mongo.enums;
+
+/**
+ * @author lfdc
+ * @description 业务类型
+ * @date 2023-07-10 13:07:05
+ */
+public enum BusinessTypeEnum {
+
+    TRADE_ORDER_TYPE("tradeOrder", "交易订单"),
+    LOGISTICS_ORDER_TYPE("logisticsOrder", "物流订单"),
+    WAYBILL_ORDER_TYPE("waybillOrder", "车辆运单");
+
+    private final String name;
+
+    private final String value;
+
+    BusinessTypeEnum(String name, String value) {
+        this.name = name;
+        this.value = value;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getName() {
+        return name;
+    }
+}

+ 10 - 4
sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/model/SckwLogisticsOrder.java

@@ -1,11 +1,13 @@
 package com.sckw.mongo.model;
 
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
 import org.springframework.data.annotation.Id;
 import org.springframework.data.mongodb.core.mapping.Document;
+
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -19,7 +21,7 @@ import java.util.Date;
 @NoArgsConstructor
 @Accessors(chain = true)
 @Document(collection = "sckw_logistics_order")
-public class SckwLogisticsOrder{
+public class SckwLogisticsOrder {
 
     /**
      * 主键
@@ -155,7 +157,7 @@ public class SckwLogisticsOrder{
     /**
      * 用户状态(0正常、1已锁)
      */
-    private Integer status;
+    private Integer status = 0;
 
     /**
      * 企业id
@@ -370,7 +372,11 @@ public class SckwLogisticsOrder{
     /**
      * 是否删除(0未删除,1删除)
      */
-    private Integer delFlag;
-
+    @TableLogic("0")
+    private Integer delFlag = 0;
 
+    /**
+     * 关联的承运订单号
+     */
+    private String wOrderNo;
 }

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

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

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

@@ -64,6 +64,16 @@
             <artifactId>sckw-common-sentinel</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-common-mongo</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-common-stream</artifactId>
+        </dependency>
+
         <!-- validation -->
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 33 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/ConsignOrderController.java

@@ -4,6 +4,7 @@ import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.easyexcel.RequestHolder;
 import com.sckw.excel.utils.ExcelUtil;
+import com.sckw.transport.model.dto.OrderDto;
 import com.sckw.transport.model.param.ConsignOrderQuery;
 import com.sckw.transport.model.vo.ConsignOrderVo;
 import com.sckw.transport.service.ConsignOrderService;
@@ -11,6 +12,8 @@ import jakarta.servlet.http.HttpServletResponse;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
@@ -80,4 +83,34 @@ public class ConsignOrderController {
         return HttpResult.error("没有可导出的数据");
     }
 
+    /**
+     * 托运订单获取车辆运单
+     * @param orderDto
+     * @return
+     */
+    @RequestMapping(value = "getCarWaybillByOrder",method = RequestMethod.GET)
+    public HttpResult getCarWaybillByOrder( @Validated  @RequestBody OrderDto orderDto){
+        try {
+            return consignOrderService.getCarWaybillByOrder(orderDto);
+        } catch (Exception e) {
+            log.error("托运订单获取车辆运单失败:订单id {},error {} ", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
+    /**
+     * 托运订单获取车辆信息
+     * @param orderDto
+     * @return
+     */
+    @RequestMapping(value = "getCarListByOrder",method = RequestMethod.GET)
+    public HttpResult getCarListByOrder(@Validated  @RequestBody OrderDto orderDto){
+        try {
+            return consignOrderService.getCarListByOrder(orderDto);
+        } catch (Exception e) {
+            log.error("托运订单获取车辆运单失败:订单id {},error {} ", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
 }

+ 0 - 15
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwoProjectOrderMapper.java

@@ -1,15 +0,0 @@
-package com.sckw.transport.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.sckw.transport.model.KwoProjectOrder;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * @desc: 项目-销售订单/采购订单mapper
- * @author: yzc
- * @date: 2023-06-25 14:18
- */
-@Mapper
-public interface KwoProjectOrderMapper extends BaseMapper<KwoProjectOrder> {
-
-}

+ 0 - 15
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwoTradeOrderGoodsMapper.java

@@ -1,15 +0,0 @@
-package com.sckw.transport.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.sckw.transport.model.KwoTradeOrderGoods;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * @desc: 交易订单商品信息mapper
- * @author: yzc
- * @date: 2023-06-25 14:18
- */
-@Mapper
-public interface KwoTradeOrderGoodsMapper extends BaseMapper<KwoTradeOrderGoods> {
-
-}

+ 0 - 15
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwoTradeOrderTrackMapper.java

@@ -1,15 +0,0 @@
-package com.sckw.transport.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.sckw.transport.model.KwoTradeOrderTrack;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * @desc: 交易订单状态记录信息mapper
- * @author: yzc
- * @date: 2023-06-25 14:18
- */
-@Mapper
-public interface KwoTradeOrderTrackMapper extends BaseMapper<KwoTradeOrderTrack> {
-
-}

+ 0 - 15
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwoTradeOrderUnitMapper.java

@@ -1,15 +0,0 @@
-package com.sckw.transport.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.sckw.transport.model.KwoTradeOrderUnit;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * @desc: 交易订单采购/销售企业信息mapper
- * @author: yzc
- * @date: 2023-06-25 14:18
- */
-@Mapper
-public interface KwoTradeOrderUnitMapper extends BaseMapper<KwoTradeOrderUnit> {
-
-}

+ 0 - 14
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwpTransportDemandMapper.java

@@ -1,14 +0,0 @@
-package com.sckw.transport.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.sckw.transport.model.KwpTransportDemand;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * @desc: 运需mapper
- * @author: yzc
- * @date: 2023-06-25 14:45
- */
-@Mapper
-public interface KwpTransportDemandMapper extends BaseMapper<KwpTransportDemand> {
-}

+ 0 - 15
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwpWantBuyMapper.java

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

+ 0 - 10
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtLogisticsOrderTrackMapper.java

@@ -6,15 +6,5 @@ import org.apache.ibatis.annotations.Mapper;
 
 @Mapper
 public interface KwtLogisticsOrderTrackMapper extends BaseMapper<KwtLogisticsOrderTrack> {
-    int deleteByPrimaryKey(Long id);
 
-    int insert(KwtLogisticsOrderTrack record);
-
-    int insertSelective(KwtLogisticsOrderTrack record);
-
-    KwtLogisticsOrderTrack selectByPrimaryKey(Long id);
-
-    int updateByPrimaryKeySelective(KwtLogisticsOrderTrack record);
-
-    int updateByPrimaryKey(KwtLogisticsOrderTrack record);
 }

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

@@ -1,32 +0,0 @@
-package com.sckw.transport.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;
-
-/**
- * @desc: 项目-销售订单/采购订单
- * @author: yzc
- * @date: 2023-06-25 9:31
- */
-@Getter
-@Setter
-@ToString
-@Accessors(chain = true)
-@TableName("sckw-order.kwo_project_order")
-public class KwoProjectOrder extends BaseModel {
-
-    /**
-     * 项目id
-     */
-    private Long projectId;
-
-    /**
-     * 订单id(销售订单/采购订单)
-     */
-    private Long orderId;
-
-}

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

@@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
 @Setter
 @ToString
 @Accessors(chain = true)
-@TableName("sckw-order.kwo_trade_order_address")
+@TableName("sckw_order.kwo_trade_order_address")
 public class KwoTradeOrderAddress extends BaseModel {
 
     /**

+ 0 - 37
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwoTradeOrderContract.java

@@ -1,37 +0,0 @@
-package com.sckw.transport.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;
-
-/**
- * @desc: 交易订单合同(采购合同/销售合同)
- * @author: yzc
- * @date: 2023-06-25 9:31
- */
-@Getter
-@Setter
-@ToString
-@Accessors(chain = true)
-@TableName("sckw-order.kwo_trade_order_contract")
-public class KwoTradeOrderContract extends BaseModel {
-
-    /**
-     * 合同id
-     */
-    private Long contractId;
-
-    /**
-     * 订单id(销售订单/采购订单)
-     */
-    private Long tOrderId;
-
-    /**
-     * 订单编号(销售订单/采购订单)
-     */
-    private String tOrderNo;
-
-}

+ 0 - 59
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwoTradeOrderGoods.java

@@ -1,59 +0,0 @@
-package com.sckw.transport.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.math.BigDecimal;
-
-/**
- * @desc: 交易订单商品信息
- * @author: yzc
- * @date: 2023-06-25 9:31
- */
-@Getter
-@Setter
-@ToString
-@Accessors(chain = true)
-@TableName("sckw-order.kwo_trade_order_goods")
-public class KwoTradeOrderGoods extends BaseModel {
-
-    /**
-     * 交易订单id
-     */
-    private Long tOrderId;
-
-    /**
-     * 订单编号
-     */
-    private String tOrderNo;
-
-    /**
-     * 商品id
-     */
-    private Long goodsId;
-
-    /**
-     * sku
-     */
-    private Long skuId;
-
-    /**
-     * 数量
-     */
-    private BigDecimal amount;
-
-    /**
-     * 单位(吨、方、件、箱、其他)
-     */
-    private String unit;
-
-    /**
-     * kwp_goods_price_range表主键ID
-     */
-    private Long priceRangeId;
-
-}

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

@@ -1,32 +0,0 @@
-package com.sckw.transport.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;
-
-/**
- * @desc: 交易订单状态记录信息
- * @author: yzc
- * @date: 2023-06-25 9:31
- */
-@Getter
-@Setter
-@ToString
-@Accessors(chain = true)
-@TableName("sckw-order.kwo_trade_order_track")
-public class KwoTradeOrderTrack extends BaseModel {
-
-    /**
-     * 交易订单id
-     */
-    private Long tOrderId;
-
-    /**
-     * 订单编号
-     */
-    private String tOrderNo;
-
-}

+ 0 - 57
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwoTradeOrderUnit.java

@@ -1,57 +0,0 @@
-package com.sckw.transport.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;
-
-/**
- * @desc: 交易订单采购/销售企业信息
- * @author: yzc
- * @date: 2023-06-25 9:31
- */
-@Getter
-@Setter
-@ToString
-@Accessors(chain = true)
-@TableName("sckw-order.kwo_trade_order_unit")
-public class KwoTradeOrderUnit extends BaseModel {
-
-    /**
-     * 交易订单id
-     */
-    private Long tOrderId;
-
-    /**
-     * 订单编号
-     */
-    private String tOrderNo;
-
-    /**
-     * 单位类型(1销售单位、2采购单位)
-     */
-    private Integer unitType;
-
-    /**
-     * 企业id
-     */
-    private Long entId;
-
-    /**
-     * 企业名称
-     */
-    private String firmName;
-
-    /**
-     * 联系人姓名
-     */
-    private String contacts;
-
-    /**
-     * 联系电话
-     */
-    private String phone;
-
-}

+ 0 - 73
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwpTransportDemand.java

@@ -1,73 +0,0 @@
-package com.sckw.transport.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.math.BigDecimal;
-
-/**
- * @desc: 运需
- * @author: yzc
- * @date: 2023-06-25 9:04
- */
-@Getter
-@Setter
-@ToString
-@Accessors(chain = true)
-@TableName("sckw-order.kwp_transport_demand")
-public class KwpTransportDemand extends BaseModel {
-
-    /**
-     * 企业id
-     */
-    private Long entId;
-
-    /**
-     * 商品名称
-     */
-    private String name;
-
-    /**
-     * 商品分类
-     */
-    private Long typeId;
-
-    /**
-     * 尺寸大小
-     */
-    private String size;
-
-    /**
-     * 单位(吨、方、件、箱、其他)
-     */
-    private String unit;
-
-    /**
-     * 采购方式(线下支付、电子钱包、银联转账、第三方支付)
-     */
-    private Integer paymentChannel;
-
-    /**
-     * 运需单价(元)
-     */
-    private BigDecimal price;
-
-    /**
-     * 运输总量
-     */
-    private BigDecimal totalNum;
-
-    /**
-     * 装货地址id
-     */
-    private Long shippingAddressId;
-
-    /**
-     * 卸货地址id
-     */
-    private Long unloadingAddressId;
-}

+ 0 - 63
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwpWantBuy.java

@@ -1,63 +0,0 @@
-package com.sckw.transport.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.math.BigDecimal;
-
-/**
- * @desc: 求购
- * @author: yzc
- * @date: 2023-06-25 9:04
- */
-@Getter
-@Setter
-@ToString
-@Accessors(chain = true)
-@TableName("sckw-order.kwp_want_buy")
-public class KwpWantBuy extends BaseModel {
-
-    /**
-     * 企业id
-     */
-    private Long entId;
-
-    /**
-     * 商品名称
-     */
-    private String name;
-
-    /**
-     * 商品分类
-     */
-    private Long typeId;
-
-    /**
-     * 尺寸大小
-     */
-    private String size;
-
-    /**
-     * 单位(吨、方、件、箱、其他)
-     */
-    private String unit;
-
-    /**
-     * 采购方式(线下支付、电子钱包、银联转账、第三方支付)
-     */
-    private Integer paymentChannel;
-
-    /**
-     * 运需单价(元)
-     */
-    private BigDecimal price;
-
-    /**
-     * 运输总量
-     */
-    private BigDecimal totalNum;
-}

+ 1 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtLogisticsOrderAddress.java

@@ -23,7 +23,7 @@ public class KwtLogisticsOrderAddress implements Serializable {
     /**
      * 物流订单id
      */
-    private Long orderId;
+    private Long lOrderId;
 
     /**
      * 地址类型(1装货地址、2卸货地址)

+ 28 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtLogisticsOrderCirculate.java

@@ -1,5 +1,6 @@
 package com.sckw.transport.model;
 
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
@@ -29,23 +30,45 @@ public class KwtLogisticsOrderCirculate implements Serializable {
     /**
      * 物流订单id
      */
-    private Long orderId;
+    private Long lOrderId;
 
     /**
      * 车牌号
      */
-    private String carNum;
+    private String truckNo;
 
     /**
      * 司机id
      */
     private Long driverId;
 
+    /**
+     * 标准荷载(净重)
+     */
+    private BigDecimal actualAmount;
+
     /**
      * 委托量
      */
     private BigDecimal entrustAmount;
 
+    private Date entrustDate;
+
+    /**
+     * 卸货量
+     */
+    private BigDecimal unloadAmount;
+
+    /**
+     * 装货量
+     */
+    private BigDecimal loadAmount;
+
+    /**
+     * 亏吨量(装货量-卸货量)
+     */
+    private BigDecimal deficitAmount;
+
     /**
      * 备注
      */
@@ -54,7 +77,7 @@ public class KwtLogisticsOrderCirculate implements Serializable {
     /**
      * 用户状态(0正常、1已锁)
      */
-    private Integer status;
+    private Integer status = 0;
 
     private Long createBy;
 
@@ -70,7 +93,8 @@ public class KwtLogisticsOrderCirculate implements Serializable {
     /**
      * 是否删除(0未删除,1删除)
      */
-    private Integer delFlag;
+    @TableLogic("0")
+    private Integer delFlag = 0;
 
     private static final long serialVersionUID = 1L;
 }

+ 1 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtLogisticsOrderTrack.java

@@ -24,7 +24,7 @@ public class KwtLogisticsOrderTrack implements Serializable {
     /**
      * 物流订单id
      */
-    private Long orderId;
+    private Long lOrderId;
 
     /**
      * 备注

+ 1 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtLogisticsOrderUnit.java

@@ -26,7 +26,7 @@ public class KwtLogisticsOrderUnit implements Serializable {
     /**
      * 交易订单id
      */
-    private Long orderId;
+    private Long lOrderId;
 
     /**
      * 单位类型(1托运企业、2承运企业)

+ 10 - 5
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtWaybillOrder.java

@@ -1,5 +1,6 @@
 package com.sckw.transport.model;
 
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
@@ -29,17 +30,18 @@ public class KwtWaybillOrder implements Serializable {
     /**
      * 物流订单id(kwt_logistics_order)
      */
-    private Long orderId;
+    private Long lOrderId;
 
     /**
      * 编号
      */
-    private String code;
+    private String wOrderNo;
+    private String type;
 
     /**
      * 车牌号
      */
-    private String carNum;
+    private String truckNo;
 
     /**
      * 司机id
@@ -74,7 +76,7 @@ public class KwtWaybillOrder implements Serializable {
     /**
      * 用户状态(0正常、1已锁)
      */
-    private Integer status;
+    private Integer status = 0;
 
     private Long createBy;
 
@@ -90,5 +92,8 @@ public class KwtWaybillOrder implements Serializable {
     /**
      * 是否删除(0未删除,1删除)
      */
-    private Integer delFlag;
+    @TableLogic("0")
+    private Integer delFlag = 0;
+
+    private static final long serialVersionUID = 1L;
 }

+ 5 - 3
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtWaybillOrderTicket.java

@@ -1,5 +1,6 @@
 package com.sckw.transport.model;
 
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
@@ -23,7 +24,7 @@ public class KwtWaybillOrderTicket implements Serializable {
     /**
      * 车辆运单id
      */
-    private Long orderId;
+    private Long wOrderId;
 
     /**
      * 磅单类型(1装货单/2卸货单)
@@ -58,7 +59,7 @@ public class KwtWaybillOrderTicket implements Serializable {
     /**
      * 用户状态(0正常、1已锁)
      */
-    private Integer status;
+    private Integer status = 0;
 
     private Long createBy;
 
@@ -74,7 +75,8 @@ public class KwtWaybillOrderTicket implements Serializable {
     /**
      * 是否删除(0未删除,1删除)
      */
-    private Integer delFlag;
+    @TableLogic("0")
+    private Integer delFlag = 0;
 
     private static final long serialVersionUID = 1L;
 

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

@@ -8,7 +8,7 @@ import java.util.Date;
 
 /**
  * @author lfdc
- * @description 辆运单-状态信息
+ * @description 辆运单-状态信息
  * @date 2023-06-26 16:06:12
  */
 @Data
@@ -22,7 +22,7 @@ public class KwtWaybillOrderTrack implements Serializable {
     /**
      * 车辆运单id
      */
-    private Long orderId;
+    private Long wOrderId;
 
     /**
      * 备注

+ 19 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/OrderDto.java

@@ -0,0 +1,19 @@
+package com.sckw.transport.model.dto;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @author lfdc
+ * @description 单据数据
+ * @date 2023-07-10 08:07:52
+ */
+@Data
+@Accessors(chain = true)
+public class OrderDto {
+    @NotBlank(message = "单据编号不能为空")
+    private String orderNo;
+    @NotBlank(message = "数据id不能为空")
+    private String id;
+}

+ 18 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/param/LogisticsConsignmentParam.java

@@ -19,14 +19,20 @@ public class LogisticsConsignmentParam {
      * 分配承运量
      */
     private Long carryingCapacity;
+    /**
+     * 分配承运量使用的单位
+     */
+    private String carryingCapacityUnit;
 
     /**
      * 托运单位
      */
+    @NotNull(message = "托运单位名称不能为空")
     private String checkCompany;
     /**
      * 托运单位id
      */
+    @NotNull(message = "托运单位id不能为空")
     private String checkCompanyId;
 
     /**
@@ -92,6 +98,17 @@ public class LogisticsConsignmentParam {
      * 合同编号
      */
     private String contractNo;
+
+    /**
+     * 合同名称
+     */
+    private String contractName;
+
+    /**
+     * 合同签约方式
+     */
+    @NotNull(message = "合同签约方式不能为空")
+    private String payment;
     /**
      * 货物名称
      */
@@ -100,6 +117,7 @@ public class LogisticsConsignmentParam {
     /**
      * 货物id
      */
+    @NotNull(message = "货物id不能为空")
     private String goodsId;
 
     /**

+ 39 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/CarDataVo.java

@@ -0,0 +1,39 @@
+package com.sckw.transport.model.vo;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @author lfdc
+ * @description 车辆信息
+ * @date 2023-07-10 12:07:40
+ */
+@Data
+@Accessors(chain = true)
+public class CarDataVo {
+    /**
+     * 司机姓名
+     */
+    private String driverName;
+    /**
+     * 司机电话
+     */
+    private String driverPhone;
+    private String id;
+    /**
+     * 身份证号
+     */
+    private String idCard;
+    /**
+     * 核载质量/吨
+     */
+    private String loadAmount;
+    /**
+     * 车牌号
+     */
+    private String truckNo;
+    /**
+     * 运单号
+     */
+    private String wOrderNo;
+}

+ 2 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/CarWaybillVo.java

@@ -1,6 +1,7 @@
 package com.sckw.transport.model.vo;
 
 import lombok.Data;
+import lombok.experimental.Accessors;
 
 /**
  * @author lfdc
@@ -8,6 +9,7 @@ import lombok.Data;
  * @date 2023-06-27 11:06:08
  */
 @Data
+@Accessors(chain = true)
 public class CarWaybillVo {
 
     /**

+ 4 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/ConsignOrderVo.java

@@ -132,4 +132,8 @@ public class ConsignOrderVo extends PageResult implements Serializable {
      * 卸货地点
      */
     private String unloadAddress;
+    /**
+     * 关联承运订单号
+     */
+    private String wOrderNo;
 }

+ 111 - 3
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ConsignOrderService.java

@@ -1,15 +1,27 @@
 package com.sckw.transport.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
-import com.sckw.transport.dao.KwtLogisticsOrderAddressMapper;
-import com.sckw.transport.dao.KwtLogisticsOrderMapper;
-import com.sckw.transport.dao.KwtLogisticsOrderUnitMapper;
+import com.sckw.excel.utils.DateUtil;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.transport.dao.*;
+import com.sckw.transport.model.*;
+import com.sckw.transport.model.dto.OrderDto;
 import com.sckw.transport.model.param.ConsignOrderQuery;
+import com.sckw.transport.model.vo.CarDataVo;
+import com.sckw.transport.model.vo.CarWaybillVo;
 import com.sckw.transport.model.vo.ConsignOrderVo;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -22,6 +34,8 @@ import java.util.List;
 @Service
 public class ConsignOrderService {
 
+    @DubboReference(version = "2.0.0", group = "design", check = false)
+    RemoteSystemService remoteSystemService;
 
     @Autowired
     public KwtLogisticsOrderMapper kwtLogisticsOrderMapper;
@@ -32,6 +46,18 @@ public class ConsignOrderService {
     @Autowired
     public KwtLogisticsOrderUnitMapper kwtLogisticsOrderUnitMapper;
 
+    @Autowired
+    public KwtWaybillOrderMapper kwtWaybillOrderMapper;
+
+    @Autowired
+    public KwtWaybillOrderTicketMapper kwtWaybillOrderTicketMapper;
+
+    @Autowired
+    public KwtWaybillOrderTrackMapper kwtWaybillOrderTrackMapper;
+
+    @Autowired
+    public KwtLogisticsOrderCirculateMapper kwtLogisticsOrderCirculateMapper;
+
     public HttpResult list(ConsignOrderQuery query) {
 //        ConsignOrderVo consignOrderVo = new ConsignOrderVo();
 //        LambdaQueryWrapper<KwtLogisticsOrder> wrapper = new LambdaQueryWrapper<>();
@@ -51,4 +77,86 @@ public class ConsignOrderService {
     public List<ConsignOrderVo> export(ConsignOrderQuery query) {
         return new ArrayList<ConsignOrderVo>();
     }
+
+    public HttpResult getCarWaybillByOrder(OrderDto orderDto) {
+        List<CarWaybillVo> returnList = new ArrayList<>();
+        CarWaybillVo carWaybillVo = new CarWaybillVo();
+        KwtLogisticsOrder order = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
+                .eq(StringUtils.isNotBlank(orderDto.getId()), KwtLogisticsOrder::getId, Long.parseLong(orderDto.getOrderNo()))
+                .eq(StringUtils.isNotBlank(orderDto.getOrderNo()), KwtLogisticsOrder::getLOrderNo, orderDto.getOrderNo())
+                .eq(KwtLogisticsOrder::getEntId, LoginUserHolder.getEntId())
+                .eq(KwtLogisticsOrder::getDelFlag, NumberConstant.ZERO));
+        if (ObjectUtils.isEmpty(order)) {
+            return HttpResult.ok(returnList);
+        }
+        List<KwtWaybillOrder> kwtWaybillOrders = kwtWaybillOrderMapper.selectList(new LambdaQueryWrapper<KwtWaybillOrder>()
+                .eq(StringUtils.isNotBlank(order.getId()), KwtWaybillOrder::getLOrderId, order.getId())
+                .eq(StringUtils.isNotBlank(orderDto.getOrderNo()), KwtWaybillOrder::getLOrderId, orderDto.getOrderNo()));
+        if (CollectionUtils.isNotEmpty(kwtWaybillOrders)) {
+            for (KwtWaybillOrder kwtWaybillOrder : kwtWaybillOrders) {
+                KwtWaybillOrderTrack kwtWaybillOrderTrack = kwtWaybillOrderTrackMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrderTrack>()
+                        .eq(StringUtils.isNotBlank(kwtWaybillOrder.getId()), KwtWaybillOrderTrack::getWOrderId, kwtWaybillOrder.getId()));
+                KwtWaybillOrderTicket loadKwtWaybillOrderTicket = kwtWaybillOrderTicketMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrderTicket>()
+                        .eq(StringUtils.isNotBlank(kwtWaybillOrder.getId()), KwtWaybillOrderTicket::getWOrderId, kwtWaybillOrder.getId())
+                        .eq(KwtWaybillOrderTicket::getType, NumberConstant.ONE));
+                KwtWaybillOrderTicket unloadKwtWaybillOrderTicket = kwtWaybillOrderTicketMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrderTicket>()
+                        .eq(StringUtils.isNotBlank(kwtWaybillOrder.getId()), KwtWaybillOrderTicket::getWOrderId, kwtWaybillOrder.getId())
+                        .eq(KwtWaybillOrderTicket::getType, NumberConstant.TWO));
+                KwtLogisticsOrderCirculate kwtLogisticsOrderCirculate = kwtLogisticsOrderCirculateMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrderCirculate>()
+                        .eq(StringUtils.isNotBlank(kwtWaybillOrder.getId()), KwtLogisticsOrderCirculate::getLOrderId, kwtWaybillOrder.getId())
+                        .eq(KwtLogisticsOrderCirculate::getEntId, order.getEntId()));
+                //扣亏量/吨->亏吨量-合理损耗
+                BigDecimal deduct = null;
+                if (kwtWaybillOrder.getDeficitAmount() != null && (kwtWaybillOrder.getDeficitAmount().compareTo(new BigDecimal(NumberConstant.ZERO)) == NumberConstant.ZERO)) {
+                    deduct = kwtWaybillOrder.getDeficitAmount().subtract(order.getLoss() == null ? new BigDecimal(NumberConstant.ZERO) : order.getLoss());
+                }
+                carWaybillVo.setWaybillNumber(order.getLOrderNo())
+                        .setTruckNo(kwtWaybillOrder.getTruckNo())
+                        .setStatus(kwtWaybillOrderTrack == null ? null : String.valueOf(kwtWaybillOrderTrack.getStatus()))
+                        .setWaybillType(kwtWaybillOrder.getType())
+                        //todo 调用司机服务 dubbo
+                        .setDriverName(null)
+                        //todo 取mongo
+                        .setConsignMotorcade(null)
+                        .setSendCarWeigh(kwtWaybillOrder.getEntrustAmount() == null ? null : String.valueOf(kwtWaybillOrder.getEntrustAmount()))
+                        .setSendCarDate(DateUtil.getDateTime(kwtLogisticsOrderCirculate.getEntrustDate()))
+                        .setStowageWeigh(loadKwtWaybillOrderTicket.getAmount() == null ? null : String.valueOf(loadKwtWaybillOrderTicket.getAmount()))
+                        .setStowageDate(DateUtil.getDateTime(loadKwtWaybillOrderTicket.getCreateTime()))
+                        .setUnloadDate(DateUtil.getDateTime(unloadKwtWaybillOrderTicket.getCreateTime()))
+                        .setUnloadWeigh(unloadKwtWaybillOrderTicket.getAmount() == null ? null : String.valueOf(loadKwtWaybillOrderTicket.getAmount()))
+                        /**亏吨量/吨->装货量-卸货量
+                         扣亏量/吨->亏吨量-合理损耗*/
+                        .setDefectiveWeigh(kwtWaybillOrder.getDeficitAmount() == null ? null : String.valueOf(kwtWaybillOrder.getDeficitAmount()))
+                        .setDeduct(String.valueOf(deduct))
+                        .setAppointor(remoteSystemService.queryUserCacheById(kwtWaybillOrder.getCreateBy()).getName());
+                returnList.add(carWaybillVo);
+            }
+        }
+        return HttpResult.ok(returnList);
+    }
+
+    public HttpResult getCarListByOrder(OrderDto orderDto) {
+        KwtWaybillOrder waybillOrder = kwtWaybillOrderMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrder>()
+                .eq(KwtWaybillOrder::getId, orderDto.getId())
+                .eq(KwtWaybillOrder::getEntId, LoginUserHolder.getEntId()));
+        List<KwtLogisticsOrderCirculate> list = kwtLogisticsOrderCirculateMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrderCirculate>()
+                .eq(KwtLogisticsOrderCirculate::getLOrderId, orderDto.getId())
+                .eq(KwtLogisticsOrderCirculate::getEntId, LoginUserHolder.getEntId()));
+        List<CarDataVo> carDataVos = new ArrayList<CarDataVo>();
+        if (CollectionUtils.isNotEmpty(list)) {
+            for (KwtLogisticsOrderCirculate circulate : list) {
+                CarDataVo carDataVo = new CarDataVo();
+                //todo dubbo查询
+//                circulate.getDriverId() ;
+//                carDataVo.setDriverName();
+//                carDataVo.getDriverPhone();
+//                carDataVo.getIdCard();
+//                carDataVo.getLoadAmount();
+                carDataVo.setTruckNo(circulate.getTruckNo());
+                carDataVo.setWOrderNo(waybillOrder.getWOrderNo());
+                carDataVos.add(carDataVo);
+            }
+        }
+        return HttpResult.ok(carDataVos);
+    }
 }

+ 166 - 24
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/LogisticsConsignmentService.java

@@ -1,21 +1,31 @@
 package com.sckw.transport.service;
 
 import cn.hutool.core.util.ArrayUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.DateUtil;
+import com.sckw.mongo.enums.BusinessTypeEnum;
+import com.sckw.mongo.model.SckwLogisticsOrder;
+import com.sckw.stream.model.SckwBusSum;
+import com.sckw.system.api.RemoteSystemService;
 import com.sckw.transport.common.enums.LogisticsOrderEnum;
 import com.sckw.transport.dao.*;
 import com.sckw.transport.model.*;
 import com.sckw.transport.model.param.LogisticsConsignmentParam;
+import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cloud.stream.function.StreamBridge;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
 
 import java.math.BigDecimal;
 import java.util.Date;
@@ -28,6 +38,13 @@ import java.util.Date;
 @Slf4j
 @Service
 public class LogisticsConsignmentService {
+
+    @Resource
+    private StreamBridge streamBridge;
+
+    @DubboReference(version = "2.0.0", group = "design", check = false)
+    RemoteSystemService remoteSystemService;
+
     @Autowired
     public KwoTradeOrderMapper kwoTradeOrderMapper;
 
@@ -66,6 +83,7 @@ public class LogisticsConsignmentService {
     }
 
     void logisticsConsignmentInsert(LogisticsConsignmentParam bo) {
+        //todo 后续改成调用dubbo接口
         KwoTradeOrder tradeOrder = kwoTradeOrderMapper.selectOne(new LambdaQueryWrapper<KwoTradeOrder>().eq(StringUtils.isNotBlank(bo.getLOrderId()), KwoTradeOrder::getId, bo.getLOrderId()));
         if (tradeOrder == null) {
             log.error("订单id查找失败:{}", bo.getLOrderId());
@@ -81,23 +99,124 @@ public class LogisticsConsignmentService {
             order.setAmount(new BigDecimal(NumberConstant.ZERO));
             order.setSubcontractAmount(new BigDecimal(NumberConstant.ZERO));
         }
-        String waybillNo = "";
-        insertLogisticsGoods(bo, waybillNo);
-        insertLogisticsOrder(bo, waybillNo, order, tradeOrder);
-        insertLogisticsOrderContract(bo);
-        insertLogisticsOrderUnit(bo,waybillNo);
-        insertLogisticsOrderAddress(bo, waybillNo);
-        insertLogisticsOrderTrack(bo, waybillNo);
+        String waybillNo = "waybillNo";
+        Long orderId = new IdWorker(NumberConstant.ONE).nextId();
+        insertLogisticsGoods(bo, waybillNo, orderId);
+        insertLogisticsOrder(bo, waybillNo, order, tradeOrder, orderId);
+        insertLogisticsOrderContract(bo, orderId);
+        insertLogisticsOrderUnit(bo, waybillNo, orderId);
+        insertLogisticsOrderAddress(bo, waybillNo, orderId);
+        insertLogisticsOrderTrack(bo, waybillNo, orderId);
+        sendMongoDB(waybillNo, orderId, bo);
+
+    }
+
+    /**
+     * 组装数据发送至mongoDb
+     *
+     * @param waybillNo
+     * @param orderId
+     * @param bo
+     */
+    private void sendMongoDB(String waybillNo, Long orderId, LogisticsConsignmentParam bo) {
+        SckwLogisticsOrder logisticsOrder = new SckwLogisticsOrder();
+        logisticsOrder.setLOrderId(new IdWorker(NumberConstant.ONE).nextId());
+        logisticsOrder.setLOrderNo(waybillNo);
+        logisticsOrder.setLOrderPid(null);
+        logisticsOrder.setTOrderId(orderId);
+        logisticsOrder.setTOrderNo("D" + waybillNo);
+        logisticsOrder.setSettlementCycle(bo.getSettlementCycle());
+        logisticsOrder.setPrice(new BigDecimal(bo.getPrice()));
+        logisticsOrder.setPriceType(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE_0.getType(), bo.getPriceType()) == null ?
+                null : Long.parseLong(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE_0.getType(), bo.getPriceType()).getValue()));
+
+        if (!bo.getIsFullDose()) {
+            if (ArrayUtil.isEmpty(bo.getCarryingCapacity())) {
+                throw new RuntimeException("不是全量分配时,分配量不能为空!");
+            }
+            logisticsOrder.setAmount(new BigDecimal(bo.getCarryingCapacity()));
+            logisticsOrder.setUnit(bo.getCarryingCapacityUnit());
+        } else {
+            logisticsOrder.setAmount(new BigDecimal(NumberConstant.ZERO));
+            logisticsOrder.setSubcontractAmount(new BigDecimal(NumberConstant.ZERO));
+        }
+        logisticsOrder.setLoss(bo.getLoss() == null ? null : new BigDecimal(bo.getLoss()));
+        logisticsOrder.setLossUnit(bo.getLossUnit());
+        logisticsOrder.setGoodsPrice(bo.getGoodsPrice() == null ? null : new BigDecimal(bo.getGoodsPrice()));
+        //TODO 生成时并无时间
+//        logisticsOrder.setUnloadTime();
+//        logisticsOrder.setLoadTime();
+//        logisticsOrder.setWOrderNo();
+        logisticsOrder.setSubcontractAmount(new BigDecimal(NumberConstant.ZERO));
+        logisticsOrder.setEntrustAmount(new BigDecimal(NumberConstant.ZERO));
+        logisticsOrder.setUnloadAmount(new BigDecimal(NumberConstant.ZERO));
+        logisticsOrder.setLoadAmount(new BigDecimal(NumberConstant.ZERO));
+        logisticsOrder.setIgnoreAmount(new BigDecimal(NumberConstant.ZERO));
+        logisticsOrder.setDeficitPrice(new BigDecimal(NumberConstant.ZERO));
+        logisticsOrder.setPayment(Long.parseLong(bo.getPayment()));
+        logisticsOrder.setTaxRate(bo.getTaxRate() == null ? null : new BigDecimal(bo.getTaxRate()));
+        logisticsOrder.setRemark(bo.getRemark());
+        logisticsOrder.setEntId(LoginUserHolder.getEntId());
+        logisticsOrder.setFirmName(remoteSystemService.queryEntCacheById(LoginUserHolder.getEntId()).getFirmName());
+        logisticsOrder.setGoodsId(Integer.parseInt(bo.getGoodsId()));
+        //todo dubbo调用订单服务
+//        logisticsOrder.setGoodsType();
+//        logisticsOrder.setGoodsSpec();
+        logisticsOrder.setContractId(Integer.parseInt(bo.getContractId()));
+        logisticsOrder.setContractNo(bo.getContractNo());
+        logisticsOrder.setContractName(bo.getContractName());
+        logisticsOrder.setContractSigningWay(bo.getPayment());
+        logisticsOrder.setCheckEntId(Long.parseLong(bo.getCheckCompanyId()));
+        logisticsOrder.setCheckFirmName(bo.getCheckCompany());
+        logisticsOrder.setCheckContacts(bo.getCheckContacts());
+        logisticsOrder.setCheckPhone(bo.getCheckContactPhone());
+        logisticsOrder.setCarrierEntId(Long.parseLong(bo.getConsignCompanyId()));
+        logisticsOrder.setCarrierFirmName(bo.getConsignCompany());
+        logisticsOrder.setCarrierContacts(bo.getConsignContacts());
+        //todo dubbo调用订单服务
+//        logisticsOrder.setLoadType();
+//        logisticsOrder.setLoadCityCode();
+//        logisticsOrder.setLoadCityName();
+//        logisticsOrder.setLoadDetailAddress();
+//        logisticsOrder.setLoadLat();
+//        logisticsOrder.setLoadLng();
+//        logisticsOrder.setLoadTime();
+//        logisticsOrder.setUnloadType();
+//        logisticsOrder.setUnloadPhone();
+//        logisticsOrder.setUnloadCityCode();
+//        logisticsOrder.setUnloadCityCode();
+//        logisticsOrder.setUnloadCityName();
+//        logisticsOrder.setUnloadDetailAddress();
+//        logisticsOrder.setUnloadLat();
+//        logisticsOrder.setUnloadLng();
+        logisticsOrder.setCreateBy(LoginUserHolder.getUserId());
+        logisticsOrder.setCreateByName(LoginUserHolder.getUserName());
+        logisticsOrder.setCreateTime(new Date());
+        logisticsOrder.setUpdateBy(LoginUserHolder.getUserId());
+        logisticsOrder.setUpdateByName(LoginUserHolder.getUserName());
+        logisticsOrder.setUpdateTime(new Date());
+        logisticsOrder.setGoodsPriceUnit(bo.getGoodsPriceUnit());
+        logisticsOrder.setContractName(new Date() + bo.getContractName());
+        //rabbitMq业务汇总数据发送/消费对象
+        SckwBusSum busSum = new SckwBusSum();
+        //业务汇总类型
+        busSum.setBusSumType(BusinessTypeEnum.LOGISTICS_ORDER_TYPE.getName());
+        //操作对象(1新增/2修改)
+        busSum.setMethod(1);
+        //业务汇总数据对象
+        busSum.setObject(logisticsOrder);
+        streamBridge.send("sckw-busSum", JSON.toJSONString(busSum));
     }
 
     /**
      * 物流订单-企业信息
+     *
      * @param bo
      * @param waybillNo
      */
-    private void insertLogisticsOrderUnit(LogisticsConsignmentParam bo, String waybillNo) {
+    private void insertLogisticsOrderUnit(LogisticsConsignmentParam bo, String waybillNo, Long orderId) {
         KwtLogisticsOrderUnit checkUnit = new KwtLogisticsOrderUnit()
-                .setOrderId(Long.parseLong(waybillNo))
+                .setLOrderId(orderId)
                 .setId(new IdWorker(NumberConstant.ONE).nextId())
                 .setUnitType(NumberConstant.ONE)
                 .setFirmName(bo.getCheckCompany())
@@ -112,7 +231,7 @@ public class LogisticsConsignmentService {
         kwtLogisticsOrderUnitMapper.insert(checkUnit);
 
         KwtLogisticsOrderUnit consignUnit = new KwtLogisticsOrderUnit()
-                .setOrderId(Long.parseLong(waybillNo))
+                .setLOrderId(orderId)
                 .setId(new IdWorker(NumberConstant.ONE).nextId())
                 .setUnitType(NumberConstant.TWO)
                 .setFirmName(bo.getConsignCompany())
@@ -129,13 +248,14 @@ public class LogisticsConsignmentService {
 
     /**
      * 物流订单-状态
+     *
      * @param bo
      * @param waybillNo
      */
-    private void insertLogisticsOrderTrack(LogisticsConsignmentParam bo, String waybillNo) {
+    private void insertLogisticsOrderTrack(LogisticsConsignmentParam bo, String waybillNo, Long orderId) {
         KwtLogisticsOrderTrack entity = new KwtLogisticsOrderTrack();
         entity.setId(new IdWorker(NumberConstant.ONE).nextId());
-        entity.setOrderId(Long.parseLong(waybillNo));
+        entity.setLOrderId(orderId);
         entity.setStatus(LogisticsOrderEnum.PENDING_ORDER.getCode());
         entity.setCreateTime(new Date());
         entity.setUpdateTime(new Date());
@@ -147,15 +267,16 @@ public class LogisticsConsignmentService {
 
     /**
      * 物流订单-商品信息
+     *
      * @param bo
      * @param waybillNo
      */
-    private void insertLogisticsGoods(LogisticsConsignmentParam bo, String waybillNo) {
+    private void insertLogisticsGoods(LogisticsConsignmentParam bo, String waybillNo, Long orderId) {
         KwtLogisticsOrderGoods kwtLogisticsOrderGoods = new KwtLogisticsOrderGoods();
         kwtLogisticsOrderGoods.setId(new IdWorker(NumberConstant.ONE).nextId());
         kwtLogisticsOrderGoods.setGoodsId(Long.parseLong(bo.getGoodsId()));
-        kwtLogisticsOrderGoods.setSkuId(Long.parseLong(bo.getSkuId()));
-        kwtLogisticsOrderGoods.setLOrderId(Long.parseLong(bo.getLOrderId()));
+        kwtLogisticsOrderGoods.setSkuId(StringUtils.isBlank(bo.getSkuId()) ? null : Long.parseLong(bo.getSkuId()));
+        kwtLogisticsOrderGoods.setLOrderId(orderId);
         kwtLogisticsOrderGoods.setLOrderNo(waybillNo);
         kwtLogisticsOrderGoods.setUpdateBy(LoginUserHolder.getUserId());
         kwtLogisticsOrderGoods.setUpdateTime(new Date());
@@ -166,13 +287,14 @@ public class LogisticsConsignmentService {
 
     /**
      * 物流订单-主体
+     *
      * @param bo
      * @param waybillNo
      * @param order
      * @param tradeOrder
      */
-    private void insertLogisticsOrder(LogisticsConsignmentParam bo, String waybillNo, KwtLogisticsOrder order, KwoTradeOrder tradeOrder) {
-        order.setId(new IdWorker(NumberConstant.ONE).nextId());
+    private void insertLogisticsOrder(LogisticsConsignmentParam bo, String waybillNo, KwtLogisticsOrder order, KwoTradeOrder tradeOrder, Long orderId) {
+        order.setId(orderId);
         order.setEntId(LoginUserHolder.getEntId());
         order.setTOrderId(Long.parseLong(bo.getLOrderId()));
         order.setTOrderNo(bo.getLOrderNo());
@@ -180,12 +302,19 @@ public class LogisticsConsignmentService {
         order.setPid(null);
         order.setSettlementCycle(bo.getSettlementCycle());
         order.setPrice(new BigDecimal(bo.getPrice()));
-        order.setPriceType(Long.parseLong(bo.getPriceType()));
+//        order.setPriceType(Long.parseLong(bo.getPriceType()));
+        order.setPriceType(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE_0.getType(), bo.getPriceType()) == null ?
+                null : Long.parseLong(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE_0.getType(), bo.getPriceType()).getValue()));
+//        order.setPriceType(Long.parseLong(new ConvertDictTypeUtils().getDictType(LogisticsTypeEnum.PRICE_TYPE_0, bo.getPriceType())));
         order.setAmount(tradeOrder.getAmount());
         order.setUnit(tradeOrder.getUnit());
         order.setLoss(new BigDecimal(bo.getLoss()));
         order.setLossUnit(bo.getLossUnit());
+        order.setLossUnit(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.UNIT_TYPE_0.getType(), bo.getLossUnit()) == null ?
+                null : remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.UNIT_TYPE_0.getType(), bo.getLossUnit()).getValue());
         order.setGoodsPrice(new BigDecimal(bo.getGoodsPrice()));
+        order.setGoodsPriceUnit(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE_0.getType(), bo.getGoodsPriceUnit()) == null ?
+                null : remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE_0.getType(), bo.getGoodsPriceUnit()).getValue());
         order.setGoodsPriceUnit(bo.getGoodsPriceUnit());
         order.setStartTime(DateUtil.LocalDateTimeToDate(tradeOrder.getStartTime()));
         order.setEntTime(DateUtil.LocalDateTimeToDate(tradeOrder.getEndTime()));
@@ -201,12 +330,13 @@ public class LogisticsConsignmentService {
 
     /**
      * 物流订单-合同
+     *
      * @param bo
      */
-    private void insertLogisticsOrderContract(LogisticsConsignmentParam bo) {
+    private void insertLogisticsOrderContract(LogisticsConsignmentParam bo, Long orderId) {
         KwtLogisticsOrderContract kwtLogisticsOrderContract = new KwtLogisticsOrderContract();
         kwtLogisticsOrderContract.setId(new IdWorker(NumberConstant.ONE).nextId());
-        kwtLogisticsOrderContract.setLOrderId(Long.parseLong(bo.getLOrderId()));
+        kwtLogisticsOrderContract.setLOrderId(orderId);
         kwtLogisticsOrderContract.setContractId(Long.parseLong(bo.getContractId()));
         kwtLogisticsOrderContract.setRemark(bo.getRemark());
         kwtLogisticsOrderContract.setCreateBy(LoginUserHolder.getUserId());
@@ -218,25 +348,32 @@ public class LogisticsConsignmentService {
 
     /**
      * 物流订单-装修货地址
+     *
      * @param bo
      * @param waybillNo
      */
-    private void insertLogisticsOrderAddress(LogisticsConsignmentParam bo, String waybillNo) {
+    private void insertLogisticsOrderAddress(LogisticsConsignmentParam bo, String waybillNo, Long orderId) {
         KwtLogisticsOrderAddress loadOrderAddress = new KwtLogisticsOrderAddress();
         KwtLogisticsOrderAddress unloadOrderAddress = new KwtLogisticsOrderAddress();
+        //todo 装卸货地址 通过dubbo查询
         KwoTradeOrderAddress loadkwoTradeOrderAddress = kwoTradeOrderAddressMapper.selectOne(new LambdaQueryWrapper<KwoTradeOrderAddress>()
                 .eq(StringUtils.isNotBlank(bo.getLOrderId()), KwoTradeOrderAddress::getTOrderId, bo.getLOrderId())
                 .eq(KwoTradeOrderAddress::getAddressType, NumberConstant.ONE));
+        if (ObjectUtils.isEmpty(loadkwoTradeOrderAddress)) {
+            log.info("查询数据:orderId:{},type:{}", bo.getLOrderId(), bo.getPriceType());
+            throw new RuntimeException("装货地址查找失败!");
+        }
         loadOrderAddress.setId(new IdWorker(NumberConstant.ONE).nextId());
         loadOrderAddress.setAddressType(NumberConstant.ONE);
         loadOrderAddress.setDetailAddress(loadkwoTradeOrderAddress.getDetailAddress());
         loadOrderAddress.setContacts(loadkwoTradeOrderAddress.getContacts());
-        loadOrderAddress.setOrderId(Long.parseLong(waybillNo));
+        loadOrderAddress.setLOrderId(orderId);
         loadOrderAddress.setLat(loadkwoTradeOrderAddress.getLat());
         loadOrderAddress.setFence(loadkwoTradeOrderAddress.getFence());
         loadOrderAddress.setCityName(loadkwoTradeOrderAddress.getCityName());
         loadOrderAddress.setEntryType(NumberConstant.FOUR);
         loadOrderAddress.setCreateTime(new Date());
+        loadOrderAddress.setPhone(loadkwoTradeOrderAddress.getPhone());
         loadOrderAddress.setCreateBy(LoginUserHolder.getUserId());
         loadOrderAddress.setUpdateBy(LoginUserHolder.getUserId());
         loadOrderAddress.setUpdateTime(new Date());
@@ -245,16 +382,21 @@ public class LogisticsConsignmentService {
         KwoTradeOrderAddress unloadkwoTradeOrderAddress = kwoTradeOrderAddressMapper.selectOne(new LambdaQueryWrapper<KwoTradeOrderAddress>()
                 .eq(StringUtils.isNotBlank(bo.getLOrderId()), KwoTradeOrderAddress::getTOrderId, bo.getLOrderId())
                 .eq(KwoTradeOrderAddress::getAddressType, NumberConstant.TWO));
+        if (ObjectUtils.isEmpty(unloadkwoTradeOrderAddress)) {
+            log.info("查询数据:orderId:{},type:{}", bo.getLOrderId(), bo.getPriceType());
+            throw new RuntimeException("卸货地址查找失败!");
+        }
         unloadOrderAddress.setId(new IdWorker(NumberConstant.ONE).nextId());
         unloadOrderAddress.setAddressType(NumberConstant.TWO);
         unloadOrderAddress.setId(new IdWorker(NumberConstant.ONE).nextId());
         unloadOrderAddress.setContacts(loadkwoTradeOrderAddress.getContacts());
-        unloadOrderAddress.setOrderId(Long.parseLong(waybillNo));
+        unloadOrderAddress.setLOrderId(orderId);
         unloadOrderAddress.setLat(loadkwoTradeOrderAddress.getLat());
         unloadOrderAddress.setFence(loadkwoTradeOrderAddress.getFence());
         unloadOrderAddress.setCityName(loadkwoTradeOrderAddress.getCityName());
         unloadOrderAddress.setEntryType(NumberConstant.FOUR);
-        unloadOrderAddress.setDetailAddress(unloadkwoTradeOrderAddress.getDetailAddress());
+        unloadOrderAddress.setPhone(loadkwoTradeOrderAddress.getPhone());
+        unloadOrderAddress.setDetailAddress(loadkwoTradeOrderAddress.getDetailAddress());
         unloadOrderAddress.setCreateTime(new Date());
         unloadOrderAddress.setCreateBy(LoginUserHolder.getUserId());
         unloadOrderAddress.setUpdateBy(LoginUserHolder.getUserId());

+ 27 - 278
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderAddressMapper.xml

@@ -1,283 +1,32 @@
 <?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.KwtLogisticsOrderAddressMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtLogisticsOrderAddress">
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="order_id" jdbcType="BIGINT" property="orderId" />
-    <result column="address_type" jdbcType="INTEGER" property="addressType" />
-    <result column="name" jdbcType="VARCHAR" property="name" />
-    <result column="type" jdbcType="BIGINT" property="type" />
-    <result column="contacts" jdbcType="VARCHAR" property="contacts" />
-    <result column="phone" jdbcType="VARCHAR" property="phone" />
-    <result column="city_code" jdbcType="INTEGER" property="cityCode" />
-    <result column="city_name" jdbcType="VARCHAR" property="cityName" />
-    <result column="detail_address" jdbcType="VARCHAR" property="detailAddress" />
-    <result column="lat" jdbcType="VARCHAR" property="lat" />
-    <result column="lng" jdbcType="VARCHAR" property="lng" />
-    <result column="fence" jdbcType="VARCHAR" property="fence" />
-    <result column="entry_type" jdbcType="INTEGER" property="entryType" />
-    <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, order_id, address_type, `name`, `type`, contacts, phone, city_code, city_name,
-    detail_address, lat, lng, fence, entry_type, remark, `status`, create_by, create_time, 
+    <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtLogisticsOrderAddress">
+        <id column="id" jdbcType="BIGINT" property="id" />
+        <result column="l_order_id" jdbcType="BIGINT" property="lOrderId" />
+        <result column="address_type" jdbcType="INTEGER" property="addressType" />
+        <result column="name" jdbcType="VARCHAR" property="name" />
+        <result column="type" jdbcType="BIGINT" property="type" />
+        <result column="contacts" jdbcType="VARCHAR" property="contacts" />
+        <result column="phone" jdbcType="VARCHAR" property="phone" />
+        <result column="city_code" jdbcType="INTEGER" property="cityCode" />
+        <result column="city_name" jdbcType="VARCHAR" property="cityName" />
+        <result column="detail_address" jdbcType="VARCHAR" property="detailAddress" />
+        <result column="lat" jdbcType="VARCHAR" property="lat" />
+        <result column="lng" jdbcType="VARCHAR" property="lng" />
+        <result column="fence" jdbcType="VARCHAR" property="fence" />
+        <result column="entry_type" jdbcType="INTEGER" property="entryType" />
+        <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, l_order_id, address_type, `name`, `type`, contacts, phone, city_code, city_name,
+    detail_address, lat, lng, fence, entry_type, remark, `status`, create_by, create_time,
     update_by, update_time, del_flag
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from kwt_logistics_order_address
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    delete from kwt_logistics_order_address
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <insert id="insert" parameterType="com.sckw.transport.model.KwtLogisticsOrderAddress">
-    insert into kwt_logistics_order_address (id, order_id, address_type, 
-      `name`, `type`, contacts,
-      phone, city_code, city_name,
-      detail_address, lat, lng, 
-      fence, entry_type, remark, 
-      `status`, create_by, create_time, 
-      update_by, update_time, del_flag
-      )
-    values (#{id,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{addressType,jdbcType=INTEGER}, 
-      #{name,jdbcType=VARCHAR}, #{type,jdbcType=BIGINT}, #{contacts,jdbcType=VARCHAR}, 
-      #{phone,jdbcType=VARCHAR}, #{cityCode,jdbcType=INTEGER}, #{cityName,jdbcType=VARCHAR},
-      #{detailAddress,jdbcType=VARCHAR}, #{lat,jdbcType=VARCHAR}, #{lng,jdbcType=VARCHAR}, 
-      #{fence,jdbcType=VARCHAR}, #{entryType,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, 
-      #{status,jdbcType=INTEGER}, #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.sckw.transport.model.KwtLogisticsOrderAddress">
-    insert into kwt_logistics_order_address
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="orderId != null">
-        order_id,
-      </if>
-      <if test="addressType != null">
-        address_type,
-      </if>
-      <if test="name != null">
-        `name`,
-      </if>
-      <if test="type != null">
-        `type`,
-      </if>
-      <if test="contacts != null">
-        contacts,
-      </if>
-      <if test="phone != null">
-        phone,
-      </if>
-      <if test="cityCode != null">
-        city_code,
-      </if>
-      <if test="cityName != null">
-        city_name,
-      </if>
-      <if test="detailAddress != null">
-        detail_address,
-      </if>
-      <if test="lat != null">
-        lat,
-      </if>
-      <if test="lng != null">
-        lng,
-      </if>
-      <if test="fence != null">
-        fence,
-      </if>
-      <if test="entryType != null">
-        entry_type,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="status != null">
-        `status`,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
-      <if test="orderId != null">
-        #{orderId,jdbcType=BIGINT},
-      </if>
-      <if test="addressType != null">
-        #{addressType,jdbcType=INTEGER},
-      </if>
-      <if test="name != null">
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="type != null">
-        #{type,jdbcType=BIGINT},
-      </if>
-      <if test="contacts != null">
-        #{contacts,jdbcType=VARCHAR},
-      </if>
-      <if test="phone != null">
-        #{phone,jdbcType=VARCHAR},
-      </if>
-      <if test="cityCode != null">
-        #{cityCode,jdbcType=INTEGER},
-      </if>
-      <if test="cityName != null">
-        #{cityName,jdbcType=VARCHAR},
-      </if>
-      <if test="detailAddress != null">
-        #{detailAddress,jdbcType=VARCHAR},
-      </if>
-      <if test="lat != null">
-        #{lat,jdbcType=VARCHAR},
-      </if>
-      <if test="lng != null">
-        #{lng,jdbcType=VARCHAR},
-      </if>
-      <if test="fence != null">
-        #{fence,jdbcType=VARCHAR},
-      </if>
-      <if test="entryType != null">
-        #{entryType,jdbcType=INTEGER},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=INTEGER},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.transport.model.KwtLogisticsOrderAddress">
-    update kwt_logistics_order_address
-    <set>
-      <if test="orderId != null">
-        order_id = #{orderId,jdbcType=BIGINT},
-      </if>
-      <if test="addressType != null">
-        address_type = #{addressType,jdbcType=INTEGER},
-      </if>
-      <if test="name != null">
-        `name` = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="type != null">
-        `type` = #{type,jdbcType=BIGINT},
-      </if>
-      <if test="contacts != null">
-        contacts = #{contacts,jdbcType=VARCHAR},
-      </if>
-      <if test="phone != null">
-        phone = #{phone,jdbcType=VARCHAR},
-      </if>
-      <if test="cityCode != null">
-        city_code = #{cityCode,jdbcType=INTEGER},
-      </if>
-      <if test="cityName != null">
-        city_name = #{cityName,jdbcType=VARCHAR},
-      </if>
-      <if test="detailAddress != null">
-        detail_address = #{detailAddress,jdbcType=VARCHAR},
-      </if>
-      <if test="lat != null">
-        lat = #{lat,jdbcType=VARCHAR},
-      </if>
-      <if test="lng != null">
-        lng = #{lng,jdbcType=VARCHAR},
-      </if>
-      <if test="fence != null">
-        fence = #{fence,jdbcType=VARCHAR},
-      </if>
-      <if test="entryType != null">
-        entry_type = #{entryType,jdbcType=INTEGER},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=INTEGER},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.sckw.transport.model.KwtLogisticsOrderAddress">
-    update kwt_logistics_order_address
-    set order_id = #{orderId,jdbcType=BIGINT},
-      address_type = #{addressType,jdbcType=INTEGER},
-      `name` = #{name,jdbcType=VARCHAR},
-      `type` = #{type,jdbcType=BIGINT},
-      contacts = #{contacts,jdbcType=VARCHAR},
-        phone = #{phone,jdbcType=VARCHAR},
-      city_code = #{cityCode,jdbcType=INTEGER},
-      city_name = #{cityName,jdbcType=VARCHAR},
-      detail_address = #{detailAddress,jdbcType=VARCHAR},
-      lat = #{lat,jdbcType=VARCHAR},
-      lng = #{lng,jdbcType=VARCHAR},
-      fence = #{fence,jdbcType=VARCHAR},
-      entry_type = #{entryType,jdbcType=INTEGER},
-      remark = #{remark,jdbcType=VARCHAR},
-      `status` = #{status,jdbcType=INTEGER},
-      create_by = #{createBy,jdbcType=BIGINT},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=BIGINT},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=INTEGER}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
+    </sql>
 </mapper>

+ 42 - 397
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml

@@ -1,401 +1,46 @@
 <?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.KwtLogisticsOrderMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtLogisticsOrder">
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="ent_id" jdbcType="BIGINT" property="entId" />
-    <result column="order_id" jdbcType="BIGINT" property="orderId" />
-    <result column="code" jdbcType="VARCHAR" property="code" />
-    <result column="settlement_cycle" jdbcType="BIGINT" property="settlementCycle" />
-    <result column="price" jdbcType="DECIMAL" property="price" />
-    <result column="price_type" jdbcType="BIGINT" property="priceType" />
-    <result column="amount" jdbcType="DECIMAL" property="amount" />
-    <result column="unit" jdbcType="VARCHAR" property="unit" />
-    <result column="loss" jdbcType="DECIMAL" property="loss" />
-    <result column="loss_unit" jdbcType="VARCHAR" property="lossUnit" />
-    <result column="goods_price" jdbcType="DECIMAL" property="goodsPrice" />
-    <result column="goods_price_unit" jdbcType="VARCHAR" property="goodsPriceUnit" />
-    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
-    <result column="ent_time" jdbcType="TIMESTAMP" property="entTime" />
-    <result column="subcontract_amount" jdbcType="DECIMAL" property="subcontractAmount" />
-    <result column="entrust_amount" jdbcType="DECIMAL" property="entrustAmount" />
-    <result column="unload_amount" jdbcType="DECIMAL" property="unloadAmount" />
-    <result column="load_amount" jdbcType="DECIMAL" property="loadAmount" />
-    <result column="ignore_amount" jdbcType="DECIMAL" property="ignoreAmount" />
-    <result column="deficit_amount" jdbcType="DECIMAL" property="deficitAmount" />
-    <result column="deficit_price" jdbcType="DECIMAL" property="deficitPrice" />
-    <result column="remark" jdbcType="VARCHAR" property="remark" />
-    <result column="payment" jdbcType="BIGINT" property="payment" />
-    <result column="tax_rate" jdbcType="DECIMAL" property="taxRate" />
-    <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, order_id, code, settlement_cycle, price, price_type, amount, unit, loss, 
-    loss_unit, goods_price, goods_price_unit, start_time, ent_time, subcontract_amount, 
-    entrust_amount, unload_amount, load_amount, ignore_amount, deficit_amount, deficit_price, 
-    remark, payment, tax_rate, `status`, create_by, create_time, update_by, update_time, 
-    del_flag
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from kwt_logistics_order
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    delete from kwt_logistics_order
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <insert id="insert" parameterType="com.sckw.transport.model.KwtLogisticsOrder">
-    insert into kwt_logistics_order (id, ent_id, order_id, 
-      code, settlement_cycle, price, 
-      price_type, amount, unit, 
-      loss, loss_unit, goods_price, 
-      goods_price_unit, start_time, ent_time, 
-      subcontract_amount, entrust_amount, unload_amount, 
-      load_amount, ignore_amount, deficit_amount, 
-      deficit_price, remark, payment, 
-      tax_rate, `status`, create_by, 
-      create_time, update_by, update_time, 
-      del_flag)
-    values (#{id,jdbcType=BIGINT}, #{entId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, 
-      #{code,jdbcType=VARCHAR}, #{settlementCycle,jdbcType=BIGINT}, #{price,jdbcType=DECIMAL}, 
-      #{priceType,jdbcType=BIGINT}, #{amount,jdbcType=DECIMAL}, #{unit,jdbcType=VARCHAR}, 
-      #{loss,jdbcType=DECIMAL}, #{lossUnit,jdbcType=VARCHAR}, #{goodsPrice,jdbcType=DECIMAL}, 
-      #{goodsPriceUnit,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{entTime,jdbcType=TIMESTAMP}, 
-      #{subcontractAmount,jdbcType=DECIMAL}, #{entrustAmount,jdbcType=DECIMAL}, #{unloadAmount,jdbcType=DECIMAL}, 
-      #{loadAmount,jdbcType=DECIMAL}, #{ignoreAmount,jdbcType=DECIMAL}, #{deficitAmount,jdbcType=DECIMAL}, 
-      #{deficitPrice,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, #{payment,jdbcType=BIGINT}, 
-      #{taxRate,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, #{createBy,jdbcType=BIGINT}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, 
-      #{delFlag,jdbcType=INTEGER})
-  </insert>
-  <insert id="insertSelective" parameterType="com.sckw.transport.model.KwtLogisticsOrder">
-    insert into kwt_logistics_order
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="entId != null">
-        ent_id,
-      </if>
-      <if test="orderId != null">
-        order_id,
-      </if>
-      <if test="code != null">
-        code,
-      </if>
-      <if test="settlementCycle != null">
-        settlement_cycle,
-      </if>
-      <if test="price != null">
-        price,
-      </if>
-      <if test="priceType != null">
-        price_type,
-      </if>
-      <if test="amount != null">
-        amount,
-      </if>
-      <if test="unit != null">
-        unit,
-      </if>
-      <if test="loss != null">
-        loss,
-      </if>
-      <if test="lossUnit != null">
-        loss_unit,
-      </if>
-      <if test="goodsPrice != null">
-        goods_price,
-      </if>
-      <if test="goodsPriceUnit != null">
-        goods_price_unit,
-      </if>
-      <if test="startTime != null">
-        start_time,
-      </if>
-      <if test="entTime != null">
-        ent_time,
-      </if>
-      <if test="subcontractAmount != null">
-        subcontract_amount,
-      </if>
-      <if test="entrustAmount != null">
-        entrust_amount,
-      </if>
-      <if test="unloadAmount != null">
-        unload_amount,
-      </if>
-      <if test="loadAmount != null">
-        load_amount,
-      </if>
-      <if test="ignoreAmount != null">
-        ignore_amount,
-      </if>
-      <if test="deficitAmount != null">
-        deficit_amount,
-      </if>
-      <if test="deficitPrice != null">
-        deficit_price,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="payment != null">
-        payment,
-      </if>
-      <if test="taxRate != null">
-        tax_rate,
-      </if>
-      <if test="status != null">
-        `status`,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
-      <if test="entId != null">
-        #{entId,jdbcType=BIGINT},
-      </if>
-      <if test="orderId != null">
-        #{orderId,jdbcType=BIGINT},
-      </if>
-      <if test="code != null">
-        #{code,jdbcType=VARCHAR},
-      </if>
-      <if test="settlementCycle != null">
-        #{settlementCycle,jdbcType=BIGINT},
-      </if>
-      <if test="price != null">
-        #{price,jdbcType=DECIMAL},
-      </if>
-      <if test="priceType != null">
-        #{priceType,jdbcType=BIGINT},
-      </if>
-      <if test="amount != null">
-        #{amount,jdbcType=DECIMAL},
-      </if>
-      <if test="unit != null">
-        #{unit,jdbcType=VARCHAR},
-      </if>
-      <if test="loss != null">
-        #{loss,jdbcType=DECIMAL},
-      </if>
-      <if test="lossUnit != null">
-        #{lossUnit,jdbcType=VARCHAR},
-      </if>
-      <if test="goodsPrice != null">
-        #{goodsPrice,jdbcType=DECIMAL},
-      </if>
-      <if test="goodsPriceUnit != null">
-        #{goodsPriceUnit,jdbcType=VARCHAR},
-      </if>
-      <if test="startTime != null">
-        #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="entTime != null">
-        #{entTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="subcontractAmount != null">
-        #{subcontractAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="entrustAmount != null">
-        #{entrustAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="unloadAmount != null">
-        #{unloadAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="loadAmount != null">
-        #{loadAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="ignoreAmount != null">
-        #{ignoreAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="deficitAmount != null">
-        #{deficitAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="deficitPrice != null">
-        #{deficitPrice,jdbcType=DECIMAL},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="payment != null">
-        #{payment,jdbcType=BIGINT},
-      </if>
-      <if test="taxRate != null">
-        #{taxRate,jdbcType=DECIMAL},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=INTEGER},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.transport.model.KwtLogisticsOrder">
-    update kwt_logistics_order
-    <set>
-      <if test="entId != null">
-        ent_id = #{entId,jdbcType=BIGINT},
-      </if>
-      <if test="orderId != null">
-        order_id = #{orderId,jdbcType=BIGINT},
-      </if>
-      <if test="code != null">
-        code = #{code,jdbcType=VARCHAR},
-      </if>
-      <if test="settlementCycle != null">
-        settlement_cycle = #{settlementCycle,jdbcType=BIGINT},
-      </if>
-      <if test="price != null">
-        price = #{price,jdbcType=DECIMAL},
-      </if>
-      <if test="priceType != null">
-        price_type = #{priceType,jdbcType=BIGINT},
-      </if>
-      <if test="amount != null">
-        amount = #{amount,jdbcType=DECIMAL},
-      </if>
-      <if test="unit != null">
-        unit = #{unit,jdbcType=VARCHAR},
-      </if>
-      <if test="loss != null">
-        loss = #{loss,jdbcType=DECIMAL},
-      </if>
-      <if test="lossUnit != null">
-        loss_unit = #{lossUnit,jdbcType=VARCHAR},
-      </if>
-      <if test="goodsPrice != null">
-        goods_price = #{goodsPrice,jdbcType=DECIMAL},
-      </if>
-      <if test="goodsPriceUnit != null">
-        goods_price_unit = #{goodsPriceUnit,jdbcType=VARCHAR},
-      </if>
-      <if test="startTime != null">
-        start_time = #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="entTime != null">
-        ent_time = #{entTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="subcontractAmount != null">
-        subcontract_amount = #{subcontractAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="entrustAmount != null">
-        entrust_amount = #{entrustAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="unloadAmount != null">
-        unload_amount = #{unloadAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="loadAmount != null">
-        load_amount = #{loadAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="ignoreAmount != null">
-        ignore_amount = #{ignoreAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="deficitAmount != null">
-        deficit_amount = #{deficitAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="deficitPrice != null">
-        deficit_price = #{deficitPrice,jdbcType=DECIMAL},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="payment != null">
-        payment = #{payment,jdbcType=BIGINT},
-      </if>
-      <if test="taxRate != null">
-        tax_rate = #{taxRate,jdbcType=DECIMAL},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=INTEGER},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.sckw.transport.model.KwtLogisticsOrder">
-    update kwt_logistics_order
-    set ent_id = #{entId,jdbcType=BIGINT},
-      order_id = #{orderId,jdbcType=BIGINT},
-      code = #{code,jdbcType=VARCHAR},
-      settlement_cycle = #{settlementCycle,jdbcType=BIGINT},
-      price = #{price,jdbcType=DECIMAL},
-      price_type = #{priceType,jdbcType=BIGINT},
-      amount = #{amount,jdbcType=DECIMAL},
-      unit = #{unit,jdbcType=VARCHAR},
-      loss = #{loss,jdbcType=DECIMAL},
-      loss_unit = #{lossUnit,jdbcType=VARCHAR},
-      goods_price = #{goodsPrice,jdbcType=DECIMAL},
-      goods_price_unit = #{goodsPriceUnit,jdbcType=VARCHAR},
-      start_time = #{startTime,jdbcType=TIMESTAMP},
-      ent_time = #{entTime,jdbcType=TIMESTAMP},
-      subcontract_amount = #{subcontractAmount,jdbcType=DECIMAL},
-      entrust_amount = #{entrustAmount,jdbcType=DECIMAL},
-      unload_amount = #{unloadAmount,jdbcType=DECIMAL},
-      load_amount = #{loadAmount,jdbcType=DECIMAL},
-      ignore_amount = #{ignoreAmount,jdbcType=DECIMAL},
-      deficit_amount = #{deficitAmount,jdbcType=DECIMAL},
-      deficit_price = #{deficitPrice,jdbcType=DECIMAL},
-      remark = #{remark,jdbcType=VARCHAR},
-      payment = #{payment,jdbcType=BIGINT},
-      tax_rate = #{taxRate,jdbcType=DECIMAL},
-      `status` = #{status,jdbcType=INTEGER},
-      create_by = #{createBy,jdbcType=BIGINT},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=BIGINT},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=INTEGER}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
+    <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtLogisticsOrder">
+        <id column="id" jdbcType="BIGINT" property="id" />
+        <result column="ent_id" jdbcType="BIGINT" property="entId" />
+        <result column="t_order_id" jdbcType="BIGINT" property="tOrderId" />
+        <result column="t_order_no" jdbcType="VARCHAR" property="tOrderNo" />
+        <result column="l_order_no" jdbcType="VARCHAR" property="lOrderNo" />
+        <result column="pid" jdbcType="BIGINT" property="pid" />
+        <result column="settlement_cycle" jdbcType="BIGINT" property="settlementCycle" />
+        <result column="price" jdbcType="DECIMAL" property="price" />
+        <result column="price_type" jdbcType="BIGINT" property="priceType" />
+        <result column="amount" jdbcType="DECIMAL" property="amount" />
+        <result column="unit" jdbcType="VARCHAR" property="unit" />
+        <result column="loss" jdbcType="DECIMAL" property="loss" />
+        <result column="loss_unit" jdbcType="VARCHAR" property="lossUnit" />
+        <result column="goods_price" jdbcType="DECIMAL" property="goodsPrice" />
+        <result column="goods_price_unit" jdbcType="VARCHAR" property="goodsPriceUnit" />
+        <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
+        <result column="ent_time" jdbcType="TIMESTAMP" property="entTime" />
+        <result column="subcontract_amount" jdbcType="DECIMAL" property="subcontractAmount" />
+        <result column="entrust_amount" jdbcType="DECIMAL" property="entrustAmount" />
+        <result column="unload_amount" jdbcType="DECIMAL" property="unloadAmount" />
+        <result column="load_amount" jdbcType="DECIMAL" property="loadAmount" />
+        <result column="ignore_amount" jdbcType="DECIMAL" property="ignoreAmount" />
+        <result column="deficit_amount" jdbcType="DECIMAL" property="deficitAmount" />
+        <result column="deficit_price" jdbcType="DECIMAL" property="deficitPrice" />
+        <result column="payment" jdbcType="BIGINT" property="payment" />
+        <result column="tax_rate" jdbcType="DECIMAL" property="taxRate" />
+        <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, t_order_id, t_order_no, l_order_no, pid, settlement_cycle, price, price_type,
+    amount, unit, loss, loss_unit, goods_price, goods_price_unit, start_time, ent_time,
+    subcontract_amount, entrust_amount, unload_amount, load_amount, ignore_amount, deficit_amount,
+    deficit_price, payment, tax_rate, remark, `status`, create_by, create_time, update_by,
+    update_time, del_flag
+    </sql>
 </mapper>

+ 15 - 137
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderTrackMapper.xml

@@ -1,141 +1,19 @@
 <?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.KwtLogisticsOrderTrackMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtLogisticsOrderTrack">
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="order_id" jdbcType="BIGINT" property="orderId" />
-    <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, order_id, remark, `status`, create_by, create_time, update_by, update_time, del_flag
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from kwt_logistics_order_track
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    delete from kwt_logistics_order_track
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <insert id="insert" parameterType="com.sckw.transport.model.KwtLogisticsOrderTrack">
-    insert into kwt_logistics_order_track (id, order_id, remark, 
-      `status`, create_by, create_time, 
-      update_by, update_time, del_flag
-      )
-    values (#{id,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{remark,jdbcType=VARCHAR}, 
-      #{status,jdbcType=INTEGER}, #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.sckw.transport.model.KwtLogisticsOrderTrack">
-    insert into kwt_logistics_order_track
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="orderId != null">
-        order_id,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="status != null">
-        `status`,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
-      <if test="orderId != null">
-        #{orderId,jdbcType=BIGINT},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=INTEGER},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.transport.model.KwtLogisticsOrderTrack">
-    update kwt_logistics_order_track
-    <set>
-      <if test="orderId != null">
-        order_id = #{orderId,jdbcType=BIGINT},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=INTEGER},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.sckw.transport.model.KwtLogisticsOrderTrack">
-    update kwt_logistics_order_track
-    set order_id = #{orderId,jdbcType=BIGINT},
-      remark = #{remark,jdbcType=VARCHAR},
-      `status` = #{status,jdbcType=INTEGER},
-      create_by = #{createBy,jdbcType=BIGINT},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=BIGINT},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=INTEGER}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
+    <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtWaybillOrderTrack">
+        <id column="id" jdbcType="BIGINT" property="id" />
+        <result column="w_order_id" jdbcType="BIGINT" property="wOrderId" />
+        <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, w_order_id, remark, `status`, create_by, create_time, update_by, update_time,
+    del_flag
+    </sql>
 </mapper>

+ 15 - 203
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderUnitMapper.xml

@@ -2,211 +2,23 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.transport.dao.KwtLogisticsOrderUnitMapper">
     <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtLogisticsOrderUnit">
-        <id column="id" jdbcType="BIGINT" property="id"/>
-        <result column="order_id" jdbcType="BIGINT" property="orderId"/>
-        <result column="unit_type" jdbcType="INTEGER" property="unitType"/>
-        <result column="ent_id" jdbcType="BIGINT" property="entId"/>
-        <result column="firm_name" jdbcType="VARCHAR" property="firmName"/>
-        <result column="contacts" jdbcType="VARCHAR" property="contacts"/>
-        <result column="phone" jdbcType="VARCHAR" property="phone"/>
-        <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"/>
+        <id column="id" jdbcType="BIGINT" property="id" />
+        <result column="l_order_id" jdbcType="BIGINT" property="lOrderId" />
+        <result column="unit_type" jdbcType="INTEGER" property="unitType" />
+        <result column="ent_id" jdbcType="BIGINT" property="entId" />
+        <result column="firm_name" jdbcType="VARCHAR" property="firmName" />
+        <result column="contacts" jdbcType="VARCHAR" property="contacts" />
+        <result column="phone" jdbcType="VARCHAR" property="phone" />
+        <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
-        , order_id, unit_type, ent_id, firm_name, contacts, phone, remark, `status`,
+        id, l_order_id, unit_type, ent_id, firm_name, contacts, phone, remark, `status`,
     create_by, create_time, update_by, update_time, del_flag
     </sql>
-    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from kwt_logistics_order_unit
-        where id = #{id,jdbcType=BIGINT}
-    </select>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-        delete
-        from kwt_logistics_order_unit
-        where id = #{id,jdbcType=BIGINT}
-    </delete>
-    <insert id="insert" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
-        insert into kwt_logistics_order_unit (id, order_id, unit_type,
-                                              ent_id, firm_name, contacts,
-                                              phone, remark, `status`,
-                                              create_by, create_time, update_by,
-                                              update_time, del_flag)
-        values (#{id,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{unitType,jdbcType=INTEGER},
-                #{entId,jdbcType=BIGINT}, #{firmName,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR},
-                #{phone,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
-                #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT},
-                #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER})
-    </insert>
-    <insert id="insertSelective" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
-        insert into kwt_logistics_order_unit
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="id != null">
-                id,
-            </if>
-            <if test="orderId != null">
-                order_id,
-            </if>
-            <if test="unitType != null">
-                unit_type,
-            </if>
-            <if test="entId != null">
-                ent_id,
-            </if>
-            <if test="firmName != null">
-                firm_name,
-            </if>
-            <if test="contacts != null">
-                contacts,
-            </if>
-            <if test="phone != null">
-                phone,
-            </if>
-            <if test="remark != null">
-                remark,
-            </if>
-            <if test="status != null">
-                `status`,
-            </if>
-            <if test="createBy != null">
-                create_by,
-            </if>
-            <if test="createTime != null">
-                create_time,
-            </if>
-            <if test="updateBy != null">
-                update_by,
-            </if>
-            <if test="updateTime != null">
-                update_time,
-            </if>
-            <if test="delFlag != null">
-                del_flag,
-            </if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="id != null">
-                #{id,jdbcType=BIGINT},
-            </if>
-            <if test="orderId != null">
-                #{orderId,jdbcType=BIGINT},
-            </if>
-            <if test="unitType != null">
-                #{unitType,jdbcType=INTEGER},
-            </if>
-            <if test="entId != null">
-                #{entId,jdbcType=BIGINT},
-            </if>
-            <if test="firmName != null">
-                #{firmName,jdbcType=VARCHAR},
-            </if>
-            <if test="contacts != null">
-                #{contacts,jdbcType=VARCHAR},
-            </if>
-            <if test="phone != null">
-                #{phone,jdbcType=VARCHAR},
-            </if>
-            <if test="remark != null">
-                #{remark,jdbcType=VARCHAR},
-            </if>
-            <if test="status != null">
-                #{status,jdbcType=INTEGER},
-            </if>
-            <if test="createBy != null">
-                #{createBy,jdbcType=BIGINT},
-            </if>
-            <if test="createTime != null">
-                #{createTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="updateBy != null">
-                #{updateBy,jdbcType=BIGINT},
-            </if>
-            <if test="updateTime != null">
-                #{updateTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="delFlag != null">
-                #{delFlag,jdbcType=INTEGER},
-            </if>
-        </trim>
-    </insert>
-    <update id="updateByPrimaryKeySelective" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
-        update kwt_logistics_order_unit
-        <set>
-            <if test="orderId != null">
-                order_id = #{orderId,jdbcType=BIGINT},
-            </if>
-            <if test="unitType != null">
-                unit_type = #{unitType,jdbcType=INTEGER},
-            </if>
-            <if test="entId != null">
-                ent_id = #{entId,jdbcType=BIGINT},
-            </if>
-            <if test="firmName != null">
-                firm_name = #{firmName,jdbcType=VARCHAR},
-            </if>
-            <if test="contacts != null">
-                contacts = #{contacts,jdbcType=VARCHAR},
-            </if>
-            <if test="phone != null">
-                phone = #{phone,jdbcType=VARCHAR},
-            </if>
-            <if test="remark != null">
-                remark = #{remark,jdbcType=VARCHAR},
-            </if>
-            <if test="status != null">
-                `status` = #{status,jdbcType=INTEGER},
-            </if>
-            <if test="createBy != null">
-                create_by = #{createBy,jdbcType=BIGINT},
-            </if>
-            <if test="createTime != null">
-                create_time = #{createTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="updateBy != null">
-                update_by = #{updateBy,jdbcType=BIGINT},
-            </if>
-            <if test="updateTime != null">
-                update_time = #{updateTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="delFlag != null">
-                del_flag = #{delFlag,jdbcType=INTEGER},
-            </if>
-        </set>
-        where id = #{id,jdbcType=BIGINT}
-    </update>
-    <update id="updateByPrimaryKey" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
-        update kwt_logistics_order_unit
-        set order_id    = #{orderId,jdbcType=BIGINT},
-            unit_type   = #{unitType,jdbcType=INTEGER},
-            ent_id      = #{entId,jdbcType=BIGINT},
-            firm_name   = #{firmName,jdbcType=VARCHAR},
-            contacts    = #{contacts,jdbcType=VARCHAR},
-            phone       = #{phone,jdbcType=VARCHAR},
-            remark      = #{remark,jdbcType=VARCHAR},
-            `status`    = #{status,jdbcType=INTEGER},
-            create_by   = #{createBy,jdbcType=BIGINT},
-            create_time = #{createTime,jdbcType=TIMESTAMP},
-            update_by   = #{updateBy,jdbcType=BIGINT},
-            update_time = #{updateTime,jdbcType=TIMESTAMP},
-            del_flag    = #{delFlag,jdbcType=INTEGER}
-        where id = #{id,jdbcType=BIGINT}
-    </update>
-
-    <select id="selectCompanyBylOrderId" resultMap="BaseResultMap">
-        SELECT lu.*
-        FROM kwt_logistics_order lo
-        LEFT JOIN kwt_logistics_order_unit lu ON lo.id = lu.l_order_id
-        AND lu.unit_type = #{unitType}
-        AND lo.l_order_no in
-        <foreach collection="list" separator="," open="(" close=")" item="id">
-            #{id}
-        </foreach>
-    </select>
 </mapper>

+ 232 - 231
sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderMapper.xml

@@ -1,235 +1,236 @@
 <?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.KwtWaybillOrderMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtWaybillOrder">
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="ent_id" jdbcType="BIGINT" property="entId" />
-    <result column="order_id" jdbcType="BIGINT" property="orderId" />
-    <result column="code" jdbcType="VARCHAR" property="code" />
-    <result column="car_num" jdbcType="VARCHAR" property="carNum" />
-    <result column="driver_id" jdbcType="BIGINT" property="driverId" />
-    <result column="entrust_amount" jdbcType="DECIMAL" property="entrustAmount" />
-    <result column="unload_amount" jdbcType="DECIMAL" property="unloadAmount" />
-    <result column="load_amount" jdbcType="DECIMAL" property="loadAmount" />
-    <result column="deficit_amount" jdbcType="DECIMAL" property="deficitAmount" />
-    <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, order_id, code, car_num, driver_id, entrust_amount, unload_amount, load_amount, 
-    deficit_amount, remark, `status`, create_by, create_time, update_by, update_time, 
-    del_flag
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from kwt_waybill_order
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    delete from kwt_waybill_order
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <insert id="insert" parameterType="com.sckw.transport.model.KwtWaybillOrder">
-    insert into kwt_waybill_order (id, ent_id, order_id, 
-      code, car_num, driver_id, 
-      entrust_amount, unload_amount, load_amount, 
-      deficit_amount, remark, `status`, 
-      create_by, create_time, update_by, 
-      update_time, del_flag)
-    values (#{id,jdbcType=BIGINT}, #{entId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, 
-      #{code,jdbcType=VARCHAR}, #{carNum,jdbcType=VARCHAR}, #{driverId,jdbcType=BIGINT}, 
-      #{entrustAmount,jdbcType=DECIMAL}, #{unloadAmount,jdbcType=DECIMAL}, #{loadAmount,jdbcType=DECIMAL}, 
-      #{deficitAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
-      #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER})
-  </insert>
-  <insert id="insertSelective" parameterType="com.sckw.transport.model.KwtWaybillOrder">
-    insert into kwt_waybill_order
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="entId != null">
-        ent_id,
-      </if>
-      <if test="orderId != null">
-        order_id,
-      </if>
-      <if test="code != null">
-        code,
-      </if>
-      <if test="carNum != null">
-        car_num,
-      </if>
-      <if test="driverId != null">
-        driver_id,
-      </if>
-      <if test="entrustAmount != null">
-        entrust_amount,
-      </if>
-      <if test="unloadAmount != null">
-        unload_amount,
-      </if>
-      <if test="loadAmount != null">
-        load_amount,
-      </if>
-      <if test="deficitAmount != null">
-        deficit_amount,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="status != null">
-        `status`,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
-      <if test="entId != null">
-        #{entId,jdbcType=BIGINT},
-      </if>
-      <if test="orderId != null">
-        #{orderId,jdbcType=BIGINT},
-      </if>
-      <if test="code != null">
-        #{code,jdbcType=VARCHAR},
-      </if>
-      <if test="carNum != null">
-        #{carNum,jdbcType=VARCHAR},
-      </if>
-      <if test="driverId != null">
-        #{driverId,jdbcType=BIGINT},
-      </if>
-      <if test="entrustAmount != null">
-        #{entrustAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="unloadAmount != null">
-        #{unloadAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="loadAmount != null">
-        #{loadAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="deficitAmount != null">
-        #{deficitAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=INTEGER},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.transport.model.KwtWaybillOrder">
-    update kwt_waybill_order
-    <set>
-      <if test="entId != null">
-        ent_id = #{entId,jdbcType=BIGINT},
-      </if>
-      <if test="orderId != null">
-        order_id = #{orderId,jdbcType=BIGINT},
-      </if>
-      <if test="code != null">
-        code = #{code,jdbcType=VARCHAR},
-      </if>
-      <if test="carNum != null">
-        car_num = #{carNum,jdbcType=VARCHAR},
-      </if>
-      <if test="driverId != null">
-        driver_id = #{driverId,jdbcType=BIGINT},
-      </if>
-      <if test="entrustAmount != null">
-        entrust_amount = #{entrustAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="unloadAmount != null">
-        unload_amount = #{unloadAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="loadAmount != null">
-        load_amount = #{loadAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="deficitAmount != null">
-        deficit_amount = #{deficitAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=INTEGER},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.sckw.transport.model.KwtWaybillOrder">
-    update kwt_waybill_order
-    set ent_id = #{entId,jdbcType=BIGINT},
-      order_id = #{orderId,jdbcType=BIGINT},
-      code = #{code,jdbcType=VARCHAR},
-      car_num = #{carNum,jdbcType=VARCHAR},
-      driver_id = #{driverId,jdbcType=BIGINT},
-      entrust_amount = #{entrustAmount,jdbcType=DECIMAL},
-      unload_amount = #{unloadAmount,jdbcType=DECIMAL},
-      load_amount = #{loadAmount,jdbcType=DECIMAL},
-      deficit_amount = #{deficitAmount,jdbcType=DECIMAL},
-      remark = #{remark,jdbcType=VARCHAR},
-      `status` = #{status,jdbcType=INTEGER},
-      create_by = #{createBy,jdbcType=BIGINT},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=BIGINT},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=INTEGER}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
+    <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtWaybillOrder">
+        <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_no" jdbcType="VARCHAR" property="wOrderNo" />
+        <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="entrust_amount" jdbcType="DECIMAL" property="entrustAmount" />
+        <result column="unload_amount" jdbcType="DECIMAL" property="unloadAmount" />
+        <result column="load_amount" jdbcType="DECIMAL" property="loadAmount" />
+        <result column="deficit_amount" jdbcType="DECIMAL" property="deficitAmount" />
+        <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_no, truck_no, driver_id, entrust_amount, unload_amount,
+    load_amount, deficit_amount, remark, `status`, create_by, create_time, update_by,
+    update_time, del_flag
+    </sql>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from kwt_waybill_order
+        where id = #{id,jdbcType=BIGINT}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        delete from kwt_waybill_order
+        where id = #{id,jdbcType=BIGINT}
+    </delete>
+    <insert id="insert" parameterType="com.sckw.transport.model.KwtWaybillOrder">
+        insert into kwt_waybill_order (id, ent_id, l_order_id,
+                                       w_order_no, truck_no, driver_id,
+                                       entrust_amount, unload_amount, load_amount,
+                                       deficit_amount, remark, `status`,
+                                       create_by, create_time, update_by,
+                                       update_time, del_flag)
+        values (#{id,jdbcType=BIGINT}, #{entId,jdbcType=BIGINT}, #{lOrderId,jdbcType=BIGINT},
+                #{wOrderNo,jdbcType=VARCHAR}, #{truckNo,jdbcType=VARCHAR}, #{driverId,jdbcType=BIGINT},
+                #{entrustAmount,jdbcType=DECIMAL}, #{unloadAmount,jdbcType=DECIMAL}, #{loadAmount,jdbcType=DECIMAL},
+                #{deficitAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
+                #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT},
+                #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER})
+    </insert>
+    <insert id="insertSelective" parameterType="com.sckw.transport.model.KwtWaybillOrder">
+        insert into kwt_waybill_order
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="entId != null">
+                ent_id,
+            </if>
+            <if test="lOrderId != null">
+                l_order_id,
+            </if>
+            <if test="wOrderNo != null">
+                w_order_no,
+            </if>
+            <if test="truckNo != null">
+                truck_no,
+            </if>
+            <if test="driverId != null">
+                driver_id,
+            </if>
+            <if test="entrustAmount != null">
+                entrust_amount,
+            </if>
+            <if test="unloadAmount != null">
+                unload_amount,
+            </if>
+            <if test="loadAmount != null">
+                load_amount,
+            </if>
+            <if test="deficitAmount != null">
+                deficit_amount,
+            </if>
+            <if test="remark != null">
+                remark,
+            </if>
+            <if test="status != null">
+                `status`,
+            </if>
+            <if test="createBy != null">
+                create_by,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="updateBy != null">
+                update_by,
+            </if>
+            <if test="updateTime != null">
+                update_time,
+            </if>
+            <if test="delFlag != null">
+                del_flag,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="entId != null">
+                #{entId,jdbcType=BIGINT},
+            </if>
+            <if test="lOrderId != null">
+                #{lOrderId,jdbcType=BIGINT},
+            </if>
+            <if test="wOrderNo != null">
+                #{wOrderNo,jdbcType=VARCHAR},
+            </if>
+            <if test="truckNo != null">
+                #{truckNo,jdbcType=VARCHAR},
+            </if>
+            <if test="driverId != null">
+                #{driverId,jdbcType=BIGINT},
+            </if>
+            <if test="entrustAmount != null">
+                #{entrustAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="unloadAmount != null">
+                #{unloadAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="loadAmount != null">
+                #{loadAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="deficitAmount != null">
+                #{deficitAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="remark != null">
+                #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                #{status,jdbcType=INTEGER},
+            </if>
+            <if test="createBy != null">
+                #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=INTEGER},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.sckw.transport.model.KwtWaybillOrder">
+        update kwt_waybill_order
+        <set>
+            <if test="entId != null">
+                ent_id = #{entId,jdbcType=BIGINT},
+            </if>
+            <if test="lOrderId != null">
+                l_order_id = #{lOrderId,jdbcType=BIGINT},
+            </if>
+            <if test="wOrderNo != null">
+                w_order_no = #{wOrderNo,jdbcType=VARCHAR},
+            </if>
+            <if test="truckNo != null">
+                truck_no = #{truckNo,jdbcType=VARCHAR},
+            </if>
+            <if test="driverId != null">
+                driver_id = #{driverId,jdbcType=BIGINT},
+            </if>
+            <if test="entrustAmount != null">
+                entrust_amount = #{entrustAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="unloadAmount != null">
+                unload_amount = #{unloadAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="loadAmount != null">
+                load_amount = #{loadAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="deficitAmount != null">
+                deficit_amount = #{deficitAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="remark != null">
+                remark = #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                `status` = #{status,jdbcType=INTEGER},
+            </if>
+            <if test="createBy != null">
+                create_by = #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                update_by = #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                update_time = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                del_flag = #{delFlag,jdbcType=INTEGER},
+            </if>
+        </set>
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.sckw.transport.model.KwtWaybillOrder">
+        update kwt_waybill_order
+        set ent_id = #{entId,jdbcType=BIGINT},
+            l_order_id = #{lOrderId,jdbcType=BIGINT},
+            w_order_no = #{wOrderNo,jdbcType=VARCHAR},
+            truck_no = #{truckNo,jdbcType=VARCHAR},
+            driver_id = #{driverId,jdbcType=BIGINT},
+            entrust_amount = #{entrustAmount,jdbcType=DECIMAL},
+            unload_amount = #{unloadAmount,jdbcType=DECIMAL},
+            load_amount = #{loadAmount,jdbcType=DECIMAL},
+            deficit_amount = #{deficitAmount,jdbcType=DECIMAL},
+            remark = #{remark,jdbcType=VARCHAR},
+            `status` = #{status,jdbcType=INTEGER},
+            create_by = #{createBy,jdbcType=BIGINT},
+            create_time = #{createTime,jdbcType=TIMESTAMP},
+            update_by = #{updateBy,jdbcType=BIGINT},
+            update_time = #{updateTime,jdbcType=TIMESTAMP},
+            del_flag = #{delFlag,jdbcType=INTEGER}
+        where id = #{id,jdbcType=BIGINT}
+    </update>
 </mapper>

+ 19 - 194
sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderTicketMapper.xml

@@ -1,199 +1,24 @@
 <?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.KwtWaybillOrderTicketMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtWaybillOrderTicket">
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="order_id" jdbcType="BIGINT" property="orderId" />
-    <result column="type" jdbcType="INTEGER" property="type" />
-    <result column="amount" jdbcType="DECIMAL" property="amount" />
-    <result column="gross_amount" jdbcType="DECIMAL" property="grossAmount" />
-    <result column="tare_amount" jdbcType="DECIMAL" property="tareAmount" />
-    <result column="urls" jdbcType="VARCHAR" property="urls" />
-    <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, order_id, `type`, amount, gross_amount, tare_amount, urls, remark, `status`, 
+    <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtWaybillOrderTicket">
+        <id column="id" jdbcType="BIGINT" property="id" />
+        <result column="w_order_id" jdbcType="BIGINT" property="wOrderId" />
+        <result column="type" jdbcType="INTEGER" property="type" />
+        <result column="amount" jdbcType="DECIMAL" property="amount" />
+        <result column="gross_amount" jdbcType="DECIMAL" property="grossAmount" />
+        <result column="tare_amount" jdbcType="DECIMAL" property="tareAmount" />
+        <result column="urls" jdbcType="VARCHAR" property="urls" />
+        <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, w_order_id, `type`, amount, gross_amount, tare_amount, urls, remark, `status`,
     create_by, create_time, update_by, update_time, del_flag
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from kwt_waybill_order_ticket
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    delete from kwt_waybill_order_ticket
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <insert id="insert" parameterType="com.sckw.transport.model.KwtWaybillOrderTicket">
-    insert into kwt_waybill_order_ticket (id, order_id, `type`, 
-      amount, gross_amount, tare_amount, 
-      urls, remark, `status`, 
-      create_by, create_time, update_by, 
-      update_time, del_flag)
-    values (#{id,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, 
-      #{amount,jdbcType=DECIMAL}, #{grossAmount,jdbcType=DECIMAL}, #{tareAmount,jdbcType=DECIMAL}, 
-      #{urls,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
-      #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER})
-  </insert>
-  <insert id="insertSelective" parameterType="com.sckw.transport.model.KwtWaybillOrderTicket">
-    insert into kwt_waybill_order_ticket
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="orderId != null">
-        order_id,
-      </if>
-      <if test="type != null">
-        `type`,
-      </if>
-      <if test="amount != null">
-        amount,
-      </if>
-      <if test="grossAmount != null">
-        gross_amount,
-      </if>
-      <if test="tareAmount != null">
-        tare_amount,
-      </if>
-      <if test="urls != null">
-        urls,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="status != null">
-        `status`,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
-      <if test="orderId != null">
-        #{orderId,jdbcType=BIGINT},
-      </if>
-      <if test="type != null">
-        #{type,jdbcType=INTEGER},
-      </if>
-      <if test="amount != null">
-        #{amount,jdbcType=DECIMAL},
-      </if>
-      <if test="grossAmount != null">
-        #{grossAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="tareAmount != null">
-        #{tareAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="urls != null">
-        #{urls,jdbcType=VARCHAR},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=INTEGER},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.transport.model.KwtWaybillOrderTicket">
-    update kwt_waybill_order_ticket
-    <set>
-      <if test="orderId != null">
-        order_id = #{orderId,jdbcType=BIGINT},
-      </if>
-      <if test="type != null">
-        `type` = #{type,jdbcType=INTEGER},
-      </if>
-      <if test="amount != null">
-        amount = #{amount,jdbcType=DECIMAL},
-      </if>
-      <if test="grossAmount != null">
-        gross_amount = #{grossAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="tareAmount != null">
-        tare_amount = #{tareAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="urls != null">
-        urls = #{urls,jdbcType=VARCHAR},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=INTEGER},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.sckw.transport.model.KwtWaybillOrderTicket">
-    update kwt_waybill_order_ticket
-    set order_id = #{orderId,jdbcType=BIGINT},
-      `type` = #{type,jdbcType=INTEGER},
-      amount = #{amount,jdbcType=DECIMAL},
-      gross_amount = #{grossAmount,jdbcType=DECIMAL},
-      tare_amount = #{tareAmount,jdbcType=DECIMAL},
-      urls = #{urls,jdbcType=VARCHAR},
-      remark = #{remark,jdbcType=VARCHAR},
-      `status` = #{status,jdbcType=INTEGER},
-      create_by = #{createBy,jdbcType=BIGINT},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=BIGINT},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=INTEGER}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
+    </sql>
 </mapper>

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

@@ -3,7 +3,7 @@
 <mapper namespace="com.sckw.transport.dao.KwtWaybillOrderTrackMapper">
   <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtWaybillOrderTrack">
     <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="order_id" jdbcType="BIGINT" property="orderId" />
+    <result column="w_order_id" jdbcType="BIGINT" property="wOrderId" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />