浏览代码

安品费用信息查询每月数据

lazhaoqian 4 年之前
父节点
当前提交
2950f9087e

+ 23 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/anpin/StockControl.java

@@ -2,10 +2,7 @@ package com.ruoyi.web.controller.anpin;
 
 import cn.hutool.core.date.DateTime;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.ruoyi.anpin.InventoryLedgerExcel;
-import com.ruoyi.anpin.ProfitExcel;
-import com.ruoyi.anpin.SalesOfOutbound;
-import com.ruoyi.anpin.WarhousrExcel;
+import com.ruoyi.anpin.*;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
@@ -362,5 +359,27 @@ public class StockControl extends BaseController {
         return tWarehousebillsService.updetePrintLog(tWarehouseBills,loginUser);
 
     }
+    /**
+     * 查询费用信息
+     */
+    @PreAuthorize("@ss.hasPermi('anpin:stockControl:selectFeeMessage')")
+    @GetMapping("/selectFeeMessage")
+    public TableDataInfo selectFeeMessage(TWarehouseBills tWarehouseBills) {
+        startPage();
+        if (StringUtils.isEmpty(tWarehouseBills.getAnnual()) || "null".equals(tWarehouseBills.getAnnual())){
+            TableDataInfo tableDataInfo = new TableDataInfo();
+            tableDataInfo.setCode(500);
+            tableDataInfo.setMsg("请选择查询年份");
+            return tableDataInfo;
+        }
+        if (StringUtils.isEmpty(tWarehouseBills.getfBilltype()) || "null".equals(tWarehouseBills.getfBilltype())){
+            TableDataInfo tableDataInfo = new TableDataInfo();
+            tableDataInfo.setCode(500);
+            tableDataInfo.setMsg("请选择查询类型");
+            return tableDataInfo;
+        }
+        List<AnPingOrderMessage> list = tWarehousebillsService.selectFeeMessage(tWarehouseBills);
+        return getDataTable(list);
+    }
 
 }

+ 234 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/anpin/AnPingOrderMessage.java

@@ -0,0 +1,234 @@
+package com.ruoyi.anpin;
+
+/**
+ * 查询安品订单费用信息
+ */
+
+import com.ruoyi.common.annotation.Excel;
+
+import java.math.BigDecimal;
+
+/**
+ * @Author ZhaoQian La
+ * @Date 2021/6/8 8:54
+ * @Version 1.0
+ */
+public class AnPingOrderMessage {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 客户名称
+     */
+    @Excel(name = "客户")
+    private String fCorpName;
+    /**
+     * 上年费用
+     */
+    @Excel(name = "上年")
+    private BigDecimal LastYear;
+    /**
+     * 一月费用
+     */
+    @Excel(name = "一月")
+    private BigDecimal January;
+    /**
+     * 二月费用
+     */
+    @Excel(name = "二月")
+    private BigDecimal February;
+    /**
+     * 三月费用
+     */
+    @Excel(name = "三月")
+    private BigDecimal March;
+    /**
+     * 四月费用
+     */
+    @Excel(name = "四月")
+    private BigDecimal April;
+    /**
+     * 五月费用
+     */
+    @Excel(name = "五月")
+    private BigDecimal May;
+    /**
+     * 六月费用
+     */
+    @Excel(name = "六月")
+    private BigDecimal June;
+    /**
+     * 七月费用
+     */
+    @Excel(name = "七月")
+    private BigDecimal July;
+    /**
+     * 八月费用
+     */
+    @Excel(name = "八月")
+    private BigDecimal August;
+    /**
+     * 九月费用
+     */
+    @Excel(name = "九月")
+    private BigDecimal September;
+    /**
+     * 十月费用
+     */
+    @Excel(name = "十月")
+    private BigDecimal October;
+    /**
+     * 十一月费用
+     */
+    @Excel(name = "十一月")
+    private BigDecimal November;
+    /**
+     * 十二月费用
+     */
+    @Excel(name = "十二月")
+    private BigDecimal December;
+    /**
+     * 合计费用
+     */
+    @Excel(name = "合计")
+    private BigDecimal total;
+
+    public String getfCorpName() {
+        return fCorpName;
+    }
+
+    public void setfCorpName(String fCorpName) {
+        this.fCorpName = fCorpName;
+    }
+
+    public BigDecimal getLastYear() {
+        return LastYear;
+    }
+
+    public void setLastYear(BigDecimal lastYear) {
+        LastYear = lastYear;
+    }
+
+    public BigDecimal getJanuary() {
+        return January;
+    }
+
+    public void setJanuary(BigDecimal january) {
+        January = january;
+    }
+
+    public BigDecimal getFebruary() {
+        return February;
+    }
+
+    public void setFebruary(BigDecimal february) {
+        February = february;
+    }
+
+    public BigDecimal getMarch() {
+        return March;
+    }
+
+    public void setMarch(BigDecimal march) {
+        March = march;
+    }
+
+    public BigDecimal getApril() {
+        return April;
+    }
+
+    public void setApril(BigDecimal april) {
+        April = april;
+    }
+
+    public BigDecimal getMay() {
+        return May;
+    }
+
+    public void setMay(BigDecimal may) {
+        May = may;
+    }
+
+    public BigDecimal getJune() {
+        return June;
+    }
+
+    public void setJune(BigDecimal june) {
+        June = june;
+    }
+
+    public BigDecimal getJuly() {
+        return July;
+    }
+
+    public void setJuly(BigDecimal july) {
+        July = july;
+    }
+
+    public BigDecimal getAugust() {
+        return August;
+    }
+
+    public void setAugust(BigDecimal august) {
+        August = august;
+    }
+
+    public BigDecimal getSeptember() {
+        return September;
+    }
+
+    public void setSeptember(BigDecimal september) {
+        September = september;
+    }
+
+    public BigDecimal getOctober() {
+        return October;
+    }
+
+    public void setOctober(BigDecimal october) {
+        October = october;
+    }
+
+    public BigDecimal getNovember() {
+        return November;
+    }
+
+    public void setNovember(BigDecimal november) {
+        November = november;
+    }
+
+    public BigDecimal getDecember() {
+        return December;
+    }
+
+    public void setDecember(BigDecimal december) {
+        December = december;
+    }
+
+    public BigDecimal getTotal() {
+        return total;
+    }
+
+    public void setTotal(BigDecimal total) {
+        this.total = total;
+    }
+
+    @Override
+    public String toString() {
+        return "AnPingOrderMessage{" +
+                "fCorpName='" + fCorpName + '\'' +
+                ", LastYear=" + LastYear +
+                ", January=" + January +
+                ", February=" + February +
+                ", March=" + March +
+                ", April=" + April +
+                ", May=" + May +
+                ", June=" + June +
+                ", July=" + July +
+                ", August=" + August +
+                ", September=" + September +
+                ", October=" + October +
+                ", November=" + November +
+                ", December=" + December +
+                ", total=" + total +
+                '}';
+    }
+}

+ 5 - 5
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -915,16 +915,16 @@ public class TFeeServiceImpl implements ITFeeService {
             key = "warehouse.contrast.ApprovalFlow";
         } else if ("SF".equals(fBilltype)) {
             actId = 220L;
-            key = "warehouse.charge.ApprovalFlow";
+            key = "warehouse.anPinSF.ApprovalFlow";
         } else if ("FF".equals(fBilltype)) {
             actId = 230L;
-            key = "warehouse.payment.ApprovalFlow";
+            key = "warehouse.anPinFF.ApprovalFlow";
         } else if ("XXFP".equals(fBilltype)) {
             actId = 430L;
-            key = "warehouse.kaiHeContrast.ApprovalFlow";
+            key = "warehouse.anPinXXFP.ApprovalFlow";
         } else if ("JXFP".equals(fBilltype)) {
             actId = 440L;
-            key = "warehouse.kaiHeCharge.ApprovalFlow";
+            key = "warehouse.anPinJXFP.ApprovalFlow";
         } else if ("KHFF".equals(fBilltype)) {
             actId = 450L;
             key = "warehouse.kaiHePayment.ApprovalFlow";
@@ -1067,7 +1067,7 @@ public class TFeeServiceImpl implements ITFeeService {
             Long code = Long.valueOf(String.valueOf(ajaxResult.get("code"))).longValue();
             if (code.equals(500L)) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                return AjaxResult.error("发票申请提交审核失败,请找管理员");
+                return ajaxResult;
             }
         }
         return AjaxResult.success("成功", messageMap);

+ 9 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsfeesMapper.java

@@ -3,6 +3,7 @@ package com.ruoyi.warehouseBusiness.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.anpin.*;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.finance.excel.FleetExcel;
 import com.ruoyi.shipping.domain.TAccount;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
@@ -193,4 +194,12 @@ public interface TWarehousebillsfeesMapper extends BaseMapper<TWarehousebillsfee
      * @return
      */
     public List<InventoryLedgerExcel> selectInventoryLedger(TWarehouseBills tWarehouseBills);
+
+    /**
+     * 安品查询费用信息
+     * @param tWarehouseBills
+     * @return
+     */
+    public List<AnPingOrderMessage> selectFeeMessage(@Param("tw") TWarehouseBills tWarehouseBills,
+                                                     @Param("annum") String annum);
 }

+ 7 - 4
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseBillsService.java

@@ -1,9 +1,6 @@
 package com.ruoyi.warehouseBusiness.service;
 
-import com.ruoyi.anpin.InventoryLedgerExcel;
-import com.ruoyi.anpin.ProfitExcel;
-import com.ruoyi.anpin.SalesOfOutbound;
-import com.ruoyi.anpin.WarhousrExcel;
+import com.ruoyi.anpin.*;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.reportManagement.domain.TWareHouseItemsExcel;
@@ -512,4 +509,10 @@ public interface ITWarehouseBillsService {
      * @return
      */
     public List<InventoryLedgerExcel> selectInventoryLedger(TWarehouseBills tWarehouseBills);
+    /**
+     * 安品查询费用信息
+     * @param tWarehouseBills
+     * @return
+     */
+    public List<AnPingOrderMessage> selectFeeMessage(TWarehouseBills tWarehouseBills);
 }

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

@@ -2126,6 +2126,12 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         return tWarehousebillsfeesMapper.selectInventoryLedger(tWarehouseBills);
     }
 
+    @Override
+    public List<AnPingOrderMessage> selectFeeMessage(TWarehouseBills tWarehouseBills) {
+        Long aLong = Long.valueOf(tWarehouseBills.getAnnual()) - 1;
+        return tWarehousebillsfeesMapper.selectFeeMessage(tWarehouseBills,aLong.toString());
+    }
+
     /**
      * app仓储新行提交业务
      *

+ 141 - 24
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

@@ -1084,7 +1084,7 @@
         sc.dict_label AS ffeeunitidName,/*计价单位中文名*/
         td.fqty AS fqty,/*数量*/
         td.famount AS famount,/*金额*/
-        tr.f_name    AS fsbuName,/*开票公司*/
+        tr.f_name AS fsbuName,/*开票公司*/
         round(td.price,2) AS price/*单价*/
         <if test="groupDate != null  and groupDate == 0">
             ,td.fBsdate AS fBsdate/*入库日期*/
@@ -1162,7 +1162,7 @@
         <if test="groupDate != null  and groupDate == 0">
             td.fBsdate DESC,/*入库日期*/
         </if>
-                  td.fgoodsid DESC
+        td.fgoodsid DESC
     </select>
     <!--安品利润统计-->
     <select id="salectAnpinProfit" parameterType="TWarehousebills"
@@ -1184,9 +1184,9 @@
         xs.fGoodid AS fGoodid,
         IFNULL( xs.pay, 0 ) AS market,
         IFNULL( sq.collect, 0 ) AS purchase,
-        CASE WHEN xs.pay IS NOT NULL AND sq.collect IS NOT NULL  THEN xs.pay-sq.collect
-        WHEN xs.pay IS NULL AND sq.collect IS NOT NULL  THEN 0 -sq.collect
-        WHEN xs.pay IS NOT NULL AND sq.collect IS NULL  THEN xs.pay- 0
+        CASE WHEN xs.pay IS NOT NULL AND sq.collect IS NOT NULL THEN xs.pay-sq.collect
+        WHEN xs.pay IS NULL AND sq.collect IS NOT NULL THEN 0 -sq.collect
+        WHEN xs.pay IS NOT NULL AND sq.collect IS NULL THEN xs.pay- 0
         END AS profit
         FROM
         (
@@ -1260,9 +1260,9 @@
         sq.fGoodid AS fGoodid,
         IFNULL( xs.pay, 0 ) AS market,
         IFNULL( sq.collect, 0 ) AS purchase,
-        CASE WHEN xs.pay IS NOT NULL AND sq.collect IS NOT NULL  THEN xs.pay-sq.collect
-        WHEN xs.pay IS NULL AND sq.collect IS NOT NULL  THEN 0 -sq.collect
-        WHEN xs.pay IS NOT NULL AND sq.collect IS NULL  THEN xs.pay- 0
+        CASE WHEN xs.pay IS NOT NULL AND sq.collect IS NOT NULL THEN xs.pay-sq.collect
+        WHEN xs.pay IS NULL AND sq.collect IS NOT NULL THEN 0 -sq.collect
+        WHEN xs.pay IS NOT NULL AND sq.collect IS NULL THEN xs.pay- 0
         END AS profit
         FROM
         (
@@ -1334,7 +1334,8 @@
         ORDER BY temp.years,temp.months,CONVERT(tp.f_name USING GBK)
     </select>
     <!--查询入库日期所在年月是否结账-->
-    <select id="selectTMonthEndingClosingList" parameterType="object" resultType="com.ruoyi.anpin.TMonthEndingClosingExcel">
+    <select id="selectTMonthEndingClosingList" parameterType="object"
+            resultType="com.ruoyi.anpin.TMonthEndingClosingExcel">
         select f_id, f_year, f_month, f_start, f_enf, f_status from t_month_ending_closing
         <where>
             <if test="fYear != null  and fYear != ''">and f_year = #{fYear}</if>
@@ -1344,11 +1345,12 @@
         ORDER BY f_year,f_month
     </select>
     <!--安品库存总账-->
-    <select id="selectInventoryLedger" parameterType="TWarehousebills" resultType="com.ruoyi.anpin.InventoryLedgerExcel">
+    <select id="selectInventoryLedger" parameterType="TWarehousebills"
+            resultType="com.ruoyi.anpin.InventoryLedgerExcel">
         SELECT
         DATE_FORMAT( MAX(tf.f_bsdate), '%Y' ) AS fyears,
         /*年*/
-       /* DATE_FORMAT( MAX(tf.f_bsdate), '%m' ) AS fmonth,*/
+        /* DATE_FORMAT( MAX(tf.f_bsdate), '%m' ) AS fmonth,*/
         /*月*/
         tf.f_corpid AS fCorpid,
         /*供应商*/
@@ -1372,39 +1374,54 @@
         /*库区*/
         th.f_warehouse_information AS fWarehouseName,
         /*库区中文名*/
-        ifnull(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_qty ELSE 0 END ) - sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_qty ELSE 0 END ),0) AS fBeginQty,
+        ifnull(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_qty ELSE 0 END ) - sum(
+        CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_qty ELSE 0 END ),0) AS fBeginQty,
         /*期初数量*/
         ROUND(
         IFNULL((
-        sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_amount ELSE 0 END ) - sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_amount ELSE 0 END ))/(
-        sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_qty ELSE 0 END ) - sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_qty ELSE 0 END )),
+        sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_amount ELSE 0 END ) - sum(
+        CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_amount ELSE 0 END ))/(
+        sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_qty ELSE 0 END ) - sum( CASE
+        WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_qty ELSE 0 END )),
         0
         ),
         2
         ) AS fBeginUnitprice,
         /*期初单价*/
-        IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_amount ELSE 0 END ) - sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_amount ELSE 0 END ),0) AS fBeginAmount,
+        IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_amount ELSE 0 END ) -
+        sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;#{timeInterval[0]} THEN tf.f_amount ELSE 0 END ),0) AS
+        fBeginAmount,
         /*期初金额*/
-        IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&gt;=#{timeInterval[0]} AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_qty ELSE 0 END ),0) AS rQty,
+        IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&gt;=#{timeInterval[0]} AND tf.f_bsdate&lt;=#{timeInterval[1]}
+        THEN tf.f_qty ELSE 0 END ),0) AS rQty,
         /*入库数量*/
-        IFNULL(sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&gt;=#{timeInterval[0]} AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_qty ELSE 0 END ),0) AS cQty,
+        IFNULL(sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&gt;=#{timeInterval[0]} AND tf.f_bsdate&lt;=#{timeInterval[1]}
+        THEN tf.f_qty ELSE 0 END ),0) AS cQty,
         /*出库数量*/
-        IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&gt;=#{timeInterval[0]} AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_amount ELSE 0 END ),0) AS rfAmount,
+        IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&gt;=#{timeInterval[0]} AND tf.f_bsdate&lt;=#{timeInterval[1]}
+        THEN tf.f_amount ELSE 0 END ),0) AS rfAmount,
         /*入库金额*/
-        IFNULL(sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&gt;=#{timeInterval[0]} AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_amount ELSE 0 END ),0) AS cfAmount,
+        IFNULL(sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&gt;=#{timeInterval[0]} AND tf.f_bsdate&lt;=#{timeInterval[1]}
+        THEN tf.f_amount ELSE 0 END ),0) AS cfAmount,
         /*出库金额*/
-        IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_qty ELSE 0 END ) - sum( CASE WHEN tf.f_billtype = 'CK' AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_qty ELSE 0 END ),0) AS fAfterQty,
+        IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_qty ELSE 0 END ) -
+        sum( CASE WHEN tf.f_billtype = 'CK' AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_qty ELSE 0 END ),0) AS
+        fAfterQty,
         /*结余数量*/
         ROUND(
         IFNULL((
-        sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_amount ELSE 0 END ) - sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_amount ELSE 0 END ))/(
-        sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;= #{timeInterval[1]} THEN tf.f_qty ELSE 0 END ) - sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_qty ELSE 0 END )),
+        sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_amount ELSE 0 END ) - sum(
+        CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_amount ELSE 0 END ))/(
+        sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;= #{timeInterval[1]} THEN tf.f_qty ELSE 0 END ) - sum( CASE
+        WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;=#{timeInterval[1]} THEN tf.f_qty ELSE 0 END )),
         0
         ),
         2
         ) AS fAfterUnitprice,
         /*结余单价*/
-        IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;= #{timeInterval[1]} THEN tf.f_amount ELSE 0 END ) - sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;= #{timeInterval[1]} THEN tf.f_amount ELSE 0 END ),0) AS fAfterAmount /*结余金额*/
+        IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate&lt;= #{timeInterval[1]} THEN tf.f_amount ELSE 0 END ) -
+        sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate&lt;= #{timeInterval[1]} THEN tf.f_amount ELSE 0 END ),0) AS
+        fAfterAmount /*结余金额*/
 
         FROM
         t_warehousebillsfees tf
@@ -1423,7 +1440,7 @@
         AND tf.f_bsdate&lt;=#{timeInterval[1]}
         <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
         <if test="fBillstatus != null">and tf.f_billstatus = #{fBillstatus}</if>
-        <if test="fBillstatus == null">and tf.f_billstatus = 6 </if>
+        <if test="fBillstatus == null">and tf.f_billstatus = 6</if>
         <if test="fCorpid != null ">and tf.f_corpid = #{fCorpid}</if>
         <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
         <if test="feeName != null and feeName != ''">and tf.f_feeid = #{feeName}</if>
@@ -1442,4 +1459,104 @@
         CONVERT (
         te.f_name USING GBK)
     </select>
+    <!--安品查询费用信息-->
+    <select id="selectFeeMessage" parameterType="TWarehousebills" resultType="com.ruoyi.anpin.AnPingOrderMessage">
+        SELECT
+        tc.f_name AS fCorpName,
+        ROUND(temp.LastYear,2) AS LastYear,
+        ROUND(temp.January,2) AS January,
+        ROUND(temp.February,2) AS February,
+        ROUND(temp.March,2) AS March,
+        ROUND(temp.April,2) AS April,
+        ROUND(temp.May,2) AS May,
+        ROUND(temp.June,2) AS June,
+        ROUND(temp.July,2) AS July,
+        ROUND(temp.August,2) AS August,
+        ROUND(temp.September,2) AS September,
+        ROUND(temp.October,2) AS October,
+        ROUND(temp.November,2) AS November,
+        ROUND(temp.December,2) AS December,
+        ROUND(SUM(temp.LastYear+temp.January+temp.February+temp.March+temp.April+temp.May+temp.June+
+        temp.July+temp.August+temp.September+temp.October+temp.November+temp.December),2) AS total
+        FROM
+        ( SELECT
+        tw.f_corpid AS fCorpid,
+        CASE
+        YEAR ( tw.f_bsdate )
+        WHEN #{annum} THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS LastYear,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '1' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS January,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '2' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS February,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '3' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS March,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '4' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS April,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '5' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS May,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '6' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS June,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '7' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS July,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '8' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS August,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '9' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS September,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '10' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS October,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '11' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS November,
+        CASE
+        MONTH ( tw.f_bsdate )
+        WHEN '12' THEN
+        sum( tf.f_amount ) ELSE 0
+        END AS December
+        FROM
+        t_warehousebillsfees tf
+        LEFT JOIN t_warehousebills tw ON tw.f_id = tf.f_pid
+        where
+        DATE_FORMAT( tw.f_bsdate, '%Y' ) = #{tw.annual}
+        <if test="tw.fCorpid != null ">and tw.f_corpid = #{tw.fCorpid}</if>
+        <if test="tw.fBillstatus != null">and tw.f_billstatus = #{tw.fBillstatus}</if>
+        <if test="tw.fBilltype != null  and tw.fBilltype != ''">and tw.f_billtype = #{tw.fBilltype}</if>
+        GROUP BY
+        tw.f_corpid ) AS temp
+        LEFT JOIN t_corps tc ON tc.f_id = temp.fCorpid
+        GROUP BY temp.fCorpid
+    </select>
 </mapper>