luobang 2 年 前
コミット
23d17bcccc

+ 31 - 0
src/main/java/com/steerinfo/dil/feign/AmsFeign.java

@@ -0,0 +1,31 @@
+package com.steerinfo.dil.feign;
+
+import com.steerinfo.framework.controller.RESTfulResult;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ author    :TXF
+ * @ time      :2021/10/8 19:07
+ */
+
+
+@FeignClient(value = "DIL-AMS-API-DEV", url = "${openfeign.AmsFeign.url}")
+public interface AmsFeign {
+
+    @PostMapping(value = "/api/v1/ams/amssaleorders/getHaveCarTruckNoList")
+    RESTfulResult getHaveCarTruckNoList(@RequestBody(required = false) Map<String, Object> mapValue,
+                                        @RequestParam Integer apiId,
+                                        @RequestParam Integer pageNum,
+                                        @RequestParam Integer pageSize,
+                                        @RequestParam String con,
+                                        @RequestParam String startTime,
+                                        @RequestParam String endTime);
+
+
+}

+ 25 - 0
src/main/java/com/steerinfo/dil/feign/DaZhouFeign.java

@@ -0,0 +1,25 @@
+package com.steerinfo.dil.feign;
+
+import com.steerinfo.framework.controller.RESTfulResult;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.Map;
+
+/**
+ * @ author    :TXF
+ * @ time      :2021/10/8 19:07
+ */
+
+
+@FeignClient(value = "DIL-DAZHOU-API-DEV", url = "${openfeign.DaZhouFeign.url}")
+public interface DaZhouFeign {
+
+    @GetMapping("/api/v1/uc/getSteelOrderNum")
+    RESTfulResult getSteelOrderNum();
+
+
+}

+ 5 - 0
src/main/java/com/steerinfo/dil/mapper/QmsQueueListMapper.java

@@ -59,6 +59,11 @@ public interface QmsQueueListMapper extends IBaseMapper<QmsQueueList, BigDecimal
 
     Integer getListSequenceNumber(Map<String, Object> map);
 
+    //未扎/已轧
+    Map<String, Object> getSteelOrderMessageToApp(Integer orderId);
+
+    Integer getOrderId(String resultTotalId);
+
     Integer getSpellingSequenceNumber(Map<String, Object> map);
 
     Integer getListGridNumber(Map<String, Object> map);

+ 16 - 0
src/main/java/com/steerinfo/dil/mapper/QmsQueueResultMapper.java

@@ -177,4 +177,20 @@ public interface QmsQueueResultMapper extends IBaseMapper<QmsQueueResult, BigDec
      * @Description:查询已出厂数量(钢材)
      */
     int queryLeaveFactoryNumber();
+
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:2022-10-27
+     * @Description:复刻出厂数
+    */
+    List<Map<String, Object>>   getCapacityByDefend(Map<String, Object> map);
+
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:2022-10-28
+     * @Description:复刻进厂数
+    */
+    int getSteelOrderNum();
 }

+ 6 - 2
src/main/java/com/steerinfo/dil/service/impl/QmsQueueListServiceImpl.java

@@ -1,5 +1,6 @@
 package com.steerinfo.dil.service.impl;
 
+import com.steerinfo.dil.feign.AmsFeign;
 import com.steerinfo.dil.feign.LargeScreenFeign;
 import com.steerinfo.dil.mapper.*;
 import com.steerinfo.dil.model.QmsQueueResult;
@@ -57,6 +58,9 @@ public class QmsQueueListServiceImpl implements IQmsQueueListService {
     @Autowired
     LargeScreenFeign largeScreenFeign;
 
+    @Autowired
+    AmsFeign amsFeign;
+
     @Autowired
     private QmsModelUnrooledMapper qmsModelUnrooledMapper;
 
@@ -443,7 +447,7 @@ public class QmsQueueListServiceImpl implements IQmsQueueListService {
      * @Date:
      * @Description:做一个定时任务向两块大屏赋予值
      */
-    @Scheduled(cron = "0 */10 * * * ?")
+    @Scheduled(cron = "0 */5 * * * ?")
     public void sendDataToLargeCreen(){
         Map<String,Object> mapValue=new HashMap<>();
         List<Map<String, Object>> datalist =new ArrayList<>();
@@ -455,7 +459,7 @@ public class QmsQueueListServiceImpl implements IQmsQueueListService {
         HashSet<Map<String,Object>> set=new HashSet<>(queueListByQueueUpSpelling);
         //queueListByQueueUp=queueListByQueueUp.stream().distinct().collect(Collectors.toList());
         datalist.addAll(queueListByQueueUp);
-        queueListByQueueUpSpelling=queueListByQueueUpSpelling.stream().distinct().collect(Collectors.toList());
+        //queueListByQueueUpSpelling=queueListByQueueUpSpelling.stream().distinct().collect(Collectors.toList());
         datalist.addAll(set);
         System.out.println(datalist.toString());
         //更新大屏(钢材科与东门)

+ 68 - 11
src/main/java/com/steerinfo/dil/service/impl/QmsQueueResultServiceImpl.java

@@ -1,6 +1,7 @@
 package com.steerinfo.dil.service.impl;
 
 import com.steerinfo.dil.controller.QmsQueueResultController;
+import com.steerinfo.dil.feign.AmsFeign;
 import com.steerinfo.dil.feign.IMFeign;
 import com.steerinfo.dil.feign.LargeScreenFeign;
 import com.steerinfo.dil.mapper.QmsQueueListMapper;
@@ -13,9 +14,12 @@ import com.steerinfo.dil.mapper.QmsQueueResultMapper;
 import com.steerinfo.dil.service.IQmsQueueResultService;
 import com.steerinfo.dil.util.ElectronicFenceUtils;
 import com.steerinfo.framework.controller.RESTfulResult;
+import oracle.sql.DATE;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.math.BigDecimal;
 
@@ -56,6 +60,9 @@ public class QmsQueueResultServiceImpl implements IQmsQueueResultService {
     @Autowired
     private IMFeign imFeign;
 
+    @Autowired
+    AmsFeign amsFeign;
+
     @Autowired
     private QueueInterfaceMapper queueInterfaceMapper;
 
@@ -180,7 +187,16 @@ public class QmsQueueResultServiceImpl implements IQmsQueueResultService {
             }else {
                 num = qmsQueueListMapper.getSpellingSequenceNumber(map); //当前多拼队列排队人数
             }
-            map.put("orderSeqNum", num);
+            //获取是否已审批或者未轧/已轧
+            try{
+                //根据实绩主键去查询出运单主键
+                Integer orderId = qmsQueueListMapper.getOrderId(resultTotalId);
+                Map<String, Object> steelOrderMessageToApp = qmsQueueListMapper.getSteelOrderMessageToApp(orderId);
+                String capacityMessage = (String) steelOrderMessageToApp.get("capacityMessage");
+                map.put("orderSeqNum", num+capacityMessage);
+            }catch (Exception e){
+                e.printStackTrace();
+            }
             map.put("status", 2);
         }else {
             //还未排队
@@ -230,16 +246,57 @@ public class QmsQueueResultServiceImpl implements IQmsQueueResultService {
     */
     public Map<String,Object> getnumber(){
         Map<String,Object> map=new HashMap<>();
-        //查询出销售钢材的派车数
-        int SentCarNumber = qmsQueueResultMapper.querySentCarNumber();
-        //查询出销售钢材的进厂数
-        int IntoFactoryNumber=qmsQueueResultMapper.queryIntoFactoryNumber();
-        //查询出销售钢材的出厂数
-        int LeaveFactoryNumber=qmsQueueResultMapper.queryLeaveFactoryNumber();
-        map.put("sentCarNumber",SentCarNumber);
-        map.put("intoFactoryNumber",IntoFactoryNumber);
-        map.put("leaveFactoryNumber",LeaveFactoryNumber);
-        map.put("waitIntoFactoryNumber",SentCarNumber-IntoFactoryNumber);
+        try{
+            //查询出销售钢材的派车数
+            //1.先把时间状态改为时分秒清零的状态
+            Date now=new Date();
+            Calendar call=Calendar.getInstance();
+            call.setTime(now);
+            call.set(Calendar.HOUR_OF_DAY,0);
+            call.set(Calendar.MINUTE,0);
+            call.set(Calendar.SECOND,0);
+            call.set(Calendar.MILLISECOND,0);
+            Date date=call.getTime();
+            Map<String,Object> map1=new HashMap<>();
+            map1.put("oneDate",date);
+            map1.put("entity",date);
+            RESTfulResult haveCarTruckNoList = amsFeign.getHaveCarTruckNoList(map1, 466, null, null, null, null, null);
+            Map<String,Object> data = (Map<String, Object>) haveCarTruckNoList.getData();
+            List<Map<String,Object>> data1 = (List<Map<String, Object>>) data.get("list");
+            int SentCarNumber=0;
+            try {
+                for (int i=0;i<data1.size();i++){
+                    for (int j=i+1;j<data1.size();j++){
+                        if (data1.get(i).get("capacityNumber").equals(data1.get(j).get("capacityNumber"))){
+                            data1.remove(j);
+                            j--;
+                        }
+                    }
+                }
+                SentCarNumber=data1.size();
+            }catch (Exception e){
+                e.printStackTrace();
+            }
+            //int SentCarNumber = qmsQueueResultMapper.querySentCarNumber();
+            //int IntoFactoryNumber=qmsQueueResultMapper.queryIntoFactoryNumber();
+            //查询出销售钢材的进厂数(由于呼叫进厂页面的数据不止)
+            int IntoFactoryNumber = qmsQueueResultMapper.getSteelOrderNum();
+            //查询出销售钢材的出厂数
+            //先把时间格式化
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            String format = simpleDateFormat.format(date);
+            Map<String,Object> map2=new HashMap<>();
+            map2.put("oneDate",format);
+            List<Map<String, Object>> capacityByDefend = qmsQueueResultMapper.getCapacityByDefend(map2);
+            int LeaveFactoryNumber = capacityByDefend.size();
+            //int LeaveFactoryNumber=qmsQueueResultMapper.queryLeaveFactoryNumber();
+            map.put("sentCarNumber",SentCarNumber);
+            map.put("intoFactoryNumber",IntoFactoryNumber);
+            map.put("leaveFactoryNumber",LeaveFactoryNumber);
+            map.put("waitIntoFactoryNumber",SentCarNumber-IntoFactoryNumber-LeaveFactoryNumber);
+        }catch (Exception e){
+            e.printStackTrace();
+        }
         return map;
     }
 

+ 4 - 0
src/main/resources/application-prod.yml

@@ -19,6 +19,10 @@ openfeign:
     url: ${IMFEIGN_URL:172.16.33.166:8055}
   LargeScreen:
     url: ${LARGESCREEN_URL:172.16.33.160:8064}
+  AmsFeign:
+    url: ${AMSFEIGN_URL:172.16.33.166:8079}
+  DaZhouFeign:
+    url: ${BMSTRUCKFEIGN_URL:172.16.33.166:8080}
 
 mvc:
   async:

+ 57 - 0
src/main/resources/com/steerinfo/dil/mapper/QmsQueueListMapper.xml

@@ -654,6 +654,63 @@
     )
   </select>
 
+  <select id="getSteelOrderMessageToApp" resultType="map">
+    SELECT
+    OO.ORDER_ID "orderId",
+    OO.ORDER_TYPE "orderType",
+    OO.ORDER_LINE_SEQUENCE "orderLineSequence",
+    OO.ORDER_NUMBER "orderNumber",
+    CASE
+    WHEN TEMP."orderId" IS NOT NULL
+    THEN '('|| decode(ASO.SALE_ORDER_STATUS,4,'订单已审核','订单未审核') || ':未轧' ||')'
+    WHEN TEMP."orderId" IS NULL
+    THEN '('|| decode(ASO.SALE_ORDER_STATUS,4,'订单已审核','订单未审核') || ':已轧' || ')'
+    END
+    "capacityMessage",
+    RC.CAPACITY_TEL "capacityTel",
+    RS.SHIPPER_NAME "shipperName",
+    ASOM.SALE_ORDER_CONSIGNEE_TEL "consigneeTel",
+    ASOM.SALE_DATE_OF_RECEIPT "saleDateOfReceipt",
+    RC2.CONSIGNEE_COMPANY_NAME "consigneeCompanyNames",
+    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",
+    ASO.SALE_ORDER_ID   "saleOrderId",
+    OO.DELETED  "orderDeleted"
+    FROM
+    OMSTRUCK_ORDER OO
+    LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
+    LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+    LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
+    LEFT JOIN RMS_CONSIGNEE RC2 ON ASO.RECEIVE_ID = RC2.CONSIGNEE_ID
+    LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
+    LEFT JOIN RMS_RECEIVE_PLACE RRP ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
+    LEFT JOIN RMS_RECEIVE_ADDRESS RDA ON RDA.ADDRESS_ID = RRP.ADDRESS_ID
+    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON OO.ORDER_ID = TTR.ORDER_ID
+    LEFT JOIN (
+    select OO.ORDER_ID "orderId"
+        from OMSTRUCK_ORDER OO
+        left join OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID=OOM.ORDER_ID
+        left join RMS_MATERIAL RM ON OOM.MATERIAL_ID = RM.MATERIAL_ID
+        where OO.ORDER_STATUS in (4,5)
+        and (OOM.MATERIAL_PRIORITY !=71 OR OOM.MATERIAL_PRIORITY is null)
+        and
+        RM.MATERIAL_ID||'' in (select SPECTIONS_MODEL from QMS_MODEL_UNROOLED)
+    ) TEMP ON TEMP."orderId"=OO.ORDER_ID
+    WHERE
+    OO.ORDER_ID = #{orderId}
+    AND ASO.DELETED = 0
+    AND rownum =1
+  </select>
+
+  <select id="getOrderId" resultType="java.lang.Integer">
+     select OO.ORDER_ID from TMSTRUCK_TOTAL_RESULT TTR
+     LEFT JOIN OMSTRUCK_ORDER OO
+     ON OO.ORDER_ID=TTR.ORDER_ID
+     where TTR.RESULT_TOTAL_ID=#{resultTotalId}
+  </select>
+
   <select id="getSpellingSequenceNumber" parameterType="map" resultType="int">
     select COUNT(QQSL.SPELLING_RESULT_ID)
     from QMS_QUEUE_SPELLING_LIST QQSL

+ 60 - 59
src/main/resources/com/steerinfo/dil/mapper/QmsQueueResultMapper.xml

@@ -868,6 +868,7 @@
         OO.ORDER_ID                  "orderId",
         RG.GATEPOST_NAME             "gatepostName",
         ASM.STEEL_METER              "steelMeter",
+        QQL.IS_VIP                  "resultInsertTime",
         (
         select COUNT(QQL2.LIST_ID)
         from QMS_QUEUE_LIST QQL2
@@ -903,10 +904,10 @@
         </if>
         <if test="locationId != null">
             and QQL.GRID_ID = #{locationId}
-            ORDER BY QQL.ENTRY_SURE_TIME DESC, QQL.IS_VIP, "listNodeOrder"
+            ORDER BY QQL.IS_VIP DESC NULLS LAST ,"listNodeOrder",QQL.ENTRY_SURE_TIME DESC
         </if>
         <if test="locationId == null">
-            ORDER BY QQL.ENTRY_SURE_TIME DESC, QQL.IS_VIP, "listNodeOrder",QQR.RESULT_START_TIME
+            ORDER BY QQL.IS_VIP DESC NULLS LAST ,"listNodeOrder",QQL.ENTRY_SURE_TIME DESC
         </if>
         ) P0
 
@@ -967,72 +968,72 @@
 
 
     <select id="getQueueListByQueueUpSpelling" parameterType="map" resultType="java.util.LinkedHashMap">
-        select QQR.RESULT_ID        "resultId",
-               QQR.RESULT_TOTAL_ID  "resultTotalId",
-               QQR.RESULT_START_TIME    "resultStartTime",
-               RC.CAPACITY_NUMBER       "capacityNumber",
-               QQSL.SPELILING_NUM       "grid",
-               QQSL.SPELLING_RESULT_ID  "spellingResultId",
-                RM.MATERIAL_ID       "materialId",
-                RM.MATERIAL_NAME     "materialName",
-                RM.MATERIAL_SPECIFICATION||'('||RM.MATERIAL_MODEL||')'    "materialSpecification",
-                RC.CAPACITY_ID           "capacityId",
-                RM.MATERIAL_MODEL        "materialModel",
-               QQSL.ENTRY_SURE_TIME      "sureTime",
-                OOM.ORDER_MATERIAL_NUMBER    "materialNumber",
-               OOM.MATERIAL_PRIORITY        "id",
-               OO.DRIVER_TEL            "driverTel",
-               OO.ORDER_ID              "orderId",
-               RG.GATEPOST_NAME             "gatepostName",
-               RCE.CONSIGNEE_COMPANY_NAME   "consigneeName",
-              (
-                  select count(QQSL2.SPELLING_RESULT_ID) from QMS_QUEUE_SPELLING_LIST QQSL2
-                  where QQSL.SPELILING_NUM = QQSL2.SPELILING_NUM
-                   and QQSL.SPELLING_SURE_TIME &lt;= QQSL2.SPELLING_SURE_TIME
-
-              )     "listNodeOrder"
+        SELECT * FROM (select QQR.RESULT_ID "resultId",
+        QQR.RESULT_TOTAL_ID "resultTotalId",
+        QQR.RESULT_START_TIME "resultStartTime",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        QQSL.SPELILING_NUM "grid",
+        QQSL.SPELLING_RESULT_ID "spellingResultId",
+        RM.MATERIAL_ID "materialId",
+        RM.MATERIAL_NAME "materialName",
+        RM.MATERIAL_SPECIFICATION||'('||RM.MATERIAL_MODEL||')' "materialSpecification",
+        RC.CAPACITY_ID "capacityId",
+        RM.MATERIAL_MODEL "materialModel",
+        QQSL.ENTRY_SURE_TIME "sureTime",
+        OOM.ORDER_MATERIAL_NUMBER "materialNumber",
+        OOM.MATERIAL_PRIORITY "id",
+        OO.DRIVER_TEL "driverTel",
+        OO.ORDER_ID "orderId",
+        RG.GATEPOST_NAME "gatepostName",
+        RCE.CONSIGNEE_COMPANY_NAME "consigneeName",
+        QQSL.IS_VIP "resultInsertTime",
+        (
+        select count(QQSL2.SPELLING_RESULT_ID) from QMS_QUEUE_SPELLING_LIST QQSL2
+        where QQSL.SPELILING_NUM = QQSL2.SPELILING_NUM
+        and QQSL.SPELLING_SURE_TIME &lt;= QQSL2.SPELLING_SURE_TIME
+
+        ) "listNodeOrder"
         from QMS_QUEUE_SPELLING_LIST QQSL
-            left join QMS_QUEUE_RESULT  QQR ON QQSL.QUEUE_RESULT_ID = QQR.RESULT_ID
-            left join RMS_CAPACITY RC ON QQR.CAPACITY_ID = RC.CAPACITY_ID
-            left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-            left join OMSTRUCK_ORDER_MATERIAL OOM on TTR.ORDER_ID = OOM.ORDER_ID
-            left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
-            left join OMSTRUCK_ORDER OO on TTR.ORDER_ID = OO.ORDER_ID
-            LEFT JOIN RMS_GATEPOST  RG ON QQR.GATEPOST_ID = RG.GATEPOST_ID
-            LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
-            LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
-            LEFT JOIN RMS_CONSIGNEE RCE ON RCE.CONSIGNEE_ID = ASO.RECEIVE_ID
-            where oo.ORDER_STATUS = 5
-              AND ASO.SALE_ORDER_STATUS = 4
-              AND OO.ORDER_ID NOT IN (
-                    select OO.ORDER_ID
-                    from OMSTRUCK_ORDER OO
-                    left join OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID=OOM.ORDER_ID
-                    left join RMS_MATERIAL RM ON OOM.MATERIAL_ID = RM.MATERIAL_ID
-                    where OO.ORDER_STATUS=5 and
-                    RM.MATERIAL_ID||'' in (select SPECTIONS_MODEL from QMS_MODEL_UNROOLED)
-                  )
-            <if test="capacityNumber != null">
-                and instr(RC.CAPACITY_NUMBER, #{capacityNumber}) > 0
-            </if>
-            <if test="materialList != null">
-                and
-                EXISTS (
-                SELECT OO2.ORDER_ID
-                from OMSTRUCK_ORDER OO2 left join OMSTRUCK_ORDER_MATERIAL OOM2 on OO2.ORDER_ID = OOM2.ORDER_ID
-                where OO2.ORDER_ID = OO.ORDER_ID  and OOM2.MATERIAL_ID in
-                <foreach collection="materialList" item="item" open="(" separator="," close=")">
+        left join QMS_QUEUE_RESULT QQR ON QQSL.QUEUE_RESULT_ID = QQR.RESULT_ID
+        left join RMS_CAPACITY RC ON QQR.CAPACITY_ID = RC.CAPACITY_ID
+        left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER_MATERIAL OOM on TTR.ORDER_ID = OOM.ORDER_ID
+        left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
+        left join OMSTRUCK_ORDER OO on TTR.ORDER_ID = OO.ORDER_ID
+        LEFT JOIN RMS_GATEPOST RG ON QQR.GATEPOST_ID = RG.GATEPOST_ID
+        LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
+        LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+        LEFT JOIN RMS_CONSIGNEE RCE ON RCE.CONSIGNEE_ID = ASO.RECEIVE_ID
+        where oo.ORDER_STATUS = 5
+        AND ASO.SALE_ORDER_STATUS = 4
+        AND OO.ORDER_ID NOT IN (
+        select OO.ORDER_ID
+        from OMSTRUCK_ORDER OO
+        left join OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID=OOM.ORDER_ID
+        left join RMS_MATERIAL RM ON OOM.MATERIAL_ID = RM.MATERIAL_ID
+        where OO.ORDER_STATUS=5 and
+        RM.MATERIAL_ID||'' in (select SPECTIONS_MODEL from QMS_MODEL_UNROOLED)
+        )
+        <if test="capacityNumber != null">and instr(RC.CAPACITY_NUMBER, #{capacityNumber}) > 0
+        </if>
+        <if test="
+        materialList != null">and
+            EXISTS (
+            SELECT OO2.ORDER_ID
+            from OMSTRUCK_ORDER OO2 left join OMSTRUCK_ORDER_MATERIAL OOM2 on OO2.ORDER_ID = OOM2.ORDER_ID
+            where OO2.ORDER_ID = OO.ORDER_ID and OOM2.MATERIAL_ID in
+            <foreach collection="materialList" item="item" open="(" separator="," close=")">
                     ${item}
                 </foreach>
                 )
             </if>
             <if test="locationId != null">
                 and QQSL.SPELILING_NUM  = #{locationId}
-                ORDER BY  QQSL.ENTRY_SURE_TIME DESC, QQSL.IS_VIP,  "listNodeOrder"
+                ORDER BY QQSL.IS_VIP DESC NULLS LAST,"listNodeOrder",QQSL.ENTRY_SURE_TIME DESC
             </if>
             <if test="locationId == null">
-                ORDER BY QQSL.ENTRY_SURE_TIME DESC, QQR.RESULT_START_TIME,QQSL.IS_VIP, "listNodeOrder"
-            </if>
+                ORDER BY QQSL.IS_VIP DESC NULLS LAST,"listNodeOrder",QQSL.ENTRY_SURE_TIME DESC
+            </if>)
     </select>
 
     <select id="getMaterialId" resultType="java.util.Map">

+ 1 - 1
src/main/resources/log4j.properties

@@ -1,5 +1,5 @@
 ## LOG4J\u914D\u7F6E
-log4j.rootCategory=INFO, file, RUNNING,errorfile
+log4j.rootCategory=INFO, file, RUNNING,errorfile,stdout
 ## \u63A7\u5236\u53F0\u8F93\u51FA
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout