瀏覽代碼

1、司机接口调整
2、派车接口调整

zk 2 年之前
父節點
當前提交
5b841be57d

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

@@ -1,11 +1,13 @@
 package com.sckw.mongo.model;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 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 org.springframework.data.mongodb.core.mapping.Field;
 
 import java.math.BigDecimal;
 import java.util.Date;

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

@@ -153,6 +153,6 @@ public class KwfDriverVo {
     private int status;
 
     public String getStatusName() {
-        return status == 1 ? "已认证" : status == 2 ? "临时" : "异常";
+        return status == 1 ? "正常" : status == 2 ? "临时" : "异常";
     }
 }

+ 2 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckReportVo.java

@@ -145,13 +145,13 @@ public class KwfTruckReportVo {
      * 上报时间
      */
     @ExcelProperty(value = "上报时间")
-    private Date createTime;
+    private String createTime;
 
     /**
      * 更新时间
      */
     @ExcelProperty(value = "更新时间")
-    private Date updateTime;
+    private String updateTime;
 
     /**
      * 备注

+ 4 - 4
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckVo.java

@@ -121,13 +121,13 @@ public class KwfTruckVo {
      * 注册日期
      */
     @ExcelProperty(value = "注册日期")
-    private Date regTime;
+    private String regTime;
 
     /**
      * 发证日期
      */
     @ExcelProperty(value = "发证日期")
-    private Date grantTime;
+    private String grantTime;
 
     /**
      * 发证机关
@@ -199,7 +199,7 @@ public class KwfTruckVo {
      * 创建时间
      */
     @ExcelProperty(value = "创建时间")
-    private Date createTime;
+    private String createTime;
 
     /**
      * 备注
@@ -208,6 +208,6 @@ public class KwfTruckVo {
     private String remark;
 
     public String getStatusName() {
-        return status == 1 ? "已认证" : status == 2 ? "临时" : "异常";
+        return status == 1 ? "正常" : status == 2 ? "临时" : "异常";
     }
 }

+ 20 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckReportService.java

@@ -3,6 +3,7 @@ package com.sckw.fleet.service;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.utils.BeanUtils;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.RegularUtils;
 import com.sckw.core.utils.StringUtils;
@@ -83,14 +84,31 @@ public class KwfTruckReportService {
         }
 
         /**全部数据-处理**/
+        List<KwfTableTopCount> countList = new ArrayList();
         KwfTableTopCount allCount = new KwfTableTopCount();
         allCount.setValue(String.valueOf(Global.NUMERICAL_ZERO));
         allCount.setTotal(tatol);
-        counts.add(allCount);
+        allCount.setName("全部");
+        countList.add(allCount);
+
+        /**数据处理**/
+        Map<String, Integer> statusMap = new HashMap(){{put("正常", 1); put("临时", 2); put("异常", 3);}};
+        for(Map.Entry<String, Integer> entry:statusMap.entrySet()){
+            System.out.println(entry.getKey()+"--->"+entry.getValue());
+            KwfTableTopCount count = new KwfTableTopCount();
+            for (KwfTableTopCount topCount:counts) {
+                if (Integer.parseInt(topCount.getValue()) == entry.getValue()) {
+                    BeanUtils.copyProperties(topCount, count);
+                }
+            }
+            count.setName(entry.getKey());
+            count.setValue(String.valueOf(entry.getValue()));
+            countList.add(count);
+        }
 
         /**数据组装**/
         Map tableCount = new HashMap();
-        tableCount.put("tableTop", counts);
+        tableCount.put("tableTop", countList);
         tableCount.put("tableBottom", tatol);
         return tableCount;
     }

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

@@ -75,14 +75,31 @@ public class KwfTruckService {
         }
 
         /**全部数据-处理**/
+        List<KwfTableTopCount> countList = new ArrayList();
         KwfTableTopCount allCount = new KwfTableTopCount();
         allCount.setValue(String.valueOf(Global.NUMERICAL_ZERO));
         allCount.setTotal(tatol);
-        counts.add(allCount);
+        allCount.setName("全部");
+        countList.add(allCount);
+
+        /**数据处理**/
+        Map<String, Integer> statusMap = new HashMap(){{put("正常", 1); put("临时", 2); put("异常", 3);}};
+        for(Map.Entry<String, Integer> entry:statusMap.entrySet()){
+            System.out.println(entry.getKey()+"--->"+entry.getValue());
+            KwfTableTopCount count = new KwfTableTopCount();
+            for (KwfTableTopCount topCount:counts) {
+                if (Integer.parseInt(topCount.getValue()) == entry.getValue()) {
+                    BeanUtils.copyProperties(topCount, count);
+                }
+            }
+            count.setName(entry.getKey());
+            count.setValue(String.valueOf(entry.getValue()));
+            countList.add(count);
+        }
 
         /**数据组装**/
         Map tableCount = new HashMap();
-        tableCount.put("tableTop", counts);
+        tableCount.put("tableTop", countList);
         tableCount.put("tableBottom", tatol);
         return tableCount;
     }

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

@@ -97,6 +97,14 @@
         <if test="endTime != null and endTime != '' " >
             and DATE( dr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
         </if>
+        <choose>
+            <when test="ids != null">
+                and dr.id in
+                <foreach collection="ids" item="id" open="(" close=")" separator=",">
+                    #{id,jdbcType=BIGINT}
+                </foreach>
+            </when>
+        </choose>
         <if test="keywords != null and keywords != ''">
             and (
             dr.name like concat('%',#{keywords},'%')

+ 8 - 0
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml

@@ -97,6 +97,14 @@
         <if test="endTime != null and endTime != '' " >
             and DATE( tr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
         </if>
+        <choose>
+            <when test="ids != null">
+                and tr.id in
+                <foreach collection="ids" item="id" open="(" close=")" separator=",">
+                    #{id,jdbcType=BIGINT}
+                </foreach>
+            </when>
+        </choose>
         <if test="keywords != null and keywords != ''">
             and (
             tr.truck_no like concat('%',#{keywords},'%')

+ 8 - 0
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckReportMapper.xml

@@ -82,6 +82,14 @@
         <if test="endTime != null and endTime != '' " >
             and DATE( trr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
         </if>
+        <choose>
+            <when test="ids != null">
+                and trr.id in
+                <foreach collection="ids" item="id" open="(" close=")" separator=",">
+                    #{id,jdbcType=BIGINT}
+                </foreach>
+            </when>
+        </choose>
         <if test="keywords != null and keywords != ''">
             and (
             tr.truck_no like concat('%',#{keywords},'%')

+ 1 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtWaybillOrderAddressMapper.java

@@ -1,11 +1,11 @@
 package com.sckw.transport.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.sckw.transport.model.KwtLogisticsOrderAddress;
 import com.sckw.transport.model.KwtWaybillOrderAddress;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper
 public interface KwtWaybillOrderAddressMapper extends BaseMapper<KwtWaybillOrderAddress> {
 
+    int insert1(KwtWaybillOrderAddress params);
 }

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

@@ -70,16 +70,6 @@ public class KwtLogisticsOrderCirculate extends BaseModel {
      */
     private String driverIdcard;
 
-    /**
-     * 标准荷载(净重)
-     */
-    private BigDecimal actualAmount;
-
-    /**
-     * 委托量
-     */
-    private BigDecimal entrustAmount;
-
     /**
      * 计划开始时间
      */
@@ -90,4 +80,9 @@ public class KwtLogisticsOrderCirculate extends BaseModel {
      */
     private Date endTime;
 
+    /**
+     * 委托量
+     */
+    private BigDecimal entrustAmount;
+
 }

+ 35 - 13
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillOrderService.java

@@ -5,6 +5,7 @@ import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.CarWaybillEnum;
 import com.sckw.core.model.enums.LogisticsOrderEnum;
 import com.sckw.core.utils.BeanUtils;
+import com.sckw.core.utils.IdWorker;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.mongo.enums.BusinessTypeEnum;
@@ -44,6 +45,8 @@ public class KwtWaybillOrderService {
     KwtLogisticsOrderUnitMapper logisticsOrderUnitDao;
     @Autowired
     KwtLogisticsOrderGoodsMapper logisticsOrderGoodsDao;
+    @Autowired
+    KwtLogisticsOrderCirculateMapper logisticsOrderCirculateDao;
     @Resource
     private StreamBridge streamBridge;
 
@@ -135,17 +138,29 @@ public class KwtWaybillOrderService {
 
             /**数据存储**/
             if (sendCarDto.getType() == Global.NUMERICAL_ONE) {
-                //趟次派车存储
-                ranksSave(waybillOrder, loadAddress, unloadAddress);
+
+                for (int i=0; i<sendCarDto.getCount(); i++) {
+                    //趟次派车存储
+                    ranksSave(waybillOrder, loadAddress, unloadAddress);
+
+                    /**SckwWaybillOrder数据组装**/
+                    SckwWaybillOrder mongoOrder = setSckwWaybillOrder(sendCarDto, waybillOrder, logisticsOrder, loadAddress,
+                            unloadAddress, checkEnt, carrierEnt, goods);
+                    sckwWaybillOrders.add(mongoOrder);
+                }
             } else {
                 //循环派车存储
-                circulateSave(waybillOrder);
+                boolean bool = circulateSave(waybillOrder);
+                if (bool) {
+                    /**SckwWaybillOrder数据组装**/
+                    SckwWaybillOrder mongoOrder = setSckwWaybillOrder(sendCarDto, waybillOrder, logisticsOrder, loadAddress,
+                            unloadAddress, checkEnt, carrierEnt, goods);
+                    sckwWaybillOrders.add(mongoOrder);
+                }
             }
 
-            /**SckwWaybillOrder数据组装**/
-            SckwWaybillOrder mongoOrder = setSckwWaybillOrder(sendCarDto, waybillOrder, logisticsOrder, loadAddress,
-                    unloadAddress, checkEnt, carrierEnt, goods);
-            sckwWaybillOrders.add(mongoOrder);
+
+
         }
 
         /**Mongodb数据存储**/
@@ -158,7 +173,7 @@ public class KwtWaybillOrderService {
             busSum.setMethod(1);
             //业务汇总数据对象
             busSum.setObject(waybillOrder);
-            streamBridge.send("sckw-busSum", JSON.toJSONString(busSum));
+            streamBridge.send("sckw-busSum", busSum);
         }
 
         return HttpResult.ok();
@@ -175,21 +190,25 @@ public class KwtWaybillOrderService {
      **/
     public void ranksSave(KwtWaybillOrder waybillOrder, KwtWaybillOrderAddress loadAddress, KwtWaybillOrderAddress unloadAddress) {
         /**车辆运单信息**/
+        waybillOrder.setId(null);
         waybillOrderDao.insert(waybillOrder);
 
         /**车辆运单地址信息**/
+        loadAddress.setId(null);
         loadAddress.setWOrderId(waybillOrder.getId());
+        loadAddress.setCreateTime(waybillOrder.getCreateTime());
+        loadAddress.setUpdateTime(waybillOrder.getUpdateTime());
         waybillOrderAddressDao.insert(loadAddress);
+        unloadAddress.setId(null);
         unloadAddress.setWOrderId(waybillOrder.getId());
+        unloadAddress.setCreateTime(waybillOrder.getCreateTime());
+        unloadAddress.setUpdateTime(waybillOrder.getUpdateTime());
         waybillOrderAddressDao.insert(unloadAddress);
 
         /**车辆运单状态记录**/
         this.setWaybillOrderTrack(waybillOrder.getId(), waybillOrder.getStatus());
     }
 
-    @Autowired
-    KwtLogisticsOrderCirculateMapper logisticsOrderCirculateDao;
-
     /**
      * @param waybillOrder 车辆订单信息
      * @desc 循环派车数据存储
@@ -207,7 +226,7 @@ public class KwtWaybillOrderService {
             int count = logisticsOrderCirculateDao.insert(circulate);
             return count > 0 ? true : false;
         }
-        return true;
+        return false;
     }
 
     /**
@@ -268,6 +287,9 @@ public class KwtWaybillOrderService {
         waybillOrder.setDriverPhone(sendCarDto.getDriverPhone());
         waybillOrder.setDriverIdcard(sendCarDto.getDriverIdcard());
         waybillOrder.setEntrustAmount(new BigDecimal(sendCarDto.getEntrustAmount()));
+        waybillOrder.setUnloadAmount(new BigDecimal(Global.AMOUNT));
+        waybillOrder.setLoadAmount(new BigDecimal(Global.AMOUNT));
+        waybillOrder.setDeficitAmount(new BigDecimal(Global.AMOUNT));
         waybillOrder.setStatus(CarWaybillEnum.PENDING_ORDER.getCode());
         return waybillOrder;
     }
@@ -290,7 +312,7 @@ public class KwtWaybillOrderService {
                                                 KwtLogisticsOrderUnit carrierEnt, KwtLogisticsOrderGoods goods) {
         //基础信息
         SckwWaybillOrder order = new SckwWaybillOrder();
-        order.set_id(waybillOrder.getId());
+        order.set_id(new IdWorker(1).nextId());
         order.setWOrderId(waybillOrder.getId());
         order.setWOrderNo(waybillOrder.getWOrderNo());
         order.setLOrderId(logisticsOrder.getId());

+ 16 - 8
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderCirculateMapper.xml

@@ -6,12 +6,16 @@
         <result column="ent_id" jdbcType="BIGINT" property="entId" />
         <result column="l_order_id" jdbcType="BIGINT" property="lOrderId" />
         <result column="w_order_id" jdbcType="BIGINT" property="wOrderId" />
+        <result column="type" jdbcType="VARCHAR" property="type" />
+        <result column="truck_id" jdbcType="BIGINT" property="truckId" />
         <result column="truck_no" jdbcType="VARCHAR" property="truckNo" />
         <result column="driver_id" jdbcType="BIGINT" property="driverId" />
-        <result column="type" jdbcType="BIGINT" property="type" />
-        <result column="actual_amount" jdbcType="DECIMAL" property="actualAmount" />
+        <result column="driver_name" jdbcType="VARCHAR" property="driverName" />
+        <result column="driver_phone" jdbcType="VARCHAR" property="driverPhone" />
+        <result column="driver_idcard" jdbcType="VARCHAR" property="driverIdcard" />
+        <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
+        <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
         <result column="entrust_amount" jdbcType="DECIMAL" property="entrustAmount" />
-        <result column="entrust_date" jdbcType="TIMESTAMP" property="entrustDate" />
         <result column="remark" jdbcType="VARCHAR" property="remark" />
         <result column="status" jdbcType="INTEGER" property="status" />
         <result column="create_by" jdbcType="BIGINT" property="createBy" />
@@ -20,10 +24,13 @@
         <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
         <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
     </resultMap>
+
     <sql id="Base_Column_List">
-        id, ent_id, l_order_id, w_order_id, truck_no,type, driver_id, actual_amount, entrust_amount,
-    entrust_date, remark, `status`, create_by, create_time, update_by, update_time, del_flag
+        `id`, `ent_id`, `l_order_id`, `w_order_id`, `type`, `truck_id`, `truck_no`, `driver_id`,
+        `driver_name`, `driver_phone`, `driver_idcard`, `start_time`, `end_time`, `entrust_amount`,
+        `remark`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`
     </sql>
+
     <select id="selectDriverOrderByStatus" resultType="java.lang.Long">
         SELECT b.w_order_id as wOrderId
         FROM kwt_waybill_order a
@@ -44,9 +51,10 @@
 
     <select id="findCirculate" resultType="com.sckw.transport.model.KwtLogisticsOrderCirculate" >
         select
-        id, ent_id entId, l_order_id lOrderId, w_order_id wOrderId, truck_no truckNo,type, driver_id driverId,
-        actual_amount actualAmount, entrust_amount entrustAmount, entrust_date entrustDate, remark, `status`,
-        create_by createBy, create_time createTime, update_by updateBy, update_time updateTime
+        id, ent_id entId, l_order_id lOrderId, w_order_id wOrderId, type, truck_id truckId,
+        truck_no truckNo, driver_id driverId, driver_name driverName, driver_phone driverPhone,
+        driver_idcard driverIdcard, start_time startTime, end_time endTime, entrust_amount entrustAmount,
+        remark, status, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime
         from kwt_logistics_order_circulate
         where del_flag = 0
         and l_order_id = #{lOrderId, jdbcType=BIGINT}

+ 134 - 0
sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderAddressMapper.xml

@@ -31,4 +31,138 @@
         , create_by, create_time, update_by, update_time, del_flag
 
     </sql>
+
+    <insert id="insert1" parameterType="com.sckw.transport.model.KwtWaybillOrderAddress">
+        insert into kwt_waybill_order_address
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                `id`,
+            </if>
+            <if test="wOrderId != null">
+                `w_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="wOrderId != null">
+                #{wOrderId,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>
 </mapper>