Browse Source

'进口矿'

HUJIANGUO 3 years ago
parent
commit
1dc9d0be4b

+ 3 - 4
src/main/java/com/steerinfo/dil/controller/OmstruckOrderController.java

@@ -38,8 +38,7 @@ import java.util.*;
  */
 @RestController
 @RequestMapping("/${api.version}/omstruckorders")
-public class
-OmstruckOrderController extends BaseRESTfulController {
+public class OmstruckOrderController extends BaseRESTfulController {
 
     @Autowired
     IOmstruckOrderService omstruckOrderService;
@@ -512,8 +511,8 @@ OmstruckOrderController extends BaseRESTfulController {
             @ApiImplicitParam(name = "planId", value = "运输计划Id", required = false, dataType = "Integer"),
     })
     @PostMapping("/dispatchOrder")
-    public RESTfulResult dispatchOrder(@RequestBody(required = false) Map<String, Object> map) {
-        int i = omstruckOrderService.dispatchOrder(map);
+    public RESTfulResult dispatchOrder(@RequestBody(required = false) Map<String, Object> mapValue) {
+        int i = omstruckOrderService.dispatchOrder(mapValue);
         return success(i);
     }
 

+ 3 - 2
src/main/java/com/steerinfo/dil/controller/OmstruckOrderSeparateController.java

@@ -71,7 +71,8 @@ public class OmstruckOrderSeparateController extends BaseRESTfulController {
      * @param map
      */
     @PostMapping("/pushMesToWebsocket")
-    public void pushMesToWebsocket(@RequestBody Map<String,Object> map) {
-        omstruckOrderSeparateService.pushMesToWebsocket(map);
+    public RESTfulResult pushMesToWebsocket(@RequestBody Map<String,Object> map) {
+        String s = omstruckOrderSeparateService.pushMesToWebsocket(map);
+        return success(s);
     }
 }

+ 0 - 15
src/main/java/com/steerinfo/dil/model/OmstruckOrder.java

@@ -122,12 +122,6 @@ public class OmstruckOrder implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="预计进厂时间",required=false)
     private Date orderEntryTime;
 
-    /**
-     * 司机排班id(DRIVER_CAPACITY_ID,DECIMAL,0)
-     */
-    @ApiModelProperty(value="司机排班id",required=false)
-    private BigDecimal driverCapacityId;
-
     /**
      * 卸货点ID(UNLOAD_POINT_ID,DECIMAL,0)
      */
@@ -304,14 +298,6 @@ public class OmstruckOrder implements IBasePO<BigDecimal> {
         this.orderEntryTime = orderEntryTime;
     }
 
-    public BigDecimal getDriverCapacityId() {
-        return driverCapacityId;
-    }
-
-    public void setDriverCapacityId(BigDecimal driverCapacityId) {
-        this.driverCapacityId = driverCapacityId;
-    }
-
     public BigDecimal getUnloadPointId() {
         return unloadPointId;
     }
@@ -353,7 +339,6 @@ public class OmstruckOrder implements IBasePO<BigDecimal> {
         sb.append(", orderLineSequence=").append(orderLineSequence);
         sb.append(", lineId=").append(lineId);
         sb.append(", orderEntryTime=").append(orderEntryTime);
-        sb.append(", driverCapacityId=").append(driverCapacityId);
         sb.append(", unloadPointId=").append(unloadPointId);
         sb.append(", driverConfirmation=").append(driverConfirmation);
         sb.append(", serialVersionUID=").append(serialVersionUID);

+ 1 - 1
src/main/java/com/steerinfo/dil/service/IOmstruckOrderService.java

@@ -54,7 +54,7 @@ public interface IOmstruckOrderService {
     int updateOrder(Map<String, Object> map);
 
     //分派运单给司机
-    int dispatchOrder(Map<String, Object> map);
+    int dispatchOrder(Map<String, Object> mapValue);
 
     //下发订单给司机
     int dispatchOrderForSale(Map<String, Object> map);

+ 2 - 1
src/main/java/com/steerinfo/dil/service/impl/OmstruckOrderSeparateServiceImpl.java

@@ -157,7 +157,7 @@ public class OmstruckOrderSeparateServiceImpl implements IOmstruckOrderSeparateS
      * orderId  订单Id  (unloadPointId)卸货点Id
      * @return
      */
-    public void pushMesToWebsocket(Map<String, Object> map) {
+    public String pushMesToWebsocket(Map<String, Object> map) {
         Map<String, Object> mesMap = omstruckOrderMapper.pushMesToWebsocket(map);
         BigDecimal newOrderId = (BigDecimal) map.get("newOrderId");
         if (newOrderId != null) {
@@ -181,6 +181,7 @@ public class OmstruckOrderSeparateServiceImpl implements IOmstruckOrderSeparateS
         sendMap.put("messages", list);
         String s = imFeign.sendToUser(sendMap);
         System.out.println(s);
+        return s;
     }
 
     /**

+ 24 - 17
src/main/java/com/steerinfo/dil/service/impl/OmstruckOrderServiceImpl.java

@@ -119,6 +119,7 @@ public class OmstruckOrderServiceImpl implements IOmstruckOrderService {
             case 11:
 
         }
+
         return i;
     }
 
@@ -153,6 +154,7 @@ public class OmstruckOrderServiceImpl implements IOmstruckOrderService {
             tmsTruckFeign.addTotalResult(capacityMap);
             //更改运力状态
         }
+//        pushMesToWebsocket();
         return count;
     }
 
@@ -175,8 +177,8 @@ public class OmstruckOrderServiceImpl implements IOmstruckOrderService {
             amsFeign.updateMaterial(map); //更改运输计划子表 增加已分配重量 减少未分配重量  feign调用ams
         }
         //添加运力Id
-        BigDecimal driverCapacityId = DataChange.dataToBigDecimal(map.get("driverCapacityId"));
-        omstruckOrder.setDriverCapacityId(driverCapacityId);
+        BigDecimal capacityId = DataChange.dataToBigDecimal(map.get("capacityId"));
+        omstruckOrder.setCapacityId(capacityId);
         //新增运输订单
         omstruckOrderMapper.insertSelective(omstruckOrder);
         //更新运力状态为待运输:2
@@ -429,24 +431,31 @@ public class OmstruckOrderServiceImpl implements IOmstruckOrderService {
      * 运单派发
      * 运单ID
      *
-     * @param map
+     * @param mapValue
      * @return
      */
     @Override
     @Transactional
-    public int dispatchOrder(Map<String, Object> map) {
-        OmstruckOrder omstruckOrder = new OmstruckOrder();
-        omstruckOrder.setOrderId(DataChange.dataToBigDecimal(map.get("orderId")));
-        //设置状态为已下发:4
-        //生成订单下发时间 修改订单表
-        //添加卸货点ID
-        if (map.get("unloadPointId") != null) {
-            omstruckOrder.setUnloadPointId(DataChange.dataToBigDecimal(map.get("unloadPointId")));
+    public int dispatchOrder(Map<String, Object> mapValue) {
+        List<Map<String,Object>> mapList = (List<Map<String, Object>>) mapValue.get("mapList");
+        BigDecimal unloadPointId = DataChange.dataToBigDecimal(mapValue.get("unloadPointId"));
+        int result = 0;
+        for (Map<String, Object> map : mapList) {
+            Integer orderId = (Integer) map.get("orderId");
+            OmstruckOrder omstruckOrder = omstruckOrderMapper.selectByPrimaryKey(new BigDecimal(orderId));
+            //添加卸货点ID
+            if (unloadPointId != null) {
+                omstruckOrder.setUnloadPointId(unloadPointId);
+            }
+            //生成订单下发时间 修改订单表
+            omstruckOrder.setOrderIssueTime(new Date());
+            //设置状态为已下发:4
+            omstruckOrder.setOrderStatus(new BigDecimal(4));
+            //下发 推送数据给 websocket
+            pushMesToWebsocket(map);
+            result += omstruckOrderMapper.updateByPrimaryKeySelective(omstruckOrder);
         }
-        omstruckOrder.setOrderIssueTime(new Date());
-        omstruckOrder.setOrderStatus(new BigDecimal(4));
-        pushMesToWebsocket(map); //下发 推送数据给 websocket
-        return omstruckOrderMapper.updateByPrimaryKeySelective(omstruckOrder);
+        return result;
     }
 
     /**
@@ -1253,7 +1262,6 @@ public class OmstruckOrderServiceImpl implements IOmstruckOrderService {
             omstruckOrder.setDeleted(new BigDecimal(0));
             omstruckOrder.setOrderType(new BigDecimal(orderType));
             omstruckOrder.setLineId(new BigDecimal(lineId));
-            omstruckOrder.setDriverCapacityId(rmsDriverCapacity.getDriverCapacityId());
             result +=omstruckOrderMapper.insertSelective(omstruckOrder);
             OmstruckOrderMaterial omstruckOrderMaterial = new OmstruckOrderMaterial();
             BigDecimal orderMaterialId = omstruckOrderMaterialMapper.selectMaxId();
@@ -1486,7 +1494,6 @@ public class OmstruckOrderServiceImpl implements IOmstruckOrderService {
             omstruckOrder.setDeleted(new BigDecimal(0));
             omstruckOrder.setOrderType(new BigDecimal(orderType));
             omstruckOrder.setLineId(new BigDecimal(lineId));
-            omstruckOrder.setDriverCapacityId(rmsDriverCapacity.getDriverCapacityId());
             result +=omstruckOrderMapper.insertSelective(omstruckOrder);
             OmstruckOrderMaterial omstruckOrderMaterial = new OmstruckOrderMaterial();
             BigDecimal orderMaterialId = omstruckOrderMaterialMapper.selectMaxId();

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -49,7 +49,7 @@ openfeign:
   AmsFeign:
     url: ${AMSFEIGN_URL:localhost:8079}
   Im:
-    url: ${AMSFEIGN_URL:172.16.33.161:8888}
+    url: ${AMSFEIGN_URL:172.16.33.161:8099}
 
 mybatis:
   type-aliases-package: com.steerinfo.dil.model

+ 79 - 155
src/main/resources/com/steerinfo/dil/mapper/OmstruckOrderMapper.xml

@@ -2,52 +2,46 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.steerinfo.dil.mapper.OmstruckOrderMapper">
     <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.OmstruckOrder">
-        <id column="ORDER_ID" jdbcType="DECIMAL" property="orderId"/>
-        <result column="ORDER_PLAN_ID" jdbcType="DECIMAL" property="orderPlanId"/>
-        <result column="ORDER_NUMBER" jdbcType="VARCHAR" property="orderNumber"/>
-        <result column="CAPACITY_ID" jdbcType="DECIMAL" property="capacityId"/>
-        <result column="ORDER_ISSUE_TIME" jdbcType="TIMESTAMP" property="orderIssueTime"/>
-        <result column="ORDER_RECEIVE_STATUS" jdbcType="DECIMAL" property="orderReceiveStatus"/>
-        <result column="ORDER_RECEIVE_REFUSE_TIME" jdbcType="TIMESTAMP" property="orderReceiveRefuseTime"/>
-        <result column="ORDER_COMMUNICATION_DURATION" jdbcType="DECIMAL" property="orderCommunicationDuration"/>
-        <result column="ORDER_STATUS" jdbcType="DECIMAL" property="orderStatus"/>
-        <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
-        <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
-        <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
-        <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
-        <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
-        <result column="DELETED" jdbcType="DECIMAL" property="deleted"/>
-        <result column="ORDER_TYPE" jdbcType="DECIMAL" property="orderType"/>
-        <result column="ORDER_LINE_SEQUENCE" jdbcType="DECIMAL" property="orderLineSequence"/>
-        <result column="LINE_ID" jdbcType="DECIMAL" property="lineId"/>
-        <result column="ORDER_ENTRY_TIME" jdbcType="TIMESTAMP" property="orderEntryTime"/>
-        <result column="DRIVER_CAPACITY_ID" jdbcType="DECIMAL" property="driverCapacityId"/>
-        <result column="UNLOAD_POINT_ID" jdbcType="DECIMAL" property="unloadPointId"/>
-        <result column="DRIVER_CONFIRMATION" jdbcType="DECIMAL" property="driverConfirmation"/>
+        <id column="ORDER_ID" jdbcType="DECIMAL" property="orderId" />
+        <result column="ORDER_PLAN_ID" jdbcType="DECIMAL" property="orderPlanId" />
+        <result column="ORDER_NUMBER" jdbcType="VARCHAR" property="orderNumber" />
+        <result column="CAPACITY_ID" jdbcType="DECIMAL" property="capacityId" />
+        <result column="ORDER_ISSUE_TIME" jdbcType="TIMESTAMP" property="orderIssueTime" />
+        <result column="ORDER_RECEIVE_STATUS" jdbcType="DECIMAL" property="orderReceiveStatus" />
+        <result column="ORDER_RECEIVE_REFUSE_TIME" jdbcType="TIMESTAMP" property="orderReceiveRefuseTime" />
+        <result column="ORDER_COMMUNICATION_DURATION" jdbcType="DECIMAL" property="orderCommunicationDuration" />
+        <result column="ORDER_STATUS" jdbcType="DECIMAL" property="orderStatus" />
+        <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+        <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+        <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+        <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+        <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+        <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
+        <result column="ORDER_TYPE" jdbcType="DECIMAL" property="orderType" />
+        <result column="ORDER_LINE_SEQUENCE" jdbcType="DECIMAL" property="orderLineSequence" />
+        <result column="LINE_ID" jdbcType="DECIMAL" property="lineId" />
+        <result column="ORDER_ENTRY_TIME" jdbcType="TIMESTAMP" property="orderEntryTime" />
+        <result column="UNLOAD_POINT_ID" jdbcType="DECIMAL" property="unloadPointId" />
+        <result column="DRIVER_CONFIRMATION" jdbcType="DECIMAL" property="driverConfirmation" />
     </resultMap>
     <sql id="columns">
-        ORDER_ID, ORDER_PLAN_ID, ORDER_NUMBER, CAPACITY_ID, ORDER_ISSUE_TIME, ORDER_RECEIVE_STATUS, 
-    ORDER_RECEIVE_REFUSE_TIME, ORDER_COMMUNICATION_DURATION, ORDER_STATUS, INSERT_USERNAME, 
-    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, ORDER_TYPE, 
-    ORDER_LINE_SEQUENCE, LINE_ID, ORDER_ENTRY_TIME, DRIVER_CAPACITY_ID, UNLOAD_POINT_ID, 
-    DRIVER_CONFIRMATION
+        ORDER_ID, ORDER_PLAN_ID, ORDER_NUMBER, CAPACITY_ID, ORDER_ISSUE_TIME, ORDER_RECEIVE_STATUS,
+    ORDER_RECEIVE_REFUSE_TIME, ORDER_COMMUNICATION_DURATION, ORDER_STATUS, INSERT_USERNAME,
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, ORDER_TYPE,
+    ORDER_LINE_SEQUENCE, LINE_ID, ORDER_ENTRY_TIME, UNLOAD_POINT_ID, DRIVER_CONFIRMATION
     </sql>
     <sql id="columns_alias">
-        t.ORDER_ID, t.ORDER_PLAN_ID, t.ORDER_NUMBER, t.CAPACITY_ID, t.ORDER_ISSUE_TIME, t.ORDER_RECEIVE_STATUS, 
-    t.ORDER_RECEIVE_REFUSE_TIME, t.ORDER_COMMUNICATION_DURATION, t.ORDER_STATUS, t.INSERT_USERNAME, 
-    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, 
-    t.ORDER_TYPE, t.ORDER_LINE_SEQUENCE, t.LINE_ID, t.ORDER_ENTRY_TIME, t.DRIVER_CAPACITY_ID, 
-    t.UNLOAD_POINT_ID, t.DRIVER_CONFIRMATION
+        t.ORDER_ID, t.ORDER_PLAN_ID, t.ORDER_NUMBER, t.CAPACITY_ID, t.ORDER_ISSUE_TIME, t.ORDER_RECEIVE_STATUS,
+    t.ORDER_RECEIVE_REFUSE_TIME, t.ORDER_COMMUNICATION_DURATION, t.ORDER_STATUS, t.INSERT_USERNAME,
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED,
+    t.ORDER_TYPE, t.ORDER_LINE_SEQUENCE, t.LINE_ID, t.ORDER_ENTRY_TIME, t.UNLOAD_POINT_ID,
+    t.DRIVER_CONFIRMATION
     </sql>
     <sql id="select">
-        SELECT
-        <include refid="columns"/>
-        FROM OMSTRUCK_ORDER
+        SELECT <include refid="columns"/> FROM OMSTRUCK_ORDER
     </sql>
     <sql id="select_alias">
-        SELECT
-        <include refid="columns_alias"/>
-        FROM OMSTRUCK_ORDER t
+        SELECT <include refid="columns_alias"/> FROM OMSTRUCK_ORDER t
     </sql>
     <sql id="where">
         <where>
@@ -108,9 +102,6 @@
             <if test="orderEntryTime != null">
                 and TO_CHAR(ORDER_ENTRY_TIME,'yyyy-MM-dd') = #{orderEntryTime}
             </if>
-            <if test="driverCapacityId != null">
-                and DRIVER_CAPACITY_ID = #{driverCapacityId}
-            </if>
             <if test="unloadPointId != null">
                 and UNLOAD_POINT_ID = #{unloadPointId}
             </if>
@@ -178,9 +169,6 @@
             <if test="orderEntryTime != null">
                 and TO_CHAR(ORDER_ENTRY_TIME,'yyyy-MM-dd') = #{orderEntryTime}
             </if>
-            <if test="driverCapacityId != null">
-                and DRIVER_CAPACITY_ID = #{driverCapacityId}
-            </if>
             <if test="unloadPointId != null">
                 and UNLOAD_POINT_ID = #{unloadPointId}
             </if>
@@ -190,8 +178,7 @@
         </where>
     </sql>
     <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
-        delete
-        from OMSTRUCK_ORDER
+        delete from OMSTRUCK_ORDER
         where ORDER_ID = #{orderId,jdbcType=DECIMAL}
     </delete>
     <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
@@ -251,9 +238,6 @@
         <if test="orderEntryTime != null">
             or TO_CHAR(ORDER_ENTRY_TIME,'yyyy-MM-dd') = '#{orderEntryTime}'
         </if>
-        <if test="driverCapacityId != null">
-            or DRIVER_CAPACITY_ID = #{driverCapacityId}
-        </if>
         <if test="unloadPointId != null">
             or UNLOAD_POINT_ID = #{unloadPointId}
         </if>
@@ -268,18 +252,16 @@
                                     ORDER_STATUS, INSERT_USERNAME, INSERT_TIME,
                                     UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
                                     DELETED, ORDER_TYPE, ORDER_LINE_SEQUENCE,
-                                    LINE_ID, ORDER_ENTRY_TIME, DRIVER_CAPACITY_ID,
-                                    UNLOAD_POINT_ID, DRIVER_CONFIRMATION)
+                                    LINE_ID, ORDER_ENTRY_TIME, UNLOAD_POINT_ID,
+                                    DRIVER_CONFIRMATION)
         values (#{orderId,jdbcType=DECIMAL}, #{orderPlanId,jdbcType=DECIMAL}, #{orderNumber,jdbcType=VARCHAR},
-                #{capacityId,jdbcType=DECIMAL}, #{orderIssueTime,jdbcType=TIMESTAMP},
-                #{orderReceiveStatus,jdbcType=DECIMAL},
+                #{capacityId,jdbcType=DECIMAL}, #{orderIssueTime,jdbcType=TIMESTAMP}, #{orderReceiveStatus,jdbcType=DECIMAL},
                 #{orderReceiveRefuseTime,jdbcType=TIMESTAMP}, #{orderCommunicationDuration,jdbcType=DECIMAL},
                 #{orderStatus,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
-                #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
-                #{insertUpdateRemark,jdbcType=VARCHAR},
+                #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
                 #{deleted,jdbcType=DECIMAL}, #{orderType,jdbcType=DECIMAL}, #{orderLineSequence,jdbcType=DECIMAL},
-                #{lineId,jdbcType=DECIMAL}, #{orderEntryTime,jdbcType=TIMESTAMP}, #{driverCapacityId,jdbcType=DECIMAL},
-                #{unloadPointId,jdbcType=DECIMAL}, #{driverConfirmation,jdbcType=DECIMAL})
+                #{lineId,jdbcType=DECIMAL}, #{orderEntryTime,jdbcType=TIMESTAMP}, #{unloadPointId,jdbcType=DECIMAL},
+                #{driverConfirmation,jdbcType=DECIMAL})
     </insert>
     <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OmstruckOrder">
         insert into OMSTRUCK_ORDER
@@ -341,9 +323,6 @@
             <if test="orderEntryTime != null">
                 ORDER_ENTRY_TIME,
             </if>
-            <if test="driverCapacityId != null">
-                DRIVER_CAPACITY_ID,
-            </if>
             <if test="unloadPointId != null">
                 UNLOAD_POINT_ID,
             </if>
@@ -409,9 +388,6 @@
             <if test="orderEntryTime != null">
                 #{orderEntryTime,jdbcType=TIMESTAMP},
             </if>
-            <if test="driverCapacityId != null">
-                #{driverCapacityId,jdbcType=DECIMAL},
-            </if>
             <if test="unloadPointId != null">
                 #{unloadPointId,jdbcType=DECIMAL},
             </if>
@@ -422,27 +398,26 @@
     </insert>
     <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OmstruckOrder">
         update OMSTRUCK_ORDER
-        set ORDER_PLAN_ID                = #{orderPlanId,jdbcType=DECIMAL},
-            ORDER_NUMBER                 = #{orderNumber,jdbcType=VARCHAR},
-            CAPACITY_ID                  = #{capacityId,jdbcType=DECIMAL},
-            ORDER_ISSUE_TIME             = #{orderIssueTime,jdbcType=TIMESTAMP},
-            ORDER_RECEIVE_STATUS         = #{orderReceiveStatus,jdbcType=DECIMAL},
-            ORDER_RECEIVE_REFUSE_TIME    = #{orderReceiveRefuseTime,jdbcType=TIMESTAMP},
+        set ORDER_PLAN_ID = #{orderPlanId,jdbcType=DECIMAL},
+            ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR},
+            CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
+            ORDER_ISSUE_TIME = #{orderIssueTime,jdbcType=TIMESTAMP},
+            ORDER_RECEIVE_STATUS = #{orderReceiveStatus,jdbcType=DECIMAL},
+            ORDER_RECEIVE_REFUSE_TIME = #{orderReceiveRefuseTime,jdbcType=TIMESTAMP},
             ORDER_COMMUNICATION_DURATION = #{orderCommunicationDuration,jdbcType=DECIMAL},
-            ORDER_STATUS                 = #{orderStatus,jdbcType=DECIMAL},
-            INSERT_USERNAME              = #{insertUsername,jdbcType=VARCHAR},
-            INSERT_TIME                  = #{insertTime,jdbcType=TIMESTAMP},
-            UPDATE_USERNAME              = #{updateUsername,jdbcType=VARCHAR},
-            UPDATE_TIME                  = #{updateTime,jdbcType=TIMESTAMP},
-            INSERT_UPDATE_REMARK         = #{insertUpdateRemark,jdbcType=VARCHAR},
-            DELETED                      = #{deleted,jdbcType=DECIMAL},
-            ORDER_TYPE                   = #{orderType,jdbcType=DECIMAL},
-            ORDER_LINE_SEQUENCE          = #{orderLineSequence,jdbcType=DECIMAL},
-            LINE_ID                      = #{lineId,jdbcType=DECIMAL},
-            ORDER_ENTRY_TIME             = #{orderEntryTime,jdbcType=TIMESTAMP},
-            DRIVER_CAPACITY_ID           = #{driverCapacityId,jdbcType=DECIMAL},
-            UNLOAD_POINT_ID              = #{unloadPointId,jdbcType=DECIMAL},
-            DRIVER_CONFIRMATION          = #{driverConfirmation,jdbcType=DECIMAL}
+            ORDER_STATUS = #{orderStatus,jdbcType=DECIMAL},
+            INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+            INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+            UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+            UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+            INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+            DELETED = #{deleted,jdbcType=DECIMAL},
+            ORDER_TYPE = #{orderType,jdbcType=DECIMAL},
+            ORDER_LINE_SEQUENCE = #{orderLineSequence,jdbcType=DECIMAL},
+            LINE_ID = #{lineId,jdbcType=DECIMAL},
+            ORDER_ENTRY_TIME = #{orderEntryTime,jdbcType=TIMESTAMP},
+            UNLOAD_POINT_ID = #{unloadPointId,jdbcType=DECIMAL},
+            DRIVER_CONFIRMATION = #{driverConfirmation,jdbcType=DECIMAL}
         where ORDER_ID = #{orderId,jdbcType=DECIMAL}
     </update>
     <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OmstruckOrder">
@@ -502,9 +477,6 @@
             <if test="orderEntryTime != null">
                 ORDER_ENTRY_TIME = #{orderEntryTime,jdbcType=TIMESTAMP},
             </if>
-            <if test="driverCapacityId != null">
-                DRIVER_CAPACITY_ID = #{driverCapacityId,jdbcType=DECIMAL},
-            </if>
             <if test="unloadPointId != null">
                 UNLOAD_POINT_ID = #{unloadPointId,jdbcType=DECIMAL},
             </if>
@@ -536,9 +508,8 @@
         INSERT_TIME, UPDATE_USERNAME,
         UPDATE_TIME, INSERT_UPDATE_REMARK,
         DELETED, ORDER_TYPE, ORDER_LINE_SEQUENCE,
-        LINE_ID, ORDER_ENTRY_TIME, DRIVER_CAPACITY_ID,
-        UNLOAD_POINT_ID, DRIVER_CONFIRMATION
-        )
+        LINE_ID, ORDER_ENTRY_TIME, UNLOAD_POINT_ID,
+        DRIVER_CONFIRMATION)
         ( <foreach collection="list" item="item" separator="union all">
         select
         #{item.orderId,jdbcType=DECIMAL},
@@ -548,12 +519,9 @@
         #{item.orderStatus,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
         #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
         #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
-        #{item.deleted,jdbcType=DECIMAL}, #{item.orderType,jdbcType=DECIMAL},
-        #{item.orderLineSequence,jdbcType=DECIMAL},
-        #{item.lineId,jdbcType=DECIMAL}, #{item.orderEntryTime,jdbcType=TIMESTAMP},
-        #{item.driverCapacityId,jdbcType=DECIMAL},
-        #{item.unloadPointId,jdbcType=DECIMAL}, #{item.driverConfirmation,jdbcType=DECIMAL}
-        from dual
+        #{item.deleted,jdbcType=DECIMAL}, #{item.orderType,jdbcType=DECIMAL}, #{item.orderLineSequence,jdbcType=DECIMAL},
+        #{item.lineId,jdbcType=DECIMAL}, #{item.orderEntryTime,jdbcType=TIMESTAMP}, #{item.unloadPointId,jdbcType=DECIMAL},
+        #{item.driverConfirmation,jdbcType=DECIMAL} from dual
     </foreach> )
     </insert>
     <update id="batchUpdate" parameterType="java.util.List">
@@ -635,10 +603,6 @@
         <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderEntryTime,jdbcType=TIMESTAMP}
         </foreach>
-        ,DRIVER_CAPACITY_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
-            when #{item.orderId,jdbcType=DECIMAL} then #{item.driverCapacityId,jdbcType=DECIMAL}
-        </foreach>
         ,UNLOAD_POINT_ID=
         <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.unloadPointId,jdbcType=DECIMAL}
@@ -659,7 +623,6 @@
             #{id}
         </foreach>
     </delete>
-
     <!-- 友情提示!!!-->
     <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
     <!--  根据插入时间排序  -->
@@ -687,7 +650,6 @@
         AP.PLAN_NO "planNo",
         RC.CAPACITY_NUMBER "capacityNumber",
         RC.CAPACITY_ID "capacityId",
-        RCD.DRIVER_NAME "driverName",
         OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
         to_char(AP.PLAN_TRUCK_TIME, 'yyyy-mm-dd')"planTruckTime",
         to_char(AP.PLAN_INCOMING_TIME, 'yyyy-mm-dd') "planIncomingTime",
@@ -705,12 +667,8 @@
         on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
         left join AMSTRUCK_PURPLAN AP
         on AP.BATCH_ID = APO.BATCH_ID and AP.PLAN_STATUS != 3
-        left join RMS_DRIVER_CAPACITY RDC
-        on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
         left join RMS_CAPACITY RC
-        on RC.CAPACITY_ID = RDC.CAPACITY_ID
-        left join RMS_CAR_DRIVER RCD
-        on RCD.DRIVER_ID = RDC.DRIVER_ID
+        on RC.CAPACITY_ID = OO.CAPACITY_ID
         left join OMSTRUCK_ORDER_MATERIAL OOM
         on OOM.ORDER_ID = OO.ORDER_ID
         left join RMS_MATERIAL RM
@@ -765,12 +723,6 @@
                     "capacityNumber" like '%${item}%'
                 </foreach>
             </if>
-            <if test="driverName != null">
-                and
-                <foreach collection="driverName" item="item" open="(" separator="or" close=")">
-                    "driverName" like '%${item}%'
-                </foreach>
-            </if>
             <if test="planTruckTime != null">
                 and
                 <foreach collection="planTruckTime" item="item" open="(" separator="or" close=")">
@@ -847,21 +799,16 @@
         from
         (
         select
-        RDC.DRIVER_CAPACITY_ID "driverCapacityId",
+        RC.CAPACITY_ID "capacityId",
         RC.CAPACITY_NUMBER "capacityNumber",
-        RCD.DRIVER_NAME "driverName",
         RC.CAPACITY_VIP "capacityVip",
         RCA.CARRIER_NAME "carrierName",
         RCT.CAPACITY_TYPE_NAME "capacityTypeName",
         RC.CAPACITY_BLACKLIST "capacityBlacklist",
-        RDC.INSERT_TIME "insertTime"
-        from RMS_DRIVER_CAPACITY RDC
-        left join RMS_CAPACITY RC
-        on RC.CAPACITY_ID = RDC.CAPACITY_ID
+        RC.INSERT_TIME AS "insertTime"
+        from RMS_CAPACITY RC
         left join RMS_CARRIER RCA
         on RC.CARRIER_ID = RCA.CARRIER_ID
-        left join RMS_CAR_DRIVER RCD
-        on RCD.DRIVER_ID = RDC.DRIVER_ID
         left join RMS_CAPACITY_TYPE RCT
         on RCT.CAPACITY_TYPE_ID = RC.CAPACITY_TYPE_ID
         <where>
@@ -889,12 +836,6 @@
                     "capacityNumber" like '%${item}%'
                 </foreach>
             </if>
-            <if test="driverName != null">
-                and
-                <foreach collection="driverName" item="item" open="(" separator="or" close=")">
-                    "driverName" like '%${item}%'
-                </foreach>
-            </if>
             <if test="capacityVip != null">
                 and
                 <foreach collection="capacityVip" item="item" open="(" separator="or" close=")">
@@ -992,8 +933,7 @@
         OO.INSERT_UPDATE_REMARK "insertUpdateRemark",
         TTR.RESULT_TOTAL_ID "resultTotalId"
         from OMSTRUCK_ORDER OO
-        left join RMS_DRIVER_CAPACITY RDC on OO.DRIVER_CAPACITY_ID = RDC.DRIVER_CAPACITY_ID
-        left join RMS_CAPACITY RC on RC.CAPACITY_ID = RDC.CAPACITY_ID
+        left join RMS_CAPACITY RC on RC.CAPACITY_ID = OO.CAPACITY_ID
         left join OMSTRUCK_ORDER_MATERIAL OOM on OOM.ORDER_ID = OO.ORDER_ID
         left join RMS_MATERIAL RM on RM.MATERIAL_ID = OOM.MATERIAL_ID
         left join RMS_WAREHOUSE RW on RW.WAREHOUSE_ID = OO.UNLOAD_POINT_ID
@@ -2232,10 +2172,8 @@
                            ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
                  LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
                            ON OOM.ORDER_ID = OO.ORDER_ID
-                 LEFT JOIN RMS_DRIVER_CAPACITY RDC
-                           ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
                  LEFT JOIN RMS_CAPACITY RC
-                           ON RC.CAPACITY_ID = RDC.CAPACITY_ID
+                           ON RC.CAPACITY_ID = OO.CAPACITY_ID
                  LEFT JOIN RMS_MATERIAL RM
                            ON RM.MATERIAL_ID = OOM.MATERIAL_ID
         WHERE ASO.SALE_ORDER_ID = #{saleOrderId}
@@ -2299,7 +2237,7 @@
         FROM RMS_DRIVER_CAPACITY RDC
                  LEFT JOIN RMS_CAPACITY RCA
                            ON RDC.CAPACITY_ID = RCA.CAPACITY_ID
-        WHERE RCA.CAPACITY_STATUS = 0
+--         WHERE RCA.CAPACITY_STATUS = 0
     </select>
 
     <!-- 派单信息 -->
@@ -2436,12 +2374,10 @@
         OO.ORDER_ID AS "orderId",
         AIP.INSERT_TIME AS "insertTime"
         FROM OMSTRUCK_ORDER OO
-        LEFT JOIN RMS_DRIVER_CAPACITY RDC
-        ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
         LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
         ON OOM.ORDER_ID = OO.ORDER_ID
         LEFT JOIN RMS_CAPACITY RC
-        ON RC.CAPACITY_ID = RDC.CAPACITY_ID
+        ON RC.CAPACITY_ID = OO.CAPACITY_ID
         LEFT JOIN AMSTRUCK_INWARD_PLAN AIP
         ON OO.ORDER_PLAN_ID = AIP.PLAN_ID
         LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
@@ -2619,10 +2555,8 @@
                            ON RSH.SHIPPER_ID = ASO.SHIPPER_ID
                  LEFT JOIN RMS_CONSIGNEE RC
                            ON RC.CONSIGNEE_ID = ASO.RECEIVE_ID
-                 LEFT JOIN RMS_DRIVER_CAPACITY RDC
-                           ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
                  LEFT JOIN RMS_CAPACITY RCA
-                           ON RDC.CAPACITY_ID = RCA.CAPACITY_ID
+                           ON OO.CAPACITY_ID = RCA.CAPACITY_ID
                  LEFT JOIN RMS_RECEIVE_ADDRESS RRA
                            ON RRA.ADDRESS_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
     </select>
@@ -2652,12 +2586,10 @@
                RC.CAPACITY_NUMBER     AS "capacityNumber",
                RCA.CARRIER_NAME       AS "carrierName"
         FROM OMSTRUCK_ORDER OO
-                 LEFT JOIN RMS_DRIVER_CAPACITY RDC
-                           ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
                  LEFT JOIN RMS_CAPACITY RC
-                           ON RC.CAPACITY_ID = RDC.CAPACITY_ID
+                           ON RC.CAPACITY_ID = OO.CAPACITY_ID
                  LEFT JOIN AMSTRUCK_INWARD_PLAN AIP
-                           ON AIP.PLAN_ID = OO.DRIVER_CAPACITY_ID
+                           ON AIP.PLAN_ID = OO.ORDER_PLAN_ID
                  LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
                            ON ARP.PLAN_ID = AIP.PLAN_ID
                  LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
@@ -2674,10 +2606,8 @@
                RC.CAPACITY_NUMBER AS "capacityNumber",
                RCA.CARRIER_NAME   AS "carrierName"
         FROM OMSTRUCK_ORDER OO
-                 LEFT JOIN RMS_DRIVER_CAPACITY RDC
-                           ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
                  LEFT JOIN RMS_CAPACITY RC
-                           ON RC.CAPACITY_ID = RDC.CAPACITY_ID
+                           ON RC.CAPACITY_ID = OO.CAPACITY_ID
                  LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
                            ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
                  LEFT JOIN RMS_CARRIER RCA
@@ -2687,10 +2617,8 @@
     <select id="selectCapacityNumber" resultType="java.lang.String">
         select rc.capacity_number
         from omstruck_order oo
-                 left join rms_driver_capacity rdc
-                           on rdc.driver_capacity_id = oo.driver_capacity_id
                  left join rms_capacity rc
-                           on rc.capacity_id = rdc.driver_capacity_id
+                           on rc.capacity_id = oo.driver_capacity_id
         where oo.order_id = #{orderId}
     </select>
     <select id="selectOrderType" resultType="java.math.BigDecimal">
@@ -2714,10 +2642,8 @@
                RRA.ADDRESS_DELIVERY_ADDRESS AS "addressDeliveryAddress",
                ASOM.SALE_DATE_OF_RECEIPT    AS "saleDateOfReceipt"
         FROM OMSTRUCK_ORDER OO
-                 LEFT JOIN RMS_DRIVER_CAPACITY RDC
-                           ON OO.DRIVER_CAPACITY_ID = RDC.DRIVER_CAPACITY_ID
                  LEFT JOIN RMS_CAPACITY RC
-                           ON RDC.CAPACITY_ID = RC.CAPACITY_ID
+                           ON RC.CAPACITY_ID = OO.CAPACITY_ID
                  LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
                            ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
                  LEFT JOIN AMS_SALE_ORDER ASO
@@ -2752,10 +2678,8 @@
                RSU.SUPPLIER_NAME  AS "loadPoint",
                RSH.SHIPPER_NAME   AS "unloadPoint"
         FROM OMSTRUCK_ORDER OO
-                 LEFT JOIN RMS_DRIVER_CAPACITY RDC
-                           ON OO.DRIVER_CAPACITY_ID = RDC.DRIVER_CAPACITY_ID
-                 LEFT JOIN RMS_CAPACITY RC
-                           ON RDC.CAPACITY_ID = RC.CAPACITY_ID
+                 LEFT JOIN RMS_CAPACITY OO
+                           ON OO.CAPACITY_ID = RC.CAPACITY_ID
                  LEFT JOIN AMS_PURCHASE_ORDER APO
                            ON APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
                  LEFT JOIN RMS_SUPPLIER RSU