Browse Source

新增发货方字段、BI大屏接口优化

Sun 3 years ago
parent
commit
9e8ffe6c69
20 changed files with 279 additions and 109 deletions
  1. 24 24
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWarehousebillsitemsSummaryController.java
  2. 7 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TCorpsMapper.java
  3. 1 1
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TWarehouseMapper.java
  4. 7 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITCorpsService.java
  5. 16 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TCorpsServiceImpl.java
  6. 6 2
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseUserServiceImpl.java
  7. 14 0
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/domain/TWhgenleg.java
  8. 5 9
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java
  9. 4 11
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/ITWhgenlegService.java
  10. 53 29
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java
  11. 15 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehouseBills.java
  12. 7 2
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsitemsMapper.java
  13. 2 2
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehousebillsitemsService.java
  14. 6 3
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java
  15. 16 4
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehousebillsitemsServiceImpl.java
  16. 11 0
      ruoyi-warehouse/src/main/resources/mapper/basicData/TCorpsMapper.xml
  17. 6 0
      ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml
  18. 19 14
      ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml
  19. 35 6
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml
  20. 25 2
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsitemsMapper.xml

+ 24 - 24
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWarehousebillsitemsSummaryController.java

@@ -118,6 +118,14 @@ public class TWarehousebillsitemsSummaryController extends BaseController {
     }
 
     /**
+     * bi大屏客户列表
+     */
+    @GetMapping("/biCustomerList")
+    public AjaxResult biCustomerList() {
+        return AjaxResult.success(itCorpsService.biCustomerList());
+    }
+
+    /**
      * bi大屏客户数量
      */
     @GetMapping("/biCustomerCount")
@@ -137,24 +145,24 @@ public class TWarehousebillsitemsSummaryController extends BaseController {
      * bi当日入库量
      */
     @GetMapping("/biTodayInStockCount")
-    public AjaxResult biTodayInStockCount(Long warehouseId) {
-        return AjaxResult.success(itWarehousebillsitemsService.biTodayInAndOutStockCount("SJRK", warehouseId));
+    public AjaxResult biTodayInStockCount(Long warehouseId, Long customerId) {
+        return AjaxResult.success(itWarehousebillsitemsService.biTodayInAndOutStockCount("SJRK", warehouseId, customerId));
     }
 
     /**
      * bi当日出库量
      */
     @GetMapping("/biTodayOutStockCount")
-    public AjaxResult biTodayOutStockCount(Long warehouseId) {
-        return AjaxResult.success(itWarehousebillsitemsService.biTodayInAndOutStockCount("SJCK", warehouseId));
+    public AjaxResult biTodayOutStockCount(Long warehouseId, Long customerId) {
+        return AjaxResult.success(itWarehousebillsitemsService.biTodayInAndOutStockCount("SJCK", warehouseId, customerId));
     }
 
     /**
      * bi库存数量
      */
     @GetMapping("/biStockCount")
-    public AjaxResult biStockCount(Long warehouseId) {
-        return AjaxResult.success(itWhgenlegService.biStockCount(warehouseId));
+    public AjaxResult biStockCount(Long warehouseId, Long customerId) {
+        return AjaxResult.success(itWhgenlegService.biStockCount(warehouseId, customerId));
     }
 
     /**
@@ -166,53 +174,45 @@ public class TWarehousebillsitemsSummaryController extends BaseController {
     }
 
     /**
-     * bi大屏商品概况
-     */
-    @GetMapping("/biGoodsInfo")
-    public AjaxResult biGoodsInfo(Long warehouseId) {
-        return AjaxResult.success(itWhgenlegService.biGoodsInfo(warehouseId));
-    }
-
-    /**
      * bi大屏毛重概况
      */
     @GetMapping("/biWeightInfo")
-    public AjaxResult biWeightInfo(Long warehouseId) {
-        return AjaxResult.success(itWhgenlegService.biWeightInfo(warehouseId));
+    public AjaxResult biWeightInfo(Long warehouseId, Long customerId, String mode) {
+        return AjaxResult.success(itWhgenlegService.biWeightInfo(warehouseId, customerId, mode));
     }
 
     /**
      * bi大屏最大库龄
      */
     @GetMapping("/biMaxStockDays")
-    public AjaxResult biMaxStockDays(Long warehouseId) {
-        return AjaxResult.success(itWhgenlegService.biMaxStockDays(warehouseId));
+    public AjaxResult biMaxStockDays(Long warehouseId, Long customerId) {
+        return AjaxResult.success(itWhgenlegService.biMaxStockDays(warehouseId, customerId));
     }
 
     /**
      * bi大屏库龄概况
      */
     @GetMapping("/biStockDaysInfo")
-    public AjaxResult biStockDaysInfo(Long warehouseId) {
-        return AjaxResult.success(itWhgenlegService.biStockDaysInfo(warehouseId));
+    public AjaxResult biStockDaysInfo(Long warehouseId, Long customerId) {
+        return AjaxResult.success(itWhgenlegService.biStockDaysInfo(warehouseId, customerId));
     }
 
     /**
      * bi大屏入库列表
      */
     @GetMapping("/biInStockList")
-    public TableDataInfo biInStockList(Long warehouseId) {
+    public TableDataInfo biInStockList(Long warehouseId, Long customerId) {
         startPage();
-        return getDataTable(itWarehousebillsitemsService.biInAndOutStockList("SJRK", warehouseId));
+        return getDataTable(itWarehousebillsitemsService.biInAndOutStockList("SJRK", warehouseId, customerId));
     }
 
     /**
      * bi大屏出库列表
      */
     @GetMapping("/biOutStockList")
-    public TableDataInfo biOutStockList(Long warehouseId) {
+    public TableDataInfo biOutStockList(Long warehouseId, Long customerId) {
         startPage();
-        return getDataTable(itWarehousebillsitemsService.biInAndOutStockList("SJCK", warehouseId));
+        return getDataTable(itWarehousebillsitemsService.biInAndOutStockList("SJCK", warehouseId, customerId));
     }
 
     /**

+ 7 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TCorpsMapper.java

@@ -162,4 +162,11 @@ public interface TCorpsMapper extends BaseMapper<TCorps> {
      */
     public Map<String, Object> biCustomerCount(Long warehouseId);
 
+    /**
+     * bi大屏客户列表
+     *
+     * @return 客户集合
+     */
+    public List<Map<String, Object>> biCustomerList(@Param("external") String external);
+
 }

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

@@ -177,6 +177,6 @@ public interface TWarehouseMapper {
      *
      * @return 仓库集合
      */
-    public List<Map<String, Object>> biWarehouseList();
+    public List<Map<String, Object>> biWarehouseList(@Param("external") String external);
 
 }

+ 7 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITCorpsService.java

@@ -121,4 +121,11 @@ public interface ITCorpsService {
      */
     public Map<String, Object> biCustomerCount(Long warehouseId);
 
+    /**
+     * bi大屏客户列表
+     *
+     * @return 客户集合
+     */
+    public List<Map<String, Object>> biCustomerList();
+
 }

+ 16 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TCorpsServiceImpl.java

@@ -387,4 +387,20 @@ public class TCorpsServiceImpl implements ITCorpsService {
         return tCorpsMapper.biCustomerCount(warehouseId);
     }
 
+    /**
+     * bi大屏客户列表
+     *
+     * @return 客户集合
+     */
+    @Override
+    public List<Map<String, Object>> biCustomerList() {
+        String external = null;
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        if ("外部用户".equals(user.getDept().getDeptName())) {
+            external = user.getUserName();
+        }
+
+        return tCorpsMapper.biCustomerList(external);
+    }
+
 }

+ 6 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseUserServiceImpl.java

@@ -112,14 +112,18 @@ public class TWarehouseUserServiceImpl implements ITWarehouseUserService {
     public List<Map<String, Object>> biWarehouseList() {
         SysUser user = SecurityUtils.getLoginUser().getUser();
         if (user.isAdmin()) {
-            return tWarehouseMapper.biWarehouseList();
+            return tWarehouseMapper.biWarehouseList(null);
+        }
+
+        if ("外部用户".equals(user.getDept().getDeptName())) {
+            return tWarehouseMapper.biWarehouseList(user.getUserName());
         }
 
         List<Map<String, Object>> warehouseList = tWarehouseUserMapper.biWarehouseList(user.getUserId());
         if (warehouseList.size() == 1) {
             Long warehouseId = (Long) warehouseList.get(0).get("warehouseId");
             if (warehouseId == 0) {
-                return tWarehouseMapper.biWarehouseList();
+                return tWarehouseMapper.biWarehouseList(null);
             }
         }
 

+ 14 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/domain/TWhgenleg.java

@@ -40,6 +40,11 @@ public class TWhgenleg extends BaseEntity {
     private Long fCorpid;
 
     /**
+     * 发货方
+     */
+    private String fShipper;
+
+    /**
      * 提单号
      */
     private String fMblno;
@@ -315,6 +320,14 @@ public class TWhgenleg extends BaseEntity {
         this.fCorpid = fCorpid;
     }
 
+    public String getfShipper() {
+        return fShipper;
+    }
+
+    public void setfShipper(String fShipper) {
+        this.fShipper = fShipper;
+    }
+
     public String getfMblno() {
         return fMblno;
     }
@@ -602,6 +615,7 @@ public class TWhgenleg extends BaseEntity {
                 ", fAccyear=" + fAccyear +
                 ", fAccmonth=" + fAccmonth +
                 ", fCorpid=" + fCorpid +
+                ", fShipper=" + fShipper +
                 ", fMblno='" + fMblno + '\'' +
                 ", fOriginalbillno='" + fOriginalbillno + '\'' +
                 ", fWarehouseLocationid=" + fWarehouseLocationid +

+ 5 - 9
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java

@@ -178,14 +178,17 @@ public interface TWhgenlegMapper {
     public Map<String, Object> stockStatistics(@Param("beginDate") String beginDate,
                                                @Param("endDate") String endDate,
                                                @Param("external") String external,
-                                               @Param("warehouseId") Long warehouseId);
+                                               @Param("warehouseId") Long warehouseId,
+                                               @Param("customerId") Long customerId);
 
     /**
      * 库龄
      * @param external 外部用户
      * @return
      */
-    public Map<String, Object> stockDays(@Param("external") String external, @Param("warehouseId") Long warehouseId);
+    public Map<String, Object> stockDays(@Param("external") String external,
+                                         @Param("warehouseId") Long warehouseId,
+                                         @Param("customerId") Long customerId);
 
     /**
      * 库龄超过60天的库存列表
@@ -202,13 +205,6 @@ public interface TWhgenlegMapper {
     public List<Map<String, Object>> biCustomerInfo(Long warehouseId);
 
     /**
-     * bi大屏商品概况
-     *
-     * @return
-     */
-    public List<Map<String, Object>> biGoodsInfo(Long warehouseId);
-
-    /**
      * bi大屏毛重概况
      *
      * @return

+ 4 - 11
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/ITWhgenlegService.java

@@ -185,34 +185,27 @@ public interface ITWhgenlegService {
      *
      * @return
      */
-    public Map<String, Object> biStockCount(Long warehouseId);
-
-    /**
-     * bi大屏商品概况
-     *
-     * @return
-     */
-    public List<Map<String, Object>> biGoodsInfo(Long warehouseId);
+    public Map<String, Object> biStockCount(Long warehouseId, Long customerId);
 
     /**
      * bi大屏毛重概况
      *
      * @return
      */
-    public Map<String, Object> biWeightInfo(Long warehouseId);
+    public Map<String, Object> biWeightInfo(Long warehouseId, Long customerId, String mode);
 
     /**
      * bi大屏最大库龄
      *
      * @return
      */
-    public Map<String, Object> biMaxStockDays(Long warehouseId);
+    public Map<String, Object> biMaxStockDays(Long warehouseId, Long customerId);
 
     /**
      * bi大屏库龄概况
      *
      * @return
      */
-    public List<Map<String, Object>> biStockDaysInfo(Long warehouseId);
+    public List<Map<String, Object>> biStockDaysInfo(Long warehouseId, Long customerId);
 
 }

+ 53 - 29
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java

@@ -657,18 +657,14 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
      * @return
      */
     @Override
-    public Map<String, Object> biStockCount(Long warehouseId) {
-        return tWhgenlegMapper.stockStatistics(null, null, null, warehouseId);
-    }
+    public Map<String, Object> biStockCount(Long warehouseId, Long customerId) {
+        String external = null;
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        if ("外部用户".equals(user.getDept().getDeptName())) {
+            external = user.getUserName();
+        }
 
-    /**
-     * bi大屏商品概况
-     *
-     * @return
-     */
-    @Override
-    public List<Map<String, Object>> biGoodsInfo(Long warehouseId) {
-        return tWhgenlegMapper.biGoodsInfo(warehouseId);
+        return tWhgenlegMapper.stockStatistics(null, null, external, warehouseId, customerId);
     }
 
     /**
@@ -677,34 +673,50 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
      * @return
      */
     @Override
-    public Map<String, Object> biWeightInfo(Long warehouseId) {
+    public Map<String, Object> biWeightInfo(Long warehouseId, Long customerId, String mode) {
+        String external = null;
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        if ("外部用户".equals(user.getDept().getDeptName())) {
+            external = user.getUserName();
+        }
+
+        List<String> names = new ArrayList<>();
+        if ("3".equals(mode)) {
+            Collections.addAll(names, "入库尺码", "出库尺码");
+        } else if ("2".equals(mode)) {
+            Collections.addAll(names, "入库重量", "入库重量");
+        } else {
+            mode = "1";
+            Collections.addAll(names, "入库件数", "入库件数");
+        }
+
         Map<String, Object> data = new HashMap<>();
         List<Map<String, Object>> series = new ArrayList<>();
         Map<String, Object> seriesMap;
 
         List<String> categories = new ArrayList<>();
         List<Object> quantityInList = new ArrayList<>();
-        List<Object> quantityList = new ArrayList<>();
+        List<Object> quantityOutList = new ArrayList<>();
         Map<String, Object> weightMap;
 
         for (int i = -5; i <= 0; i++) {
             categories.add(DateUtils.offsetOnlyMonth(i) + "月");
 
             weightMap = tWarehousebillsitemsMapper.inAndOutStockStatistics("SJRK", DateUtils.beginOfOffsetMonth(i) + " 00:00:00",
-                    DateUtils.endOfOffsetMonth(i) + " 23:59:59", null, warehouseId);
+                    DateUtils.endOfOffsetMonth(i) + " 23:59:59", external, warehouseId, customerId, mode);
             quantityInList.add(weightMap.get("total"));
             weightMap = tWarehousebillsitemsMapper.inAndOutStockStatistics("SJCK", DateUtils.beginOfOffsetMonth(i) + " 00:00:00",
-                    DateUtils.endOfOffsetMonth(i) + " 23:59:59", null, warehouseId);
-            quantityList.add(weightMap.get("total"));
+                    DateUtils.endOfOffsetMonth(i) + " 23:59:59", external, warehouseId, customerId, mode);
+            quantityOutList.add(weightMap.get("total"));
         }
 
         seriesMap = new HashMap<>();
-        seriesMap.put("name", "入库毛重");
+        seriesMap.put("name", names.get(0));
         seriesMap.put("data", quantityInList);
         series.add(seriesMap);
         seriesMap = new HashMap<>();
-        seriesMap.put("name", "出库毛重");
-        seriesMap.put("data", quantityList);
+        seriesMap.put("name", names.get(1));
+        seriesMap.put("data", quantityOutList);
         series.add(seriesMap);
 
         data.put("categories", categories);
@@ -718,8 +730,14 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
      * @return
      */
     @Override
-    public Map<String, Object> biMaxStockDays(Long warehouseId) {
-        return tWhgenlegMapper.stockDays(null, warehouseId);
+    public Map<String, Object> biMaxStockDays(Long warehouseId, Long customerId) {
+        String external = null;
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        if ("外部用户".equals(user.getDept().getDeptName())) {
+            external = user.getUserName();
+        }
+
+        return tWhgenlegMapper.stockDays(external, warehouseId, customerId);
     }
 
     /**
@@ -728,42 +746,48 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
      * @return
      */
     @Override
-    public List<Map<String, Object>> biStockDaysInfo(Long warehouseId) {
+    public List<Map<String, Object>> biStockDaysInfo(Long warehouseId, Long customerId) {
+        String external = null;
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        if ("外部用户".equals(user.getDept().getDeptName())) {
+            external = user.getUserName();
+        }
+
         List<Map<String, Object>> data = new ArrayList<>();
         Map<String, Object> item;
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-6) + " 00:00:00",
-                null, null, warehouseId);
+                null, external, warehouseId, customerId);
         item.put("name", "7天以内");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-14) + " 00:00:00",
-                DateUtils.offsetDate(-6) + " 00:00:00", null, warehouseId);
+                DateUtils.offsetDate(-6) + " 00:00:00", external, warehouseId, customerId);
         item.put("name", "7~15天");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-29) + " 00:00:00",
-                DateUtils.offsetDate(-14) + " 00:00:00", null, warehouseId);
+                DateUtils.offsetDate(-14) + " 00:00:00", external, warehouseId, customerId);
         item.put("name", "15~30天");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-59) + " 00:00:00",
-                DateUtils.offsetDate(-29) + " 00:00:00", null, warehouseId);
+                DateUtils.offsetDate(-29) + " 00:00:00", external, warehouseId, customerId);
         item.put("name", "30~60天");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-89) + " 00:00:00",
-                DateUtils.offsetDate(-59) + " 00:00:00", null, warehouseId);
+                DateUtils.offsetDate(-59) + " 00:00:00", external, warehouseId, customerId);
         item.put("name", "60~90天");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-179) + " 00:00:00",
-                DateUtils.offsetDate(-89) + " 00:00:00", null, warehouseId);
+                DateUtils.offsetDate(-89) + " 00:00:00", external, warehouseId, customerId);
         item.put("name", "90~180天");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(null,
-                DateUtils.offsetDate(-179) + " 00:00:00", null, warehouseId);
+                DateUtils.offsetDate(-179) + " 00:00:00", external, warehouseId, customerId);
         item.put("name", "超过180天");
         data.add(item);
 

+ 15 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehouseBills.java

@@ -86,6 +86,12 @@ public class TWarehouseBills extends BaseEntity {
     private Long fCorpid;
 
     /**
+     * 发货方
+     */
+    @Excel(name = "发货方")
+    private String fShipper;
+
+    /**
      * 货转客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name,自有在货权转移是该字段有效
      */
     @Excel(name = "货转客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name,自有在货权转移是该字段有效")
@@ -1351,6 +1357,14 @@ public class TWarehouseBills extends BaseEntity {
         return fCorpid;
     }
 
+    public void setfShipper(String fShipper) {
+        this.fShipper = fShipper;
+    }
+
+    public String getfShipper() {
+        return fShipper;
+    }
+
     public void setfTocorpid(Long fTocorpid) {
         this.fTocorpid = fTocorpid;
     }
@@ -1876,6 +1890,7 @@ public class TWarehouseBills extends BaseEntity {
                 ", fContacts='" + fContacts + '\'' +
                 ", fTel='" + fTel + '\'' +
                 ", fCorpid=" + fCorpid +
+                ", fShipper=" + fShipper +
                 ", fTocorpid=" + fTocorpid +
                 ", fStltypeid=" + fStltypeid +
                 ", fBscorpno='" + fBscorpno + '\'' +

+ 7 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsitemsMapper.java

@@ -299,7 +299,9 @@ public interface TWarehousebillsitemsMapper extends BaseMapper<TWarehousebillsit
                                                        @Param("beginDate") String beginDate,
                                                        @Param("endDate") String endDate,
                                                        @Param("external") String external,
-                                                       @Param("warehouseId") Long warehouseId);
+                                                       @Param("warehouseId") Long warehouseId,
+                                                       @Param("customerId") Long customerId,
+                                                       @Param("mode") String mode);
 
     /**
      * bi出入库列表
@@ -307,6 +309,9 @@ public interface TWarehousebillsitemsMapper extends BaseMapper<TWarehousebillsit
      * @param billType 单据类型
      * @return
      */
-    public List<Map<String,Object>> biInAndOutStockList(@Param("billType") String billType, @Param("warehouseId") Long warehouseId);
+    public List<Map<String,Object>> biInAndOutStockList(@Param("billType") String billType,
+                                                        @Param("external") String external,
+                                                        @Param("warehouseId") Long warehouseId,
+                                                        @Param("customerId") Long customerId);
 
 }

+ 2 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehousebillsitemsService.java

@@ -90,7 +90,7 @@ public interface ITWarehousebillsitemsService {
      * @param billType 单据类型
      * @return
      */
-    public Map<String,Object> biTodayInAndOutStockCount(String billType, Long warehouseId);
+    public Map<String,Object> biTodayInAndOutStockCount(String billType, Long warehouseId, Long customerId);
 
     /**
      * bi出入库列表
@@ -98,6 +98,6 @@ public interface ITWarehousebillsitemsService {
      * @param billType 单据类型
      * @return
      */
-    public List<Map<String,Object>> biInAndOutStockList(String billType, Long warehouseId);
+    public List<Map<String,Object>> biInAndOutStockList(String billType, Long warehouseId, Long customerId);
 
 }

+ 6 - 3
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -547,6 +547,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             if (StringUtils.isNotEmpty(warehouseBills.getRemark())) {
                 tWhgenleg.setRemark(warehouseBills.getRemark());
             }
+            if (StringUtils.isNotEmpty(warehouseBills.getfShipper())) {
+                tWhgenleg.setfShipper(warehouseBills.getfShipper());
+            }
         }
         if (WarehouseTypeEnum.HQZY.getType().equals(warehouseBills.getfBilltype()) || WarehouseTypeEnum.CKDB.getType().equals(warehouseBills.getfBilltype()) ||
                 WarehouseTypeEnum.HWTG.getType().equals(warehouseBills.getfBilltype())) {
@@ -7758,7 +7761,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
 
         Map<String, String> data = new HashMap<>();
         // 库龄
-        data.put("stockDays", String.valueOf(tWhgenlegMapper.stockDays(external, null).get("stockDays")));
+        data.put("stockDays", String.valueOf(tWhgenlegMapper.stockDays(external, null, null).get("stockDays")));
         // 7天
         data.put("stockTotalA", stockStatistics(DateUtils.offsetDate(-6), null, external));
         // 15天
@@ -7779,7 +7782,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     private String inAndOutStockStatistics(String billType, String beginDate, String endDate, String external) {
         beginDate += " 00:00:00";
         endDate += " 23:59:59";
-        Map<String, Object> statistics = tWarehousebillsitemsMapper.inAndOutStockStatistics(billType, beginDate, endDate, external, null);
+        Map<String, Object> statistics = tWarehousebillsitemsMapper.inAndOutStockStatistics(billType, beginDate, endDate, external, null, null, null);
         return String.valueOf(statistics.get("total"));
     }
 
@@ -7790,7 +7793,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         if (StringUtils.isNotEmpty(endDate)) {
             endDate += " 00:00:00";
         }
-        Map<String, Object> statistics = tWhgenlegMapper.stockStatistics(beginDate, endDate, external, null);
+        Map<String, Object> statistics = tWhgenlegMapper.stockStatistics(beginDate, endDate, external, null, null);
         return String.valueOf(statistics.get("quantity"));
     }
 

+ 16 - 4
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehousebillsitemsServiceImpl.java

@@ -238,11 +238,17 @@ public class TWarehousebillsitemsServiceImpl implements ITWarehousebillsitemsSer
      * @return
      */
     @Override
-    public Map<String,Object> biTodayInAndOutStockCount(String billType, Long warehouseId){
+    public Map<String,Object> biTodayInAndOutStockCount(String billType, Long warehouseId, Long customerId){
         String beginDate = DateUtils.today() + " 00:00:00";
         String endDate = DateUtils.today() + " 23:59:59";
 
-        return tWarehousebillsitemsMapper.inAndOutStockStatistics(billType, beginDate, endDate, null, warehouseId);
+        String external = null;
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        if ("外部用户".equals(user.getDept().getDeptName())) {
+            external = user.getUserName();
+        }
+
+        return tWarehousebillsitemsMapper.inAndOutStockStatistics(billType, beginDate, endDate, external, warehouseId, customerId, null);
     }
 
     /**
@@ -252,8 +258,14 @@ public class TWarehousebillsitemsServiceImpl implements ITWarehousebillsitemsSer
      * @return
      */
     @Override
-    public List<Map<String,Object>> biInAndOutStockList(String billType, Long warehouseId) {
-        return tWarehousebillsitemsMapper.biInAndOutStockList(billType, warehouseId);
+    public List<Map<String,Object>> biInAndOutStockList(String billType, Long warehouseId, Long customerId) {
+        String external = null;
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        if ("外部用户".equals(user.getDept().getDeptName())) {
+            external = user.getUserName();
+        }
+
+        return tWarehousebillsitemsMapper.biInAndOutStockList(billType, external, warehouseId, customerId);
     }
 
 }

+ 11 - 0
ruoyi-warehouse/src/main/resources/mapper/basicData/TCorpsMapper.xml

@@ -467,4 +467,15 @@
         );
     </select>
 
+    <select id="biCustomerList" resultType="map">
+        select f_id as customerId,
+            f_name as customerName
+        from t_corps
+        where f_typename like '%客户%'
+        <if test="external != null and external != ''">
+            and f_id = (select f_corpid from t_customer_contact where f_tel = #{external})
+        </if>
+        order by convert(f_name using gbk)
+    </select>
+
 </mapper>

+ 6 - 0
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -326,6 +326,12 @@
             f_name as warehouseName
         from t_warehouse
         where parent_id = 100
+        <if test="external != null and external != ''">
+            and f_id in (
+                select distinct f_warehouseid
+                from t_customer_contact t1 left join t_whgenleg t2 on t1.f_pid = t2.f_corpid
+                where f_tel = #{external})
+        </if>
         order by convert(f_name using gbk)
     </select>
 </mapper>

+ 19 - 14
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -9,6 +9,7 @@
         <result property="fAccyear" column="f_accyear"/>
         <result property="fAccmonth" column="f_accmonth"/>
         <result property="fCorpid" column="f_corpid"/>
+        <result property="fShipper" column="f_shipper"/>
         <result property="fMblno" column="f_mblno"/>
         <result property="fOriginalbillno" column="f_originalbillno"/>
         <result property="fWarehouseLocationid" column="f_warehouse_locationid"/>
@@ -88,7 +89,7 @@
     </resultMap>
 
     <sql id="selectTWhgenlegVo">
-        select f_id, f_accyear, f_accmonth, f_corpid, f_mblno, f_originalbillno, f_warehouse_locationid, f_goodsid, f_trademodeid, f_preqty,
+        select f_id, f_accyear, f_accmonth, f_corpid, f_shipper, f_mblno, f_originalbillno, f_warehouse_locationid, f_goodsid, f_trademodeid, f_preqty,
          f_pregrossweight, f_warehouseid, f_prenetweight, f_bsdate, f_chargedate, f_volumnD, f_qtyD, f_billingway, f_grossweightD, f_netweightD, f_volumnC,
           f_qtyC, f_grossweightC, f_qtyblc, f_grossweightblc, f_netweightC, f_netweightblc, f_cntrno, f_status, del_flag, f_marks, create_by,
            create_time, update_by, f_volumnblc, update_time, remark, f_business_type, f_originalbilldate, f_localcntrno,f_customno from t_whgenleg
@@ -116,6 +117,7 @@
             <if test="fNetweightd != null ">and f_netweightD = #{fNetweightd}</if>
             <if test="fVolumnc != null ">and f_volumnC = #{fVolumnc}</if>
             <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fBusinessType != null "> and f_business_type = #{fBusinessType}</if>
             <if test="fQtyc != null ">and f_qtyC = #{fQtyc}</if>
             <if test="fGrossweightc != null ">and f_grossweightC = #{fGrossweightc}</if>
@@ -136,6 +138,7 @@
         <include refid="selectTWhgenlegVo"/>
         <where>
             <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null ">and f_shipper = #{fShipper}</if>
             <if test="fMblno != null ">and f_mblno = #{fMblno}</if>
             <if test="fCntrno != null ">and f_cntrno = #{fCntrno}</if>
             <if test="fBusinessType != null ">and f_business_type = #{fBusinessType}</if>
@@ -176,6 +179,7 @@
             <if test="fAccyear != null">f_accyear,</if>
             <if test="fAccmonth != null">f_accmonth,</if>
             <if test="fCorpid != null">f_corpid,</if>
+            <if test="fShipper != null">f_shipper,</if>
             <if test="fMblno != null">f_mblno,</if>
             <if test="fOriginalbillno != null">f_originalbillno,</if>
             <if test="fWarehouseLocationid != null">f_warehouse_locationid,</if>
@@ -217,6 +221,7 @@
             <if test="fAccyear != null">#{fAccyear},</if>
             <if test="fAccmonth != null">#{fAccmonth},</if>
             <if test="fCorpid != null">#{fCorpid},</if>
+            <if test="fShipper != null">#{fShipper},</if>
             <if test="fMblno != null">#{fMblno},</if>
             <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
             <if test="fWarehouseLocationid != null">#{fWarehouseLocationid},</if>
@@ -262,6 +267,7 @@
             <if test="fAccyear != null">f_accyear = #{fAccyear},</if>
             <if test="fAccmonth != null">f_accmonth = #{fAccmonth},</if>
             <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
+            <if test="fShipper != null">f_shipper = #{fShipper},</if>
             <if test="fMblno != null">f_mblno = #{fMblno},</if>
             <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
             <if test="fWarehouseLocationid != null">f_warehouse_locationid = #{fWarehouseLocationid},</if>
@@ -651,6 +657,7 @@
             leg.f_corpid AS fCorpIds,
             leg.f_bsdate AS fBsdate,
             corp.f_name AS fCorpid,
+            leg.f_shipper AS fShipper,
             ware.f_warehouse_information AS fWarehouseids,
             area.f_name AS fWarehouseLocationids,
             leg.f_originalbillno AS fOriginalbillno,
@@ -702,6 +709,7 @@
             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
                 and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}
             </if>
@@ -745,6 +753,7 @@
             leg.f_id AS fId,
             leg.f_corpid AS fCorpIds,
             corp.f_name AS fCorpid,
+            leg.f_shipper AS fShipper,
             ware.f_warehouse_information AS fWarehouseids,
             area.f_name AS fWarehouseLocationids,
             leg.f_originalbillno AS fOriginalbillno,
@@ -798,6 +807,7 @@
             <if test="fTel != null  and fTel != ''">and tc.f_tel = #{fTel}</if>
             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
             <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
                 and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}
@@ -854,6 +864,7 @@
         leg.f_id AS fId,
         leg.f_corpid AS fCorpIds,
         corp.f_name AS fCorpid,
+        leg.f_shipper AS fShipper,
         ware.f_warehouse_information AS fWarehouseids,
         area.f_name AS fWarehouseLocationids,
         leg.f_originalbillno AS fOriginalbillno,
@@ -907,6 +918,7 @@
             <if test="fTel != null  and fTel != ''">and tc.f_tel = #{fTel}</if>
             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
             <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
                 and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}
@@ -963,6 +975,7 @@
         leg.f_id AS fId,
         leg.f_corpid AS fCorpIds,
         corp.f_name AS fCorpid,
+        leg.f_shipper AS fShipper,
         ware.f_warehouse_information AS fWarehouseids,
         area.f_name AS fWarehouseLocationids,
         leg.f_originalbillno AS fOriginalbillno,
@@ -1014,6 +1027,7 @@
             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
                 and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}
             </if>
@@ -1056,6 +1070,7 @@
             DISTINCT
             leg.f_id AS fId,
             corp.f_name AS fCorpid,
+            leg.f_shipper AS fShipper,
             DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
             ware.f_warehouse_information AS fWarehouseids,
             leg.f_mblno AS fMblno,
@@ -1078,6 +1093,7 @@
             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
             <if test='timeStartBsdate != null'>
                 and leg.f_originalbilldate &gt;= #{timeStartBsdate}
@@ -1192,6 +1208,7 @@
                 and f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
             </if>
             <if test="warehouseId != null"> and f_warehouseid = #{warehouseId}</if>
+            <if test="customerId != null"> and f_corpid = #{customerId}</if>
         </where>
     </select>
 
@@ -1205,6 +1222,7 @@
                 and f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
             </if>
             <if test="warehouseId != null"> and f_warehouseid = #{warehouseId}</if>
+            <if test="customerId != null"> and f_corpid = #{customerId}</if>
     </select>
 
     <select id="stockAfterMonthList" resultType="map">
@@ -1240,19 +1258,6 @@
         order by quantity desc limit 10
     </select>
 
-    <select id="biGoodsInfo" parameterType="long" resultType="map">
-        select
-            tg.f_name as goodsName,
-            round(ifnull(sum(tw.f_grossweightblc), 0) / 1000, 2) as quantity
-        from t_whgenleg tw left join t_goods tg on tw.f_goodsid = tg.f_id
-        where
-            tw.f_qtyD != 0
-            and tw.f_qtyblc != 0
-            <if test="warehouseId != null"> and tw.f_warehouseid = #{warehouseId}</if>
-        group by tg.f_name
-        order by quantity desc limit 10
-    </select>
-
     <select id="biWeightInfo" resultType="map">
         select
             round(ifnull(sum(f_grossweightD), 0) / 1000, 2) as quantityIn,

+ 35 - 6
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -14,6 +14,7 @@
         <result property="fContacts"    column="f_contacts"    />
         <result property="fTel"    column="f_tel"    />
         <result property="fCorpid"    column="f_corpid"    />
+        <result property="fShipper"    column="f_shipper"    />
         <result property="fTocorpid"    column="f_tocorpid"    />
         <result property="fStltypeid"    column="f_stltypeid"    />
         <result property="fBscorpno"    column="f_bscorpno"    />
@@ -134,7 +135,7 @@
     </resultMap>
 
     <sql id="selectTWarehousebillsVo">
-        select f_id, f_billno, f_customsdeclartion, f_originalbillno, f_deptid, f_bsdeptid, f_contacts, f_tel, f_corpid, f_tocorpid, f_stltypeid, f_bscorpno,
+        select f_id, f_billno, f_customsdeclartion, f_originalbillno, f_deptid, f_bsdeptid, f_contacts, f_tel, f_corpid, f_shipper, f_tocorpid, f_stltypeid, f_bscorpno,
         f_warehouseid, f_storekeeper, f_chargedate, f_bsdate, f_planqty, f_plangrossweight, f_plannetweight, f_planvolumn, f_qty, f_grossweight, f_netweight,
         f_volumn, f_billingway, f_trademodeid, f_sbu, f_feetunit, f_mblno, f_emblno, f_marks, f_vslvoy, f_eta, f_customno, f_ifweigh, f_ifpledge, f_ifdamage, f_bankcorpid,
         f_billtype, f_billstatus, f_items_status, del_flag, create_by, create_time, update_by, update_time, remark, f_billing_deadline, f_product_name, f_review_date,
@@ -167,6 +168,7 @@
             <if test="fContacts != null  and fContacts != ''">and f_contacts = #{fContacts}</if>
             <if test="fTel != null  and fTel != ''">and f_tel = #{fTel}</if>
             <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fTocorpid != null ">and f_tocorpid = #{fTocorpid}</if>
             <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
             <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
@@ -219,6 +221,7 @@
             bill.f_id AS fId,
             corp.f_name AS fCorpid,
             corpTo.f_name AS fTocorpid,
+            bill.f_shipper AS fShipper,
             bill.f_mblno AS fMblno,
             bill.f_emblno AS fEmblno,
             corpSub.f_name AS fSbu,
@@ -360,6 +363,7 @@
             <if test="fContacts != null  and fContacts != ''">and bill.f_contacts = #{fContacts}</if>
             <if test="fTel != null  and fTel != ''">and bill.f_tel = #{fTel}</if>
             <if test="fCorpid != null ">and bill.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and bill.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fBillingDeadline != null ">and bill.f_billing_deadline = #{fBillingDeadline}</if>
             <if test="fTocorpid != null ">and bill.f_tocorpid = #{fTocorpid}</if>
             <if test="fMarks != null  and fMarks != ''">and bill.f_marks like concat('%', #{fMarks}, '%')</if>
@@ -426,6 +430,7 @@
             bill.f_id AS fId,
             corp.f_name AS fCorpid,
             corpTo.f_name AS fTocorpid,
+            bill.f_shipper AS fShipper,
             bill.f_mblno AS fMblno,
             bill.f_emblno AS fEmblno,
             corpSub.f_name AS fSbu,
@@ -540,6 +545,7 @@
             <if test="fContacts != null  and fContacts != ''">and bill.f_contacts = #{fContacts}</if>
             <if test="fTel != null  and fTel != ''">and bill.f_tel = #{fTel}</if>
             <if test="fCorpid != null ">and bill.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and bill.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fBillingDeadline != null ">and bill.f_billing_deadline = #{fBillingDeadline}</if>
             <if test='timeInterval2 != null and timeInterval2[0] != null and timeInterval2[0]!= ""'><!-- 仓储费增加计费截止日期区间查询 -->
                 and bill.f_billing_deadline &gt;= #{timeInterval2[0]}
@@ -666,12 +672,14 @@
         wi.f_grossweight      AS fGrossweightC,
         wf.f_billing_days     AS fBillingDays,
         wf.f_amount           AS fAmount
-        FROM t_warehousebills w
-        LEFT JOIN t_warehousebillsfees wf ON w.f_id = wf.f_pid
+        FROM t_warehousebillsfees wf
         LEFT JOIN t_warehousebillsitems wi ON wi.f_id = wf.src_id
-        LEFT JOIN sys_dict_data dict ON wi.f_business_type = dict.dict_value
-        WHERE w.f_id = #{fId}
-        AND w.f_typeid IS NULL
+        LEFT JOIN t_warehousebills w ON w.f_id = wi.f_pid
+        LEFT JOIN sys_dict_data dict ON w.f_business_type = dict.dict_value
+        WHERE w.f_typeid IS NULL
+        <if test="fId != null and fId!= ''">
+          AND w.f_mblno = (select f_mblno from t_warehousebills where f_id = #{fId})
+        </if>
         AND dict.status = '0'
         <if test="billType != null and billType!= '' and billType== 'SJCK'">
           AND wf.f_billtype = 'SJCK'
@@ -703,6 +711,7 @@
     <select id="selectInventorySJRKList" parameterType="TWarehousebills" resultType="java.util.Map">
         SELECT
         co.f_name AS fName,
+        leg.f_shipper AS fShipper,
         it.f_bsdate AS fBsdate,
         leg.f_mblno AS fMblno,
         it.f_business_type AS fBusinessType,
@@ -745,6 +754,7 @@
             <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
             <if test="fNewTrademodeid != null ">and leg.f_new_trademodeid = #{fNewTrademodeid}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fMblno != null ">and it.f_mblno like concat('%',#{fMblno},'%')</if>
             <if test="fEmblno != null ">and it.f_emblno like concat('%',#{fEmblno},'%')</if>
             <if test="fLocation != null  and fLocation ==1 ">
@@ -766,6 +776,7 @@
     <select id="selectInventorySJCKList" parameterType="TWarehousebills"  resultType="java.util.Map">
         SELECT
             co.f_name AS fName,
+            leg.f_shipper AS fShipper,
             it.f_bsdate AS fBsdate,
             leg.f_mblno AS fMblno,
             it.f_business_type AS fBusinessType,
@@ -816,6 +827,7 @@
             <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
             <if test="fNewTrademodeid != null ">and leg.f_new_trademodeid = #{fNewTrademodeid}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fMblno != null ">and it.f_mblno like concat('%',#{fMblno},'%')</if>
             <if test="fEmblno != null ">and it.f_emblno like concat('%',#{fEmblno},'%')</if>
             <if test="fLocation != null  and fLocation ==1 ">
@@ -839,6 +851,7 @@
         SELECT
         ( @ii := @ii + 1 ) AS fId,
         co.f_name AS fCorpid,
+        leg.f_shipper AS fShipper,
         it.f_bsdate AS fBsdate,
         leg.f_mblno AS fMblno,
         dict.dict_label AS fBusinessType,
@@ -875,6 +888,7 @@
         <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
         <if test="fNewTrademodeid != null ">and leg.f_new_trademodeid = #{fNewTrademodeid}</if>
         <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
+        <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
         <if test="fMblno != null ">and leg.f_mblno = #{fMblno}</if>
         <if test="fEmblno != null ">and leg.f_emblno = #{fEmblno}</if>
         <if test="fLocation != null  and fLocation ==1 ">
@@ -913,6 +927,7 @@
             <if test="fContacts != null">f_contacts,</if>
             <if test="fTel != null">f_tel,</if>
             <if test="fCorpid != null">f_corpid,</if>
+            <if test="fShipper != null">f_shipper,</if>
             <if test="fTocorpid != null">f_tocorpid,</if>
             <if test="fStltypeid != null">f_stltypeid,</if>
             <if test="fBscorpno != null">f_bscorpno,</if>
@@ -1029,6 +1044,7 @@
             <if test="fContacts != null">#{fContacts},</if>
             <if test="fTel != null">#{fTel},</if>
             <if test="fCorpid != null">#{fCorpid},</if>
+            <if test="fShipper != null">#{fShipper},</if>
             <if test="fTocorpid != null">#{fTocorpid},</if>
             <if test="fStltypeid != null">#{fStltypeid},</if>
             <if test="fBscorpno != null">#{fBscorpno},</if>
@@ -1149,6 +1165,7 @@
             <if test="fContacts != null">f_contacts = #{fContacts},</if>
             <if test="fTel != null">f_tel = #{fTel},</if>
             <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
+            <if test="fShipper != null">f_shipper = #{fShipper},</if>
             <if test="fTocorpid != null">f_tocorpid = #{fTocorpid},</if>
             <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
             <if test="fBscorpno != null">f_bscorpno = #{fBscorpno},</if>
@@ -1270,6 +1287,7 @@
             <if test="fContacts != null">f_contacts = #{fContacts},</if>
             <if test="fTel != null">f_tel = #{fTel},</if>
             <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
+            <if test="fShipper != null">f_shipper = #{fShipper},</if>
             <if test="fTocorpid != null">f_tocorpid = #{fTocorpid},</if>
             <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
             <if test="fBscorpno != null and fBscorpno != ''">f_bscorpno = #{fBscorpno},</if>
@@ -1444,6 +1462,7 @@
             t.f_id AS fId,
             item.f_id AS fItemsId,
             C.f_name AS fcorpid,
+            t.f_shipper AS fShipper,
             t.f_mblno AS fMblno,
             g.f_name AS fGoodsid,
             dict.dict_label AS fBusinessType,
@@ -1557,6 +1576,7 @@
             tw.f_contacts,
             tw.f_tel,
             tw.f_corpid,
+            tw.f_shipper,
             tc.f_name corpName,
             tw.f_tocorpid,
             tw.f_stltypeid,
@@ -1680,6 +1700,7 @@
             <if test="fContacts != null  and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
             <if test="fTel != null  and fTel != ''">and tw.f_tel = #{fTel}</if>
             <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and tw.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
             <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
             <if test="fBscorpno != null  and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
@@ -1774,6 +1795,7 @@
         tw.f_id fId,
         tw.f_billno fBillno,
         tw.f_originalbillno fOriginalbillno,
+        tw.f_shipper fShipper,
         tw.f_mblno fMblno,
         sd.dict_label fServiceitems,
         tw.f_consigneername fConsigneername,
@@ -1913,6 +1935,7 @@
             <if test="fContacts != null  and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
             <if test="fTel != null  and fTel != ''">and tw.f_tel = #{fTel}</if>
             <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and tw.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
             <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
             <if test="fBscorpno != null  and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
@@ -2046,6 +2069,7 @@
         tw.f_id fId,
         tw.f_billno fBillno,
         tw.f_originalbillno fOriginalbillno,
+        tw.f_shipper fShipper,
         tw.f_mblno fMblno,
         sd.dict_label fServiceitems,
         tw.f_consigneername fConsigneername,
@@ -2183,6 +2207,7 @@
             <if test="fContacts != null  and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
             <if test="fTel != null  and fTel != ''">and tw.f_tel = #{fTel}</if>
             <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
+            <if test="fShipper != null and fShipper != ''">and tw.f_shipper like concat('%', #{fShipper}, '%')</if>
             <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
             <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
             <if test="fBscorpno != null  and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
@@ -2314,6 +2339,7 @@
                tw.f_bsdeptid,
                tw.f_contacts,
                tw.f_tel,
+               tw.f_shipper,
                tw.f_corpid,
                tc.f_name      corpName,
                tw.f_tocorpid,
@@ -2447,6 +2473,7 @@
             w.f_id fId,
             w.f_corpid fCorpid,
             c.f_name corpName,
+            w.f_shipper fShipper,
             w.f_bsdate fBsdate,
             g.f_name goodsName,
             w.f_mblno fMblno,
@@ -2529,6 +2556,7 @@
         <if test="fItemsStatus == null and timeInterval == null and fMblno == null">
             and IF( w.f_planqty IS NOT NULL, w.f_planqty != w.f_qty, w.f_id != '')
         </if>
+        <if test="fShipper != null and fShipper != ''">and w.f_shipper like concat('%', #{fShipper}, '%')</if>
         <if test="fMblno != null ">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
         <if test="fItemsStatus != null ">and w.f_items_status = #{fItemsStatus}</if>
         <if test="fBillstatus != null ">and w.f_billstatus = #{fBillstatus}</if>
@@ -2549,6 +2577,7 @@
         SELECT
             t.f_id fId,
             t.f_pid fPid,
+            w.f_shipper fShipper,
             c.f_name corpName,
             t.f_bsdate fBsdate,
             g.f_name goodsName,

+ 25 - 2
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsitemsMapper.xml

@@ -953,7 +953,20 @@
     </update>
 
     <select id="inAndOutStockStatistics" resultType="map">
-        select round(ifnull(sum(ts.f_grossweight) / 1000, 0)) as total
+        select
+            <if test="mode == null or mode == ''">round(ifnull(sum(ts.f_grossweight) / 1000, 0)) as total</if>
+            <if test="mode != null and mode != ''">
+                case #{mode}
+                    when '3' then round(ifnull(sum(ts.f_volumn), 0))
+                    when '2' then round(ifnull(sum(
+                        case tb.f_billingway
+                            when 3 then ts.f_netweight
+                            else ts.f_grossweight
+                        end
+                    ) / 1000, 0))
+                    else ifnull(sum(ts.f_qty), 0)
+                end as total
+            </if>
         from t_warehousebillsitems ts
         left join t_warehousebills tb on ts.f_mblno = tb.f_mblno and ts.f_billno = tb.f_billno
         where
@@ -965,14 +978,20 @@
                 and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
             </if>
             <if test="warehouseId != null"> and tb.f_warehouseid = #{warehouseId}</if>
+            <if test="customerId != null">and tb.f_corpid = #{customerId}</if>
     </select>
 
     <select id="biInAndOutStockList" resultType="map">
         select
             ifnull(tc.f_cname, tc.f_name) as customerName,
+            tb.f_shipper as shipper,
             ts.f_warehouse_information as warehouseName,
             tg.f_name as goodsName,
-            round(ts.f_grossweight / 1000, 2) as quantity,
+            concat(ts.f_qty, '/',
+                case tb.f_billingway
+                    when 3 then round(ts.f_netweight / 1000)
+                    else round(ts.f_grossweight / 1000)
+                end, '/', round(ifnull(ts.f_volumn, 0))) as quantity,
             date_format(ts.f_bsdate, '%Y-%m-%d') as businessTime
         from t_warehousebillsitems ts
         left join t_warehousebills tb on ts.f_pid = tb.f_id
@@ -981,7 +1000,11 @@
         where
             ts.f_billstatus = '40'
             <if test="billType != null and billType != ''">and ts.f_billtype = #{billType}</if>
+            <if test="external != null and external != ''">
+                and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
+            </if>
             <if test="warehouseId != null"> and tb.f_warehouseid = #{warehouseId}</if>
+            <if test="customerId != null">and tb.f_corpid = #{customerId}</if>
         order by ts.f_bsdate desc
     </select>