Browse Source

新增首页图表,BI大屏拓展查询条件

Sun 3 years ago
parent
commit
55db397daa
15 changed files with 201 additions and 79 deletions
  1. 14 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/basicData/TFeesController.java
  2. 8 8
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWarehousebillsitemsSummaryController.java
  3. 2 2
      ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
  4. 16 3
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TFeesMapper.java
  5. 17 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITFeesService.java
  6. 54 1
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TFeesServiceImpl.java
  7. 2 1
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java
  8. 1 1
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/ITWhgenlegService.java
  9. 10 10
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java
  10. 19 18
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/excel/QueryMenu.java
  11. 2 2
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehousebillsitemsService.java
  12. 14 28
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java
  13. 3 3
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehousebillsitemsServiceImpl.java
  14. 29 0
      ruoyi-warehouse/src/main/resources/mapper/basicData/TFeesMapper.xml
  15. 10 2
      ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

+ 14 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/basicData/TFeesController.java

@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.warehouse.basicData;
 
 import com.ruoyi.basicData.domain.TFees;
 import com.ruoyi.basicData.service.ITFeesService;
+import com.ruoyi.common.annotation.DataScope;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.constant.UserConstants;
@@ -103,4 +104,17 @@ public class TFeesController extends BaseController {
     public AjaxResult remove(@PathVariable Long[] fIds) {
         return tFeesService.deleteTFeesByIds(fIds);
     }
+
+    @DataScope(deptAlias = "d", userAlias = "u")
+    @GetMapping(value = "/getFeeStatistics")
+    public AjaxResult getFeeStatistics(TFees tFees) {
+        return AjaxResult.success(tFeesService.getFeeStatistics(tFees));
+    }
+
+    @DataScope(deptAlias = "d", userAlias = "u")
+    @GetMapping(value = "/getArrearsStatistics")
+    public AjaxResult getArrearsStatistics(TFees tFees) {
+        return AjaxResult.success(tFeesService.getArrearsStatistics(tFees));
+    }
+
 }

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

@@ -145,24 +145,24 @@ public class TWarehousebillsitemsSummaryController extends BaseController {
      * bi当日入库量
      */
     @GetMapping("/biTodayInStockCount")
-    public AjaxResult biTodayInStockCount(Long warehouseId, Long customerId) {
-        return AjaxResult.success(itWarehousebillsitemsService.biTodayInAndOutStockCount("SJRK", warehouseId, customerId));
+    public AjaxResult biTodayInStockCount(Long warehouseId, Long customerId, String mode) {
+        return AjaxResult.success(itWarehousebillsitemsService.biTodayInAndOutStockCount("SJRK", warehouseId, customerId, mode));
     }
 
     /**
      * bi当日出库量
      */
     @GetMapping("/biTodayOutStockCount")
-    public AjaxResult biTodayOutStockCount(Long warehouseId, Long customerId) {
-        return AjaxResult.success(itWarehousebillsitemsService.biTodayInAndOutStockCount("SJCK", warehouseId, customerId));
+    public AjaxResult biTodayOutStockCount(Long warehouseId, Long customerId, String mode) {
+        return AjaxResult.success(itWarehousebillsitemsService.biTodayInAndOutStockCount("SJCK", warehouseId, customerId, mode));
     }
 
     /**
      * bi库存数量
      */
     @GetMapping("/biStockCount")
-    public AjaxResult biStockCount(Long warehouseId, Long customerId) {
-        return AjaxResult.success(itWhgenlegService.biStockCount(warehouseId, customerId));
+    public AjaxResult biStockCount(Long warehouseId, Long customerId, String mode) {
+        return AjaxResult.success(itWhgenlegService.biStockCount(warehouseId, customerId, mode));
     }
 
     /**
@@ -203,7 +203,7 @@ public class TWarehousebillsitemsSummaryController extends BaseController {
     @GetMapping("/biInStockList")
     public TableDataInfo biInStockList(Long warehouseId, Long customerId) {
         startPage();
-        return getDataTable(itWarehousebillsitemsService.biInAndOutStockList("SJRK", warehouseId, customerId));
+        return getDataTable(itWarehousebillsitemsService.biInAndOutStockList("SJRK", warehouseId, customerId, null));
     }
 
     /**
@@ -212,7 +212,7 @@ public class TWarehousebillsitemsSummaryController extends BaseController {
     @GetMapping("/biOutStockList")
     public TableDataInfo biOutStockList(Long warehouseId, Long customerId) {
         startPage();
-        return getDataTable(itWarehousebillsitemsService.biInAndOutStockList("SJCK", warehouseId, customerId));
+        return getDataTable(itWarehousebillsitemsService.biInAndOutStockList("SJCK", warehouseId, customerId, null));
     }
 
     /**

+ 2 - 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java

@@ -464,8 +464,8 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return dateTime(cale.getTime());
     }
 
-    public static String offsetOnlyMonth(int num) {
-        SimpleDateFormat sf = new SimpleDateFormat("M");
+    public static String offsetFormatMonth(int num, String format) {
+        SimpleDateFormat sf = new SimpleDateFormat(format);
         Calendar cale = Calendar.getInstance();
         cale.add(Calendar.MONTH, num);
         return sf.format(cale.getTime());

+ 16 - 3
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TFeesMapper.java

@@ -1,11 +1,10 @@
 package com.ruoyi.basicData.mapper;
 
 import com.ruoyi.basicData.domain.TFees;
-import com.ruoyi.basicData.domain.TGoods;
-import com.ruoyi.finance.domain.TFee;
-import io.lettuce.core.dynamic.annotation.Param;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 费用信息Mapper接口
@@ -99,4 +98,18 @@ public interface TFeesMapper {
      * @return 费用名称集合
      */
     public List<String> selectTFeesNameList();
+
+    /**
+     * 获取费用统计
+     *
+     * @return 费用统计
+     */
+    public Map<String, String> getFeeStatistics(TFees tFees);
+
+    /**
+     * 获取欠费统计
+     *
+     * @return 费用统计
+     */
+    public List<Map<String, String>> getArrearsStatistics(TFees tFees);
 }

+ 17 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITFeesService.java

@@ -5,6 +5,7 @@ import com.ruoyi.basicData.domain.TGoods;
 import com.ruoyi.common.core.domain.AjaxResult;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 费用信息Service接口
@@ -72,4 +73,20 @@ public interface ITFeesService {
      * @return
      */
     public String checkUFNnameUnique(TFees tFees);
+
+    /**
+     * 获取费用统计
+     *
+     * @param tFees 费用信息
+     * @return 费用统计
+     */
+    public Map<String, Object> getFeeStatistics(TFees tFees);
+
+    /**
+     * 获取欠费统计
+     *
+     * @param tFees 费用信息
+     * @return 欠费统计
+     */
+    public Map<String, Object> getArrearsStatistics(TFees tFees);
 }

+ 54 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TFeesServiceImpl.java

@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
-import java.util.List;
+import java.util.*;
 
 /**
  * 费用信息Service业务层处理
@@ -144,4 +144,57 @@ public class TFeesServiceImpl implements ITFeesService {
         }
         return UserConstants.UNIQUE;
     }
+
+    /**
+     * 获取费用统计
+     *
+     * @param tFees 费用信息
+     * @return 费用统计
+     */
+    @Override
+    public Map<String, Object> getFeeStatistics(TFees tFees) {
+        List<String> dimensions = Arrays.asList("product", "应收", "已收", "利润");
+        List<Map<String, Object>> source = new ArrayList<>();
+
+        for (int i = -5; i <= 0; i++) {
+            tFees.getParams().put("beginDate", DateUtils.beginOfOffsetMonth(i) + " 00:00:00");
+            tFees.getParams().put("endDate", DateUtils.endOfOffsetMonth(i) + " 23:59:59");
+            Map<String, String> feeMap = tFeesMapper.getFeeStatistics(tFees);
+            Map<String, Object> temp = new HashMap<>();
+            temp.put("product", DateUtils.offsetFormatMonth(i, "yyyy-MM"));
+            temp.put("应收", feeMap.get("receivable"));
+            temp.put("已收", feeMap.get("received"));
+            temp.put("利润", feeMap.get("profit"));
+            source.add(temp);
+        }
+
+        return new HashMap<String, Object>() {{
+            this.put("dimensions", dimensions);
+            this.put("source", source);
+        }};
+    }
+
+    /**
+     * 获取费用统计
+     *
+     * @param tFees 费用信息
+     * @return 费用统计
+     */
+    @Override
+    public Map<String, Object> getArrearsStatistics(TFees tFees) {
+        List<String> key = new ArrayList<>();
+        List<String> value = new ArrayList<>();
+
+        List<Map<String, String>> statisticsList = tFeesMapper.getArrearsStatistics(tFees);
+        for (Map<String, String> statisticsMap : statisticsList) {
+            String name = statisticsMap.get("name");
+            key.add(name.length() > 6 ? name.substring(0,6) : name);
+            value.add(statisticsMap.get("receivable"));
+        }
+
+        return new HashMap<String, Object>() {{
+            this.put("key", key);
+            this.put("value", value);
+        }};
+    }
 }

+ 2 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java

@@ -179,7 +179,8 @@ public interface TWhgenlegMapper {
                                                @Param("endDate") String endDate,
                                                @Param("external") String external,
                                                @Param("warehouseId") Long warehouseId,
-                                               @Param("customerId") Long customerId);
+                                               @Param("customerId") Long customerId,
+                                               @Param("mode") String mode);
 
     /**
      * 库龄

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

@@ -185,7 +185,7 @@ public interface ITWhgenlegService {
      *
      * @return
      */
-    public Map<String, Object> biStockCount(Long warehouseId, Long customerId);
+    public Map<String, Object> biStockCount(Long warehouseId, Long customerId, String mode);
 
     /**
      * bi大屏毛重概况

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

@@ -667,14 +667,14 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
      * @return
      */
     @Override
-    public Map<String, Object> biStockCount(Long warehouseId, Long customerId) {
+    public Map<String, Object> biStockCount(Long warehouseId, Long customerId, String mode) {
         String external = null;
         SysUser user = SecurityUtils.getLoginUser().getUser();
         if ("外部用户".equals(user.getDept().getDeptName())) {
             external = user.getUserName();
         }
 
-        return tWhgenlegMapper.stockStatistics(null, null, external, warehouseId, customerId);
+        return tWhgenlegMapper.stockStatistics(null, null, external, warehouseId, customerId, mode);
     }
 
     /**
@@ -710,7 +710,7 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
         Map<String, Object> weightMap;
 
         for (int i = -5; i <= 0; i++) {
-            categories.add(DateUtils.offsetOnlyMonth(i) + "月");
+            categories.add(DateUtils.offsetFormatMonth(i, "M") + "月");
 
             weightMap = tWarehousebillsitemsMapper.inAndOutStockStatistics("SJRK", DateUtils.beginOfOffsetMonth(i) + " 00:00:00",
                     DateUtils.endOfOffsetMonth(i) + " 23:59:59", external, warehouseId, customerId, mode);
@@ -767,37 +767,37 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
         Map<String, Object> item;
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-6) + " 00:00:00",
-                null, external, warehouseId, customerId);
+                null, external, warehouseId, customerId, null);
         item.put("name", "7天以内");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-14) + " 00:00:00",
-                DateUtils.offsetDate(-6) + " 00:00:00", external, warehouseId, customerId);
+                DateUtils.offsetDate(-6) + " 00:00:00", external, warehouseId, customerId, null);
         item.put("name", "7~15天");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-29) + " 00:00:00",
-                DateUtils.offsetDate(-14) + " 00:00:00", external, warehouseId, customerId);
+                DateUtils.offsetDate(-14) + " 00:00:00", external, warehouseId, customerId, null);
         item.put("name", "15~30天");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-59) + " 00:00:00",
-                DateUtils.offsetDate(-29) + " 00:00:00", external, warehouseId, customerId);
+                DateUtils.offsetDate(-29) + " 00:00:00", external, warehouseId, customerId, null);
         item.put("name", "30~60天");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-89) + " 00:00:00",
-                DateUtils.offsetDate(-59) + " 00:00:00", external, warehouseId, customerId);
+                DateUtils.offsetDate(-59) + " 00:00:00", external, warehouseId, customerId, null);
         item.put("name", "60~90天");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(DateUtils.offsetDate(-179) + " 00:00:00",
-                DateUtils.offsetDate(-89) + " 00:00:00", external, warehouseId, customerId);
+                DateUtils.offsetDate(-89) + " 00:00:00", external, warehouseId, customerId, null);
         item.put("name", "90~180天");
         data.add(item);
 
         item = tWhgenlegMapper.stockStatistics(null,
-                DateUtils.offsetDate(-179) + " 00:00:00", external, warehouseId, customerId);
+                DateUtils.offsetDate(-179) + " 00:00:00", external, warehouseId, customerId, null);
         item.put("name", "超过180天");
         data.add(item);
 

+ 19 - 18
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/excel/QueryMenu.java

@@ -2,6 +2,7 @@ package com.ruoyi.warehouseBusiness.excel;
 
 import com.ruoyi.common.annotation.Excel;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -59,13 +60,13 @@ public class QueryMenu {
      * 金额
      */
     @Excel(name = "金额")
-    private Float fAmount;
+    private BigDecimal fAmount;
 
     /**
      * 结算金额
      */
     @Excel(name = "结算金额")
-    private Float fStlamount;
+    private BigDecimal fStlamount;
 
     /**
      * 结算日期
@@ -77,7 +78,7 @@ public class QueryMenu {
      * 开票金额
      */
     @Excel(name = "开票金额")
-    private Float fInvamount;
+    private BigDecimal fInvamount;
 
     /**
      * 发票号
@@ -89,7 +90,7 @@ public class QueryMenu {
      * 对账金额
      */
     @Excel(name = "对账金额")
-    private Float fAccamount;
+    private BigDecimal fAccamount;
 
     /**
      * 对账日期
@@ -113,13 +114,13 @@ public class QueryMenu {
      * 数量
      */
     @Excel(name = "数量")
-    private Float fQty;
+    private BigDecimal fQty;
 
     /**
      * 单价
      */
     @Excel(name = "单价")
-    private Float fUnitprice;
+    private BigDecimal fUnitprice;
 
     /**
      * 业务类型
@@ -196,19 +197,19 @@ public class QueryMenu {
         this.fDc = fDc;
     }
 
-    public Float getfAmount() {
+    public BigDecimal getfAmount() {
         return fAmount;
     }
 
-    public void setfAmount(Float fAmount) {
+    public void setfAmount(BigDecimal fAmount) {
         this.fAmount = fAmount;
     }
 
-    public Float getfStlamount() {
+    public BigDecimal getfStlamount() {
         return fStlamount;
     }
 
-    public void setfStlamount(Float fStlamount) {
+    public void setfStlamount(BigDecimal fStlamount) {
         this.fStlamount = fStlamount;
     }
 
@@ -220,11 +221,11 @@ public class QueryMenu {
         this.fStlamountDate = fStlamountDate;
     }
 
-    public Float getfInvamount() {
+    public BigDecimal getfInvamount() {
         return fInvamount;
     }
 
-    public void setfInvamount(Float fInvamount) {
+    public void setfInvamount(BigDecimal fInvamount) {
         this.fInvamount = fInvamount;
     }
 
@@ -236,11 +237,11 @@ public class QueryMenu {
         this.fInvnos = fInvnos;
     }
 
-    public Float getfAccamount() {
+    public BigDecimal getfAccamount() {
         return fAccamount;
     }
 
-    public void setfAccamount(Float fAccamount) {
+    public void setfAccamount(BigDecimal fAccamount) {
         this.fAccamount = fAccamount;
     }
 
@@ -268,19 +269,19 @@ public class QueryMenu {
         this.fFeeunitid = fFeeunitid;
     }
 
-    public Float getfQty() {
+    public BigDecimal getfQty() {
         return fQty;
     }
 
-    public void setfQty(Float fQty) {
+    public void setfQty(BigDecimal fQty) {
         this.fQty = fQty;
     }
 
-    public Float getfUnitprice() {
+    public BigDecimal getfUnitprice() {
         return fUnitprice;
     }
 
-    public void setfUnitprice(Float fUnitprice) {
+    public void setfUnitprice(BigDecimal fUnitprice) {
         this.fUnitprice = fUnitprice;
     }
 

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

+ 14 - 28
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -19,6 +19,7 @@ import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.exception.BaseException;
 import com.ruoyi.common.exception.WarehouseException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.DictUtils;
@@ -3075,9 +3076,16 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             }
         }
         tWarehousebillsitems.setfChargedate(time);//仓储费计算日期
-        if (warehousebillsitems.getfBillstatus() != 30L) {
+
+        SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("entry.printing");
+        if (StringUtils.isNull(sysConfig)) {
+            throw new BaseException("系统参数异常");
+        }
+        String configValue = sysConfig.getConfigValue();
+        if ("0".equals(configValue) && warehousebillsitems.getfBillstatus() != 30L) {
             return AjaxResult.error("请确认是该明细数据是否存在,或该明细数据状态异常");
         }
+
         TGoods goods = tGoodsMapper.selectTGoodsById(warehousebillsitems.getfGoodsid());
         if ("1".equals(goods.getIfCntrno()) && StringUtils.isNull(warehousebillsitems.getfCntrno())) {
             return AjaxResult.error("仓库明细第未找到箱号");
@@ -6141,11 +6149,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         tWarehousebillsCntrMapper.deleteTWarehousebillsCntrfPid(tWarehousebills.getfId());
         JSONArray warehouseJSON = JSONArray.parseArray(warehousebillsitems);
         List<TWarehousebillsitems> warehousebillsitemsList = JSONObject.parseArray(warehouseJSON.toJSONString(), TWarehousebillsitems.class);
-        /**
-         * 流水号回收
-         *  1、 获取所有流水号
-         */
-        List<String> serialNumberList = new ArrayList<>();
+
         if (StringUtils.isNotEmpty(warehousebillsitemsList)) {
             int i = 1;
             for (TWarehousebillsitems wb : warehousebillsitemsList) {
@@ -6153,9 +6157,6 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 if ("1".equals(goods.getIfCntrno()) && StringUtils.isNull(wb.getfCntrno())) {
                     return AjaxResult.error("仓库明细第" + i + "行未找到箱号");
                 }
-                if (StringUtils.isNotNull(wb.getfSerialNumber())) {
-                    serialNumberList.add(wb.getfSerialNumber()); // 流水号回收
-                }
                 if (WarehouseTypeEnum.SJRK_REVOKE.getType().equals(billsType)) { // 撤销 入库
                     // 查询库存总账
                     TWhgenleg tWhgenle = queryWhgenlegService.stockWhgenleg(tWarehousebills, wb, goods.getIfCntrno(), WarehouseTypeEnum.UNDO_OPERATION.getType());
@@ -6255,20 +6256,6 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 }
             }
         }
-        if (!WarehouseTypeEnum.HQZY_REVOKE.getType().equals(billsType)) {
-            /**
-             * 流水号回收
-             *  2、 流水号去重
-             *  3、 添加到 billno_del
-             */
-            List<String> serialNumberNewList = delRepeat(serialNumberList);
-            serialNumberNewList.forEach(item -> {
-                BillnoDel billnoDel = new BillnoDel();
-                billnoDel.setBillType(item.substring(0, 2));
-                billnoDel.setBillNo(item);
-                billnoDelMapper.insertBillnoDel(billnoDel);
-            });
-        }
         //  箱型数据
         if (StringUtils.isNotNull(tCntr) && !"[]".equals(tCntr)) {
             JSONArray jsonDrArray = JSONArray.parseArray(tCntr);
@@ -6309,7 +6296,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 wbDr.setfDc("D");
                 wbDr.setCreateBy(loginUser.getUser().getUserName());
                 wbDr.setCreateTime(new Date());
-                if (tWarehousebills.getfBsdate() != null && !tWarehousebills.getfBsdate().equals("")) {
+                if (tWarehousebills.getfBsdate() != null && !"".equals(tWarehousebills.getfBsdate())) {
                     wbDr.setfBsdate(tWarehousebills.getfBsdate());
                 }
                 tWarehousebillsfeesMapper.insertTWarehousebillsfees(wbDr);
@@ -6324,7 +6311,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 wbCr.setfDc("C");
                 wbCr.setCreateBy(loginUser.getUser().getUserName());
                 wbCr.setCreateTime(new Date());
-                if (tWarehousebills.getfBsdate() != null && !tWarehousebills.getfBsdate().equals("")) {
+                if (tWarehousebills.getfBsdate() != null && !"".equals(tWarehousebills.getfBsdate())) {
                     wbCr.setfBsdate(tWarehousebills.getfBsdate());
                 }
                 tWarehousebillsfeesMapper.insertTWarehousebillsfees(wbCr);
@@ -6341,8 +6328,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
 
 
     public static List<String> delRepeat(List<String> list) {
-        List<String> myList = list.stream().distinct().collect(Collectors.toList());
-        return myList;
+        return list.stream().distinct().collect(Collectors.toList());
     }
 
     /**
@@ -7948,7 +7934,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         if (StringUtils.isNotEmpty(endDate)) {
             endDate += " 00:00:00";
         }
-        Map<String, Object> statistics = tWhgenlegMapper.stockStatistics(beginDate, endDate, external, null, null);
+        Map<String, Object> statistics = tWhgenlegMapper.stockStatistics(beginDate, endDate, external, null, null, null);
         return String.valueOf(statistics.get("quantity"));
     }
 

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

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

+ 29 - 0
ruoyi-warehouse/src/main/resources/mapper/basicData/TFeesMapper.xml

@@ -138,4 +138,33 @@
         select f_name from t_fees where del_flag = 0 and f_dc like '%D%'
     </select>
 
+    <select id="getFeeStatistics" resultType="map">
+        select
+            ifnull(round(sum(if(f_dc = 'D', f_amount, 0)) / 10000, 2), 0) as receivable,
+            ifnull(round(sum(if(f_dc = 'D', f_stlamount, 0)) / 10000, 2), 0) as received,
+            ifnull(round((sum(if(f_dc = 'D', f_amount, 0)) - sum(if(f_dc = 'C', f_amount, 0))) / 10000, 2), 0) as profit
+        from t_warehousebillsfees wf
+            left join t_warehousebills tw on wf.f_pid = tw.f_id
+            left join sys_user u on tw.create_by = u.user_name
+            left join sys_dept d on tw.f_bsdeptid = d.dept_id
+        where wf.f_review_date between #{params.beginDate} and #{params.endDate}
+            ${params.dataScope}
+    </select>
+
+    <select id="getArrearsStatistics" resultType="map">
+        select
+            ifnull(tc.f_cname, tc.f_name) as name,
+            ifnull(round(sum(f_amount) / 10000, 2), 0) as receivable
+        from t_warehousebillsfees wf
+            left join t_warehousebills tw on wf.f_pid = tw.f_id
+            left join sys_user u on tw.create_by = u.user_name
+            left join sys_dept d on tw.f_bsdeptid = d.dept_id
+            left join t_corps tc on wf.f_corpid = tc.f_id
+        where f_dc = 'D'
+            ${params.dataScope}
+        group by wf.f_corpid
+        order by receivable desc
+        limit 12
+    </select>
+
 </mapper>

+ 10 - 2
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -1193,7 +1193,15 @@
     </select>
 
     <select id="stockStatistics" resultType="map">
-        select round(ifnull(sum(f_grossweightblc), 0) / 1000) as quantity
+        select
+            <if test="mode == null or mode == ''">round(ifnull(sum(f_grossweightblc), 0) / 1000) as quantity</if>
+            <if test="mode != null and mode != ''">
+                case #{mode}
+                    when '3' then round(ifnull(sum(f_volumnblc), 0))
+                    when '2' then round(ifnull(sum(f_grossweightblc) / 1000, 0))
+                    else ifnull(sum(f_qtyblc), 0)
+                end as quantity
+            </if>
         from t_whgenleg
         <where>
             <if test="beginDate != null and beginDate != ''">and f_bsdate &gt;= #{beginDate}</if>
@@ -1241,7 +1249,7 @@
 
     <select id="biCustomerInfo" resultType="map">
         select
-            ifnull(ifnull(tw.f_shipper, tc.f_cname), tc.f_name) as customerName,
+            ifnull(tw.f_shipper, tc.f_name) as customerName,
             round(ifnull(sum(tw.f_grossweightblc), 0) / 1000) as quantity
         from t_whgenleg tw left join t_corps tc on tw.f_corpid = tc.f_id
         where