Переглянути джерело

Merge remote-tracking branch 'origin/dev' into _update/bug

# Conflicts:
#	ruoyi-warehouse/src/main/java/com/ruoyi/finance/mapper/TFeeMapper.java
#	ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/ITFeeService.java
#	ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java
caifc 3 роки тому
батько
коміт
aabcec4545

+ 56 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/statement/HandleController.java

@@ -0,0 +1,56 @@
+package com.ruoyi.web.controller.shipping.statement;
+
+import com.ruoyi.common.annotation.DataScope;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+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;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 凯和应付统计
+ */
+@RestController
+@RequestMapping("/shipping/handle")
+public class HandleController extends BaseController {
+    @Autowired
+    private ITFeeService tFeeService;
+
+    /**
+     * 查询应付总账列表
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:profit:list')")
+    @GetMapping("/list")
+    public TableDataInfo chargeList(TWareHouseFees tWareHouseFees) {
+        startPage();
+        tWareHouseFees.setfDc("C");
+        List<HandleExcel> list = tFeeService.handle(tWareHouseFees);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出应付总账
+     */
+    @Log(title = "应付总账", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TWareHouseFees tWareHouseFees) throws Exception {
+        tWareHouseFees.setfDc("C");
+        List<HandleExcel> list = tFeeService.handle(tWareHouseFees);
+        ExcelUtil<HandleExcel> util = new ExcelUtil<HandleExcel>(HandleExcel.class);
+        return util.exportExcel(list, "应付总账");
+    }
+}

+ 52 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/statement/ProfitShippingController.java

@@ -0,0 +1,52 @@
+package com.ruoyi.web.controller.shipping.statement;
+
+import com.ruoyi.common.annotation.DataScope;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+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.ProfitExcel;
+import com.ruoyi.reportManagement.excel.Profit;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 利润统计
+ */
+@RestController
+@RequestMapping("/shipping/profit")
+public class ProfitShippingController extends BaseController {
+    @Autowired
+    private ITFeeService tFeeService;
+    /**
+     * 查询利润列表
+     */
+    //@PreAuthorize("@ss.hasPermi('warehouseBusiness:profit:list')")
+    @GetMapping("/list")
+    public TableDataInfo chargeList(TWareHouseFees tWareHouseFees) {
+        startPage();
+        List<ProfitExcel> list = tFeeService.profit(tWareHouseFees);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出利润统计
+     */
+    @Log(title = "库存总账", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TWareHouseFees tWareHouseFees) throws Exception {
+        List<ProfitExcel> list = tFeeService.profit(tWareHouseFees);
+        ExcelUtil<ProfitExcel> util = new ExcelUtil<ProfitExcel>(ProfitExcel.class);
+        return util.exportExcel(list, "利润总账");
+    }
+}

+ 55 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/statement/ReceivableShippingController.java

@@ -0,0 +1,55 @@
+package com.ruoyi.web.controller.shipping.statement;
+
+import com.ruoyi.common.annotation.DataScope;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+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.ReceivableExcel;
+import com.ruoyi.reportManagement.excel.Payable;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 凯和应收总账统计
+ */
+@RestController
+@RequestMapping("/shipping/receivable")
+public class ReceivableShippingController extends BaseController {
+    @Autowired
+    private ITFeeService tFeeService;
+
+    /**
+     * 查询应收总账列表
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:profit:list')")
+    @GetMapping("/list")
+    public TableDataInfo chargeList(TWareHouseFees tWareHouseFees) {
+        startPage();
+        tWareHouseFees.setfDc("D");
+        List<ReceivableExcel> list = tFeeService.receivable(tWareHouseFees);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出应收总账
+     */
+    @Log(title = "应收总账", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TWareHouseFees tWareHouseFees) throws Exception {
+        tWareHouseFees.setfDc("D");
+        List<ReceivableExcel> list = tFeeService.receivable(tWareHouseFees);
+        ExcelUtil<ReceivableExcel> util = new ExcelUtil<ReceivableExcel>(ReceivableExcel.class);
+        return util.exportExcel(list, "应收总账");
+    }
+}

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

@@ -6,6 +6,9 @@ import com.ruoyi.finance.domain.dto.FeeDTO;
 import com.ruoyi.finance.domain.vo.FeeVO;
 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;
 import com.ruoyi.shipping.excel.ExportFinancial;
 import com.ruoyi.warehouseBusiness.excel.TWareHouseExcelItem;
@@ -170,4 +173,24 @@ public interface TFeeMapper {
      */
     List<FeeVO> selectFinancialLedgerDetails(FeeDTO feeDTO);
 
+    /**
+     * 凯和查询应收应付总账
+     * @param tWareHouseFees
+     * @return
+     */
+    List<ReceivableExcel> receivable(TWareHouseFees tWareHouseFees);
+
+    /**
+     * 凯和查询利润
+     * @param tWareHouseFees
+     * @return
+     */
+    List<ProfitExcel> profit(TWareHouseFees tWareHouseFees);
+    /**
+     * 凯和查询应付总账
+     * @param tWareHouseFees
+     * @return
+     */
+    List<HandleExcel> handle(TWareHouseFees tWareHouseFees);
+
 }

+ 22 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/ITFeeService.java

@@ -12,8 +12,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.*;
 import com.ruoyi.reportManagement.dto.TWarehousebill;
 import com.ruoyi.reportManagement.excel.Profit;
 import com.ruoyi.reportManagement.excel.Receivable;
@@ -315,6 +314,27 @@ public interface ITFeeService {
     public AjaxResult exportFinancial(Long fId);
 
     /**
+     * 凯和查询应收总账
+     * @param tWareHouseFees
+     * @return
+     */
+    public List<ReceivableExcel> receivable(TWareHouseFees tWareHouseFees);
+
+    /**
+     * 凯和查询利润统计
+     * @param tWareHouseFees
+     * @return
+     */
+    public List<ProfitExcel> profit(TWareHouseFees tWareHouseFees);
+
+    /**
+     * 凯和查询应付总账
+     * @param tWareHouseFees
+     * @return
+     */
+    public List<HandleExcel> handle(TWareHouseFees tWareHouseFees);
+
+    /**
      * 根据结算单位、费用状态、审核日期查询应付总帐明细
      *
      * @param feeDTO

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

@@ -35,7 +35,6 @@ import com.ruoyi.finance.service.ITFeeService;
 import com.ruoyi.finance.shipping.FinancialTFee;
 import com.ruoyi.finance.shipping.FinancialTFeeDoExcel;
 import com.ruoyi.reportManagement.dto.TWarehousebill;
-import com.ruoyi.reportManagement.excel.Payable;
 import com.ruoyi.reportManagement.excel.Profit;
 import com.ruoyi.reportManagement.excel.Receivable;
 import com.ruoyi.shipping.domain.TAccount;
@@ -1899,7 +1898,7 @@ public class TFeeServiceImpl implements ITFeeService {
         //第四行
         HSSFRow row5 = sheet.createRow(rowNum++);
         row5.setHeight((short) 500);
-        String[] row_third = {"序号", "提单号", "始发港", "目的港","运输条款", "货名", "箱量", "规格", "单价", "合计"};
+        String[] row_third = {"序号", "提单号", "始发港", "目的港", "运输条款", "货名", "箱量", "规格", "单价", "合计"};
         for (int i = 0; i < row_third.length; i++) {
             HSSFCell tempCell = row5.createCell(i);
             tempCell.setCellValue(row_third[i]);
@@ -1979,7 +1978,7 @@ public class TFeeServiceImpl implements ITFeeService {
         HSSFCell c07 = row7.createCell(0);
         c07.setCellValue(message7);
         c07.setCellStyle(endStyle);
-        sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 0, 9));//标题合并单元格操作,总列数为9
+        sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 9));//标题合并单元格操作,总列数为9
         //导出excel
 
         String fileName = "客户对账单.xls";
@@ -2049,6 +2048,22 @@ public class TFeeServiceImpl implements ITFeeService {
         return detailExcelList;
     }
 
+
+    @Override
+    public List<ReceivableExcel> receivable(TWareHouseFees tWareHouseFees) {
+        return tFeeMapper.receivable(tWareHouseFees);
+    }
+
+    @Override
+    public List<ProfitExcel> profit(TWareHouseFees tWareHouseFees) {
+        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 +
+                '}';
+    }
+}

+ 120 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/shipping/ProfitExcel.java

@@ -0,0 +1,120 @@
+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 ProfitExcel implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * 船名
+     */
+    @Excel(name = "船名")
+    private String shipsName;
+    /**
+     *航次
+     */
+    @Excel(name = "航次")
+    private String voyage;
+    /**
+     *应收合计
+     */
+    @Excel(name = "应收合计")
+    private BigDecimal receivable;
+    /**
+     *应付合计
+     */
+    @Excel(name = "应付合计")
+    private BigDecimal handle;
+    /**
+     *利润
+     */
+    @Excel(name = "利润")
+    private BigDecimal profit;
+    /**
+     *实收合计
+     */
+    @Excel(name = "实收合计")
+    private BigDecimal actualReceivable;
+    /**
+     *实付合计
+     */
+    @Excel(name = "实付合计")
+    private BigDecimal actualHandle;
+
+    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 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;
+    }
+
+    public BigDecimal getActualReceivable() {
+        return actualReceivable;
+    }
+
+    public void setActualReceivable(BigDecimal actualReceivable) {
+        this.actualReceivable = actualReceivable;
+    }
+
+    public BigDecimal getActualHandle() {
+        return actualHandle;
+    }
+
+    public void setActualHandle(BigDecimal actualHandle) {
+        this.actualHandle = actualHandle;
+    }
+
+    @Override
+    public String toString() {
+        return "ProfitExcel{" +
+                "shipsName='" + shipsName + '\'' +
+                ", voyage='" + voyage + '\'' +
+                ", receivable=" + receivable +
+                ", handle=" + handle +
+                ", profit=" + profit +
+                ", actualReceivable=" + actualReceivable +
+                ", actualHandle=" + actualHandle +
+                '}';
+    }
+}

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

@@ -0,0 +1,176 @@
+package com.ruoyi.finance.shipping;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 凯和导出应收总账对象
+ */
+public class ReceivableExcel 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 +
+                '}';
+    }
+}

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

@@ -2393,6 +2393,153 @@
         )tp,
         (SELECT @rank:= 0) b
     </select>
+    <select id="receivable" resultType="com.ruoyi.finance.shipping.ReceivableExcel">
+        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>
+    <select id="profit" resultType="com.ruoyi.finance.shipping.ProfitExcel">
+        SELECT
+        DISTINCT
+        tv.f_name AS shipsName,
+        ty.f_no AS voyage,
+        ROUND(sum( CASE f_dc WHEN 'D' THEN f_amount ELSE 0 END ),2) AS receivable,
+        ROUND(sum( CASE f_dc WHEN 'C' THEN f_amount ELSE 0 END ),2) AS handle,
+        ROUND((sum( CASE f_dc WHEN 'D' THEN f_amount ELSE 0 END ) - sum( CASE f_dc WHEN 'C' THEN f_amount ELSE 0 END )),2) AS profit,
+        ROUND(sum( CASE f_dc WHEN 'D' THEN f_stlamount ELSE 0 END ),2) AS actualReceivable,
+        ROUND(sum( CASE f_dc WHEN 'C' THEN f_stlamount ELSE 0 END ),2) AS actualHandle
+        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
+        <where>
+            1=1
+            <if test="fVslid != null">and tw.f_vslid = #{fVslid}</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_vslid,tw.f_voyid
+            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>
 
     <select id="queryApplyInvoiceFeesList" resultType="java.util.Map">
         SELECT

+ 5 - 3
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -1796,7 +1796,7 @@
         LEFT JOIN t_cntr tr ON th.f_cntrid = tr.f_id
         LEFT JOIN t_goods tg ON th.f_goodsid = tg.f_id
         ) tc ON tc.f_pid = tw.f_id
-        LEFT JOIN (SELECT f_pid,f_billstatus FROM t_warehousebillsfees GROUP BY f_pid,f_billstatus)tf ON tf.f_pid = tw.f_id
+        LEFT JOIN (SELECT f_pid,f_billstatus FROM t_warehousebillsfees GROUP BY f_pid)tf ON tf.f_pid = tw.f_id
         <where>
             tw.f_typeid = '1'
             and tw.del_flag = '0'
@@ -2067,7 +2067,7 @@
         LEFT JOIN t_cntr tr ON th.f_cntrid = tr.f_id
         LEFT JOIN t_goods tg ON th.f_goodsid = tg.f_id
         ) tc ON tc.f_pid = tw.f_id
-        LEFT JOIN (SELECT f_pid,f_billstatus,IFNULL(SUM(f_amount),0) fAmount FROM t_warehousebillsfees GROUP BY f_pid,f_billstatus)tf ON tf.f_pid = tw.f_id
+        LEFT JOIN (SELECT f_pid,f_billstatus,IFNULL(SUM(f_amount),0) fAmount FROM t_warehousebillsfees GROUP BY f_pid)tf ON tf.f_pid = tw.f_id
         <where>
             tw.f_typeid = '1'
             and tw.del_flag = '0'
@@ -2326,7 +2326,9 @@
             AND sda.dict_type = 'f_paymode'
                  LEFT JOIN t_vessel tv ON tv.f_id = tw.f_vslid
                  LEFT JOIN t_voyage ty ON ty.f_id = tw.f_voyid
-        where tw.f_id = #{fId}
+        where 1= 1
+        <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno} </if>
+        <if test="fId != null ">and tw.f_id = #{fId} </if>
     </select>
 
     <select id="selectTWarehousebillsfMblno" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">