luobang 3 vuotta sitten
vanhempi
commit
1fd00f370c

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

@@ -107,7 +107,7 @@ public class StatisticalReportController extends BaseRESTfulController {
         PageHelper.startPage(pageNum, pageSize);
         //分页数据
         List<Map<String, Object>> report = statisticalReportService.getAllSaleReport(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
+        PageListAdd pageList = columnDataUtil.tableColumnData5(apiId, null, report);
         return success(pageList);
     }
 
@@ -326,7 +326,6 @@ public class StatisticalReportController extends BaseRESTfulController {
                                          String isPage,
                                           String index
     ){
-
          if (orgCode!=null&&!"null".equals(orgCode)){
              mapValue.put("orgCode",orgCode);
          }
@@ -375,7 +374,6 @@ public class StatisticalReportController extends BaseRESTfulController {
         if ("yes".equals(isPage)){
             return success(statisticalReportService.getPurchaseOrderList(mapValue));
         }
-
         PageHelper.startPage(pageNum, pageSize);
         //分页数据
         List<Map<String, Object>> report = statisticalReportService.getPurchaseOrderList(mapValue);

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

@@ -3,6 +3,7 @@ import com.steerinfo.dil.feign.ESFeign;
 import com.steerinfo.dil.service.ITmstruckUnloadResultService;
 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 org.apache.commons.collections4.Put;
 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;
@@ -44,6 +46,7 @@ public class TmstruckUnloadResultController 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"),
@@ -60,9 +63,11 @@ public class TmstruckUnloadResultController extends BaseRESTfulController {
                                            Integer orderType,
                                            String con,
                                            String userId,
-                                           String  userIds
+                                           String  userIds,
+                                         String startTime,
+                                         String endTime
     ){
-
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         if (orderType!=null){
             mapValue.put("orderTypee", orderType);
         }

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

@@ -6,6 +6,7 @@ import com.steerinfo.dil.service.ITmstruckWeightResultService;
 import com.steerinfo.dil.service.impl.TmstruckWeightResultServiceImpl;
 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;
@@ -16,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -47,7 +49,7 @@ public class TmstruckWeightResultController extends BaseRESTfulController {
     @Autowired
     ColumnDataUtil columnDataUtil;
 
-
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
     @ApiOperation(value="新增计量实绩 ")
     @ApiImplicitParams({
@@ -79,6 +81,7 @@ public class TmstruckWeightResultController extends BaseRESTfulController {
                                                String usersId,
                                             String startTime,String endTime
     ){
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         if (orderType!=null) {
             mapValue.put("orderTypee", orderType);
         }

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

@@ -35,13 +35,27 @@ public class ColumnDataUtil {
         pageList.setColumnData(columnDataList);
         return pageList;
     }
-    public PageListAdd tableColumnData4(Integer apiId, List<Map<String, Object>> list,List<Map<String,Object>> data) {
+
+    //动态配置需要筛选条件的表头
+    public PageListAdd tableColumnData5(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) {
+            //每个表头字段的过滤条件
+            if(DataChange.dataToBigDecimal(columnData.get("isFilter")).intValue() == 1){
+                columnData.put("filters", setListMap(data, columnData.get("prop").toString()));
+            }
+        }
         PageListAdd pageList = new PageListAdd(data);
         pageList.setColumnData(columnDataList);
         return pageList;
     }
 
+    public PageListAdd tableColumnData4(Integer apiId, List<Map<String, Object>> list,List<Map<String,Object>> data) {
+        List<Map<String, Object>> columnDataList = columnDataFeign.getColumnData(apiId);
+        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) {

+ 1 - 1
src/main/resources/application-prod.yml

@@ -26,7 +26,7 @@ piction:
 #feign设置
 openfeign:
   ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
+    url: ${COLUMNDATAFEIGN_URL:localhost:8083}
   BmsShipFeign:
     url: ${BMSSHIPFEIGN_URL:172.16.33.166:8078}
   BmsTruckFeign:

+ 24 - 0
src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml

@@ -435,6 +435,30 @@
                     "materialName" like '%${item}%'
                 </foreach>
             </if>
+            <if test="receiveName != null">
+                and
+                <foreach collection="receiveName" item="item" open="(" separator="or" close=")">
+                    "receiveName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="sendName != null">
+                and
+                <foreach collection="sendName" item="item" open="(" separator="or" close=")">
+                    "sendName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="saleWarehouse != null">
+                and
+                <foreach collection="saleWarehouse" item="item" open="(" separator="or" close=")">
+                    "saleWarehouse" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="warehouseName != null">
+                and
+                <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
+                    "warehouseName" like '%${item}%'
+                </foreach>
+            </if>
         </where>
         <include refid="orderBy"></include>
         <if test="orderField == null">

+ 9 - 13
src/main/resources/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.xml

@@ -892,11 +892,19 @@
         LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
         ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
         WHERE OO.ORDER_TYPE = #{orderTypee}
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TUR.RESULT_END_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TUR.RESULT_END_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TUR.RESULT_END_TIME
+        </if>
         ORDER BY TUR.RESULT_END_TIME desc
+
         )
         <where>
             <if test="con !=null">
-                 "mohu" like #{con}
+                 and "mohu" like #{con}
             </if>
             <if test="orderNumber != null">
                 and
@@ -928,18 +936,6 @@
                     "warehouseName" like '%${item}%'
                 </foreach>
             </if>
-            <if test="resultEndTime != null">
-                and
-                <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
-                    to_char("resultEndTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultNetWeight != null">
-                and
-                <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
-                    "resultNetWeight" like '%${item}%'
-                </foreach>
-            </if>
         </where>
         <include refid="orderBy"></include>
     </select>

+ 12 - 44
src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml

@@ -2089,7 +2089,7 @@
         TWR.RESULT_NET_WEIGHT "resultNetWeight",
         TWR.RESULT_POUND_NO "resultPoundNo",
         TWR.INSERT_UPDATE_REMARK "insertUpdateRemark",
-        RC.CAPACITY_NUMBER
+        RC.CAPACITY_NUMBER || RM.MATERIAL_NAME "likeCon"
         from TMSTRUCK_WEIGHT_RESULT TWR
         left join TMSTRUCK_TOTAL_RESULT TTR
         on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
@@ -2107,10 +2107,20 @@
         on RM.MATERIAL_ID = OOM.MATERIAL_ID
         where TWR.RESULT_NET_WEIGHT IS NOT NULL
         and OO.ORDER_TYPE = #{orderTypee}
+        <if test="oneDate != null">
+            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
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
+        </if>
         )
         <where>
+            <if test="con != null">
+                and "likeCon" like #{con}
+            </if>
             <if test="materialName != null">
-                <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+                and <foreach collection="materialName" item="item" open="(" separator="or" close=")">
                     "materialName" like '%${item}%'
                 </foreach>
             </if>
@@ -2132,48 +2142,6 @@
                     "truckCalculateNumber" like '%${item}%'
                 </foreach>
             </if>
-            <if test="resultGrossWeight != null">
-                and
-                <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
-                    "resultGrossWeight" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultGrossWeightTime != null">
-                and
-                <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
-                    to_char("resultGrossWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultTareWeight != null">
-                and
-                <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
-                    "resultTareWeight" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultPoundNo != null">
-                and
-                <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
-                    "resultPoundNo" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultTareWeightTime != null">
-                and
-                <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
-                    to_char("resultTareWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultNetWeight != null">
-                and
-                <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
-                    "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  ">