Kaynağa Gözat

凯和应收应付利润统计

lazhaoqian 3 yıl önce
ebeveyn
işleme
4b7c7ef9f2

+ 4 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/statement/HandleController.java

@@ -9,6 +9,7 @@ import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.finance.domain.TWareHouseFees;
 import com.ruoyi.finance.service.ITFeeService;
+import com.ruoyi.finance.shipping.HandleExcel;
 import com.ruoyi.finance.shipping.ReceivableExcel;
 import com.ruoyi.reportManagement.excel.Payable;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -37,7 +38,7 @@ public class HandleController extends BaseController {
     public TableDataInfo chargeList(TWareHouseFees tWareHouseFees) {
         startPage();
         tWareHouseFees.setfDc("C");
-        List<ReceivableExcel> list = tFeeService.receivable(tWareHouseFees);
+        List<HandleExcel> list = tFeeService.handle(tWareHouseFees);
         return getDataTable(list);
     }
 
@@ -48,8 +49,8 @@ public class HandleController extends BaseController {
     @GetMapping("/export")
     public AjaxResult export(TWareHouseFees tWareHouseFees) throws Exception {
         tWareHouseFees.setfDc("C");
-        List<ReceivableExcel> list = tFeeService.receivable(tWareHouseFees);
-        ExcelUtil<ReceivableExcel> util = new ExcelUtil<ReceivableExcel>(ReceivableExcel.class);
+        List<HandleExcel> list = tFeeService.handle(tWareHouseFees);
+        ExcelUtil<HandleExcel> util = new ExcelUtil<HandleExcel>(HandleExcel.class);
         return util.exportExcel(list, "应付总账");
     }
 }

+ 7 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/mapper/TFeeMapper.java

@@ -4,6 +4,7 @@ import com.ruoyi.finance.domain.TFee;
 import com.ruoyi.finance.domain.TWareHouseFees;
 import com.ruoyi.finance.excel.Detailed;
 import com.ruoyi.finance.shipping.FinancialTFee;
+import com.ruoyi.finance.shipping.HandleExcel;
 import com.ruoyi.finance.shipping.ProfitExcel;
 import com.ruoyi.finance.shipping.ReceivableExcel;
 import com.ruoyi.reportManagement.dto.TWarehousebill;
@@ -162,5 +163,11 @@ public interface TFeeMapper {
      * @return
      */
     List<ProfitExcel> profit(TWareHouseFees tWareHouseFees);
+    /**
+     * 凯和查询应付总账
+     * @param tWareHouseFees
+     * @return
+     */
+    List<HandleExcel> handle(TWareHouseFees tWareHouseFees);
 
 }

+ 9 - 5
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/ITFeeService.java

@@ -8,10 +8,7 @@ import com.ruoyi.finance.excel.Charge;
 import com.ruoyi.finance.excel.Contrast;
 import com.ruoyi.finance.excel.Detailed;
 import com.ruoyi.finance.excel.Payment;
-import com.ruoyi.finance.shipping.FinancialTFee;
-import com.ruoyi.finance.shipping.FinancialTFeeDoExcel;
-import com.ruoyi.finance.shipping.ProfitExcel;
-import com.ruoyi.finance.shipping.ReceivableExcel;
+import com.ruoyi.finance.shipping.*;
 import com.ruoyi.reportManagement.dto.TWarehousebill;
 import com.ruoyi.reportManagement.excel.Payable;
 import com.ruoyi.reportManagement.excel.Profit;
@@ -283,7 +280,7 @@ public interface ITFeeService {
     public AjaxResult exportFinancial(Long fId);
 
     /**
-     * 凯和查询应收应付总账
+     * 凯和查询应收总账
      * @param tWareHouseFees
      * @return
      */
@@ -296,5 +293,12 @@ public interface ITFeeService {
      */
     public List<ProfitExcel> profit(TWareHouseFees tWareHouseFees);
 
+    /**
+     * 凯和查询应付总账
+     * @param tWareHouseFees
+     * @return
+     */
+    public List<HandleExcel> handle(TWareHouseFees tWareHouseFees);
+
 
 }

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

@@ -28,10 +28,7 @@ import com.ruoyi.finance.excel.Payment;
 import com.ruoyi.finance.mapper.TFeeDoMapper;
 import com.ruoyi.finance.mapper.TFeeMapper;
 import com.ruoyi.finance.service.ITFeeService;
-import com.ruoyi.finance.shipping.FinancialTFee;
-import com.ruoyi.finance.shipping.FinancialTFeeDoExcel;
-import com.ruoyi.finance.shipping.ProfitExcel;
-import com.ruoyi.finance.shipping.ReceivableExcel;
+import com.ruoyi.finance.shipping.*;
 import com.ruoyi.reportManagement.dto.TWarehousebill;
 import com.ruoyi.reportManagement.excel.Payable;
 import com.ruoyi.reportManagement.excel.Profit;
@@ -1996,6 +1993,11 @@ public class TFeeServiceImpl implements ITFeeService {
         return tFeeMapper.profit(tWareHouseFees);
     }
 
+    @Override
+    public List<HandleExcel> handle(TWareHouseFees tWareHouseFees) {
+        return tFeeMapper.handle(tWareHouseFees);
+    }
+
     //下载路径
     private String getAbsoluteFile(String fileName) {
         String downloadPath = RuoYiConfig.getDownloadPath() + fileName;

+ 175 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/shipping/HandleExcel.java

@@ -0,0 +1,175 @@
+package com.ruoyi.finance.shipping;
+
+import com.ruoyi.common.annotation.Excel;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 凯和导出应收总账对象
+ */
+public class HandleExcel implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 船名
+     */
+    @Excel(name = "船名")
+    private String shipsName;
+    /**
+     *航次
+     */
+    @Excel(name = "航次")
+    private String voyage;
+    /**
+     *结算单位
+     */
+    @Excel(name = "结算单位")
+    private String unitOfAccount;
+    /**
+     *提单号
+     */
+    @Excel(name = "提单号")
+    private String blNo;
+    /**
+     *起运港
+     */
+    @Excel(name = "起运港")
+    private String portOfLoading;
+    /**
+     *目的港
+     */
+    @Excel(name = "目的港")
+    private String destination;
+    /**
+     *开船日期
+     */
+    @Excel(name = "开船日期",dateFormat = "yyyy-MM-dd")
+    private Date sailingDate;
+    /**
+     *审核日期
+     */
+    @Excel(name = "审核日期",dateFormat = "yyyy-MM-dd")
+    private Date auditDate;
+    /**
+     *应收金额
+     */
+    @Excel(name = "应付金额")
+    private BigDecimal receivable;
+    /**
+     *实收金额
+     */
+    @Excel(name = "实付金额")
+    private BigDecimal handle;
+    /**
+     *未收金额
+     */
+    @Excel(name = "未付金额")
+    private BigDecimal profit;
+
+    public String getShipsName() {
+        return shipsName;
+    }
+
+    public void setShipsName(String shipsName) {
+        this.shipsName = shipsName;
+    }
+
+    public String getVoyage() {
+        return voyage;
+    }
+
+    public void setVoyage(String voyage) {
+        this.voyage = voyage;
+    }
+
+    public String getUnitOfAccount() {
+        return unitOfAccount;
+    }
+
+    public void setUnitOfAccount(String unitOfAccount) {
+        this.unitOfAccount = unitOfAccount;
+    }
+
+    public String getBlNo() {
+        return blNo;
+    }
+
+    public void setBlNo(String blNo) {
+        this.blNo = blNo;
+    }
+
+    public String getPortOfLoading() {
+        return portOfLoading;
+    }
+
+    public void setPortOfLoading(String portOfLoading) {
+        this.portOfLoading = portOfLoading;
+    }
+
+    public String getDestination() {
+        return destination;
+    }
+
+    public void setDestination(String destination) {
+        this.destination = destination;
+    }
+
+    public Date getSailingDate() {
+        return sailingDate;
+    }
+
+    public void setSailingDate(Date sailingDate) {
+        this.sailingDate = sailingDate;
+    }
+
+    public Date getAuditDate() {
+        return auditDate;
+    }
+
+    public void setAuditDate(Date auditDate) {
+        this.auditDate = auditDate;
+    }
+
+    public BigDecimal getReceivable() {
+        return receivable;
+    }
+
+    public void setReceivable(BigDecimal receivable) {
+        this.receivable = receivable;
+    }
+
+    public BigDecimal getHandle() {
+        return handle;
+    }
+
+    public void setHandle(BigDecimal handle) {
+        this.handle = handle;
+    }
+
+    public BigDecimal getProfit() {
+        return profit;
+    }
+
+    public void setProfit(BigDecimal profit) {
+        this.profit = profit;
+    }
+
+    @Override
+    public String toString() {
+        return "ReceivableExcel{" +
+                "shipsName='" + shipsName + '\'' +
+                ", voyage='" + voyage + '\'' +
+                ", unitOfAccount='" + unitOfAccount + '\'' +
+                ", blNo='" + blNo + '\'' +
+                ", portOfLoading='" + portOfLoading + '\'' +
+                ", destination='" + destination + '\'' +
+                ", sailingDate=" + sailingDate +
+                ", auditDate=" + auditDate +
+                ", receivable=" + receivable +
+                ", handle=" + handle +
+                ", profit=" + profit +
+                '}';
+    }
+}

+ 1 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/finance/shipping/ReceivableExcel.java

@@ -8,7 +8,7 @@ import java.math.BigDecimal;
 import java.util.Date;
 
 /**
- * 凯和导出应收应付总账对象
+ * 凯和导出应收总账对象
  */
 public class ReceivableExcel implements Serializable {
     private static final long serialVersionUID = 1L;

+ 52 - 0
ruoyi-warehouse/src/main/resources/mapper/finance/TFeeMapper.xml

@@ -2432,5 +2432,57 @@
             ORDER BY tw.f_bsdate DESC
         </where>
     </select>
+    <select id="handle" resultType="com.ruoyi.finance.shipping.HandleExcel">
+        SELECT
+        DISTINCT
+        tv.f_name AS shipsName,#船名
+        ty.f_no AS voyage,# 航次
+        tc.f_name AS unitOfAccount,#结算单位
+        tw.f_mblno AS blNo,#提单号
+        ta.f_name AS portOfLoading,#起运港
+        td.f_name AS destination,#目的港
+        tw.f_bsdate sailingDate,#开船日期
+        tf.f_review_date AS auditDate,#审核日期
+        ROUND(IFNULL(SUM(f_amount),0),2) AS receivable, #应收金额
+        ROUND(IFNULL(SUM(f_stlamount),0),2) AS handle,#实收金额
+        ROUND((IFNULL(SUM(f_amount),0)-IFNULL(SUM(f_stlamount),0)),2) AS profit #未收金额
+        FROM
+        t_warehousebillsfees tf
+        LEFT JOIN t_warehousebills tw ON tf.f_pid = tw.f_id
+        LEFT JOIN t_vessel tv ON tw.f_vslid = tv.f_id
+        LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
+        LEFT JOIN t_corps tc ON tc.f_id = tf.f_corpid
+        LEFT JOIN t_address ta ON ta.f_id = tw.f_loadportid
+        LEFT JOIN t_address td ON td.f_id = tw.f_destportid
+        <where>
+            tf.f_dc = #{fDc}
+            <if test="fMblno != null  and fMblno != ''">and tw.f_mblno like concat('%', #{fMblno}, '%')</if>
+            <if test="fVslid != null">and tw.f_vslid = #{fVslid}</if>
+            <if test="fCorpid != null">and tf.f_corpid = #{fCorpid}</if>
+            <if test="fVoyid != null">and tw.f_voyid = #{fVoyid}</if>
+            <if test="fLoadportid != null">and tw.f_loadportid = #{fLoadportid}</if>
+            <if test="fDestportid != null">and tw.f_destportid = #{fDestportid}</if>
+            <if test='fBillstatus != null and fBillstatus != "" and fBillstatus == "1" '>
+                and tf.f_billstatus != 6
+            </if>
+            <if test='fBillstatus != null and fBillstatus != "" and fBillstatus == "2" '>
+                and tf.f_billstatus = 6
+            </if>
+            <if test='timeExamine != null and timeExamine[0] != null and timeExamine[0]!= ""'>
+                and tf.f_review_date &gt;= #{timeExamine[0]}
+            </if>
+            <if test='timeExamine != null and timeExamine[1] != null and timeExamine[1]!= ""'>
+                and tf.f_review_date &lt;= #{timeExamine[1]}
+            </if>
+            <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
+                and tw.f_bsdate &gt;= #{timeInterval[0]}
+            </if>
+            <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
+                and tw.f_bsdate &lt;= #{timeInterval[1]}
+            </if>
+            GROUP BY tw.f_mblno,tf.f_corpid
+            ORDER BY tw.f_bsdate DESC
+        </where>
+    </select>
 
 </mapper>