luobang 3 years ago
parent
commit
c0c2d048a3

+ 14 - 0
src/main/java/com/steerinfo/dil/controller/TestController.java

@@ -2,9 +2,11 @@ package com.steerinfo.dil.controller;
 
 import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
 import com.steerinfo.dil.service.impl.TmstruckMeasureCommissionServiceImpl;
+import com.steerinfo.dil.service.impl.UtilsServiceImpl;
 import com.steerinfo.dil.util.BaseRESTfulController;
 import com.steerinfo.route.service.impl.RouteServiceImpl;
 import com.steerinfo.route.vo.Map.RouteVo;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -17,6 +19,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 @RestController
+@RequestMapping("/${api.version}/Test")
 public class TestController extends BaseRESTfulController {
 
     @Autowired
@@ -26,6 +29,10 @@ public class TestController extends BaseRESTfulController {
 
     @Autowired
     TmstruckMeasureCommissionServiceImpl tmstruckMeasureCommissionService;
+
+    @Autowired
+    private UtilsServiceImpl utilsService;
+
     @PostMapping("/savePath")
     public String savePath() throws Exception {
 
@@ -67,4 +74,11 @@ public class TestController extends BaseRESTfulController {
         return createOrder.get();
     }
 
+
+    @PostMapping("/Test")
+    public int test(){
+        utilsService.pushMesToWebsocket("湘M99999","排队信息");
+        return 1;
+    }
+
 }

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

@@ -6,6 +6,7 @@ import com.steerinfo.dil.feign.IMFeign;
 import com.steerinfo.dil.mapper.UtilsMapper;
 import com.steerinfo.dil.service.IUtilsService;
 import com.steerinfo.dil.util.DataChange;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -173,7 +174,7 @@ public class UtilsServiceImpl implements IUtilsService {
 
         //添加消息实体
         HashMap<Object, Object> mesMap = new HashMap<>();
-        mesMap.put("messageType", 4); //用于进厂后 刷新消息
+        mesMap.put("messageType", 5); //用于进厂后 刷新消息
         mesMap.put("sendPerson", "system");
         mesMap.put("receivePerson", capacityNumber);
         mesMap.put("messageContent", pushMes + new Date());
@@ -187,7 +188,6 @@ public class UtilsServiceImpl implements IUtilsService {
         imFeign.sendToUser(sendMap);
     }
 
-
     public int randomGetValue(List<Integer> dataList){
         if(dataList.size() != 0&&dataList !=null){
             if(dataList.size() == 1){

+ 7 - 13
src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml

@@ -576,7 +576,7 @@
             join RMS_CARRIER RCA
                 on RCA.CARRIER_ID = RC.CARRIER_ID
         </if>
-        where OO.ORDER_TYPE in (12,15)
+        where OO.ORDER_TYPE = 12
         <if test="carrierSsoId != null">
             and RCA.CARRIER_SSO_ID = #{carrierSsoId}
         </if>
@@ -597,9 +597,6 @@
         <if test="userIds!=null">
             and ASO.UPDATE_USERNAME=#{userIds}
         </if>
-        <if test="orderType!=null">
-            and OO.ORDER_TYPE=#{orderType}
-        </if>
         )
         <where>
             <if test="receiveName != null">
@@ -640,7 +637,7 @@
             <if test="resultTareWeightTime != null">
                 and
                 <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
-                    "resultTareWeightTime" like '%${item}%'
+                    to_char("resultTareWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
                 </foreach>
             </if>
             <if test="resultTareWeight != null">
@@ -652,7 +649,7 @@
             <if test="resultEndTime != null">
                 and
                 <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
-                    "resultEndTime" like '%${item}%'
+                    to_char("resultEndTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
                 </foreach>
             </if>
             <if test="warehouseName != null">
@@ -664,7 +661,7 @@
             <if test="resultGrossWeightTime != null">
                 and
                 <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
-                    "resultGrossWeightTime" like '%${item}%'
+                    to_char("resultGrossWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
                 </foreach>
             </if>
             <if test="resultGrossWeight != null">
@@ -769,7 +766,7 @@
             join RMS_CARRIER RCA
             on RCA.CARRIER_ID = RC.CARRIER_ID
         </if>
-        where OO.ORDER_TYPE in (13,16)
+        where OO.ORDER_TYPE = 13
         <if test="carrierSsoId != null">
             and RCA.CARRIER_SSO_ID = #{carrierSsoId}
         </if>
@@ -790,9 +787,6 @@
         <if test="userIds!=null">
             and ASO.UPDATE_USERNAME=#{userIds}
         </if>
-        <if test="orderType!=null">
-            and OO.ORDER_TYPE=#{orderType}
-        </if>
         )
         <where>
             <if test="receiveName != null">
@@ -1160,7 +1154,7 @@
             <if test="resultTareWeightTime != null">
                 and
                 <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
-                    "resultTareWeightTime" like '%${item}%'
+                    to_char("resultTareWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
                 </foreach>
             </if>
 
@@ -1172,7 +1166,7 @@
             <if test="resultGrossWeightTime != null">
                 and
                 <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
-                    "resultGrossWeightTime" like '%${item}%'
+                    to_char("resultGrossWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
                 </foreach>
             </if>
             <if test="resultGrossWeight != null">

+ 7 - 1
src/main/resources/com/steerinfo/dil/mapper/TmstruckLoadResultMapper.xml

@@ -1538,7 +1538,13 @@
       <if test="resultLoadStartTime != null">
         and
         <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
-          "resultLoadStartTime" like '%${item}%'
+          to_char("resultLoadStartTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultLoadEndTime != null">
+        and
+        <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
+          to_char("resultLoadEndTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
         </foreach>
       </if>
       <if test="warehouseName != null">

+ 11 - 11
src/main/resources/com/steerinfo/dil/mapper/TmstruckTimeTaskResultMapper.xml

@@ -667,10 +667,10 @@
 
   <!-- 查询计时作业 -->
   <select id="getAllTimeTaskResult" resultType="java.util.Map">
-    select RC.CAPACITY_NUMBER "capacityNumber",
-           OO.ORDER_ID "orderId",
+    select * from (select RC.CAPACITY_NUMBER "capacityNumber",
+    OO.ORDER_ID "orderId",
     OO.ORDER_NUMBER "orderNumber",
-    CONCAT(TTTR.RESULT_VALUE,RUOM.UNIT_OF_MEASURE_NAME)  AS "resultTime",
+    CONCAT(TTTR.RESULT_VALUE,RUOM.UNIT_OF_MEASURE_NAME) AS "resultTime",
     RCT.CAPACITY_TYPE_NAME "capacityTypeName",
     TTTR.INSERT_TIME "insertTime",
     (
@@ -715,17 +715,17 @@
     LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
     ON TTR.ORDER_ID=OO.ORDER_ID
     LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
-    ON  TTR.RESULT_TOTAL_ID=TTTR.RESULT_TOTAL_ID
+    ON TTR.RESULT_TOTAL_ID=TTTR.RESULT_TOTAL_ID
     LEFT JOIN RMS_UNIT_OF_MEASURE RUOM
     ON TTTR.RESULT_UOM_ID=RUOM.UNIT_OF_MEASURE_ID
-    LEFT JOIN  RMS_CAPACITY RC
+    LEFT JOIN RMS_CAPACITY RC
     ON RC.CAPACITY_ID=OO.CAPACITY_ID
     LEFT JOIN RMS_CAPACITY_TYPE RCT
     ON RCT.CAPACITY_TYPE_ID=RC.CAPACITY_TYPE_ID
-    where TTTR.RESULT_TIME_TYPE = 3  AND   TTTR.RESULT_VALUE IS NOT NULL
+    where TTTR.RESULT_TIME_TYPE = 3 AND TTTR.RESULT_VALUE IS NOT NULL
     <if test="con!=null">
-      AND RC.CAPACITY_NUMBER LIKE #{con} or  RM.MATERIAL_NAME LIKE  #{con}
-      or  RS.SHIPPER_NAME LIKE #{con}
+      AND RC.CAPACITY_NUMBER LIKE #{con} or RM.MATERIAL_NAME LIKE #{con}
+      or RS.SHIPPER_NAME LIKE #{con}
     </if>
     <if test="userId!=null">
       AND oo.INSERT_USERNAME LIKE #{userId}
@@ -736,7 +736,7 @@
     <if test="startDate != null">
       and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TTTR.INSERT_TIME
       and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TTTR.INSERT_TIME
-    </if>
+    </if>)
     <where>
       <if test="orderNumber != null">
         <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
@@ -776,13 +776,13 @@
       <if test="startTime != null">
         and
         <foreach collection="startTime" item="item" open="(" separator="or" close=")">
-          "startTime" like '%${item}%'
+          to_char("startTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
         </foreach>
       </if>
       <if test="endTime != null">
         and
         <foreach collection="endTime" item="item" open="(" separator="or" close=")">
-          "endTime" like '%${item}%'
+          to_char("endTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
         </foreach>
       </if>
       <if test="timingTime != null">

+ 1 - 8
src/main/resources/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.xml

@@ -865,7 +865,6 @@
 
     <!--  查询内转厂内卸货实绩  -->
     <select id="getInFactoryUnloadResult" parameterType="java.util.Map" resultType="java.util.Map">
-
         SELECT *
         FROM (
         SELECT TUR.RESULT_ID             "resultId",
@@ -924,16 +923,10 @@
                     "warehouseName" like '%${item}%'
                 </foreach>
             </if>
-            <if test="resultStartTime != null">
-                and
-                <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
-                    "resultStartTime" like '%${item}%'
-                </foreach>
-            </if>
             <if test="resultEndTime != null">
                 and
                 <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
-                    "resultEndTime" like '%${item}%'
+                    to_char("resultEndTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
                 </foreach>
             </if>
             <if test="resultNetWeight != null">

+ 14 - 4
src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml

@@ -2078,8 +2078,10 @@
         OO.ORDER_NUMBER "orderNumber",
         RC.CAPACITY_NUMBER "capacityNumber",
         RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        RTC1.TRUCK_CALCULATE_NUMBER "grossCalculateNumber",
         TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
         TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
+        GREATEST(TWR.RESULT_GROSS_WEIGHT_TIME,TWR.RESULT_TARE_WEIGHT_TIME) "netWeightTime",
         TWR.RESULT_TARE_WEIGHT "resultTareWeight",
         TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
         TWR.RESULT_NET_WEIGHT "resultNetWeight",
@@ -2094,11 +2096,13 @@
         on RC.CAPACITY_ID = OO.CAPACITY_ID
         left join RMS_TRUCK_CALCULATE RTC
         on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
+        left join RMS_TRUCK_CALCULATE RTC1
+        on RTC1.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_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
-        where RESULT_TARE_WEIGHT_TIME is not null
+        where TWR.RESULT_NET_WEIGHT IS NOT NULL
         and OO.ORDER_TYPE = #{orderTypee}
         )
         <where>
@@ -2134,7 +2138,7 @@
             <if test="resultGrossWeightTime != null">
                 and
                 <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
-                    "resultGrossWeightTime" like '%${item}%'
+                    to_char("resultGrossWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
                 </foreach>
             </if>
             <if test="resultTareWeight != null">
@@ -2152,7 +2156,7 @@
             <if test="resultTareWeightTime != null">
                 and
                 <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
-                    "resultTareWeightTime" like '%${item}%'
+                    to_char("resultTareWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
                 </foreach>
             </if>
             <if test="resultNetWeight != null">
@@ -2161,10 +2165,16 @@
                     "resultNetWeight" like '%${item}%'
                 </foreach>
             </if>
+            <if test="netWeightTime != null">
+                and
+                <foreach collection="netWeightTime" item="item" open="(" separator="or" close=")">
+                    to_char("netWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
+                </foreach>
+            </if>
         </where>
         <include refid="orderBy"></include>
         <if test="orderField == null  ">
-            order by "resultTareWeightTime" desc
+            order by "netWeightTime" desc
         </if>
     </select>