Преглед на файлове

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

txf преди 3 години
родител
ревизия
230885ca98

+ 6 - 6
src/main/java/com/steerinfo/dil/controller/TmstruckEnfactoryResultController.java

@@ -4,6 +4,7 @@ import com.steerinfo.dil.feign.ESFeign;
 import com.steerinfo.dil.service.ITmstruckEnfactoryResultService;
 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;
@@ -42,7 +44,7 @@ public class TmstruckEnfactoryResultController extends BaseRESTfulController {
 
     @Autowired
     ColumnDataUtil columnDataUtil;
-
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     @ApiOperation(value="查询所有的进厂实绩")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
@@ -57,14 +59,12 @@ public class TmstruckEnfactoryResultController extends BaseRESTfulController {
                                        Integer pageNum,
                                        Integer pageSize,
                                        Integer orderType,
-                                       String con,
+                                       String startTime,
+                                       String endTime,
                                        String userId,
                                        String userIds
                                        ){
-
-        if(con!=null&&con.equals("undefined")){
-            mapValue.put("con","%"+con+"%");
-        }
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         if (userId!=null){
             mapValue.put("userId",userId);
         }

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

@@ -5,6 +5,7 @@ import com.steerinfo.dil.model.TmstruckLeaveFactoryResult;
 import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
 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;
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.io.File;
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -50,6 +52,8 @@ public class TmstruckLeaveFactoryResultController extends BaseRESTfulController
     @Autowired
     ColumnDataUtil columnDataUtil;
 
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
     @ApiOperation(value="新增汽车出厂实绩:oms远程调用")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "mapValue", value = "总实绩ID、线路终点", required = false, dataType = "Map"),
@@ -77,7 +81,9 @@ public class TmstruckLeaveFactoryResultController extends BaseRESTfulController
                                                String con,
                                                String carrierSsoId,
                                                String userId,
-                                               String userIds){
+                                               String userIds,
+                                               String startTime,
+                                               String endTime){
 
         if (userId!=null){
             mapValue.put("userId",userId);
@@ -96,6 +102,7 @@ public class TmstruckLeaveFactoryResultController extends BaseRESTfulController
         if(con!=null&&con.equals("undefined")){
             mapValue.put("con","%"+con+"%");
         }
+        DataChange.queryDataByDateTime(startTime,endTime,mapValue,sdfDateTime);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
         List<Map<String, Object>> leaveFactoryResult = tmstruckLeaveFactoryResultService.getLeaveFactoryResult(mapValue);

+ 63 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckEnfactoryResultMapper.xml

@@ -497,6 +497,13 @@
         left join RMS_GATEPOST RG
         on RG.GATEPOST_ID = TER.GATEPOST_ID
         where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
         )
         <where>
             <if test="purchaseOrderId != null">
@@ -589,6 +596,13 @@
         left join RMS_GATEPOST RG
         on RG.GATEPOST_ID = TER.GATEPOST_ID
         where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = 4
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
         )
         <where>
             <if test="materialName != null">
@@ -727,6 +741,13 @@
         LEFT JOIN RMS_CONSIGNEE RCON
         ON RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
         WHERE TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
               AND OO.ORDER_TYPE IN (1, 2, 3)
         )
         <where>
@@ -854,6 +875,13 @@
                                     ON RC.CAPACITY_ID = OO.CAPACITY_ID
                  WHERE OO.ORDER_TYPE = 4
                    AND TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
              )
         <where>
             <if test="dayplanNo != null">
@@ -947,6 +975,13 @@
                                     on RG.GATEPOST_ID = TER.GATEPOST_ID
                  where TER.RESULT_ENTRY_GATE_TIME is not null
                    and OO.ORDER_TYPE = 9
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
              )
         <where>
             <if test="purchaseOrderId != null">
@@ -1043,6 +1078,13 @@
         on RG.GATEPOST_ID = TER.GATEPOST_ID
         where TER.RESULT_ENTRY_GATE_TIME is not null
         and OO.ORDER_TYPE = 11
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
         )
         <where>
             <if test="materialName != null">
@@ -1192,6 +1234,13 @@
         left join RMS_CAPACITY RC
         on RC.CAPACITY_ID = OO.CAPACITY_ID
         WHERE OO.ORDER_TYPE = #{orderTypee} and TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
+            <if test="oneDate != null">
+                and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            </if>
+            <if test="startDate != null">
+                and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+                and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+            </if>
             <if test="userId!=null">
                and ASO.INSERT_USERNAME=#{userId}
             </if>
@@ -1284,6 +1333,13 @@
         <if test="userId">
             and air.INSERT_USERNAME=#{userId}
         </if>
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
         )
         <where>
             <if test="purchaseOrderId != null">
@@ -1380,6 +1436,13 @@
    <if test="userId !=null">
       and AIR.INSERT_USERNAME = #{userId}
    </if>
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
     order by tlfr.result_out_gate_time desc
         <where>
             <if test="capacityNumber != null">

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

@@ -501,6 +501,13 @@
             <if test="carrierSsoId != null">
                 and RCA.CARRIER_SSO_ID = #{carrierSsoId}
             </if>
+            <if test="oneDate != null">
+              and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            </if>
+            <if test="startDate != null">
+              and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+              and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+           </if>
         )
         <where>
             <if test="purchaseOrderNo != null">
@@ -641,6 +648,13 @@
         ON RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
         WHERE TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
         AND OO.ORDER_TYPE IN (1, 2, 3)
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
         )
         <where>
             <if test="saleNum != null">
@@ -799,6 +813,13 @@
                                     ON RG.GATEPOST_ID = TLFR.GATEPOST_ID
                  WHERE OO.ORDER_TYPE = 4
                    AND TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
              )
         <where>
             <if test="dayplanNo != null">
@@ -880,6 +901,13 @@
 
                  where RESULT_OUT_GATE_TIME is not null
                    and OO.ORDER_TYPE = 9
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
              )
         <where>
             <if test="purchaseOrderNo != null">
@@ -961,6 +989,13 @@
         on RG.GATEPOST_ID = TLFR.GATEPOST_ID
         where RESULT_OUT_GATE_TIME is not null
         and OO.ORDER_TYPE = 11
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
         )
         <where>
             <if test="orderNumber != null">
@@ -1129,6 +1164,13 @@
                 where "orderNumber" like #{con} or "capacityNumber" like #{con}
                 or "gatepostName" like #{con}  or  "materialName" like #{con}
             </if>
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
         )
         <where>
             <if test="orderNumber != null">