Your Name %!s(int64=3) %!d(string=hai) anos
pai
achega
ff6a81ff92

+ 17 - 20
src/main/java/com/steerinfo/dil/controller/StatisticalReportController.java

@@ -87,7 +87,7 @@ public class StatisticalReportController extends BaseRESTfulController {
                 mapValue.put("carrierSsoId", carrierSsoId);
             }
         }
-        DataChange.queryDataByTwoDate(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         List<Map<String, Object>> allReport =  statisticalReportService.getAllSaleReportNum(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页数据
@@ -115,7 +115,7 @@ public class StatisticalReportController extends BaseRESTfulController {
                 mapValue.put("carrierSsoId", carrierSsoId);
             }
         }
-        DataChange.queryDataByTwoDate(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         List<Map<String, Object>> allReport =  statisticalReportService.getAllSaleReportNum(mapValue);
         //获取销售统计报表筛选过后的总净重
         BigDecimal AllResultNetWeight = new BigDecimal(0);
@@ -143,29 +143,26 @@ public class StatisticalReportController extends BaseRESTfulController {
                                           String startTime,
                                           String endTime,
                                           String carrierSsoId,
-                                          String userId,
-                                           String userIds,
-                                           String con,
-                                           Integer orderType
+                                          String userId, String userIds, String con, Integer orderType
     ){
         if(carrierSsoId != null) {
             if (!"null".equals(carrierSsoId)) {
                 mapValue.put("carrierSsoId", carrierSsoId);
             }
         }
-        DataChange.queryDataByDate(startTime, endTime, mapValue, sdfDate);//根据时间段查询数据
-            if (userId!=null){
-                mapValue.put("userId",userId);
-            }
-            if (orderType!=null){
-                mapValue.put("orderType",orderType);
-            }
-            if (userIds!=null){
-                mapValue.put("userIds",userIds);
-            }
-            if (con!=null&&!con.equals("undefined")){
-                mapValue.put("con","%"+con+"%");
-            }
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
+        if (userId!=null){
+            mapValue.put("userId",userId);
+        }
+        if (orderType!=null){
+            mapValue.put("orderType",orderType);
+        }
+        if (userIds!=null){
+            mapValue.put("userIds",userIds);
+        }
+        if (con!=null&&!con.equals("undefined")){
+            mapValue.put("con","%"+con+"%");
+        }
         List<Map<String, Object>> allReport =  statisticalReportService.getSporadicSuppliesReportNum1(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页数据
@@ -200,7 +197,7 @@ public class StatisticalReportController extends BaseRESTfulController {
                 mapValue.put("carrierSsoId", carrierSsoId);
             }
         }
-        DataChange.queryDataByDate(startTime, endTime, mapValue, sdfDate);//根据时间段查询数据
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         if (con!=null&&!con.equals("undefined")){
             mapValue.put("con","%"+con+"%");
         }

+ 1 - 1
src/main/java/com/steerinfo/dil/util/DataChange.java

@@ -198,7 +198,7 @@ public class DataChange {
      * @param sdf
      * @return
      **/
-    public static void queryDataByTwoDate(String startTime, String endTime, Map<String, Object> map,SimpleDateFormat sdf){
+    public static void queryDataByDateTime(String startTime, String endTime, Map<String, Object> map,SimpleDateFormat sdf){
         SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
         if (startTime != null && !"null".equals(startTime) && endTime != null && !"null".equals(endTime)) {
             map.put("startDate", sdf.format(new Date(Long.parseLong(startTime))));

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

@@ -360,7 +360,6 @@
         RS.SUPPLIER_NAME            "sendName",
         RM.MATERIAL_NAME                     "materialName",
         CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "materialCode"
-
         from OMSTRUCK_ORDER OO
         join TMSTRUCK_TOTAL_RESULT TTR
             on TTR.ORDER_ID = OO.ORDER_ID
@@ -403,11 +402,11 @@
             and RCA.CARRIER_SSO_ID = #{carrierSsoId}
         </if>
         <if test="oneDate != null">
-            and to_char(TER.RESULT_ENTRY_GATE_TIME, 'YYYY-MM-DD') = #{oneDate}
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_TARE_WEIGHT_TIME
         </if>
         <if test="startDate != null">
-            and to_date(#{startDate}, 'yyyy-mm-dd') &lt;= TER.RESULT_ENTRY_GATE_TIME
-            and to_date(#{endDate}, 'yyyy-mm-dd') >= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_TARE_WEIGHT_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_TARE_WEIGHT_TIME
         </if>
         <if test="con!=null">
             where  "receiveName" like #{con} or  "sendName" like #{con} or "materialName" like #{con}
@@ -584,11 +583,11 @@
             and RCA.CARRIER_SSO_ID = #{carrierSsoId}
         </if>
         <if test="oneDate != null">
-            and to_char(TER.RESULT_ENTRY_GATE_TIME, 'YYYY-MM-DD') = #{oneDate}
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
         </if>
         <if test="startDate != null">
-            and to_date(#{startDate}, 'yyyy-mm-dd') &lt;= TER.RESULT_ENTRY_GATE_TIME
-            and to_date(#{endDate}, 'yyyy-mm-dd') >= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
         </if>
         <if test="con!=null">
             where  "receiveName" like #{con} or  "sendName" like #{con} or "materialName" like #{con}