txf 3 роки тому
батько
коміт
ba5a946162

+ 4 - 5
src/main/java/com/steerinfo/dil/controller/StatisticalReportController.java

@@ -56,12 +56,11 @@ public class StatisticalReportController extends BaseRESTfulController {
                                                Integer orderType
     ){
         mapValue.put("orderTypee", orderType);
-        DataChange.queryDataByDate(startTime, endTime, mapValue, sdfDate);//根据时间段查询数据
-        List<Map<String, Object>> allReport =  statisticalReportService.getAllPurchaseFLRLReport(mapValue);
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         PageHelper.startPage(pageNum, pageSize);
         //分页数据
         List<Map<String, Object>> report = statisticalReportService.getRLFLReport(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport,report);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,report);
         return success(pageList);
     }
 
@@ -87,7 +86,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 +114,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);

+ 11 - 0
src/main/java/com/steerinfo/dil/util/ColumnDataUtil.java

@@ -26,6 +26,17 @@ public class ColumnDataUtil {
     }
 
     public PageListAdd tableColumnData(Integer apiId, List<Map<String, Object>> list,List<Map<String,Object>> data) {
+        List<Map<String, Object>> columnDataList = columnDataFeign.getColumnData(apiId);
+        for (Map<String, Object> columnData : columnDataList) {
+            //每个表头字段的过滤条件
+            columnData.put("filters", setListMap(data, columnData.get("prop").toString()));
+        }
+        PageListAdd pageList = new PageListAdd(data);
+        pageList.setColumnData(columnDataList);
+        return pageList;
+    }
+
+    public PageListAdd tableColumnData2(Integer apiId, List<Map<String, Object>> list,List<Map<String,Object>> data) {
         List<Map<String, Object>> columnDataList = columnDataFeign.getColumnData(apiId);
         for (Map<String, Object> columnData : columnDataList) {
             //每个表头字段的过滤条件

+ 3 - 3
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))));
@@ -233,7 +233,7 @@ public class DataChange {
         Date date2 = new Date(Long.parseLong(time) + 86400000);
         String dayStartTime = sdfDate.format(date1);
         String dayEndTime = sdfDate.format(date2);
-        map.put("startTime", dayStartTime + "00:00:00");
-        map.put("endTime", dayEndTime + "00:00:00");
+        map.put("startDate", dayStartTime + " 00:00:00");
+        map.put("endDate", dayEndTime + " 00:00:00");
     }
 }

+ 46 - 35
src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml

@@ -17,6 +17,8 @@
                      RC.CAPACITY_NUMBER         "capacityNumber",
                      TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
                      TWR.RESULT_NET_WEIGHT      "resultNetWeight",
+                     TWR.RESULT_GROSS_WEIGHT    "resultGrossWeight",
+                     TWR.RESULT_TARE_WEIGHT     "resultTareWeight",
                      TQR.RESULT_DEDUCTION       "resultDeduction",
                      TUR.RESULT_END_TIME        "resultEndTime",
                      RW.WAREHOUSE_NAME          "warehouseName",
@@ -74,66 +76,75 @@
 
               where OO.ORDER_STATUS in (5, 8, 9, 1, 2)
                 and OO.ORDER_TYPE = #{orderTypee}
-                    <if test="oneDate != null">
-                        and to_char(TER.RESULT_ENTRY_GATE_TIME, 'YYYY-MM-DD') = #{oneDate}
-                    </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
-                    </if>
+                <if test="oneDate != null">
+                    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 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>
              )
         <where>
-            <if test="orderNumber != null">
-                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-                    "orderNumber" like '%${item}%'
-                </foreach>
-            </if>
             <if test="capacityNumber != null">
                 and
                 <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
                     "capacityNumber" like '%${item}%'
                 </foreach>
             </if>
-            <if test="resultEntryGateTime != null">
+            <if test="warehouseName != null">
                 and
-                <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
-                    "resultEntryGateTime" like '%${item}%'
+                <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
+                    "warehouseName" like '%${item}%'
                 </foreach>
             </if>
-            <if test="resultNetWeight != null">
+
+             <if test="resultGrossWeight != null">
                 and
-                <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
-                    "resultNetWeight" like '%${item}%'
+                <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeight" like '%${item}%'
                 </foreach>
             </if>
-            <if test="resultDeduction != null">
+
+            <if test="resultTareWeight != null">
                 and
-                <foreach collection="resultDeduction" item="item" open="(" separator="or" close=")">
-                    "resultDeduction" like '%${item}%'
+                <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
+                    "resultTareWeight" like '%${item}%'
                 </foreach>
             </if>
-            <if test="resultEndTime != null">
+            <if test="enGatepostName != null">
                 and
-                <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
-                    "resultEndTime" like '%${item}%'
+                <foreach collection="enGatepostName" item="item" open="(" separator="or" close=")">
+                    "enGatepostName" like '%${item}%'
                 </foreach>
             </if>
-            <if test="warehouseName != null">
+            <if test="outGatepostName != null">
                 and
-                <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
-                    "warehouseName" like '%${item}%'
+                <foreach collection="outGatepostName" item="item" open="(" separator="or" close=")">
+                    "outGatepostName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="materialName != null">
+                and
+                <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+                    "materialName" like '%${item}%'
                 </foreach>
             </if>
-            <if test="insertTime != null">
+            <if test="purchaseOrderNo != null">
                 and
-                <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
-                    "insertTime" like '%${item}%'
+                <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
+                    "purchaseOrderNo" like '%${item}%'
                 </foreach>
             </if>
-            <if test="resultOutGateTime != null">
+            <if test="supplierName != null">
                 and
-                <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
-                    "resultOutGateTime" like '%${item}%'
+                <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
+                    "supplierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="receiveName != null">
+                and
+                <foreach collection="receiveName" item="item" open="(" separator="or" close=")">
+                    "receiveName" like '%${item}%'
                 </foreach>
             </if>
         </where>
@@ -214,7 +225,7 @@
                               and RCA.CARRIER_SSO_ID = #{carrierSsoId}
                           </if>
                           <if test="oneDate != null">
-                              and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+                              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 hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
@@ -257,7 +268,7 @@
             <if test="materialRemark != null">
                 and
                 <foreach collection="materialRemark" item="item" open="(" separator="or" close=")">
-                    "materialRemark" like '%${item}%'
+                    "materialRemark" = #{item}
                 </foreach>
             </if>
             <if test="sendName != null">