Explorar o código

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU2/DAI_DAZHOU-OMS

zx %!s(int64=2) %!d(string=hai) anos
pai
achega
fe189e64eb

+ 1 - 1
pom.xml

@@ -118,7 +118,7 @@
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
 <!--                        <table>TMSTRUCK_UNLOAD_RESULT</table>-->
-                        <param>TMSTT_ORDER</param>
+                        <param>OMSTRAIN_ORDER</param>
                     </tables>
                 </configuration>
                 <executions>

+ 17 - 1
src/main/java/com/steerinfo/dil/controller/OmstrainOrderController.java

@@ -43,8 +43,24 @@ public class OmstrainOrderController extends BaseRESTfulController {
     @PostMapping("getWagonShippingDetails")
     public RESTfulResult getWagonShippingDetails(@RequestBody(required = false) Map<String,Object> map,
                                                  String startTime,
-                                                 String endTime){
+                                                 String endTime,
+                                                 String sendStation,
+                                                 String toTheStation,
+                                                 String consigneeName,
+                                                 String wagonNo){
         DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        if(sendStation != null && !"null".equals(sendStation)){
+            map.put("sendStation",sendStation);
+        }
+        if(toTheStation != null && !"null".equals(toTheStation)){
+            map.put("toTheStation",toTheStation);
+        }
+        if(consigneeName != null && !"null".equals(consigneeName)){
+            map.put("consigneeName",consigneeName);
+        }
+        if(wagonNo != null && !"null".equals(wagonNo)){
+            map.put("wagonNo",wagonNo);
+        }
         List<Map<String,Object>> mapList = omstrainOrderService.getWagonShippingDetails(map);
         return success(mapList);
     }

+ 30 - 0
src/main/java/com/steerinfo/dil/model/OmstrainOrder.java

@@ -87,6 +87,18 @@ public class OmstrainOrder implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="是否验收",required=false)
     private BigDecimal isAccept;
 
+    /**
+     * 卸货点ID(WAREHOUSE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="卸货点ID",required=false)
+    private BigDecimal warehouseId;
+
+    /**
+     * 草垫根数(STRAWMATS,DECIMAL,0)
+     */
+    @ApiModelProperty(value="草垫根数",required=false)
+    private BigDecimal strawmats;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -203,6 +215,22 @@ public class OmstrainOrder implements IBasePO<BigDecimal> {
         this.isAccept = isAccept;
     }
 
+    public BigDecimal getWarehouseId() {
+        return warehouseId;
+    }
+
+    public void setWarehouseId(BigDecimal warehouseId) {
+        this.warehouseId = warehouseId;
+    }
+
+    public BigDecimal getStrawmats() {
+        return strawmats;
+    }
+
+    public void setStrawmats(BigDecimal strawmats) {
+        this.strawmats = strawmats;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -222,6 +250,8 @@ public class OmstrainOrder implements IBasePO<BigDecimal> {
         sb.append(", outstationTime=").append(outstationTime);
         sb.append(", billingWeight=").append(billingWeight);
         sb.append(", isAccept=").append(isAccept);
+        sb.append(", warehouseId=").append(warehouseId);
+        sb.append(", strawmats=").append(strawmats);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 6 - 0
src/main/java/com/steerinfo/dil/service/impl/OmstrainOrderServiceImpl.java

@@ -64,6 +64,12 @@ public class OmstrainOrderServiceImpl implements IOmstrainOrderService {
             BigDecimal wagonBillWeight = DataChange.dataToBigDecimal(map.get("wagonBillWeight"));
             omstrainOrder.setBillingWeight(wagonBillWeight);
         }
+        if(map.get("strawMats") != null){
+            omstrainOrder.setStrawmats(DataChange.dataToBigDecimal(map.get("strawMats")));
+        }
+        if(map.get("unloadPointId") != null){
+            omstrainOrder.setWarehouseId(DataChange.dataToBigDecimal(map.get("unloadPointId")));
+        }
         omstrainOrder.setId(trainOrderId);
         omstrainOrder.setOrderNo(trainOrderNumber);
         omstrainOrder.setInsertTime(new Date());

+ 8 - 7
src/main/java/com/steerinfo/dil/service/impl/OmstruckOrderServiceImpl.java

@@ -82,6 +82,8 @@ public class OmstruckOrderServiceImpl implements IOmstruckOrderService {
     private static final String judgeInwardFactory = "化工园区铁专线内转";
 
 
+
+
     /**
      * 用于远程调用运输订单新增
      *
@@ -578,12 +580,12 @@ public class OmstruckOrderServiceImpl implements IOmstruckOrderService {
         int result=0;
         BigDecimal orderId =DataChange.dataToBigDecimal(map.get("orderId"));
         Map<String, Object> mesMap = omstruckOrderSeparateMapper.getOrderMesByOrderId(orderId);
-        if(DataChange.dataToBigDecimal(mesMap.get("orderType")).intValue() == 1){
+        if(DataChange.dataToBigDecimal(mesMap.get("orderType")).intValue() == 1||DataChange.dataToBigDecimal(mesMap.get("orderType")).intValue() == 4){
             throw new Exception("钢材订单不允许撤销!");
         }
-//        if(DataChange.dataToBigDecimal(mesMap.get("lineSqe")).intValue() >= 1){
-//            throw new Exception("撤单失败");
-//        }
+        if(DataChange.dataToBigDecimal(mesMap.get("lineSqe")).intValue() >= 1){
+            throw new Exception("撤单失败");
+        }
         //获取运输订单号
         String orderNumber = (String) mesMap.get("orderNumber");
         //撤销订单的同时删除计量数据
@@ -868,7 +870,7 @@ public class OmstruckOrderServiceImpl implements IOmstruckOrderService {
                 throw new RuntimeException("订单已被接收或已被拒绝!");
             }
             int orderType = DataChange.dataToBigDecimal(orderMessage.get("orderType")).intValue();
-            if(orderType == 1||orderType==4){
+            if(orderType == 1){
                 //订阅车辆 查询车牌号
                 String capacityNumber = omstruckOrderMapper.getCapacityNumberByCapacityId(DataChange.dataToBigDecimal(orderMessage.get("capacityId")));
                 Map<String, Object> subMap = new HashMap<>();
@@ -1985,11 +1987,10 @@ public class OmstruckOrderServiceImpl implements IOmstruckOrderService {
             BigDecimal orderLineSequence = DataChange.dataToBigDecimal(seqMap.get("orderLineSequence"));
             BigDecimal maxSegmentSqe = DataChange.dataToBigDecimal(seqMap.get("segmentSqe"));
             int i = maxSegmentSqe.intValue() - orderLineSequence.intValue();
-            if( i != 1){
+            if( i != 1 && i != 2){
                 return 0;
             }
         }
-
         omstruckOrder.setOrderId(orderId);
         //设置司机确认订单
         omstruckOrder.setDriverConfirmation(new BigDecimal(1));

+ 1 - 1
src/main/resources/application-dev.yml

@@ -13,7 +13,7 @@ openfeign:
   ColumnDataFeign:
     url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
   TmsTruckFeign:
-    url: ${TMSTRUCKFEIGN_URL:localhost:8008}
+    url: ${TMSTRUCKFEIGN_URL:172.16.33.166:8008}
   AmsFeign:
     url: ${AMSFEIGN_URL:172.16.33.166:8015}
   ImFeign:

+ 1 - 1
src/main/resources/application-prod.yml

@@ -18,7 +18,7 @@ spring:
 #feign设置
 openfeign:
   ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
   TmsTruckFeign:
     url: ${TMSTRUCKFEIGN_URL:172.16.33.166:8088}
   AmsFeign:

+ 228 - 154
src/main/resources/com/steerinfo/dil/mapper/OmstrainOrderMapper.xml

@@ -15,16 +15,18 @@
     <result column="OUTSTATION_TIME" jdbcType="TIMESTAMP" property="outstationTime" />
     <result column="BILLING_WEIGHT" jdbcType="DECIMAL" property="billingWeight" />
     <result column="IS_ACCEPT " jdbcType="DECIMAL" property="isAccept" />
+    <result column="WAREHOUSE_ID" jdbcType="DECIMAL" property="warehouseId" />
+    <result column="STRAWMATS" jdbcType="DECIMAL" property="strawmats" />
   </resultMap>
   <sql id="columns">
     ORDER_ID, ORDER_NO, ORDER_WAGON_NO, ORDER_WAGON_WEIGHT, INSERT_USERNAME, INSERT_TIME, 
     UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, ENSTATION_TIME, OUTSTATION_TIME, 
-    BILLING_WEIGHT, "IS_ACCEPT "
+    BILLING_WEIGHT, "IS_ACCEPT ", WAREHOUSE_ID, STRAWMATS
   </sql>
   <sql id="columns_alias">
     t.ORDER_ID, t.ORDER_NO, t.ORDER_WAGON_NO, t.ORDER_WAGON_WEIGHT, t.INSERT_USERNAME, 
     t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.ENSTATION_TIME, 
-    t.OUTSTATION_TIME, t.BILLING_WEIGHT, t."IS_ACCEPT "
+    t.OUTSTATION_TIME, t.BILLING_WEIGHT, t."IS_ACCEPT ", t.WAREHOUSE_ID, t.STRAWMATS
   </sql>
   <sql id="select">
     SELECT <include refid="columns" /> FROM OMSTRAIN_ORDER
@@ -33,7 +35,7 @@
     SELECT <include refid="columns_alias" /> FROM OMSTRAIN_ORDER t
   </sql>
   <sql id="where">
-    <where> 
+    <where>
       <if test="orderId != null">
         and ORDER_ID = #{orderId}
       </if>
@@ -73,10 +75,16 @@
       <if test="isAccept != null">
         and IS_ACCEPT  = #{isAccept}
       </if>
+      <if test="warehouseId != null">
+        and WAREHOUSE_ID = #{warehouseId}
+      </if>
+      <if test="strawmats != null">
+        and STRAWMATS = #{strawmats}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
-    <where> 
+    <where>
       <if test="orderId != null">
         and ORDER_ID = #{orderId}
       </if>
@@ -116,6 +124,12 @@
       <if test="isAccept != null">
         and IS_ACCEPT  = #{isAccept}
       </if>
+      <if test="warehouseId != null">
+        and WAREHOUSE_ID = #{warehouseId}
+      </if>
+      <if test="strawmats != null">
+        and STRAWMATS = #{strawmats}
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
@@ -124,55 +138,63 @@
   </delete>
   <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
     delete from OMSTRAIN_ORDER
-    where 1!=1 
-      <if test="orderNo != null and orderNo != ''">
-        or ORDER_NO = #{orderNo}
-      </if>
-      <if test="orderWagonNo != null and orderWagonNo != ''">
-        or ORDER_WAGON_NO = #{orderWagonNo}
-      </if>
-      <if test="orderWagonWeight != null">
-        or ORDER_WAGON_WEIGHT = #{orderWagonWeight}
-      </if>
-      <if test="insertUsername != null and insertUsername != ''">
-        or INSERT_USERNAME = #{insertUsername}
-      </if>
-      <if test="insertTime != null">
-        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
-      </if>
-      <if test="updateUsername != null and updateUsername != ''">
-        or UPDATE_USERNAME = #{updateUsername}
-      </if>
-      <if test="updateTime != null">
-        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
-      </if>
-      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
-        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
-      </if>
-      <if test="enstationTime != null">
-        or TO_CHAR(ENSTATION_TIME,'yyyy-MM-dd') = '#{enstationTime}'
-      </if>
-      <if test="outstationTime != null">
-        or TO_CHAR(OUTSTATION_TIME,'yyyy-MM-dd') = '#{outstationTime}'
-      </if>
-      <if test="billingWeight != null">
-        or BILLING_WEIGHT = #{billingWeight}
-      </if>
-      <if test="isAccept != null">
-        or IS_ACCEPT  = #{isAccept}
-      </if>
+    where 1!=1
+    <if test="orderNo != null and orderNo != ''">
+      or ORDER_NO = #{orderNo}
+    </if>
+    <if test="orderWagonNo != null and orderWagonNo != ''">
+      or ORDER_WAGON_NO = #{orderWagonNo}
+    </if>
+    <if test="orderWagonWeight != null">
+      or ORDER_WAGON_WEIGHT = #{orderWagonWeight}
+    </if>
+    <if test="insertUsername != null and insertUsername != ''">
+      or INSERT_USERNAME = #{insertUsername}
+    </if>
+    <if test="insertTime != null">
+      or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+    </if>
+    <if test="updateUsername != null and updateUsername != ''">
+      or UPDATE_USERNAME = #{updateUsername}
+    </if>
+    <if test="updateTime != null">
+      or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+    </if>
+    <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+      or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+    </if>
+    <if test="enstationTime != null">
+      or TO_CHAR(ENSTATION_TIME,'yyyy-MM-dd') = '#{enstationTime}'
+    </if>
+    <if test="outstationTime != null">
+      or TO_CHAR(OUTSTATION_TIME,'yyyy-MM-dd') = '#{outstationTime}'
+    </if>
+    <if test="billingWeight != null">
+      or BILLING_WEIGHT = #{billingWeight}
+    </if>
+    <if test="isAccept != null">
+      or IS_ACCEPT  = #{isAccept}
+    </if>
+    <if test="warehouseId != null">
+      or WAREHOUSE_ID = #{warehouseId}
+    </if>
+    <if test="strawmats != null">
+      or STRAWMATS = #{strawmats}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.OmstrainOrder">
-    insert into OMSTRAIN_ORDER (ORDER_ID, ORDER_NO, ORDER_WAGON_NO, 
-      ORDER_WAGON_WEIGHT, INSERT_USERNAME, INSERT_TIME, 
-      UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
-      ENSTATION_TIME, OUTSTATION_TIME, BILLING_WEIGHT, 
-      "IS_ACCEPT ")
-    values (#{orderId,jdbcType=DECIMAL}, #{orderNo,jdbcType=VARCHAR}, #{orderWagonNo,jdbcType=VARCHAR}, 
-      #{orderWagonWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, 
-      #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, 
-      #{enstationTime,jdbcType=TIMESTAMP}, #{outstationTime,jdbcType=TIMESTAMP}, #{billingWeight,jdbcType=DECIMAL}, 
-      #{isAccept,jdbcType=DECIMAL})
+    insert into OMSTRAIN_ORDER (ORDER_ID, ORDER_NO, ORDER_WAGON_NO,
+                                ORDER_WAGON_WEIGHT, INSERT_USERNAME, INSERT_TIME,
+                                UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
+                                ENSTATION_TIME, OUTSTATION_TIME, BILLING_WEIGHT,
+                                "IS_ACCEPT ", WAREHOUSE_ID, STRAWMATS
+    )
+    values (#{orderId,jdbcType=DECIMAL}, #{orderNo,jdbcType=VARCHAR}, #{orderWagonNo,jdbcType=VARCHAR},
+            #{orderWagonWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
+            #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
+            #{enstationTime,jdbcType=TIMESTAMP}, #{outstationTime,jdbcType=TIMESTAMP}, #{billingWeight,jdbcType=DECIMAL},
+            #{isAccept,jdbcType=DECIMAL}, #{warehouseId,jdbcType=DECIMAL}, #{strawmats,jdbcType=DECIMAL}
+           )
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OmstrainOrder">
     insert into OMSTRAIN_ORDER
@@ -216,6 +238,12 @@
       <if test="isAccept != null">
         "IS_ACCEPT ",
       </if>
+      <if test="warehouseId != null">
+        WAREHOUSE_ID,
+      </if>
+      <if test="strawmats != null">
+        STRAWMATS,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="orderId != null">
@@ -257,22 +285,30 @@
       <if test="isAccept != null">
         #{isAccept,jdbcType=DECIMAL},
       </if>
+      <if test="warehouseId != null">
+        #{warehouseId,jdbcType=DECIMAL},
+      </if>
+      <if test="strawmats != null">
+        #{strawmats,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OmstrainOrder">
     update OMSTRAIN_ORDER
     set ORDER_NO = #{orderNo,jdbcType=VARCHAR},
-      ORDER_WAGON_NO = #{orderWagonNo,jdbcType=VARCHAR},
-      ORDER_WAGON_WEIGHT = #{orderWagonWeight,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},
-      ENSTATION_TIME = #{enstationTime,jdbcType=TIMESTAMP},
-      OUTSTATION_TIME = #{outstationTime,jdbcType=TIMESTAMP},
-      BILLING_WEIGHT = #{billingWeight,jdbcType=DECIMAL},
-      "IS_ACCEPT " = #{isAccept,jdbcType=DECIMAL}
+        ORDER_WAGON_NO = #{orderWagonNo,jdbcType=VARCHAR},
+        ORDER_WAGON_WEIGHT = #{orderWagonWeight,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},
+        ENSTATION_TIME = #{enstationTime,jdbcType=TIMESTAMP},
+        OUTSTATION_TIME = #{outstationTime,jdbcType=TIMESTAMP},
+        BILLING_WEIGHT = #{billingWeight,jdbcType=DECIMAL},
+        "IS_ACCEPT " = #{isAccept,jdbcType=DECIMAL},
+        WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
+        STRAWMATS = #{strawmats,jdbcType=DECIMAL}
     where ORDER_ID = #{orderId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OmstrainOrder">
@@ -314,6 +350,12 @@
       <if test="isAccept != null">
         "IS_ACCEPT " = #{isAccept,jdbcType=DECIMAL},
       </if>
+      <if test="warehouseId != null">
+        WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
+      </if>
+      <if test="strawmats != null">
+        STRAWMATS = #{strawmats,jdbcType=DECIMAL},
+      </if>
     </set>
     where ORDER_ID = #{orderId,jdbcType=DECIMAL}
   </update>
@@ -329,94 +371,104 @@
     <include refid="select" />
     <include refid="whereLike" />
   </select>
-
-    <insert id="batchInsert" parameterType="java.util.List">
-    insert into OMSTRAIN_ORDER 
-      (ORDER_ID, 
-      ORDER_NO, ORDER_WAGON_NO, ORDER_WAGON_WEIGHT, 
-      INSERT_USERNAME, INSERT_TIME, 
-      UPDATE_USERNAME, UPDATE_TIME, 
-      INSERT_UPDATE_REMARK, ENSTATION_TIME, 
-      OUTSTATION_TIME, BILLING_WEIGHT, 
-      "IS_ACCEPT ")
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.orderId,jdbcType=DECIMAL}, 
-      #{item.orderNo,jdbcType=VARCHAR}, #{item.orderWagonNo,jdbcType=VARCHAR}, #{item.orderWagonWeight,jdbcType=DECIMAL}, 
-      #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
-      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
-      #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.enstationTime,jdbcType=TIMESTAMP}, 
-      #{item.outstationTime,jdbcType=TIMESTAMP}, #{item.billingWeight,jdbcType=DECIMAL}, 
-      #{item.isAccept,jdbcType=DECIMAL} from dual  
-   </foreach> )
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into OMSTRAIN_ORDER
+    (ORDER_ID,
+    ORDER_NO, ORDER_WAGON_NO, ORDER_WAGON_WEIGHT,
+    INSERT_USERNAME, INSERT_TIME,
+    UPDATE_USERNAME, UPDATE_TIME,
+    INSERT_UPDATE_REMARK, ENSTATION_TIME,
+    OUTSTATION_TIME, BILLING_WEIGHT,
+    "IS_ACCEPT ", WAREHOUSE_ID, STRAWMATS
+    )
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.orderId,jdbcType=DECIMAL},
+    #{item.orderNo,jdbcType=VARCHAR}, #{item.orderWagonNo,jdbcType=VARCHAR}, #{item.orderWagonWeight,jdbcType=DECIMAL},
+    #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
+    #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
+    #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.enstationTime,jdbcType=TIMESTAMP},
+    #{item.outstationTime,jdbcType=TIMESTAMP}, #{item.billingWeight,jdbcType=DECIMAL},
+    #{item.isAccept,jdbcType=DECIMAL}, #{item.warehouseId,jdbcType=DECIMAL}, #{item.strawmats,jdbcType=DECIMAL}
+    from dual
+  </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
-     update OMSTRAIN_ORDER
-     set
-       ORDER_ID=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.orderId,jdbcType=DECIMAL}
-       </foreach>
-       ,ORDER_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.orderNo,jdbcType=VARCHAR}
-       </foreach>
-       ,ORDER_WAGON_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.orderWagonNo,jdbcType=VARCHAR}
-       </foreach>
-       ,ORDER_WAGON_WEIGHT=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.orderWagonWeight,jdbcType=DECIMAL}
-       </foreach>
-       ,INSERT_USERNAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,INSERT_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,UPDATE_USERNAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,INSERT_UPDATE_REMARK=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-       </foreach>
-       ,ENSTATION_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.enstationTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,OUTSTATION_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.outstationTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,BILLING_WEIGHT=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.billingWeight,jdbcType=DECIMAL}
-       </foreach>
-       ,"IS_ACCEPT "=
-       <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
-          when #{item.orderId,jdbcType=DECIMAL} then #{item.isAccept,jdbcType=DECIMAL}
-       </foreach>
-     where ORDER_ID in 
-     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
-    #{item.orderId,jdbcType=DECIMAL}
-     </foreach> 
+    update OMSTRAIN_ORDER
+    set
+    ORDER_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.orderId,jdbcType=DECIMAL}
+    </foreach>
+    ,ORDER_NO=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.orderNo,jdbcType=VARCHAR}
+    </foreach>
+    ,ORDER_WAGON_NO=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.orderWagonNo,jdbcType=VARCHAR}
+    </foreach>
+    ,ORDER_WAGON_WEIGHT=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.orderWagonWeight,jdbcType=DECIMAL}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,ENSTATION_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.enstationTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,OUTSTATION_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.outstationTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,BILLING_WEIGHT=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.billingWeight,jdbcType=DECIMAL}
+    </foreach>
+    ,"IS_ACCEPT "=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.isAccept,jdbcType=DECIMAL}
+    </foreach>
+    ,WAREHOUSE_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
+    </foreach>
+    ,STRAWMATS=
+    <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+      when #{item.orderId,jdbcType=DECIMAL} then #{item.strawmats,jdbcType=DECIMAL}
+    </foreach>
+    where ORDER_ID in
+    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+      #{item.orderId,jdbcType=DECIMAL}
+    </foreach>
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from OMSTRAIN_ORDER
-    where ORDER_ID in 
+    where ORDER_ID in
     <foreach close=")" collection="list" item="id" open="(" separator=",">
       #{id}
     </foreach>
   </delete>
+
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
 
@@ -498,8 +550,8 @@
                                    RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "materialSpa",
                                    OTO.ORDER_NO                                   "orderNum",
                                    TWR.RESULT_NET_WEIGHT                          "materialWeight",
-                                   to_date(OTO.OUTSTATION_TIME,'yyyy-mm-dd')                            "OutStation",
-                                   to_date(OTO.ENSTATION_TIME,'yyyy-mm-dd')                             "EnStation",
+                                   to_char(OTO.OUTSTATION_TIME,'yyyy-mm-dd')      "OutStation",
+                                   to_char(OTO.ENSTATION_TIME,'yyyy-mm-dd')       "EnStation",
                                    OTO.ORDER_WAGON_NO                             "wagonNo",
                                    OTO.ORDER_WAGON_WEIGHT                         "wagonWeight",
                                    OTO.BILLING_WEIGHT                             "wagonBillWeight",
@@ -507,11 +559,14 @@
                                    RAR.ARRIVAL_NAME                               "sendStation",
                                    ASO.SALE_REMARK                                "orderType",
                                    OTO.ORDER_ID                                    "trainOrderId",
-                                   RPG.GRID_ID                                      "gridId"
+                                   RPG.GRID_ID                                      "gridId",
+                                   decode(wgm.DELETED,0,'入库',1,'出库','未入库')      "wgmDelete",
+                                   R_CAPACITY.CAPACITY_NUMBER                       "capacityNum",
+                                   RW.WAREHOUSE_NAME                                "unloadPoint",
+                                   RAR1.RAILWAY_BUREAU                              "railwayBureau",
+                                   OTO.STRAWMATS                                    "strawMats",
+                                   TWR.RESULT_POUND_NO                              "number"
                    FROM AMS_SALE_ORDER ASO
-                          LEFT JOIN TMSTRAIN_PLEASE_APPROVE_RESULT TPAR ON TPAR.RAIL_PLAN_ID = ASO.SALE_ORDER_ID
-                          LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAR ON RAR.ARRIVAL_ID = TPAR.SEND_STATION_ID
-                          LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAR1 ON RAR1.ARRIVAL_ID = TPAR.TO_THE_STATION_ID
                           LEFT JOIN RMS_CONSIGNEE RC ON RC.CONSIGNEE_ID = ASO.RECEIVE_ID
                           LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
                           LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
@@ -521,21 +576,40 @@
                                     ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
                           LEFT JOIN AMS_SALE_MATERIAL ASM ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
                           LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASM.MATERIAL_ID
+                          LEFT JOIN TMSTRAIN_PLEASE_APPROVE_RESULT TPAR ON TPAR.RAIL_PLAN_ID = ASM.SALE_MATERIAL_ID
+                          LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAR ON RAR.ARRIVAL_ID = TPAR.SEND_STATION_ID
+                          LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAR1 ON RAR1.ARRIVAL_ID = TPAR.TO_THE_STATION_ID
                           LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
+                          LEFT JOIN RMS_CAPACITY   R_CAPACITY ON  R_CAPACITY.CAPACITY_ID = OO.CAPACITY_ID
                           LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
                           LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
                                     AND TWR.MATERIAL_ID = RM.MATERIAL_ID
                           LEFT JOIN TMSTT_ORDER TTO ON TTO.TRUCK_ORDER_ID = OO.ORDER_ID
                           LEFT JOIN OMSTRAIN_ORDER OTO ON OTO.ORDER_ID = TTO.TRAIN_ORDER_ID
                           LEFT JOIN RMS_PWAREHOUSE_GRID RPG ON RPG.STACKING_ID = OO.ORDER_ID
+                          LEFT JOIN WMSP_GRID_MATERIAL  WGM ON WGM.GRID_ID = RPG.GRID_ID
+                                    and wgm.MATERIAL_ID = rm.MATERIAL_ID
+                          LEFT JOIN RMS_WAREHOUSE   RW ON RW.WAREHOUSE_ID = OTO.WAREHOUSE_ID
                           WHERE ASO.SALE_TYPE = 4
-<!--                          <if test="oneDate != null">-->
-<!--                            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = RPG.INSERT_TIME-->
-<!--                          </if>-->
-<!--                          <if test="startDate != null">-->
-<!--                            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  RPG.INSERT_TIME-->
-<!--                            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  RPG.INSERT_TIME-->
-<!--                          </if>-->
+                          <if test="oneDate != null">
+                            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = ASO.INSERT_TIME
+                          </if>
+                          <if test="startDate != null">
+                            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  ASO.INSERT_TIME
+                            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  ASO.INSERT_TIME
+                          </if>
+                          <if test="wagonNo != null">
+                            and OTO.ORDER_WAGON_NO like #{wagonNo}
+                          </if>
+                          <if test="consigneeName != null">
+                            and RC.CONSIGNEE_COMPANY_NAME like #{consigneeName}
+                          </if>
+                          <if test="toTheStation != null">
+                            and RAR1.ARRIVAL_NAME like #{toTheStation}
+                          </if>
+                          <if test="sendStation != null">
+                            and RAR.ARRIVAL_NAME  like #{sendStation}
+                          </if>
                           )
   </select>
 

+ 3 - 1
src/main/resources/com/steerinfo/dil/mapper/OmstruckOrderMapper.xml

@@ -3852,7 +3852,8 @@
         CONCAT(CONCAT( CONCAT( CONCAT( RDA.ADDRESS_PROVINCE, RDA.ADDRESS_DISTRICT ), RDA.ADDRESS_TOWN ),RDA.ADDRESS_DELIVERY_ADDRESS ),RRP.ADDRESS_DELIVERY_ADDRESS) "receiveAddressName",
         TTR.RESULT_TOTAL_ID "resultTotalId",
         OO.CAN_WORK "canWork",
-        OO.ORDER_STATUS "orderStatus"
+        OO.ORDER_STATUS "orderStatus",
+        ASO.SALE_ORDER_ID   "saleOrderId"
         FROM
         OMSTRUCK_ORDER OO
         LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
@@ -4122,6 +4123,7 @@
         UPDATE OMSTRUCK_ORDER OO
         SET OO.ORDER_STATUS = 7
         WHERE OO.ORDER_PLAN_ID = #{planId}
+        AND OO.ORDER_STATUS = 4
         AND OO.ORDER_TYPE = 11
     </update>
 

+ 3 - 1
src/main/resources/com/steerinfo/dil/mapper/OmstruckOrderSeparateMapper.xml

@@ -895,11 +895,13 @@
           and TO_CHAR(ASOM.SALE_DATE_OF_RECEIPT, 'YYYY-MM-DD hh24:mi:ss') >= TO_CHAR(SYSDATE - 1, 'YYYY-MM-DD hh24:mi:ss')
     </select>
     <select id="getWeightTask" resultType="java.math.BigDecimal" parameterType="decimal">
-        SELECT twr.RESULT_TARE_WEIGHT FROM TMSTRUCK_WEIGHT_RESULT TWR
+        SELECT * FROM (SELECT twr.RESULT_TARE_WEIGHT FROM TMSTRUCK_WEIGHT_RESULT TWR
         LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
         ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
         LEFT JOIN OMSTRUCK_ORDER OO
         ON OO.ORDER_ID = TTR.ORDER_ID
         WHERE OO.ORDER_ID = #{orderId}
+        ORDER BY TWR.RESULT_TARE_WEIGHT DESC)
+        WHERE ROWNUM = 1
     </select>
 </mapper>