wangzhuo преди 2 години
родител
ревизия
301cf345c3

+ 60 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/plugin/ForeignApiController.java

@@ -1,13 +1,12 @@
 package com.ruoyi.web.controller.plugin;
 
+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 lombok.AllArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
 
@@ -19,7 +18,7 @@ import java.util.Map;
 @AllArgsConstructor
 @RestController
 @RequestMapping("/open/wms")
-public class ForeignApiController {
+public class ForeignApiController extends BaseController {
 
     @Autowired
     private ForeignHttpService foreignHttpService;
@@ -45,4 +44,60 @@ public class ForeignApiController {
         return foreignHttpService.queryPositionV1(position);
     }
 
+    /**
+     * 分⻚查询货物台账
+     *
+     * @return 结果
+     */
+    @PostMapping("/queryGoodsAccountByPageV1")
+    public Map<String, Object> queryGoodsAccountByPageV1(@RequestParam(value = "warehouseCode") String warehouseCode,
+                                                         @RequestParam(value = "ownerName",required = false) String ownerName,
+                                                         @RequestParam(value = "goodsName",required = false) String goodsName,
+                                                         @RequestParam(value = "specifications",required = false) String specifications,
+                                                         @RequestParam(value = "producing",required = false) String producing,
+                                                         @RequestParam(value = "materialQuality",required = false) String materialQuality,
+                                                         @RequestParam(value = "level",required = false) String level,
+                                                         @RequestParam(value = "pageNo") Integer pageNo,
+                                                         @RequestParam(value = "pageSize") Integer pageSize) {
+        startPage();
+        return foreignHttpService.queryGoodsAccountByPageV1(warehouseCode, ownerName, goodsName, specifications,
+                producing, materialQuality, level, pageNo, pageSize);
+    }
+
+    /**
+     * 分⻚查询台账明细
+     *
+     * @return 结果
+     */
+    @PostMapping("/queryGoodsAccountDetailByPageV1")
+    public Map<String, Object> queryGoodsAccountByPageV1(@RequestParam(value = "warehouseCode") String warehouseCode,
+                                                         @RequestParam(value = "ownerName",required = false) String ownerName,
+                                                         @RequestParam(value = "ownerCode",required = false) String ownerCode,
+                                                         @RequestParam(value = "goodsName",required = false) String goodsName,
+                                                         @RequestParam(value = "specifications",required = false) String specifications,
+                                                         @RequestParam(value = "producing",required = false) String producing,
+                                                         @RequestParam(value = "materialQuality",required = false) String materialQuality,
+                                                         @RequestParam(value = "level",required = false) String level,
+                                                         @RequestParam(value = "receiptDoc",required = false) String receiptDoc,
+                                                         @RequestParam(value = "billOfLading",required = false) String billOfLading,
+                                                         @RequestParam(value = "areaName",required = false) String areaName,
+                                                         @RequestParam(value = "areaCode",required = false) String areaCode,
+                                                         @RequestParam(value = "slotName",required = false) String slotName,
+                                                         @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,
+                producing, materialQuality, level, receiptDoc, billOfLading, areaName, areaCode, slotName, slotCode, pageNo, pageSize);
+    }
+
+    /**
+     * WMS作业通知数字仓库系统接⼝
+     */
+    @PostMapping("/workNoticeV1")
+    public Map<String, Object> workNoticeV1(){
+        return foreignHttpService.workNoticeV1();
+    }
+
+
 }

+ 119 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/plugin/WareHouseController.java

@@ -0,0 +1,119 @@
+package com.ruoyi.web.controller.plugin;
+
+
+import com.ruoyi.ccb.service.ForeignHttpService;
+import com.ruoyi.common.core.controller.BaseController;
+import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+/**
+ * WMS仓库接⼝
+ */
+@AllArgsConstructor
+@RestController
+@RequestMapping("/api/open/wareHouse")
+public class WareHouseController extends BaseController {
+
+    @Autowired
+    private ForeignHttpService foreignHttpService;
+
+    /**
+     * 获取仓库详细信息
+     */
+    @GetMapping("/getWareHouseInfo")
+    public Map<String, Object> getWareHouseInfo(@RequestParam(value = "wareHouseId") String wareHouseId){
+        return foreignHttpService.getWareHouseInfo(wareHouseId);
+    }
+
+    /**
+     * 获取最新库存数据
+     */
+    @GetMapping("/getStorageInfo")
+    public Map<String, Object> getStorageInfo(@RequestParam(value = "wareHouseId") String wareHouseId){
+        return foreignHttpService.getStorageInfo(wareHouseId);
+    }
+
+    /**
+     * 库存吞吐趋势信息
+     */
+    @GetMapping("/getStorageTrend")
+    public Map<String, Object> getStorageTrend(@RequestParam(value = "wareHouseId") String wareHouseId,
+                                               @RequestParam(value = "startTime",required = false) String startTime,
+                                               @RequestParam(value = "endTime",required = false) String endTime){
+        return foreignHttpService.getStorageTrend(wareHouseId, startTime, endTime);
+    }
+
+    /**
+     * 货物保管信息
+     */
+    @GetMapping("/getCargoInfo")
+    public Map<String, Object> getCargoInfo(@RequestParam(value = "wareHouseId") String wareHouseId,
+                                            @RequestParam(value = "startTime",required = false) String startTime,
+                                            @RequestParam(value = "endTime",required = false) String endTime) {
+        return foreignHttpService.getCargoInfo(wareHouseId, startTime, endTime);
+    }
+
+    /**
+     * 仓库保管趋势
+     */
+    @GetMapping("/getCargoInfoTrend")
+    public Map<String, Object> getCargoInfoTrend(@RequestParam(value = "wareHouseId") String wareHouseId,
+                                                 @RequestParam(value = "startTime",required = false) String startTime,
+                                                 @RequestParam(value = "endTime",required = false) String endTime){
+        return foreignHttpService.getCargoInfoTrend(wareHouseId, startTime, endTime);
+    }
+
+    /**
+     * 获取货物品类top值
+     */
+    @GetMapping("/getStorageTop")
+    public Map<String, Object> getStorageTop(@RequestParam(value = "wareHouseId") String wareHouseId,
+                                             @RequestParam(value = "countType") Integer countType,
+                                             @RequestParam(value = "topCnt") Integer topCnt){
+        return foreignHttpService.getStorageTop(wareHouseId, countType, topCnt);
+    }
+
+    /**
+     *  获取货主仓库top值
+     */
+    @GetMapping("/getGoodsTop")
+    public Map<String, Object> getGoodsTop(@RequestParam(value = "wareHouseId") String wareHouseId,
+                                           @RequestParam(value = "countType") Integer countType,
+                                           @RequestParam(value = "topCnt") Integer topCnt){
+        return foreignHttpService.getGoodsTop(wareHouseId, countType, topCnt);
+    }
+
+    /**
+     *  过户交易信息获取
+     */
+    @GetMapping("/getTransferInfo")
+    public Map<String, Object> getTransferInfo(@RequestParam(value = "wareHouseId") String wareHouseId,
+                                               @RequestParam(value = "startTime",required = false) String startTime,
+                                               @RequestParam(value = "endTime",required = false) String endTime){
+        return foreignHttpService.getTransferInfo(wareHouseId, startTime, startTime);
+    }
+
+    /**
+     * 最新的作业统计
+     */
+    @GetMapping("/getWorkInfo")
+    public Map<String, Object> getWorkInfo(@RequestParam(value = "wareHouseId") String wareHouseId){
+        return foreignHttpService.getWorkInfo(wareHouseId);
+    }
+
+    /**
+     *  作业统计趋势数据
+     */
+    @GetMapping("/getWorkTrend")
+    public Map<String, Object> getWorkTrend(@RequestParam(value = "wareHouseId") String wareHouseId,
+                                            @RequestParam(value = "startTime",required = false) String startTime,
+                                            @RequestParam(value = "endTime",required = false) String endTime){
+        return foreignHttpService.getWorkTrend(wareHouseId, startTime, startTime);
+    }
+}

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java

@@ -51,7 +51,7 @@ public class ResourcesConfig implements WebMvcConfigurer
     {
         registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
         registry.addInterceptor(tSeapriceQueryLogInterceptor).addPathPatterns("/**");
-        registry.addInterceptor(signInterceptor).addPathPatterns("/open/wms/**");
+        registry.addInterceptor(signInterceptor).addPathPatterns("/open/wms/**").addPathPatterns("/api/open/wareHouse/**");
     }
 
     /**

+ 70 - 0
ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/ForeignHttpService.java

@@ -2,7 +2,9 @@ package com.ruoyi.ccb.service;
 
 import com.ruoyi.ccb.domain.*;
 import com.ruoyi.ccb.domain.basic.Page;
+import org.springframework.web.bind.annotation.RequestParam;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -20,4 +22,72 @@ public interface ForeignHttpService {
     QueryLowerPositionR queryLowerPositionV1(String position);
 
     Map<String, Object> queryPositionV1(String position);
+
+    /**
+     * 查询货物台账
+     */
+    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,
+                                                        String producing,String materialQuality,String level, String receiptDoc,String billOfLading,
+                                                        String areaName,String areaCode,String slotName,String slotCode,Integer pageNo,Integer pageSize);
+
+    /**
+     *  获取仓库详细信息
+     */
+    Map<String, Object> getWareHouseInfo(String wareHouseId);
+
+    /**
+     *  获取最新的库存数据
+     */
+    Map<String, Object> getStorageInfo(String wareHouseId);
+
+    /**
+     *  库存吞吐趋势信息
+     */
+    Map<String, Object> getStorageTrend(String wareHouseId, String startTime, String endTime);
+
+    /**
+     *  货物保管信息
+     */
+    Map<String, Object> getCargoInfo(String wareHouseId, String startTime, String endTime);
+
+    /**
+     *  仓库保管趋势
+     */
+    Map<String, Object> getCargoInfoTrend(String wareHouseId, String startTime, String endTime);
+
+    /**
+     *  获取货物品类top值
+     */
+    Map<String, Object> getStorageTop(String wareHouseId, Integer countType, Integer topCnt);
+
+    /**
+     *  获取货主仓库top值
+     */
+    Map<String, Object> getGoodsTop(String wareHouseId, Integer countType, Integer topCnt);
+
+    /**
+     *  过户交易信息获取
+     */
+    Map<String, Object> getTransferInfo(String wareHouseId, String startTime, String endTime);
+
+    /**
+     *  最新的作业统计
+     */
+    Map<String, Object> getWorkInfo(String wareHouseId);
+
+    /**
+     *  作业统计趋势数据
+     */
+    Map<String, Object> getWorkTrend(String wareHouseId, String startTime, String endTime);
+
+    /**
+     *  WMS作业通知数字仓库系统接
+     */
+    Map<String, Object> workNoticeV1();
 }

+ 271 - 1
ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/impl/ForeignHttpServiceImpl.java

@@ -29,6 +29,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.io.IOException;
 import java.math.BigDecimal;
@@ -42,7 +44,7 @@ import java.util.stream.Collectors;
  */
 @Service
 @AllArgsConstructor
-public class ForeignHttpServiceImpl implements ForeignHttpService {
+public class ForeignHttpServiceImpl implements ForeignHttpService{
 
     @Autowired
     private ITWarehouseService itWarehouseService;
@@ -86,4 +88,272 @@ public class ForeignHttpServiceImpl implements ForeignHttpService {
         mapR.put("data",map);
         return mapR;
     }
+
+    /**
+     * 查询货物台账
+     */
+    @Override
+    public 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>> list = 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,
+                                                                     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,
+                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;
+    }
+
+    /**
+     *  获取仓库详细信息
+     */
+    @Override
+    public Map<String, Object> getWareHouseInfo(String wareHouseId) {
+        Map<String,Object> map = new HashMap<>();
+        TWarehouse tWarehouse = itWarehouseService.getWareHouseInfo(wareHouseId);
+        if (ObjectUtil.isNotNull(tWarehouse)){
+            map.put("wareHouseId",tWarehouse.getfId());
+            map.put("name",tWarehouse.getfName());
+            map.put("type","");
+            map.put("scope","");
+            map.put("area","");
+        }
+        Map<String,Object> mapR = new HashMap<>();
+        mapR.put("code","0");
+        mapR.put("msg","OK");
+        mapR.put("data",map);
+        return mapR;
+    }
+
+    /**
+     *  获取最新的库存数据
+     */
+    @Override
+    public Map<String, Object> getStorageInfo(String wareHouseId) {
+        Map<String,Object> map= itWarehouseService.getStorageInfo(wareHouseId);
+        Map<String,Object> mapR = new HashMap<>();
+        mapR.put("code","0");
+        mapR.put("msg","OK");
+        mapR.put("data",map);
+        return mapR;
+    }
+
+    /**
+     * 库存吞吐趋势信息
+     */
+    @Override
+    public Map<String, Object> getStorageTrend(String wareHouseId,String startTime,String endTime){
+        Map<String,Object> data = new HashMap<>();
+
+        List<Map<String,Object>> storageInfo = itWarehouseService.getTimeStorageInfo(wareHouseId,startTime,endTime);
+        data.put("storageInfo", storageInfo);
+
+        List<Map<String, Object>> throughputInfo = itWarehouseService.getTimeThroughputInfo(wareHouseId,startTime,endTime);
+        data.put("throughputInfo", throughputInfo);
+
+        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> getCargoInfo(String wareHouseId,String startTime,String endTime){
+        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> pledgeGoods = itWarehouseService.getCargoInfo(wareHouseId,startTime,endTime,"0");
+        data.put("pledgeGoods", pledgeGoods.get("FGrossweight"));
+
+        List<Map<String, Object>> goodsList = itWarehouseService.getGoodsList(wareHouseId,startTime,endTime);
+        data.put("goods", goodsList);
+        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> getCargoInfoTrend(String wareHouseId,String startTime,String endTime){
+        Map<String,Object> data = new HashMap<>();
+
+        //报税现货
+        List<Map<String, Object>> freeTaxCurGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"保税现货");
+        data.put("freeTaxCurGoods", freeTaxCurGoods);
+        //非报税现货
+        List<Map<String, Object>> taxCurGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"非保税现货");
+        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);
+
+        Map<String,Object> mapR = new HashMap<>();
+        mapR.put("code","0");
+        mapR.put("msg","OK");
+        mapR.put("data",data);
+        return mapR;
+    }
+
+    /**
+     * 获取货物品类top值
+     */
+    @Override
+    public Map<String, Object> getStorageTop(String wareHouseId, Integer countType, Integer topCnt){
+
+       List<Map<String, Object>> data = itWarehouseService.getStorageTop(wareHouseId,countType,topCnt);
+
+        Map<String,Object> mapR = new HashMap<>();
+        mapR.put("code","0");
+        mapR.put("msg","OK");
+        mapR.put("data",data);
+        return mapR;
+    }
+
+    /**
+     * 获取货主仓库top值
+     */
+    @Override
+    public Map<String, Object> getGoodsTop(String wareHouseId, Integer countType, Integer topCnt){
+
+        List<Map<String, Object>> data = itWarehouseService.getGoodsTop(wareHouseId,countType,topCnt);
+
+        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> getTransferInfo(String wareHouseId,String startTime,String endTime){
+        Map<String,Object> data = new HashMap<>();
+
+        //普通过户量
+        List<Map<String, Object>> normalTransferList = new ArrayList<>();
+        data.put("normalTransferList", normalTransferList);
+
+        //仓单过户量
+        List<Map<String, Object>> receiptTransferList = new ArrayList<>();
+        data.put("receiptTransferList", receiptTransferList);
+
+        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> getWorkInfo(String wareHouseId) {
+        Map<String, Object> data = new HashMap<>();
+
+        //入库
+        Map<String,Object> map= itWarehouseService.getWorkInfo(wareHouseId, "SJRK");
+        data.put("input", map.get("Fgrossweight"));
+        data.put("inputReceiptCnt", map.get("count"));
+
+        //出库
+        Map<String,Object> map2= itWarehouseService.getWorkInfo(wareHouseId, "SJCK");
+        data.put("output", map2.get("Fgrossweight"));
+        data.put("outputReceiptCnt", map2.get("count"));
+
+        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> getWorkTrend(String wareHouseId,String startTime,String endTime){
+        Map<String,Object> data = new HashMap<>();
+
+        //入库单据
+        List<Map<String, Object>> inputReceiptList = itWarehouseService.getWorkTrend(wareHouseId,startTime,endTime, "SJRK");
+        data.put("inputReceiptList", inputReceiptList);
+
+        //出库单据
+        List<Map<String, Object>> outputReceiptList = itWarehouseService.getWorkTrend(wareHouseId,startTime,endTime, "SJRK");
+        data.put("receiptTransferList", outputReceiptList);
+
+        Map<String,Object> mapR = new HashMap<>();
+        mapR.put("code","0");
+        mapR.put("msg","OK");
+        mapR.put("data",data);
+        return mapR;
+    }
+
+    /**
+     * WMS作业通知数字仓库系统接
+     */
+    @Override
+    public Map<String, Object> workNoticeV1(){
+        Map<String,Object> mapR = new HashMap<>();
+        mapR.put("code","0");
+        mapR.put("msg","OK");
+        return mapR;
+    }
 }

+ 84 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TWarehouseMapper.java

@@ -4,6 +4,7 @@ package com.ruoyi.basicData.mapper;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.math.BigDecimal;
 import java.util.List;
@@ -183,4 +184,87 @@ public interface TWarehouseMapper {
 
     public TWarehouse getWarehouseByNo(String fNo);
 
+    List<Map<String, Object>> queryGoodsAccountByPageV1(@Param("warehouseCode") String warehouseCode,
+                                                        @Param("ownerName") String ownerName,
+                                                        @Param("goodsName") String goodsName,
+                                                        @Param("specifications") String specifications,
+                                                        @Param("producing") String producing,
+                                                        @Param("materialQuality") String materialQuality,
+                                                        @Param("level") String level,
+                                                        @Param("pageNo") Integer pageNo,
+                                                        @Param("pageSize") Integer pageSize);
+
+
+    List<Map<String, Object>> queryGoodsAccountDetailByPageV1(@Param("warehouseCode") String warehouseCode,
+                                                              @Param("ownerName") String ownerName,
+                                                              @Param("ownerCode") String ownerCode,
+                                                              @Param("goodsName") String goodsName,
+                                                              @Param("specifications") String specifications,
+                                                              @Param("producing") String producing,
+                                                              @Param("materialQuality") String materialQuality,
+                                                              @Param("level") String level,
+                                                              @Param("receiptDoc") String receiptDoc,
+                                                              @Param("billOfLading") String billOfLading,
+                                                              @Param("areaName") String areaName,
+                                                              @Param("areaCode") String areaCode,
+                                                              @Param("slotName") String slotName,
+                                                              @Param("slotCode") String slotCode,
+                                                              @Param("pageNo") Integer pageNo,
+                                                              @Param("pageSize") Integer pageSize);
+
+    /**
+     *  获取仓库详细信息
+     */
+    public TWarehouse getWareHouseInfo(String wareHouseId);
+
+    /**
+     *  获取最新的库存数据
+     */
+    Map<String, Object> getStorageInfo(String wareHouseId);
+
+    /**
+     *  库存吞吐趋势信息
+     */
+    List<Map<String, Object>> getTimeStorageInfo(@Param("wareHouseId") String wareHouseId,@Param("startTime") String startTime,@Param("endTime") String endTime);
+
+    /**
+     *  库存吞吐趋势信息
+     */
+    List<Map<String, Object>> getTimeThroughputInfo(@Param("wareHouseId") String wareHouseId,@Param("startTime") String startTime,@Param("endTime") String endTime);
+
+    /**
+     *  货物保管信息
+     */
+    Map<String, Object> getCargoInfo(@Param("wareHouseId")String wareHouseId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("isPledge") String isPledge);
+
+    /**
+     *  货物保管信息
+     */
+    List<Map<String, Object>> getGoodsList(@Param("wareHouseId")String wareHouseId,@Param("startTime") String startTime,@Param("endTime") String endTime);
+
+    /**
+     *  货物保管信息
+     */
+    List<Map<String, Object>> getCargoInfoTrend(@Param("wareHouseId")String wareHouseId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("FTradeModeId") String FTradeModeId);
+
+    /**
+     *  获取货物品类top值
+     */
+    List<Map<String, Object>> getStorageTop(@Param("wareHouseId")String wareHouseId,@Param("countType") Integer countType,@Param("topCnt") Integer topCnt);
+
+    /**
+     *  获取货主仓库top值
+     */
+    List<Map<String, Object>> getGoodsTop(@Param("wareHouseId")String wareHouseId,@Param("countType") Integer countType,@Param("topCnt") Integer topCnt);
+
+    /**
+     *  最新的作业统计
+     */
+    Map<String, Object> getWorkInfo(@Param("wareHouseId")String wareHouseId,@Param("countType") String countType);
+
+    /**
+     *  作业统计趋势数据
+     */
+    List<Map<String, Object>> getWorkTrend(@Param("wareHouseId")String wareHouseId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("countType") String countType);
 }
+

+ 75 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITWarehouseService.java

@@ -188,4 +188,79 @@ public interface ITWarehouseService {
     List<TWarehouse> lazyList(TWarehouse tWarehouse);
 
     TWarehouse selectByCode(String position);
+
+    /**
+     * 查询货物台账
+     */
+    List<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>> 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);
+
+    /**
+     *  获取仓库详细信息
+     */
+    TWarehouse getWareHouseInfo(String wareHouseId);
+
+    /**
+     *  获取最新的库存数据
+     */
+    Map<String, Object> getStorageInfo(String wareHouseId);
+
+    /**
+     *  库存吞吐趋势信息
+     */
+    List<Map<String, Object>> getTimeStorageInfo(String wareHouseId, String startTime, String endTime);
+
+    /**
+     *  库存吞吐趋势信息
+     */
+    List<Map<String, Object>> getTimeThroughputInfo(String wareHouseId, String startTime, String endTime);
+
+    /**
+     *  货物保管信息
+     */
+    Map<String, Object> getCargoInfo(String wareHouseId, String startTime, String endTime, String isPledge);
+
+    /**
+     *  货物保管信息
+     */
+    List<Map<String, Object>> getGoodsList(String wareHouseId, String startTime, String endTime);
+
+    /**
+     *  仓库保管趋势
+     */
+    List<Map<String, Object>> getCargoInfoTrend(String wareHouseId, String startTime, String endTime, String FTradeModeId);
+
+    /**
+     *  获取货物品类top值
+     */
+    List<Map<String, Object>> getStorageTop(String wareHouseId, Integer countType, Integer topCnt);
+
+    /**
+     *  获取货主仓库top值
+     */
+    List<Map<String, Object>> getGoodsTop(String wareHouseId, Integer countType, Integer topCnt);
+
+    /**
+     *  最新的作业统计
+     */
+    Map<String, Object> getWorkInfo(String wareHouseId, String countType);
+
+    /**
+     *  作业统计趋势数据
+     */
+    List<Map<String, Object>> getWorkTrend(String wareHouseId,  String startTime, String endTime, String countType);
 }

+ 111 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseServiceImpl.java

@@ -26,6 +26,7 @@ import com.ruoyi.warehouseBusiness.domain.enums.AnnexActEnum;
 import com.ruoyi.warehouseBusiness.domain.vo.WarehouseInfoVO;
 import com.ruoyi.warehouseBusiness.mapper.TAnnexMapper;
 import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -467,6 +468,116 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
     }
 
     @Override
+    public List<Map<String, Object>> queryGoodsAccountByPageV1(String warehouseCode,
+                                                               String ownerName,
+                                                               String goodsName,
+                                                               String specifications,
+                                                               String producing,
+                                                               String materialQuality,
+                                                               String level,
+                                                               Integer pageNo,
+                                                               Integer pageSize){
+        return tWarehouseMapper.queryGoodsAccountByPageV1(warehouseCode, ownerName, goodsName, specifications,
+                producing, materialQuality, level, pageNo, pageSize);
+    }
+
+    @Override
+    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){
+        return tWarehouseMapper.queryGoodsAccountDetailByPageV1(warehouseCode, ownerName, ownerCode, goodsName, specifications,
+                producing, materialQuality, level, receiptDoc, billOfLading, areaName, areaCode, slotName, slotCode, pageNo, pageSize);
+    }
+
+    /**
+     *  获取仓库详细信息
+     */
+    @Override
+    public TWarehouse getWareHouseInfo(String wareHouseId) {
+        return tWarehouseMapper.getWareHouseInfo(wareHouseId);
+    }
+
+    /**
+     *  获取最新的库存数据
+     */
+    @Override
+    public Map<String, Object> getStorageInfo(String wareHouseId) {
+        return tWarehouseMapper.getStorageInfo(wareHouseId);
+    }
+
+    /**
+     *  库存吞吐趋势信息
+     */
+    @Override
+    public List<Map<String, Object>> getTimeStorageInfo(String wareHouseId, String startTime, String endTime) {
+        return tWarehouseMapper.getTimeStorageInfo(wareHouseId,startTime,endTime);
+    }
+
+    /**
+     *  库存吞吐趋势信息
+     */
+    @Override
+    public List<Map<String, Object>> getTimeThroughputInfo(String wareHouseId, String startTime, String endTime) {
+        return tWarehouseMapper.getTimeThroughputInfo(wareHouseId,startTime,endTime);
+    }
+
+    /**
+     *  货物保管信息
+     */
+    @Override
+    public Map<String, Object> getCargoInfo(String wareHouseId, String startTime, String endTime, String isPledge) {
+        return tWarehouseMapper.getCargoInfo(wareHouseId,startTime,endTime,isPledge);
+    }
+
+    /**
+     *  货物保管信息
+     */
+    @Override
+    public List<Map<String, Object>> getGoodsList(String wareHouseId, String startTime, String endTime) {
+        return tWarehouseMapper.getGoodsList(wareHouseId,startTime,endTime);
+    }
+
+    /**
+     *  仓库保管趋势
+     */
+    @Override
+    public List<Map<String, Object>> getCargoInfoTrend(String wareHouseId, String startTime, String endTime, String FTradeModeId) {
+        return tWarehouseMapper.getCargoInfoTrend(wareHouseId,startTime,endTime,FTradeModeId);
+    }
+
+    /**
+     *  获取货物品类top值
+     */
+    @Override
+    public List<Map<String, Object>> getStorageTop(String wareHouseId, Integer countType, Integer topCnt) {
+        return tWarehouseMapper.getStorageTop(wareHouseId,countType,topCnt);
+    }
+
+    /**
+     *  获取货主仓库top值
+     */
+    @Override
+    public List<Map<String, Object>> getGoodsTop(String wareHouseId, Integer countType, Integer topCnt) {
+        return tWarehouseMapper.getGoodsTop(wareHouseId,countType,topCnt);
+    }
+
+    /**
+     *  最新的作业统计
+     */
+    @Override
+    public Map<String, Object> getWorkInfo(String wareHouseId, String countType) {
+        return tWarehouseMapper.getWorkInfo(wareHouseId, countType);
+    }
+
+    /**
+     *  作业统计趋势数据
+     */
+    @Override
+    public List<Map<String, Object>> getWorkTrend(String wareHouseId,  String startTime, String endTime, String countType) {
+        return tWarehouseMapper.getWorkTrend(wareHouseId, startTime, endTime, countType);
+    }
+
+    @Override
     public String checkUFNoUnique(TWarehouse tWarehouse) {
         TWarehouse tWarehouse1 = tWarehouseMapper.checkFNoUnique(tWarehouse.getfNo());
         if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId() != tWarehouse.getfId()) {

+ 252 - 32
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -365,70 +365,290 @@
             TG.f_name AS goodsName,
             TG.f_packagespecs AS specifications,
             '' AS producing,
-            '' AS materialQuality,
+            TWG.f_marks AS materialQuality,
             '' AS level,
-            '' AS totalQuantity,
-            '' AS availableQuantity,
-            '' AS quantityUnit,
-            '' AS totalNetWeight,
-            '' AS availableWeight,
-            '' AS weightUnit,
-            '' AS spu
+            TWG.f_qtyblc AS totalQuantity,
+            TWG.f_qtyD AS availableQuantity,
+            '' AS quantityUnit,
+            IFNULL( ROUND( TWG.f_netweightblc / 1000, 2 ), 0 ) AS totalNetWeight,
+            IFNULL( ROUND( TWG.f_netweightD / 1000, 2 ), 0 ) AS availableWeight,
+            '' AS weightUnit,
+            TG.f_name + '-' + TG.f_packagespecs + '/袋' + '-' + 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>
-            del_flag = '0'
+            TW.del_flag = '0'
+            AND TW.f_no = #{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="producing != null  and producing != ''"> and '' like concat('%', #{producing}, '%')</if>
-            <if test="materialQuality != null  and materialQuality != ''"> and '' like concat('%', #{materialQuality}, '%')</if>
-            <if test="level != null  and level != ''"> and '' like concat('%', #{level}, '%')</if>
+            <if test="materialQuality != null  and materialQuality != ''"> and TWG.f_marks like concat('%', #{materialQuality}, '%')</if>
         </where>
     </select>
 
     <select id="queryGoodsAccountDetailByPageV1" resultType="map">
         SELECT
-            '' AS id,
+            TW.f_id AS id,
             TW.f_no AS warehouseCode,
             TW.f_name AS warehouseName,
-            '' AS areaName,
-            '' AS areaCode,
+            TW.f_name AS areaName,
+            TW.f_no AS areaCode,
             '' AS slotName,
             '' AS slotCode,
-            '' AS receiptDoc,
-            '' AS billOfLading,
+            TWG.f_originalbillno AS receiptDoc,
+            TWG.f_mblno AS billOfLading,
             TC.f_no AS ownerCode,
             TC.f_name AS ownerName,
             TG.f_name AS goodsName,
             TG.f_packagespecs AS specifications,
             '' AS producing,
-            '' AS materialQuality,
-            '' AS level,
-            '' AS totalQuantity,
-            '' AS availableQuantity,
-            '' AS quantityUnit,
-            '' AS totalNetWeight,
-            '' AS availableWeight,
-            '' AS weightUnit,
-            '' AS storesTime,
+            TWG.f_marks AS materialQuality,
+            '' AS LEVEL,
+            TWG.f_qtyblc AS totalQuantity,
+            TWG.f_qtyD AS availableQuantity,
+            '' AS quantityUnit,
+            IFNULL( ROUND( TWG.f_netweightblc / 1000, 2 ), 0 ) AS totalNetWeight,
+            IFNULL( ROUND( TWG.f_netweightD / 1000, 2 ), 0 ) AS availableWeight,
+            '' AS weightUnit,
+            TWG.f_originalbilldate AS storesTime,
             '' AS productionTime,
-            '' AS plateNumber,
+            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
         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
         <where>
             TW.f_no = #{warehouseCode}
-            AND del_flag = '0'
-            <if test="areaName != null  and areaName != ''"> and '' like concat('%', #{areaName}, '%')</if>
-            <if test="areaCode != null  and areaCode != ''"> and '' = #{areaCode}</if>
-            <if test="slotName != null  and slotName != ''"> and '' like concat('%', #{slotName}, '%')</if>
-            <if test="slotCode != null  and slotCode != ''"> and '' = #{slotCode}</if>
+            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>
+        </where>
+    </select>
+
+    <select id="getWareHouseInfo" parameterType="String" resultMap="TWarehouseResult">
+        <include refid="selectTWarehouseVo"/>
+        <where>
+            f_id = #{wareHouseId} and del_flag = '0' limit 1
+        </where>
+    </select>
+
+    <select id="getStorageInfo" resultType="map">
+        SELECT
+            IFNULL( ROUND( TW.f_totalgross / 1000, 2 ), 0 ) AS capacity,
+            IFNULL( ROUND( TWB.f_netweight / 1000, 2 ), 0 ) AS storage,
+            '' AS throughput,
+            '' AS customers
+        FROM
+            t_warehouse TW
+                LEFT JOIN t_warehousebills TWB ON TW.f_id = TWB.f_warehouseid
+        <where>
+            TW.del_flag = '0'
+            AND TW.f_id = #{wareHouseId}
+        </where>
+        GROUP BY
+            TW.f_id
+    </select>
+
+    <select id="getTimeStorageInfo" resultType="map">
+        SELECT
+            IFNULL( f_bsdate, '' ) as time,
+            IFNULL( ROUND( SUM(f_grossweight) / 1000, 2 ), 0 ) as value
+        FROM t_warehousebills
+        <where>
+            del_flag = '0'
+            AND f_id = #{wareHouseId}
+            <if test="startTime != null and startTime != ''">
+                and f_bsdate >= #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and f_bsdate &lt;= #{endTime}
+            </if>
+            <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
+                and f_bsdate>=date(now()) and f_bsdate &lt; DATE_ADD(date(now()),INTERVAL 1 DAY)
+            </if>
+        </where>
+    </select>
+
+    <select id="getTimeThroughputInfo" resultType="map">
+        SELECT
+        IFNULL( f_bsdate, '' ) as time,
+        IFNULL( ROUND( SUM(f_grossweight) / 1000, 2 ), 0 ) as value
+        FROM t_warehousebills
+        <where>
+            del_flag = '0'
+            AND f_id = #{wareHouseId}
+            and f_billtype in ('SJRK','SJCK')
+            <if test="startTime != null and startTime != ''">
+                and f_bsdate >= #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and f_bsdate &lt;= #{endTime}
+            </if>
+            <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
+                and f_bsdate>=date(now()) and f_bsdate &lt; DATE_ADD(date(now()),INTERVAL 1 DAY)
+            </if>
+        </where>
+    </select>
+
+    <select id="getCargoInfo" resultType="map">
+        SELECT
+            IFNULL( ROUND( SUM(f_grossweight) / 1000, 2 ), 0 ) as FGrossweight
+        FROM t_warehousebills
+        <where>
+            is_pledge = #{isPledge}
+            AND f_id = #{wareHouseId}
+            <if test="startTime != null and startTime != ''">
+                and f_bsdate >= #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and f_bsdate >= #{endTime}
+            </if>
+            <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
+                and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(f_bsdate)
+            </if>
+        </where>
+    </select>
+
+    <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) * 100 /(
+                  SELECT
+                    SUM(f_grossweight) as total
+                  FROM
+                    t_warehousebills
+                ),
+                2
+            ) 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
+        <where>
+            TW.f_id = #{wareHouseId}
+            and is_pledge = '1'
+            <if test="startTime != null and startTime != ''">
+                and TW.f_bsdate >= #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and TW.f_bsdate >= #{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)
+            </if>
+        </where>
+        GROUP BY
+            SDD.dict_label
+    </select>
+
+    <select id="getCargoInfoTrend" resultType="map">
+        SELECT
+            IFNULL( f_bsdate, '' ) as time,
+            IFNULL( ROUND( SUM(TW.f_grossweight) / 1000, 2 ), 0 ) 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
+        <where>
+            TW.del_flag = '0'
+            AND TW.f_id = #{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}
+            </if>
+            <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
+                and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(TW.f_bsdate)
+            </if>
+        </where>
+        GROUP BY
+        SDD.dict_label
+    </select>
+
+    <select id="getStorageTop" resultType="map">
+        SELECT
+            '' AS top,
+            TG.f_name AS goodsName,
+            IFNULL( ROUND( SUM(TW.f_grossweight) / 1000, 2 ), 0 ) 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}
+            <if test="countType != null and countType != '' and countType == 2">
+                and TW.f_billtype in ('SJRK','SJCK')
+            </if>
+        </where>
+        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
+        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}
+            <if test="countType != null and countType != '' and countType == 2">
+                and TW.f_billtype in ('SJRK','SJCK')
+            </if>
+        </where>
+        GROUP BY TW.f_corpid
+        ORDER BY IFNULL( ROUND( SUM(TW.f_grossweight) / 1000, 2 ), 0 ) DESC
+        LIMIT #{topCnt}
+    </select>
+
+    <select id="getWorkInfo"  resultType="map">
+        SELECT
+            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}
+            <if test="countType != null and countType != '' and countType == 'SJRK'">
+                and TW.f_billtype = #{countType}
+            </if>
+        </where>
+    </select>
+
+    <select id="getWorkTrend"  resultType="map">
+        SELECT
+            IFNULL( f_bsdate, '' ) as time,
+            IFNULL( ROUND( SUM( TW.f_grossweight ) / 1000, 2 ), 0 ) AS value
+        FROM
+        t_warehousebills TW
+        <where>
+            TW.del_flag = '0'
+            AND TW.f_id = #{wareHouseId}
+            <if test="countType != null and countType != ''">
+                and TW.f_billtype = #{countType}
+            </if>
+            <if test="startTime != null and startTime != ''">
+                and TW.f_bsdate >= #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and TW.f_bsdate >= #{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)
+            </if>
         </where>
     </select>
 </mapper>