Parcourir la source

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/DAL-DAZHOU-API

Your Name il y a 3 ans
Parent
commit
e9a57855aa

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

@@ -1945,7 +1945,7 @@ public class TMSController extends BaseRESTfulController {
     ){
         return tmsTruckFeign.getRLFLReport(mapValue==null?new HashMap<>():mapValue, apiId, pageNum, pageSize, startTime, endTime,  orderType);
     }
-    @ApiOperation(value="查询辅料燃料统计报表")
+    @ApiOperation(value="查询销售统计报表")
     @PostMapping("/getAllSaleReport")
     public Map<String, Object> getAllSaleReport(@RequestBody(required=false) Map<String,Object> mapValue,
                                           Integer apiId,
@@ -1956,6 +1956,31 @@ public class TMSController extends BaseRESTfulController {
     ){
         return tmsTruckFeign.getAllSaleReport(mapValue==null?new HashMap<>():mapValue, apiId, pageNum, pageSize, startTime, endTime, carrierSsoId);
     }
+
+    @ApiOperation(value="查询销售统计报表筛选过后的总净重")
+    @PostMapping("/getAllSaleReportTotal")
+    public Map<String, Object> getAllSaleReportTotal(@RequestBody(required=false) Map<String,Object> mapValue,
+                                                String startTime, String endTime,
+                                                String carrierSsoId
+    ){
+        return tmsTruckFeign.getAllSaleReportTotal(mapValue==null?new HashMap<>():mapValue, startTime, endTime, carrierSsoId);
+    }
+
+//    @ApiOperation(value="查询内转统计报表")
+//    @PostMapping("/getAllInwardResult")
+//    public Map<String, Object> getAllInwardResult(@RequestBody(required=false) Map<String,Object> mapValue,
+//                                                Integer apiId,
+//                                                Integer pageNum,
+//                                                Integer pageSize,
+//                                                String startTime, String endTime,
+//                                                String carrierSsoId
+//    ){
+//        return tmsTruckFeign.getAllInwardResult(mapValue==null?new HashMap<>():mapValue, apiId, pageNum, pageSize, startTime, endTime, carrierSsoId);
+//    }
+
+
+
+
     @ApiOperation(value="查询零星物资进厂统计报表")
     @PostMapping("/getSporadicSuppliesReport1")
     public Map<String, Object> getSporadicSuppliesReport1(@RequestBody(required=false) Map<String,Object> mapValue,

+ 27 - 40
src/main/java/com/steerinfo/dil/controller/UniversalController.java

@@ -73,11 +73,10 @@ public class UniversalController extends BaseRESTfulController {
         if(index != null){
             mapValue.put("index","%" + index + "%");
         }
-        List<Map<String, Object>> list = universalMapper.querySupplierByLike(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = universalMapper.querySupplierByLike(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId,columnList);
         return success(data);
     }
 
@@ -99,11 +98,10 @@ public class UniversalController extends BaseRESTfulController {
         if(index != null){
             mapValue.put("index","%" + index + "%");
         }
-        List<Map<String, Object>> list = universalMapper.queryAllSupplierByLike(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = universalMapper.queryAllSupplierByLike(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
         return success(data);
     }
 
@@ -130,11 +128,10 @@ public class UniversalController extends BaseRESTfulController {
         if(index != null){
             mapValue.put("index","%" + index + "%");
         }
-        List<Map<String, Object>> list = universalMapper.getSupplierMesByMaterialId(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = universalMapper.getSupplierMesByMaterialId(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
         return success(data);
     }
 
@@ -152,7 +149,8 @@ public class UniversalController extends BaseRESTfulController {
                                         Integer pageNum,
                                         Integer pageSize,
                                         String carrierSsoId,
-                                        String index
+                                        String index,
+                                        String con
     ){
         if(mapValue == null){
             mapValue = new HashMap<>();
@@ -160,6 +158,9 @@ public class UniversalController extends BaseRESTfulController {
         if(index != null){
             mapValue.put("index", index);
         }
+        if (con != null&&con.equals("undefined")){
+            mapValue.put("con","%"+con+"%");
+        }
         if (carrierSsoId != null && carrierSsoId.equals("undefined")) {
             carrierSsoId = null;
         }
@@ -168,11 +169,10 @@ public class UniversalController extends BaseRESTfulController {
           mapValue.put("carrierId",carrierId);
         }
         //不分页筛选数据
-        List<Map<String, Object>> allCapacity = universalMapper.getAllCapacityByCarrierLike(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
         List<Map<String, Object>> capacity = universalMapper.getAllCapacityByCarrierLike(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allCapacity,capacity);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, capacity);
         return success(pageList);
     }
 
@@ -198,11 +198,10 @@ public class UniversalController extends BaseRESTfulController {
             mapValue.put("orderId", orderId);
         }
         //不分页筛选数据
-        List<Map<String, Object>> allCapacity = universalMapper.getMaterialMesByOrderId(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
         List<Map<String, Object>> capacity = universalMapper.getMaterialMesByOrderId(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allCapacity,capacity);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, capacity);
         return success(pageList);
     }
 
@@ -236,7 +235,7 @@ public class UniversalController extends BaseRESTfulController {
             @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
     })
     @PostMapping("/queryAPOMaterialByLike")
-    public RESTfulResult queryMaterialByLike(@RequestBody(required = false) Map<String,Object> mapValue,
+    public RESTfulResult queryAPOMaterialByLike(@RequestBody(required = false) Map<String,Object> mapValue,
                                              Integer pageNum,
                                              Integer pageSize,
                                              Integer apiId,
@@ -245,14 +244,13 @@ public class UniversalController extends BaseRESTfulController {
         if(mapValue == null) {
             mapValue = new HashMap<>();
         }
-        if(index != null){
-            mapValue.put("index", "%" + index + "%");
+        if(index != null && !"".equals(index) &&!"null".equals(index)){
+            mapValue.put("index", index);
         }
-        List<Map<String, Object>> list = universalMapper.queryAPOMaterialByLike(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = universalMapper.queryAPOMaterialByLike(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
         return success(data);
     }
 
@@ -278,13 +276,12 @@ public class UniversalController extends BaseRESTfulController {
             mapValue.put("type", type);
         }
         if(index != null){
-            mapValue.put("index", "%" + index + "%");
+            mapValue.put("index", index);
         }
-        List<Map<String, Object>> list = universalMapper.getUnloadingMesByLike(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = universalMapper.getUnloadingMesByLike(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
         return success(data);
     }
 
@@ -299,23 +296,18 @@ public class UniversalController extends BaseRESTfulController {
                                              Integer pageNum,
                                              Integer pageSize,
                                              Integer apiId,
-                                             String index,
-                                             String startNum) {
+                                             String index) {
 
         if(mapValue == null) {
             mapValue = new HashMap<>();
         }
-        if(startNum != null){
-            mapValue.put("startNum", startNum + "%");
-        }
         if(index != null){
-            mapValue.put("index", "%" + index + "%");
+            mapValue.put("index", index);
         }
-        List<Map<String, Object>> list = universalMapper.queryMaterialByLike(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = universalMapper.queryMaterialByLike(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
         return success(data);
     }
 
@@ -336,13 +328,12 @@ public class UniversalController extends BaseRESTfulController {
             mapValue = new HashMap<>();
         }
         if(index != null){
-            mapValue.put("index", "%" + index + "%");
+            mapValue.put("index", index);
         }
-        List<Map<String, Object>> list = universalMapper.getBatchAndOrderMes(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = universalMapper.getBatchAndOrderMes(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
         return success(data);
     }
 
@@ -369,13 +360,12 @@ public class UniversalController extends BaseRESTfulController {
             mapValue = new HashMap<>();
         }
         if(index != null){
-            mapValue.put("index","%" + index + "%");
+            mapValue.put("index", index);
         }
-        List<Map<String, Object>> list = universalMapper.queryConsigneeByLike(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = universalMapper.queryConsigneeByLike(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
         return success(data);
     }
 
@@ -395,13 +385,12 @@ public class UniversalController extends BaseRESTfulController {
             mapValue = new HashMap<>();
         }
         if(index != null){
-            mapValue.put("index","%" + index + "%");
+            mapValue.put("index", index);
         }
-        List<Map<String, Object>> list = universalMapper.selectAllMaterialName(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = universalMapper.selectAllMaterialName(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
         return success(data);
     }
 
@@ -440,11 +429,10 @@ public class UniversalController extends BaseRESTfulController {
             mapValue = new HashMap<>();
         }
         mapValue.put("index",index);
-        List<Map<String, Object>> list = universalMapper.getCarrierListByLike(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = universalMapper.getCarrierListByLike(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
         return success(data);
     }
 
@@ -494,11 +482,10 @@ public class UniversalController extends BaseRESTfulController {
             mapValue = new HashMap<>();
         }
         mapValue.put("index",index);
-        List<Map<String, Object>> list = universalMapper.getConsigneeListByLike(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = universalMapper.getConsigneeListByLike(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
         return success(data);
     }
 

+ 19 - 0
src/main/java/com/steerinfo/dil/feign/TmsTruckFeign.java

@@ -380,6 +380,14 @@ public interface TmsTruckFeign {
                                          @RequestParam("endTime")   String endTime,
                                       @RequestParam("carrierSsoId")   String carrierSsoId
     );
+
+    @PostMapping("api/v1/truckTms/statisticalReport/getAllSaleReportTotal")
+    Map<String, Object> getAllSaleReportTotal(@RequestBody(required=false) Map<String,Object> mapValue,
+                                         @RequestParam("startTime") String startTime,
+                                         @RequestParam("endTime")   String endTime,
+                                         @RequestParam("carrierSsoId")   String carrierSsoId
+    );
+
     @PostMapping("api/v1/truckTms/statisticalReport/getSporadicSuppliesReport1")
     Map<String, Object> getSporadicSuppliesReport1(@RequestBody(required=false) Map<String,Object> mapValue,
                                                    @RequestParam("apiId") Integer apiId,
@@ -406,6 +414,17 @@ public interface TmsTruckFeign {
                                                    @RequestParam("con") String con,
                                                    @RequestParam("orderType") Integer orderType
     );
+    //内转统计报表
+    @PostMapping("api/v1/truckTms/statisticalReport/getAllInwardResult")
+    Map<String, Object> getAllInwardResult(@RequestBody(required=false) Map<String,Object> mapValue,
+                                         @RequestParam("apiId") Integer apiId,
+                                         @RequestParam("pageNum") Integer pageNum,
+                                         @RequestParam("pageSize") Integer pageSize,
+                                         @RequestParam("startTime") String startTime,
+                                         @RequestParam("endTime")   String endTime,
+                                         @RequestParam("carrierSsoId")   String carrierSsoId
+    );
+
 }
 
 

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

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

+ 37 - 33
src/main/resources/com/steerinfo/dil/mapper/UniversalMapper.xml

@@ -60,7 +60,7 @@
     <select id="queryAPOMaterialByLike" parameterType="java.util.Map" resultType="java.util.Map">
         SELECT *
         FROM (
-                SELECT DISTINCT RM.MATERIAL_ID "materialId",
+                SELECT RM.MATERIAL_ID "materialId",
                     RM.MATERIAL_NAME "materialName",
                     RM.MATERIAL_CODE "materialCode",
                     RM.MATERIAL_SPECIFICATION "materialSpecification",
@@ -72,13 +72,13 @@
                         ON RM.MATERIAL_ID = DB.MATERIAL_ID
                 <where>
                     <if test="index != null">
-                        RM.MATERIAL_NAME LIKE #{index}
+                        instr(RM.MATERIAL_NAME, #{index}) > 0
                     </if>
                 </where>
+                 group by RM.MATERIAL_ID,RM.MATERIAL_NAME,RM.MATERIAL_CODE,RM.MATERIAL_SPECIFICATION,RM.MATERIAL_MODEL
         )
         <where>
             <if test="materialName != null">
-
                 <foreach collection="materialName" item="item" open="(" separator="or" close=")">
                  "materialName" like '%${item}%'
                 </foreach>
@@ -103,9 +103,6 @@
             </if>
         </where>
         <include refid="orderBy"></include>
-        <if test="orderField == null  ">
-            order by "materialId" desc
-        </if>
     </select>
     <!--    模糊查询发货单位 -->
     <select id="querySupplierByLike" parameterType="java.util.Map" resultType="java.util.Map">
@@ -160,6 +157,10 @@
             <if test="index != null">
                 and (instr(RC.CAPACITY_NUMBER, #{index}) > 0 or instr(RCA.CARRIER_NAME, #{index}) > 0)
             </if>
+            <if test="con != null">
+                where "capacityNumber" like #{con} or "carrierName" like #{con} or
+                "remark" like #{con}
+            </if>
         )
         <where>
             <if test="capacityNumber != null">
@@ -173,6 +174,12 @@
                     "carrierName" like '%${item}%'
                 </foreach>
             </if>
+            <if test="remark != null">
+                and
+                <foreach collection="remark" item="item" open="(" separator="or" close=")">
+                    "remark" like '%${item}%'
+                </foreach>
+            </if>
         </where>
         <include refid="orderBy"></include>
         <if test="orderField == null  ">
@@ -241,7 +248,7 @@
         from RMS_MATERIAL RM
         <where>
             <if test="index != null">
-                RM.MATERIAL_NAME like #{index}
+               instr(RM.MATERIAL_NAME, #{index}) > 0
             </if>
         </where>
         )
@@ -309,12 +316,12 @@
                      <if test="type != null">
                          RW.WAREHOUSE_TYPE_ID = #{type}
                      </if>
+                     <if test="index != null">
+                         instr(RW.WAREHOUSE_NAME, #{index}) > 0
+                     </if>
                  </where>
              )
         <where>
-            <if test="index != null">
-                "warehouseName" like #{index}
-            </if>
             <if test="warehouseName != null">
                 <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
                     "warehouseName" like '%${item}%'
@@ -338,20 +345,13 @@
         RM.MATERIAL_MODEL "materialModel"
         FROM RMS_MATERIAL RM
         <where>
-            <if test="startNum != null">
-                RM.MATERIAL_CODE LIKE #{startNum}
-            </if>
-            <if test="startNum == null">
-                RM.MATERIAL_CODE LIKE '010%' OR RM.MATERIAL_CODE LIKE '080%'
+            <if test="index != null">
+                instr(RM.MATERIAL_NAM, #{index}) > 0
             </if>
         </where>
         )
         <where>
-            <if test="index != null">
-                "materialName" LIKE #{index}
-            </if>
             <if test="materialName != null">
-                and
                 <foreach collection="materialName" item="item" open="(" separator="or" close=")">
                     "materialName" like '%${item}%'
                 </foreach>
@@ -397,7 +397,7 @@
                                     on RM.MATERIAL_ID = DB.MATERIAL_ID
                  <where>
                      <if test="index != null">
-                         "resultForeignShipName" like #{index}
+                         instr(DB.RESULT_FOREIGN_SHIP_NAME, #{index}) > 0
                      </if>
                  </where>
              )
@@ -493,7 +493,9 @@
     </select>
 
     <select id="queryConsigneeByLike" resultType="java.util.Map" parameterType="java.util.Map" >
-        SELECT * FROM (
+        SELECT
+               *
+        FROM (
         SELECT
         RCO.CONSIGNEE_COMPANY_NAME AS "consigneeCompanyName",
         RCO.CONSIGNEE_CODE AS "consigneeCode",
@@ -501,21 +503,23 @@
         FROM RMS_CONSIGNEE RCO
         <where>
             <if test="index != null">
-                RCO.CONSIGNEE_COMPANY_NAME like #{index}
+                instr(RCO.CONSIGNEE_COMPANY_NAME, #{index}) > 0
             </if>
         </where>
         )
-        <if test="consigneeCompanyName != null">
-            <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
-                "consigneeCompanyName" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="consigneeCode != null">
-            and
-            <foreach collection="consigneeCode" item="item" open="(" separator="or" close=")">
-                "consigneeCode" like '%${item}%'
-            </foreach>
-        </if>
+        <where>
+            <if test="consigneeCompanyName != null">
+                <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+                    "consigneeCompanyName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="consigneeCode != null">
+                and
+                <foreach collection="consigneeCode" item="item" open="(" separator="or" close=")">
+                    "consigneeCode" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
     </select>
 
 <!--  通过订单ID查询订单下所有物资  -->