Jelajahi Sumber

20221215 14:04

wangzhuo 2 tahun lalu
induk
melakukan
0913cefc07

+ 48 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/plugin/ForeignApiController.java

@@ -4,10 +4,13 @@ import cn.hutool.json.JSONObject;
 import com.ruoyi.ccb.domain.QueryLowerPositionR;
 import com.ruoyi.ccb.service.ForeignHttpService;
 import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.page.TableDataInfo;
 import lombok.AllArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -59,9 +62,29 @@ public class ForeignApiController extends BaseController {
                                                          @RequestParam(value = "level",required = false) String level,
                                                          @RequestParam(value = "pageNo",required = false) Integer pageNo,
                                                          @RequestParam(value = "pageSize",required = false) Integer pageSize) {
-        startPage();
-        return foreignHttpService.queryGoodsAccountByPageV1(warehouseCode, ownerName, goodsName, specifications,
+        List<Map<String, Object>> listSize = foreignHttpService.queryGoodsAccountByPageV1(warehouseCode, ownerName, goodsName, specifications,
                 producing, materialQuality, level, pageNo, pageSize);
+
+        WMSStartPage(pageNo, pageSize);
+
+        List<Map<String, Object>> list = foreignHttpService.queryGoodsAccountByPageV1(warehouseCode, ownerName, goodsName, specifications,
+                producing, materialQuality, level, pageNo, pageSize);
+
+        TableDataInfo tableDataInfo = getDataTable(list);
+
+        Map<String, Object> data = new HashMap<>();
+        data.put("list", tableDataInfo.getRows());
+        data.put("pageNo", pageNo);
+        data.put("pageSize", pageSize);
+        data.put("total", listSize.size());
+        data.put("pageCount", listSize.size() / pageSize);
+
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code","0");
+        mapR.put("msg", "OK");
+        mapR.put("data", data);
+
+        return mapR;
     }
 
     /**
@@ -86,9 +109,30 @@ public class ForeignApiController extends BaseController {
                                                          @RequestParam(value = "slotCode",required = false) String slotCode,
                                                          @RequestParam(value = "pageNo") Integer pageNo,
                                                          @RequestParam(value = "pageSize") Integer pageSize) {
-        startPage();
-        return foreignHttpService.queryGoodsAccountDetailByPageV1(warehouseCode, ownerName, ownerCode, goodsName, specifications,
+
+        List<Map<String, Object>> listSize = foreignHttpService.queryGoodsAccountDetailByPageV1(warehouseCode, ownerName, ownerCode, goodsName, specifications,
                 producing, materialQuality, level, receiptDoc, billOfLading, areaName, areaCode, slotName, slotCode, pageNo, pageSize);
+
+        WMSStartPage(pageNo, pageSize);
+
+        List<Map<String, Object>> list = foreignHttpService.queryGoodsAccountDetailByPageV1(warehouseCode, ownerName, ownerCode, goodsName, specifications,
+                producing, materialQuality, level, receiptDoc, billOfLading, areaName, areaCode, slotName, slotCode, pageNo, pageSize);
+
+        TableDataInfo tableDataInfo = getDataTable(list);
+
+        Map<String, Object> data = new HashMap<>();
+        data.put("list", tableDataInfo.getRows());
+        data.put("pageNo", pageNo);
+        data.put("pageSize", pageSize);
+        data.put("total", listSize.size());
+        data.put("pageCount", listSize.size() / pageSize);
+
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code","0");
+        mapR.put("msg", "OK");
+        mapR.put("data", data);
+
+        return mapR;
     }
 
     /**

+ 11 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java

@@ -55,6 +55,17 @@ public class BaseController {
     }
 
     /**
+     * 设置请求分页数据
+     */
+    protected void WMSStartPage(Integer pageNo, Integer pageSize) {
+        PageDomain pageDomain = TableSupport.buildPageRequest();
+        if (StringUtils.isNotNull(pageNo) && StringUtils.isNotNull(pageSize)) {
+            String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
+            PageHelper.startPage(pageNo, pageSize, orderBy);
+        }
+    }
+
+    /**
      * 响应请求分页数据
      */
     @SuppressWarnings({"rawtypes", "unchecked"})

+ 2 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/SignInterceptor.java

@@ -29,7 +29,8 @@ public class SignInterceptor implements HandlerInterceptor {
             String uri = request.getHeader("uri");
             String sign = request.getHeader("sign");
 
-            String mdUrl = "appKey="+appKey+"&timestamp="+timestamp+"&uri="+uri+"&appSecret=irf6DdRkEdR6whj4";
+            String mdUrl = "appKey="+appKey+"&timestamp="+timestamp+"&uri="+uri+"&appSecret=Qrgx3tn2tGqdIkvwIK0rcdckdYDG3caF";//森能正式
+            //String mdUrl = "appKey="+appKey+"&timestamp="+timestamp+"&uri="+uri+"&appSecret=irf6DdRkEdR6whj4";
             System.out.println("MD5加密======>"+mdUrl);
             String md5Upper = this.encrypt3ToMD5(mdUrl);
             System.out.println("加密后======>"+md5Upper);

+ 5 - 4
ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/ForeignHttpService.java

@@ -3,6 +3,7 @@ package com.ruoyi.ccb.service;
 import cn.hutool.json.JSONObject;
 import com.ruoyi.ccb.domain.*;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -24,13 +25,13 @@ public interface ForeignHttpService {
     /**
      * 查询货物台账
      */
-    Map<String, Object> queryGoodsAccountByPageV1(String warehouseCode,String ownerName,String goodsName,String specifications,String producing,
-                                                        String materialQuality,String level,Integer pageNo,Integer pageSize);
+    List<Map<String, Object>> queryGoodsAccountByPageV1(String warehouseCode, String ownerName, String goodsName, String specifications, String producing,
+                                                        String materialQuality, String level, Integer pageNo, Integer pageSize);
 
     /**
-     * 查询货物台账
+     * 查询货物台账明细
      */
-    Map<String, Object> queryGoodsAccountDetailByPageV1(String warehouseCode,String ownerName,String ownerCode,String goodsName,String specifications,
+    List<Map<String, Object>> queryGoodsAccountDetailByPageV1(String warehouseCode,String ownerName,String ownerCode,String goodsName,String specifications,
                                                         String producing,String materialQuality,String level, String receiptDoc,String billOfLading,
                                                         String areaName,String areaCode,String slotName,String slotCode,Integer pageNo,Integer pageSize);
 

+ 84 - 49
ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/impl/ForeignHttpServiceImpl.java

@@ -7,6 +7,7 @@ import com.ruoyi.ccb.domain.*;
 import com.ruoyi.ccb.service.ForeignHttpService;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import lombok.AllArgsConstructor;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import java.util.*;
@@ -30,14 +31,14 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
         tWarehouse.setDelFlag("0");
         tWarehouse.setfStatus("0");
         if (ObjectUtil.isNotNull(position)){
-            tWarehouse.setfNo(position);
-        }else{
+            tWarehouse.setParentId(Long.valueOf(position));
+        }else {
             tWarehouse.setParentId(100l);
         }
         List<TWarehouse> list = itWarehouseService.selectTWarehouseList(tWarehouse);
         for (TWarehouse tWarehouse_:list) {
             Map<String,Object> map = new HashMap<>();
-            map.put("code",tWarehouse_.getfNo());
+            map.put("code",tWarehouse_.getfId());
             map.put("name",tWarehouse_.getfName());
             mapList.add(map);
         }
@@ -53,7 +54,7 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
         Map<String,Object> map = new HashMap<>();
         TWarehouse tWarehouse = itWarehouseService.selectByCode(position);
         if (ObjectUtil.isNotNull(tWarehouse)){
-            map.put("code",tWarehouse.getfNo());
+            map.put("code",tWarehouse.getfId());
             map.put("name",tWarehouse.getfName());
         }
         Map<String,Object> mapR = new HashMap<>();
@@ -67,7 +68,7 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      * 查询货物台账
      */
     @Override
-    public Map<String, Object> queryGoodsAccountByPageV1(String warehouseCode,
+    public List<Map<String, Object>> queryGoodsAccountByPageV1(String warehouseCode,
                                                            String ownerName,
                                                            String goodsName,
                                                            String specifications,
@@ -77,45 +78,20 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
                                                            Integer pageNo,
                                                            Integer pageSize)
     {
-        List<Map<String, Object>> list = itWarehouseService.queryGoodsAccountByPageV1(warehouseCode, ownerName, goodsName, specifications,
+        return itWarehouseService.queryGoodsAccountByPageV1(warehouseCode, ownerName, goodsName, specifications,
                 producing, materialQuality, level, pageNo, pageSize);
-        Map<String, Object> data = new HashMap<>();
-        data.put("list", list);
-        data.put("pageNo", pageNo);
-        data.put("pageSize", pageSize);
-        data.put("total", list.size());
-        data.put("pageCount", list.size() / pageSize);
-
-        Map<String, Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg", "OK");
-        mapR.put("data", data);
 
-        return mapR;
     }
 
     /**
      * 查询台账明细
      */
     @Override
-    public Map<String, Object> queryGoodsAccountDetailByPageV1(String warehouseCode,String ownerName,String ownerCode,String goodsName,String specifications,
+    public List<Map<String, Object>> queryGoodsAccountDetailByPageV1(String warehouseCode,String ownerName,String ownerCode,String goodsName,String specifications,
                                                                      String producing,String materialQuality,String level, String receiptDoc,String billOfLading,
                                                                      String areaName,String areaCode,String slotName,String slotCode,Integer pageNo,Integer pageSize){
-        List<Map<String, Object>> list = itWarehouseService.queryGoodsAccountDetailByPageV1(warehouseCode, ownerName, ownerCode, goodsName, specifications,
+        return itWarehouseService.queryGoodsAccountDetailByPageV1(warehouseCode, ownerName, ownerCode, goodsName, specifications,
                 producing, materialQuality, level, receiptDoc, billOfLading, areaName, areaCode, slotName, slotCode, pageNo, pageSize);
-        Map<String, Object> data = new HashMap<>();
-        data.put("list", list);
-        data.put("pageNo", pageNo);
-        data.put("pageSize", pageSize);
-        data.put("total", list.size());
-        data.put("pageCount", list.size() / pageSize);
-
-        Map<String, Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg", "OK");
-        mapR.put("data", data);
-
-        return mapR;
     }
 
     /**
@@ -144,11 +120,17 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      */
     @Override
     public Map<String, Object> getStorageInfo(String wareHouseId) {
-        Map<String,Object> map= itWarehouseService.getStorageInfo(wareHouseId);
         Map<String,Object> mapR = new HashMap<>();
+
+        Map<String,Object> map= itWarehouseService.getStorageInfo(wareHouseId);
+        if (map == null){
+            mapR.put("data",new HashMap<>());
+        }else {
+            mapR.put("data",map);
+        }
+
         mapR.put("code","0");
         mapR.put("msg","OK");
-        mapR.put("data",map);
         return mapR;
     }
 
@@ -160,10 +142,20 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
         Map<String,Object> data = new HashMap<>();
 
         List<Map<String,Object>> storageInfo = itWarehouseService.getTimeStorageInfo(wareHouseId,startTime,endTime);
-        data.put("storageInfo", storageInfo);
+        storageInfo.removeAll(Collections.singleton(null));
+        if (storageInfo == null){
+            data.put("storageInfo", new ArrayList<Map<String,Object>>());
+        }else {
+            data.put("storageInfo", storageInfo);
+        }
 
         List<Map<String, Object>> throughputInfo = itWarehouseService.getTimeThroughputInfo(wareHouseId,startTime,endTime);
-        data.put("throughputInfo", throughputInfo);
+        throughputInfo.removeAll(Collections.singleton(null));
+        if (throughputInfo == null){
+            data.put("throughputInfo", new ArrayList<Map<String,Object>>());
+        }else {
+            data.put("throughputInfo", throughputInfo);
+        }
 
         Map<String,Object> mapR = new HashMap<>();
         mapR.put("code","0");
@@ -180,11 +172,17 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
         Map<String,Object> data = new HashMap<>();
 
         //质押保管
-        Map<String, Object> normaGoods = itWarehouseService.getCargoInfo(wareHouseId,startTime,endTime,"1");
-        data.put("normaGoods", normaGoods.get("FGrossweight"));
+        Map<String, Object> normaGoods = itWarehouseService.getCargoInfo(wareHouseId,startTime,endTime,"0");
+        if (normaGoods != null){
+            data.put("normaGoods", normaGoods.get("FGrossweight"));
+        }
+
         //普通保管
-        Map<String, Object> pledgeGoods = itWarehouseService.getCargoInfo(wareHouseId,startTime,endTime,"0");
-        data.put("pledgeGoods", pledgeGoods.get("FGrossweight"));
+        Map<String, Object> pledgeGoods = itWarehouseService.getCargoInfo(wareHouseId,startTime,endTime,null);
+        if (pledgeGoods != null){
+            data.put("pledgeGoods", pledgeGoods.get("FGrossweight"));
+        }
+
 
         List<Map<String, Object>> goodsList = itWarehouseService.getGoodsList(wareHouseId,startTime,endTime);
         data.put("goods", goodsList);
@@ -203,15 +201,15 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
         Map<String,Object> data = new HashMap<>();
 
         //报税现货
-        List<Map<String, Object>> freeTaxCurGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"保税现货");
+        List<Map<String, Object>> freeTaxCurGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"1");
         data.put("freeTaxCurGoods", freeTaxCurGoods);
         //非报税现货
-        List<Map<String, Object>> taxCurGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"非保税现货");
+        List<Map<String, Object>> taxCurGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"2");
         data.put("taxCurGoods", taxCurGoods);
-        //报税现
+        //非报税期
         List<Map<String, Object>> taxForGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"非保税期货");
         data.put("taxForGoods", taxForGoods);
-        //报税
+        //报税
         List<Map<String, Object>> freeTaxForGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"保税期货");
         data.put("freeTaxForGoods", freeTaxForGoods);
 
@@ -230,6 +228,13 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
 
        List<Map<String, Object>> data = itWarehouseService.getStorageTop(wareHouseId,countType,topCnt);
 
+        if (data.size() > 0){
+            for (int i = 0; i < data.size(); i++){
+                Map<String, Object> map = data.get(i);
+                map.put("top", i + 1);
+            }
+        }
+
         Map<String,Object> mapR = new HashMap<>();
         mapR.put("code","0");
         mapR.put("msg","OK");
@@ -245,6 +250,13 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
 
         List<Map<String, Object>> data = itWarehouseService.getGoodsTop(wareHouseId,countType,topCnt);
 
+        if (data.size() > 0){
+            for (int i = 0; i < data.size(); i++){
+                Map<String, Object> map = data.get(i);
+                map.put("top", i + 1);
+            }
+        }
+
         Map<String,Object> mapR = new HashMap<>();
         mapR.put("code","0");
         mapR.put("msg","OK");
@@ -261,11 +273,23 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
 
         //普通过户量
         List<Map<String, Object>> normalTransferList = itWarehouseService.getTransferTransaction(wareHouseId, startTime, endTime);
-        data.put("normalTransferList", normalTransferList);
+        normalTransferList.removeAll(Collections.singleton(null));
+        if (normalTransferList == null){
+            data.put("normalTransferList", new ArrayList<Map<String,Object>>());
+        }else {
+            data.put("normalTransferList", normalTransferList);
+        }
+
 
         //仓单过户量
         List<Map<String, Object>> receiptTransferList = new ArrayList<>();
-        data.put("receiptTransferList", receiptTransferList);
+        receiptTransferList.removeAll(Collections.singleton(null));
+        if (receiptTransferList == null){
+            data.put("receiptTransferList", new ArrayList<Map<String,Object>>());
+        }else {
+            data.put("receiptTransferList", receiptTransferList);
+        }
+
 
         Map<String,Object> mapR = new HashMap<>();
         mapR.put("code","0");
@@ -307,11 +331,22 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
 
         //入库单据
         List<Map<String, Object>> inputReceiptList = itWarehouseService.getWorkTrend(wareHouseId,startTime,endTime, "SJRK");
-        data.put("inputReceiptList", inputReceiptList);
+        inputReceiptList.removeAll(Collections.singleton(null));
+        if (inputReceiptList == null){
+            data.put("inputReceiptList", new ArrayList<Map<String,Object>>());
+        }else {
+            data.put("inputReceiptList", inputReceiptList);
+        }
 
         //出库单据
         List<Map<String, Object>> outputReceiptList = itWarehouseService.getWorkTrend(wareHouseId,startTime,endTime, "SJRK");
-        data.put("receiptTransferList", outputReceiptList);
+        outputReceiptList.removeAll(Collections.singleton(null));
+        if (outputReceiptList == null){
+            data.put("outputReceiptList", new ArrayList<Map<String,Object>>());
+        }else {
+            data.put("outputReceiptList", outputReceiptList);
+        }
+
 
         Map<String,Object> mapR = new HashMap<>();
         mapR.put("code","0");

+ 77 - 62
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -352,81 +352,96 @@
     <select id="getWarehouseByNo" parameterType="String" resultMap="TWarehouseResult">
         <include refid="selectTWarehouseVo"/>
         <where>
-            f_no = #{fNo} and del_flag = '0' limit 1
+            f_id = #{fNo} and del_flag = '0' limit 1
         </where>
     </select>
 
     <select id="queryGoodsAccountByPageV1" resultType="map">
         SELECT
-            TW.f_no AS warehouseCode,
+            TW.f_id AS warehouseCode,
             TW.f_name AS warehouseName,
             TC.f_no AS ownerCode,
-            'xxx有限公司' AS ownerName,
+            TC.f_name AS ownerName,
             TG.f_name AS goodsName,
             TG.f_packagespecs AS specifications,
             '' AS producing,
             TWG.f_marks AS materialQuality,
-            '' AS level,
-            TWG.f_qtyblc AS totalQuantity,
-            TWG.f_qtyD AS availableQuantity,
+            '' AS LEVEL,
+            SUM(TWG.f_qtyD) AS totalQuantity,
+            SUM(TWG.f_qtyblc) AS availableQuantity,
             '袋' AS quantityUnit,
-            IFNULL( ROUND( TWG.f_netweightblc / 1000, 2 ), 0 ) AS totalNetWeight,
-            IFNULL( ROUND( TWG.f_netweightD / 1000, 2 ), 0 ) AS availableWeight,
+            IFNULL( ROUND( SUM(TWG.f_netweightD) / 1000, 2 ), 0 ) AS totalNetWeight,
+            IFNULL( ROUND( SUM(TWG.f_netweightblc) / 1000, 2 ), 0 ) AS availableWeight,
             '吨' AS weightUnit,
-            TG.f_name + '-' + TG.f_packagespecs + '/袋' + '-' + TWG.f_marks AS spu
+            CONCAT_WS('-',IFNULL( TG.f_name, '' ),CONCAT_WS( IFNULL( TG.f_packagespecs, '' ), '/袋' ),IFNULL( TWG.f_marks, '' )) AS spu
         FROM t_warehouse TW
         LEFT JOIN t_whgenleg TWG ON TWG.f_warehouseid = TW.f_id
         LEFT JOIN t_corps TC ON TC.f_id = TWG.f_corpid
         LEFT JOIN t_goods TG ON TG.f_id = TWG.f_goodsid
         <where>
             TW.del_flag = '0'
-            AND TW.f_no = #{warehouseCode}
+            AND TW.f_id = #{warehouseCode}
             <if test="ownerName != null  and ownerName != ''"> and TC.f_name like concat('%', #{ownerName}, '%')</if>
             <if test="goodsName != null  and goodsName != ''"> and TG.f_name like concat('%', #{goodsName}, '%')</if>
             <if test="specifications != null  and specifications != ''"> and TG.f_packagespecs like concat('%', #{specifications}, '%')</if>
             <if test="materialQuality != null  and materialQuality != ''"> and TWG.f_marks like concat('%', #{materialQuality}, '%')</if>
         </where>
+        GROUP BY
+        TW.f_id,TC.f_no,TG.f_name,TG.f_packagespecs,TWG.f_marks
     </select>
 
     <select id="queryGoodsAccountDetailByPageV1" resultType="map">
         SELECT
-            TW.f_id AS id,
+            DISTINCT
+            TWG.f_id AS id,
             TW.f_no AS warehouseCode,
             TW.f_name AS warehouseName,
-            TW.f_name AS areaName,
-            TW.f_no AS areaCode,
-            '' AS slotName,
-            '' AS slotCode,
+            ware.f_name AS areaName,
+            ware.f_no AS areaCode,
+            ware.f_name AS slotName,
+            ware.f_no AS slotCode,
             TWG.f_originalbillno AS receiptDoc,
             TWG.f_mblno AS billOfLading,
             TC.f_no AS ownerCode,
-            'XXX有限公司' AS ownerName,
+            TC.f_name AS ownerName,
             TG.f_name AS goodsName,
             TG.f_packagespecs AS specifications,
             '' AS producing,
             TWG.f_marks AS materialQuality,
             '' AS LEVEL,
-            TWG.f_qtyblc AS totalQuantity,
-            TWG.f_qtyD AS availableQuantity,
+            TWG.f_qtyD AS totalQuantity,
+            TWG.f_qtyblc AS availableQuantity,
             '袋' AS quantityUnit,
-            IFNULL( ROUND( TWG.f_netweightblc / 1000, 2 ), 0 ) AS totalNetWeight,
-            IFNULL( ROUND( TWG.f_netweightD / 1000, 2 ), 0 ) AS availableWeight,
+            IFNULL( ROUND( TWG.f_netweightD / 1000, 2 ), 0 ) AS totalNetWeight,
+            IFNULL( ROUND( TWG.f_netweightblc / 1000, 2 ), 0 ) AS availableWeight,
             '吨' AS weightUnit,
             TWG.f_originalbilldate AS storesTime,
             '' AS productionTime,
             TWB.f_truckno AS plateNumber,
             '' AS batchNo,
             '' AS warehouseReceiptNo
-        FROM t_warehouse TW
-        LEFT JOIN t_whgenleg TWG ON TWG.f_warehouseid = TW.f_id
+        FROM
+            t_whgenleg TWG
+        LEFT JOIN t_warehouse TW ON TWG.f_warehouseid = TW.f_id
+        LEFT JOIN t_warehouse ware ON ware.f_id = TWG.f_warehouse_locationid
         LEFT JOIN t_corps TC ON TC.f_id = TWG.f_corpid
         LEFT JOIN t_goods TG ON TG.f_id = TWG.f_goodsid
-        LEFT JOIN t_warehousebills TWB ON TW.f_id = TWB.f_warehouseid
+        LEFT JOIN t_warehousebills TWB ON TWG.f_originalbillno = TWB.f_billno
         <where>
-            TW.f_no = #{warehouseCode}
+            TW.del_flag = '0'
+            and TWG.f_warehouseid = #{warehouseCode}
             AND TW.del_flag = '0'
-            <if test="areaName != null  and areaName != ''"> and TW.f_name like concat('%', #{areaName}, '%')</if>
-            <if test="areaCode != null  and areaCode != ''"> and TW.f_no = #{areaCode}</if>
+            <if test="ownerName != null  and ownerName != ''"> and TC.f_name like concat('%', #{ownerName}, '%')</if>
+            <if test="ownerCode != null  and ownerCode != ''"> and TC.f_no = #{ownerCode}</if>
+            <if test="goodsName != null  and goodsName != ''"> and TG.f_name like concat('%', #{goodsName}, '%')</if>
+            <if test="specifications != null  and specifications != ''"> and TG.f_packagespecs like concat('%', #{specifications}, '%')</if>
+            <if test="materialQuality != null  and materialQuality != ''"> and TWG.f_marks like concat('%', #{materialQuality}, '%')</if>
+            <if test="receiptDoc != null  and receiptDoc != ''"> and TWG.f_originalbillno like concat('%', #{receiptDoc}, '%')</if>
+            <if test="billOfLading != null  and billOfLading != ''"> and TWG.f_mblno like concat('%', #{billOfLading}, '%')</if>
+            <if test="areaName != null  and areaName != ''"> and ware.f_name like concat('%', #{areaName}, '%')</if>
+            <if test="areaCode != null  and areaCode != ''"> and ware.f_no = #{areaCode}</if>
+            <if test="slotName != null  and slotName != ''"> and ware.f_name like concat('%', #{slotName}, '%')</if>
+            <if test="slotCode != null  and slotCode != ''"> and ware.f_no = #{slotCode}</if>
         </where>
     </select>
 
@@ -456,12 +471,12 @@
 
     <select id="getTimeStorageInfo" resultType="map">
         SELECT
-            IFNULL( f_bsdate, '' ) as time,
-            IFNULL( ROUND( SUM(f_grossweight) / 1000, 2 ), 0 ) as value
+            f_bsdate as time,
+            ROUND( SUM(f_grossweight) / 1000, 2 ) as value
         FROM t_warehousebills
         <where>
             del_flag = '0'
-            AND f_id = #{wareHouseId}
+            AND f_warehouseid = #{wareHouseId}
             <if test="startTime != null and startTime != ''">
                 and f_bsdate >= #{startTime}
             </if>
@@ -476,12 +491,12 @@
 
     <select id="getTimeThroughputInfo" resultType="map">
         SELECT
-        IFNULL( f_bsdate, '' ) as time,
-        IFNULL( ROUND( SUM(f_grossweight) / 1000, 2 ), 0 ) as value
+            f_bsdate as time,
+            ROUND( SUM(f_grossweight) / 1000, 2 ) as value
         FROM t_warehousebills
         <where>
             del_flag = '0'
-            AND f_id = #{wareHouseId}
+            AND f_warehouseid = #{wareHouseId}
             and f_billtype in ('SJRK','SJCK')
             <if test="startTime != null and startTime != ''">
                 and f_bsdate >= #{startTime}
@@ -497,16 +512,18 @@
 
     <select id="getCargoInfo" resultType="map">
         SELECT
-            IFNULL( ROUND( SUM(f_grossweight) / 1000, 2 ), 0 ) as FGrossweight
+            ROUND( SUM(f_grossweight) / 1000, 2 ) as FGrossweight
         FROM t_warehousebills
         <where>
-            is_pledge = #{isPledge}
-            AND f_id = #{wareHouseId}
+            f_warehouseid = #{wareHouseId}
+            <if test="isPledge != null and isPledge != ''">
+                and is_pledge = #{isPledge}
+            </if>
             <if test="startTime != null and startTime != ''">
                 and f_bsdate >= #{startTime}
             </if>
             <if test="endTime != null and endTime != ''">
-                and f_bsdate >= #{endTime}
+                and f_bsdate &lt;= #{endTime}
             </if>
             <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
                 and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(f_bsdate)
@@ -517,7 +534,7 @@
     <select id="getGoodsList" resultType="map">
         SELECT
             SDD.dict_label AS goodsType,
-            IFNULL( ROUND( SUM(TW.f_grossweight) / 1000, 2 ), 0 ) as count,
+            ROUND( SUM(TW.f_grossweight) / 1000, 2 ) as count,
             round(
                 SUM(TW.f_grossweight) * 100 /(
                   SELECT
@@ -529,15 +546,14 @@
             ) as rate
         FROM
             t_warehousebills TW
-            LEFT JOIN sys_dict_data SDD ON SDD.dict_type = 't_trademodels' AND SDD.dict_value = TW.f_trademodeid
+            LEFT JOIN sys_dict_data SDD ON SDD.dict_type = 'data_trademodes' AND SDD.dict_value = TW.f_trademodeid
         <where>
-            TW.f_id = #{wareHouseId}
-            and is_pledge = '1'
+            TW.f_warehouseid = #{wareHouseId}
             <if test="startTime != null and startTime != ''">
                 and TW.f_bsdate >= #{startTime}
             </if>
             <if test="endTime != null and endTime != ''">
-                and TW.f_bsdate >= #{endTime}
+                and TW.f_bsdate &lt;= #{endTime}
             </if>
             <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
                 and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(TW.f_bsdate)
@@ -549,20 +565,20 @@
 
     <select id="getCargoInfoTrend" resultType="map">
         SELECT
-            IFNULL( f_bsdate, '' ) as time,
-            IFNULL( ROUND( SUM(TW.f_grossweight) / 1000, 2 ), 0 ) as value
+            f_bsdate as time,
+            ROUND( SUM(TW.f_grossweight) / 1000, 2 ) as value
         FROM
         t_warehousebills TW
-        LEFT JOIN sys_dict_data SDD ON SDD.dict_type = 't_trademodels' AND SDD.dict_value = TW.f_trademodeid
+        LEFT JOIN sys_dict_data SDD ON SDD.dict_type = 'data_trademodes' AND SDD.dict_value = TW.f_trademodeid
         <where>
             TW.del_flag = '0'
-            AND TW.f_id = #{wareHouseId}
+            AND TW.f_warehouseid = #{wareHouseId}
             AND SDD.dict_value = #{FTradeModeId}
             <if test="startTime != null and startTime != ''">
                 and TW.f_bsdate >= #{startTime}
             </if>
             <if test="endTime != null and endTime != ''">
-                and TW.f_bsdate >= #{endTime}
+                and TW.f_bsdate &lt;= #{endTime}
             </if>
             <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
                 and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(TW.f_bsdate)
@@ -574,16 +590,15 @@
 
     <select id="getStorageTop" resultType="map">
         SELECT
-            '' AS top,
             TG.f_name AS goodsName,
-            IFNULL( ROUND( SUM(TW.f_grossweight) / 1000, 2 ), 0 ) as normalCnt,
+            ROUND( SUM(TW.f_grossweight) / 1000, 2 ) as normalCnt,
             '' AS receiptCnt
         FROM
         t_warehousebills TW
         LEFT JOIN t_goods TG ON TG.f_id = TW.f_goodsid
         <where>
             TW.del_flag = '0'
-            AND TW.f_id = #{wareHouseId}
+            AND TW.f_warehouseid = #{wareHouseId}
             <if test="countType != null and countType != '' and countType == 2">
                 and TW.f_billtype in ('SJRK','SJCK')
             </if>
@@ -591,19 +606,19 @@
         GROUP BY TW.f_goodsid
         ORDER BY IFNULL( ROUND( SUM(TW.f_grossweight) / 1000, 2 ), 0 ) DESC
         LIMIT #{topCnt}
+
     </select>
 
     <select id="getGoodsTop" resultType="map">
         SELECT
-        '' AS top,
         TC.f_name AS ownerName,
-        IFNULL( ROUND( SUM(TW.f_grossweight) / 1000, 2 ), 0 ) as count
+        ROUND( SUM(TW.f_grossweight) / 1000, 2 ) as count
         FROM
         t_warehousebills TW
         LEFT JOIN t_corps TC ON TC.f_id = TW.f_corpid
         <where>
             TW.del_flag = '0'
-            AND TW.f_id = #{wareHouseId}
+            AND TW.f_warehouseid = #{wareHouseId}
             <if test="countType != null and countType != '' and countType == 2">
                 and TW.f_billtype in ('SJRK','SJCK')
             </if>
@@ -615,18 +630,18 @@
 
     <select id="getTransferTransaction" resultType="map">
         SELECT
-        IFNULL( f_bsdate, '' ) as time,
-        IFNULL( ROUND( SUM(f_grossweight) / 1000, 2 ), 0 ) as value
+        f_bsdate as time,
+        ROUND( SUM(f_grossweight) / 1000, 2 ) as value
         FROM
         t_warehousebills
         <where>
             del_flag = '0'
-            AND f_id = #{wareHouseId}
+            AND f_warehouseid = #{wareHouseId}
             <if test="startTime != null and startTime != ''">
                 and f_bsdate >= #{startTime}
             </if>
             <if test="endTime != null and endTime != ''">
-                and f_bsdate >= #{endTime}
+                and f_bsdate &lt;= #{endTime}
             </if>
             <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
                 and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(f_bsdate)
@@ -636,13 +651,13 @@
 
     <select id="getWorkInfo"  resultType="map">
         SELECT
-            IFNULL( ROUND( SUM( TW.f_grossweight ) / 1000, 2 ), 0 ) AS Fgrossweight,
+            IFNULL( ROUND( SUM( TW.f_grossweight ) / 1000, 2 ),0) AS Fgrossweight,
             COUNT(f_id) AS count
         FROM
             t_warehousebills TW
         <where>
             TW.del_flag = '0'
-            AND TW.f_id = #{wareHouseId}
+            AND TW.f_warehouseid = #{wareHouseId}
             <if test="countType != null and countType != '' and countType == 'SJRK'">
                 and TW.f_billtype = #{countType}
             </if>
@@ -651,13 +666,13 @@
 
     <select id="getWorkTrend"  resultType="map">
         SELECT
-            IFNULL( f_bsdate, '' ) as time,
-            IFNULL( ROUND( SUM( TW.f_grossweight ) / 1000, 2 ), 0 ) AS value
+            f_bsdate as time,
+            ROUND( SUM( TW.f_grossweight ) / 1000, 2 ) AS value
         FROM
         t_warehousebills TW
         <where>
             TW.del_flag = '0'
-            AND TW.f_id = #{wareHouseId}
+            AND TW.f_warehouseid = #{wareHouseId}
             <if test="countType != null and countType != ''">
                 and TW.f_billtype = #{countType}
             </if>
@@ -665,7 +680,7 @@
                 and TW.f_bsdate >= #{startTime}
             </if>
             <if test="endTime != null and endTime != ''">
-                and TW.f_bsdate >= #{endTime}
+                and TW.f_bsdate &lt;= #{endTime}
             </if>
             <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
                 and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(TW.f_bsdate)