瀏覽代碼

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU1/DAL-TMS-TRUCK-API

luobang 2 年之前
父節點
當前提交
39488498d9

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

@@ -93,7 +93,7 @@ public class TmstruckLeaveFactoryResultController extends BaseRESTfulController
                 mapValue.put("carrierSsoId", carrierSsoId);
             }
         }
-        if(con!=null&&con.equals("undefined")){
+        if(con!=null&&!con.equals("undefined")){
             mapValue.put("con","%"+con+"%");
         }
         DataChange.queryDataByDateTime(startTime,endTime,mapValue,sdfDateTime);

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

@@ -127,7 +127,7 @@ public class TmstruckLoadResultController extends BaseRESTfulController {
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
         List<Map<String, Object>> loadResult = tmstruckLoadResultService.getAllLoadResult(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,loadResult);
+        PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null,loadResult);
         return success(pageList);
     }
 

+ 7 - 0
src/main/java/com/steerinfo/dil/controller/TmstruckSmsRusultController.java

@@ -4,6 +4,7 @@ import com.steerinfo.dil.feign.ESFeign;
 import com.steerinfo.dil.service.ITmstruckSmsRusultService;
 import com.steerinfo.dil.util.BaseRESTfulController;
 import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageHelper;
@@ -13,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -40,6 +42,7 @@ public class TmstruckSmsRusultController extends BaseRESTfulController{
     ESFeign esFeign;
     @Autowired
     ColumnDataUtil columnDataUtil;
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     //查询短信实绩
     @ApiOperation(value="查询短信实绩")
     @ApiImplicitParams({
@@ -56,7 +59,11 @@ public class TmstruckSmsRusultController extends BaseRESTfulController{
                                                       String con
     ){
         PageHelper.startPage(pageNum,pageSize);
+        if(con!=null){
+            mapValue.put("con","%"+con+"%");
+        }
         //分页数据
+        DataChange.queryDataByDateTime(""+mapValue.get("startTime"),""+mapValue.get("endTime") , mapValue,sdfDateTime);//根据时间段查询数据
         List<Map<String, Object>> smsResult = tmstruckSmsRusultService.getSmsResult(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,smsResult);
         return success(pageList);

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

@@ -102,7 +102,7 @@ public class TmstruckWeightResultController extends BaseRESTfulController {
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
         List<Map<String, Object>> jiMaoResult = tmstruckWeightResultService.getAllJiMaoResult(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,jiMaoResult);
+        PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null,jiMaoResult);
         return success(pageList);
     }
 
@@ -144,7 +144,7 @@ public class TmstruckWeightResultController extends BaseRESTfulController {
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
         List<Map<String, Object>> jiPiResult = tmstruckWeightResultService.getAllJiPiResult(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,jiPiResult);
+        PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null,jiPiResult);
         return success(pageList);
     }
 

+ 7 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckLoadResultServiceImpl.java

@@ -97,6 +97,13 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
     @Override
     public List<Map<String, Object>> getAllLoadResult(Map<String, Object> map) {
         Integer orderType = (Integer) map.get("orderTypee");
+        if(orderType==2){
+            String endDate = (String) map.get("endDate");
+            if (endDate!=null){
+                String s = endDate.replaceAll("00:00:00", "23:59:59");
+                map.put("endDate",s);
+            }
+        }
         switch (orderType) {
             case 1:
             case 2:

+ 7 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckWeightResultServiceImpl.java

@@ -109,6 +109,13 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
     @Override
     public List<Map<String, Object>> getAllJiMaoResult(Map<String, Object> map) {
         Integer orderType = (Integer) map.get("orderTypee");
+        if(orderType==2){
+            String endDate = (String) map.get("endDate");
+            if (endDate!=null){
+                String s = endDate.replaceAll("00:00:00", "23:59:59");
+                map.put("endDate",s);
+            }
+        }
         switch (orderType){
             case 1:
             case 2:

+ 3 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.xml

@@ -647,6 +647,9 @@
         </if>
         )
         <where>
+            <if test="con!=null">
+                "capacityNumber" like #{con}
+            </if>
             <if test="saleNum != null">
                 <foreach collection="saleNum" item="item" open="(" separator="or" close=")">
                     "saleNum" like '%${item}%'

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

@@ -1087,6 +1087,17 @@
     and TLR.STATUS = #{status}
     )
     <where>
+      <if test="startDate!=null">
+        to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=
+        to_date(to_char("resultLoadStartTime",'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')
+      </if>
+      <if test="endDate!=null">
+        and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=
+        to_date(to_char("resultLoadStartTime",'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')
+      </if>
+      <if test="oneDate != null">
+        and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= "resultLoadStartTime"
+      </if>
       <if test="orderNumber != null">
         <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
           "orderNumber" like '%${item}%'

+ 28 - 10
src/main/resources/com/steerinfo/dil/mapper/TmstruckSmsRusultMapper.xml

@@ -362,16 +362,34 @@
   </select>
 <!-- 查询短信实绩 -->
   <select id="selectSmsResult" parameterType="java.util.Map" resultType="java.util.Map">
-    SELECT TSR.RESULT_SENDING_TIME "sendIngTime",
-           TSR.RESULT_SMS_CONTENT  "content",
-           rc.capacity_number      "capacityNo"
-    FROM TMSTRUCK_SMS_RUSULT TSR
-           LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-                     ON TTR.RESULT_TOTAL_ID = TSR.TOTAL_RESULT_ID
-           left join omstruck_order oo
-                     on oo.order_id = ttr.order_id
-           left join rms_capacity rc
-                     on rc.capacity_id = oo.capacity_id
+    SELECT *
+    FROM
+    (
+     SELECT TSR.RESULT_SENDING_TIME "sendIngTime",
+            TSR.RESULT_SMS_CONTENT  "content",
+            rc.capacity_number      "capacityNo"
+     FROM TMSTRUCK_SMS_RUSULT TSR
+    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+              ON TTR.RESULT_TOTAL_ID = TSR.TOTAL_RESULT_ID
+    left join omstruck_order oo
+              on oo.order_id = ttr.order_id
+    left join rms_capacity rc
+              on rc.capacity_id = oo.capacity_id
+   )
+    <where>
+      <if test="con!=null">
+        "capacityNo" like #{con}
+      </if>
+      <if test="oneDate != null">
+        and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= "sendIngTime"
+      </if>
+      <if test="startDate != null">
+        and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= "sendIngTime"
+        and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= "sendIngTime"
+      </if>
+    </where>
+    order by "sendIngTime" DESC
+
   </select>
     <select id="selectIdApp" resultType="java.util.Map">
       select rs.SHIPPER_APPID "AppId",

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

@@ -1174,6 +1174,9 @@
                 and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=
                 to_date(to_char("resultTareWeightTime",'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')
             </if>
+            <if test="oneDate != null">
+                and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= "resultTareWeightTime"
+            </if>
             <if test="purchaseOrderNo != null">
                 <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
                     "purchaseOrderNo" like '%${item}%'
@@ -1301,6 +1304,17 @@
         where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE in (1, 2)
         )
         <where>
+            <if test="startDate!=null">
+                to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=
+                to_date(to_char("resultTareWeightTime",'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')
+            </if>
+            <if test="endDate!=null">
+                and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=
+                to_date(to_char("resultTareWeightTime",'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')
+            </if>
+            <if test="oneDate != null">
+                and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= "resultTareWeightTime"
+            </if>
             <if test="saleNumber != null">
                 <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
                     "saleNumber" like '%${item}%'