Bladeren bron

[CODE]: 报表分析导出功能

maxianghua 4 jaren geleden
bovenliggende
commit
ffd132491d

+ 15 - 10
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/PayableController.java

@@ -1,10 +1,15 @@
 package com.ruoyi.web.controller.warehouse.reportManagement;
 
 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.reportManagement.excel.Payable;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -41,17 +46,17 @@ public class PayableController extends BaseController {
     }
 
     /**
-     * 导出库存总账列表
-     *//*
-    @PreAuthorize("@ss.hasPermi('warehouseBusiness:receivable:export')")
+     * 应付总账列表
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:payable:export')")
     @Log(title = "库存总账", businessType = BusinessType.EXPORT)
+    @DataScope(deptAlias = "d", userAlias = "u")
     @GetMapping("/export")
-    public AjaxResult export(TWhgenleg tWhgenleg) {
-        List<TWhgenleg> list = tWhgenlegService.selectTWhgenlegList(tWhgenleg);
-        ExcelUtil<TWhgenleg> util = new ExcelUtil<TWhgenleg>(TWhgenleg.class);
-        return util.exportExcel(list, "whgenleg");
-    }*/
-
-
+    public AjaxResult export(TWareHouseFees tWareHouseFees) throws Exception {
+        tWareHouseFees.setfDc("C");
+        List<Payable> list = tFeeService.payableExport(tWareHouseFees);
+        ExcelUtil<Payable> util = new ExcelUtil<Payable>(Payable.class);
+        return util.exportExcel(list, "应付总账");
+    }
 
 }

+ 14 - 10
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/ProfitController.java

@@ -1,10 +1,15 @@
 package com.ruoyi.web.controller.warehouse.reportManagement;
 
 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.reportManagement.excel.Profit;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -40,17 +45,16 @@ public class ProfitController extends BaseController {
     }
 
     /**
-     * 导出库存总账列表
-     *//*
-    @PreAuthorize("@ss.hasPermi('warehouseBusiness:receivable:export')")
+     * 应付总账列表
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:profit:export')")
     @Log(title = "库存总账", businessType = BusinessType.EXPORT)
+    @DataScope(deptAlias = "d", userAlias = "u")
     @GetMapping("/export")
-    public AjaxResult export(TWhgenleg tWhgenleg) {
-        List<TWhgenleg> list = tWhgenlegService.selectTWhgenlegList(tWhgenleg);
-        ExcelUtil<TWhgenleg> util = new ExcelUtil<TWhgenleg>(TWhgenleg.class);
-        return util.exportExcel(list, "whgenleg");
-    }*/
-
-
+    public AjaxResult export(TWareHouseFees tWareHouseFees) throws Exception {
+        List<Profit> list = tFeeService.profitExport(tWareHouseFees);
+        ExcelUtil<Profit> util = new ExcelUtil<Profit>(Profit.class);
+        return util.exportExcel(list, "利润总账");
+    }
 
 }

+ 14 - 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/ReceivableController.java

@@ -1,10 +1,15 @@
 package com.ruoyi.web.controller.warehouse.reportManagement;
 
 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.reportManagement.excel.Receivable;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -41,16 +46,18 @@ public class ReceivableController extends BaseController {
     }
 
     /**
-     * 导出库存总账列表
-     *//*
+     * 应收总账列表
+     */
     @PreAuthorize("@ss.hasPermi('warehouseBusiness:receivable:export')")
     @Log(title = "库存总账", businessType = BusinessType.EXPORT)
+    @DataScope(deptAlias = "d", userAlias = "u")
     @GetMapping("/export")
-    public AjaxResult export(TWhgenleg tWhgenleg) {
-        List<TWhgenleg> list = tWhgenlegService.selectTWhgenlegList(tWhgenleg);
-        ExcelUtil<TWhgenleg> util = new ExcelUtil<TWhgenleg>(TWhgenleg.class);
-        return util.exportExcel(list, "whgenleg");
-    }*/
+    public AjaxResult export(TWareHouseFees tWareHouseFees) throws Exception {
+        tWareHouseFees.setfDc("D");
+        List<Receivable> list = tFeeService.receivableExport(tWareHouseFees);
+        ExcelUtil<Receivable> util = new ExcelUtil<Receivable>(Receivable.class);
+        return util.exportExcel(list, "应收总账");
+    }
 
 
 

+ 5 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWhgenlegController.java

@@ -9,6 +9,7 @@ import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
+import com.ruoyi.reportManagement.excel.Whgenleg;
 import com.ruoyi.reportManagement.service.ITWhgenlegService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -48,10 +49,10 @@ public class TWhgenlegController extends BaseController {
     @Log(title = "库存总账", businessType = BusinessType.EXPORT)
     @DataScope(deptAlias = "d", userAlias = "u")
     @GetMapping("/export")
-    public AjaxResult export(TWhgenleg tWhgenleg) {
-        List<TWhgenleg> list = tWhgenlegService.selectTWhgenlegList(tWhgenleg);
-        ExcelUtil<TWhgenleg> util = new ExcelUtil<TWhgenleg>(TWhgenleg.class);
-        return util.exportExcel(list, "whgenleg");
+    public AjaxResult export(TWhgenleg tWhgenleg) throws Exception {
+        List<Whgenleg> list = tWhgenlegService.whgenlegExport(tWhgenleg);
+        ExcelUtil<Whgenleg> util = new ExcelUtil<Whgenleg>(Whgenleg.class);
+        return util.exportExcel(list, "库存总账");
     }
 
     /**

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

@@ -4,6 +4,9 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.finance.domain.TFee;
 import com.ruoyi.finance.domain.TWareHouseFees;
+import com.ruoyi.reportManagement.excel.Payable;
+import com.ruoyi.reportManagement.excel.Profit;
+import com.ruoyi.reportManagement.excel.Receivable;
 import com.ruoyi.warehouseBusiness.domain.TWareHouseExcelItem;
 
 import java.util.List;
@@ -110,4 +113,10 @@ public interface ITFeeService {
     public List<TWareHouseExcelItem> selectTWarehousebillsItemsList(Long  fId);
 
     public  String  findCtrlcorpid (Long  fId);
+
+    public List<Receivable> receivableExport(TWareHouseFees tWareHouseFees) throws Exception;
+
+    public List<Payable> payableExport(TWareHouseFees tWareHouseFees) throws Exception;
+
+    public List<Profit> profitExport(TWareHouseFees tWareHouseFees) throws Exception;
 }

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

@@ -19,10 +19,17 @@ import com.ruoyi.finance.domain.TWareHouseFees;
 import com.ruoyi.finance.mapper.TFeeDoMapper;
 import com.ruoyi.finance.mapper.TFeeMapper;
 import com.ruoyi.finance.service.ITFeeService;
+import com.ruoyi.reportManagement.excel.Payable;
+import com.ruoyi.reportManagement.excel.Profit;
+import com.ruoyi.reportManagement.excel.Receivable;
 import com.ruoyi.system.domain.SysConfig;
 import com.ruoyi.system.mapper.SysConfigMapper;
 import com.ruoyi.system.service.ISysDictDataService;
-import com.ruoyi.warehouseBusiness.domain.*;
+import com.ruoyi.warehouseBusiness.domain.BillnoDel;
+import com.ruoyi.warehouseBusiness.domain.TWareHouseExcelItem;
+import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
+import com.ruoyi.warehouseBusiness.domain.TWarehousebillsfees;
+import com.ruoyi.warehouseBusiness.excel.ListMapToBeanUtils;
 import com.ruoyi.warehouseBusiness.mapper.BillnoDelMapper;
 import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
 import com.ruoyi.warehouseBusiness.mapper.TWarehousebillsfeesMapper;
@@ -558,6 +565,27 @@ public class TFeeServiceImpl implements ITFeeService {
         return exportName;
     }
 
+    @Override
+    public List<Receivable> receivableExport(TWareHouseFees tWareHouseFees) throws Exception {
+        List<Map<String, Object>> list =  tFeeMapper.warehouseBillsFeesList1(tWareHouseFees);
+        List<Receivable> list1 = ListMapToBeanUtils.castMapToBean(list,Receivable.class);
+        return list1;
+    }
+
+    @Override
+    public List<Payable> payableExport(TWareHouseFees tWareHouseFees) throws Exception {
+        List<Map<String, Object>> list =  tFeeMapper.warehouseBillsFeesList1(tWareHouseFees);
+        List<Payable> list1 = ListMapToBeanUtils.castMapToBean(list,Payable.class);
+        return list1;
+    }
+
+    @Override
+    public List<Profit> profitExport(TWareHouseFees tWareHouseFees) throws Exception {
+        List<Map<String, Object>> list =  tFeeMapper.warehouseBillsFeesProfitList(tWareHouseFees);
+        List<Profit> list1 = ListMapToBeanUtils.castMapToBean(list,Profit.class);
+        return list1;
+    }
+
     /**
      *  更新费用明细
      * @param fid

+ 143 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/excel/Payable.java

@@ -0,0 +1,143 @@
+package com.ruoyi.reportManagement.excel;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 入库导出
+ *
+ * @author ruoyi
+ * @date 2020-12-11
+ */
+public class Payable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name
+     */
+    @Excel(name = "货权方")
+    private String fName;
+
+    /**
+     * 入(出)库日期
+     */
+    @Excel(name = "结算单位")
+    private String fFeesName;
+
+    /**
+     * 提单号
+     */
+    @Excel(name = "提单号")
+    private String fMblno;
+
+    /**
+     * 提单号
+     */
+    @Excel(name = "货物名称")
+    private String fProductName;
+
+    /**
+     * 唛头
+     */
+    @Excel(name = "品牌")
+    private String fMarks;
+
+    /**
+     * 入(出)库日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审核日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date fReviewDate;
+
+    /**
+     * 应收金额
+     */
+    @Excel(name = "应付金额")
+    private Double fAmount;
+
+    /**
+     * 实收金额
+     */
+    @Excel(name = "实付金额")
+    private Double fStlamount;
+
+    /**
+     * 未收金额
+     */
+    @Excel(name = "未付金额")
+    private Double nnfinished;
+
+    public String getfName() {
+        return fName;
+    }
+
+    public void setfName(String fName) {
+        this.fName = fName;
+    }
+
+    public String getfFeesName() {
+        return fFeesName;
+    }
+
+    public void setfFeesName(String fFeesName) {
+        this.fFeesName = fFeesName;
+    }
+
+    public String getfMblno() {
+        return fMblno;
+    }
+
+    public void setfMblno(String fMblno) {
+        this.fMblno = fMblno;
+    }
+
+    public String getfProductName() {
+        return fProductName;
+    }
+
+    public void setfProductName(String fProductName) {
+        this.fProductName = fProductName;
+    }
+
+    public String getfMarks() {
+        return fMarks;
+    }
+
+    public void setfMarks(String fMarks) {
+        this.fMarks = fMarks;
+    }
+
+    public Date getfReviewDate() {
+        return fReviewDate;
+    }
+
+    public void setfReviewDate(Date fReviewDate) {
+        this.fReviewDate = fReviewDate;
+    }
+
+    public Double getfAmount() {
+        return fAmount;
+    }
+
+    public void setfAmount(Double fAmount) {
+        this.fAmount = fAmount;
+    }
+
+    public Double getfStlamount() {
+        return fStlamount;
+    }
+
+    public void setfStlamount(Double fStlamount) {
+        this.fStlamount = fStlamount;
+    }
+
+    public Double getNnfinished() {
+        return nnfinished;
+    }
+
+    public void setNnfinished(Double nnfinished) {
+        this.nnfinished = nnfinished;
+    }
+}

+ 143 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/excel/Profit.java

@@ -0,0 +1,143 @@
+package com.ruoyi.reportManagement.excel;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 入库导出
+ *
+ * @author ruoyi
+ * @date 2020-12-11
+ */
+public class Profit {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name
+     */
+    @Excel(name = "货权方")
+    private String fName;
+
+    /**
+     * 入(出)库日期
+     */
+    @Excel(name = "结算单位")
+    private String fFeesName;
+
+    /**
+     * 提单号
+     */
+    @Excel(name = "提单号")
+    private String fMblno;
+
+    /**
+     * 提单号
+     */
+    @Excel(name = "货物名称")
+    private String fProductName;
+
+    /**
+     * 唛头
+     */
+    @Excel(name = "品牌")
+    private String fMarks;
+
+    /**
+     * 入(出)库日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审核日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date fReviewDate;
+
+    /**
+     * 应收金额
+     */
+    @Excel(name = "应付金额")
+    private Double fAmount;
+
+    /**
+     * 应付金额
+     */
+    @Excel(name = "应付金额")
+    private Double fStlamount;
+
+    /**
+     * 利润
+     */
+    @Excel(name = "利润")
+    private Double nnfinished;
+
+    public String getfName() {
+        return fName;
+    }
+
+    public void setfName(String fName) {
+        this.fName = fName;
+    }
+
+    public String getfFeesName() {
+        return fFeesName;
+    }
+
+    public void setfFeesName(String fFeesName) {
+        this.fFeesName = fFeesName;
+    }
+
+    public String getfMblno() {
+        return fMblno;
+    }
+
+    public void setfMblno(String fMblno) {
+        this.fMblno = fMblno;
+    }
+
+    public String getfProductName() {
+        return fProductName;
+    }
+
+    public void setfProductName(String fProductName) {
+        this.fProductName = fProductName;
+    }
+
+    public String getfMarks() {
+        return fMarks;
+    }
+
+    public void setfMarks(String fMarks) {
+        this.fMarks = fMarks;
+    }
+
+    public Date getfReviewDate() {
+        return fReviewDate;
+    }
+
+    public void setfReviewDate(Date fReviewDate) {
+        this.fReviewDate = fReviewDate;
+    }
+
+    public Double getfAmount() {
+        return fAmount;
+    }
+
+    public void setfAmount(Double fAmount) {
+        this.fAmount = fAmount;
+    }
+
+    public Double getfStlamount() {
+        return fStlamount;
+    }
+
+    public void setfStlamount(Double fStlamount) {
+        this.fStlamount = fStlamount;
+    }
+
+    public Double getNnfinished() {
+        return nnfinished;
+    }
+
+    public void setNnfinished(Double nnfinished) {
+        this.nnfinished = nnfinished;
+    }
+}

+ 143 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/excel/Receivable.java

@@ -0,0 +1,143 @@
+package com.ruoyi.reportManagement.excel;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 入库导出
+ *
+ * @author ruoyi
+ * @date 2020-12-11
+ */
+public class Receivable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name
+     */
+    @Excel(name = "货权方")
+    private String fName;
+
+    /**
+     * 入(出)库日期
+     */
+    @Excel(name = "结算单位")
+    private String fFeesName;
+
+    /**
+     * 提单号
+     */
+    @Excel(name = "提单号")
+    private String fMblno;
+
+    /**
+     * 提单号
+     */
+    @Excel(name = "货物名称")
+    private String fProductName;
+
+    /**
+     * 唛头
+     */
+    @Excel(name = "品牌")
+    private String fMarks;
+
+    /**
+     * 入(出)库日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审核日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date fReviewDate;
+
+    /**
+     * 应收金额
+     */
+    @Excel(name = "应收金额")
+    private Double fAmount;
+
+    /**
+     * 实收金额
+     */
+    @Excel(name = "实收金额")
+    private Double fStlamount;
+
+    /**
+     * 未收金额
+     */
+    @Excel(name = "未收金额")
+    private Double nnfinished;
+
+    public String getfName() {
+        return fName;
+    }
+
+    public void setfName(String fName) {
+        this.fName = fName;
+    }
+
+    public String getfFeesName() {
+        return fFeesName;
+    }
+
+    public void setfFeesName(String fFeesName) {
+        this.fFeesName = fFeesName;
+    }
+
+    public String getfMblno() {
+        return fMblno;
+    }
+
+    public void setfMblno(String fMblno) {
+        this.fMblno = fMblno;
+    }
+
+    public String getfProductName() {
+        return fProductName;
+    }
+
+    public void setfProductName(String fProductName) {
+        this.fProductName = fProductName;
+    }
+
+    public String getfMarks() {
+        return fMarks;
+    }
+
+    public void setfMarks(String fMarks) {
+        this.fMarks = fMarks;
+    }
+
+    public Date getfReviewDate() {
+        return fReviewDate;
+    }
+
+    public void setfReviewDate(Date fReviewDate) {
+        this.fReviewDate = fReviewDate;
+    }
+
+    public Double getfAmount() {
+        return fAmount;
+    }
+
+    public void setfAmount(Double fAmount) {
+        this.fAmount = fAmount;
+    }
+
+    public Double getfStlamount() {
+        return fStlamount;
+    }
+
+    public void setfStlamount(Double fStlamount) {
+        this.fStlamount = fStlamount;
+    }
+
+    public Double getNnfinished() {
+        return nnfinished;
+    }
+
+    public void setNnfinished(Double nnfinished) {
+        this.nnfinished = nnfinished;
+    }
+}

+ 294 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/excel/Whgenleg.java

@@ -0,0 +1,294 @@
+package com.ruoyi.reportManagement.excel;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 入库导出
+ *
+ * @author ruoyi
+ * @date 2020-12-11
+ */
+public class Whgenleg {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name
+     */
+    @Excel(name = "货权方")
+    private String fCorpid;
+
+
+    /**
+     * 入(出)库日期
+     */
+    @Excel(name = "入库日期")
+    private String fOriginalbilldate;
+
+    /**
+     * 入(出)库日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "仓储费计算日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date fChargedate;
+
+    /**
+     * 提单号
+     */
+    @Excel(name = "提单号")
+    private String fMblno;
+
+    /**
+     * 提单号
+     */
+    @Excel(name = "货物属性")
+    private String fBusinessTypes;
+
+    /**
+     * 唛头
+     */
+    @Excel(name = "属性详情")
+    private String fMarks;
+
+    /**
+     * 唛头
+     */
+    @Excel(name = "品名")
+    private String fGoodsids;
+
+    /**
+     * 仓库
+     */
+    @Excel(name = "仓库")
+    private String fWarehouseids;
+
+    /**
+     * 贸易方式
+     */
+    @Excel(name = "贸易方式")
+    private String fTrademodeid;
+
+    /**
+     * 件数,由明细表自动合计生成
+     */
+    @Excel(name = "入库件数")
+    private Integer fQtyD;
+
+    /**
+     * 毛重,由明细表自动合计生成
+     */
+    @Excel(name = "入库毛重(KG)")
+    private Float fGrossweightD;
+
+    /**
+     * 净重,由明细表自动合计生成
+     */
+    @Excel(name = "入库净重(KG)")
+    private Float fNetweightD;
+
+    /**
+     * 件数,由明细表自动合计生成
+     */
+    @Excel(name = "出库件数")
+    private Integer fQtyC;
+
+    /**
+     * 毛重,由明细表自动合计生成
+     */
+    @Excel(name = "出库毛重(KG)")
+    private Float fGrossweightC;
+
+    /**
+     * 净重,由明细表自动合计生成
+     */
+    @Excel(name = "出库净重(KG)")
+    private Float fNetweightC;
+
+    /**
+     * 件数,由明细表自动合计生成
+     */
+    @Excel(name = "结余件数")
+    private Integer fQtyblc;
+
+    /**
+     * 毛重,由明细表自动合计生成
+     */
+    @Excel(name = "结余毛重(KG)")
+    private Float fGrossweightblc;
+
+    /**
+     * 净重,由明细表自动合计生成
+     */
+    @Excel(name = "结余净重(KG)")
+    private Float fNetweightblc;
+
+    /** 明细品名合计 */
+    @Excel(name = "箱号")
+    private String fCntrno;
+
+    /** 明细品名合计 */
+    @Excel(name = "备注")
+    private String remark;
+
+    public String getfCorpid() {
+        return fCorpid;
+    }
+
+    public void setfCorpid(String fCorpid) {
+        this.fCorpid = fCorpid;
+    }
+
+    public String getfOriginalbilldate() {
+        return fOriginalbilldate;
+    }
+
+    public void setfOriginalbilldate(String fOriginalbilldate) {
+        this.fOriginalbilldate = fOriginalbilldate;
+    }
+
+    public Date getfChargedate() {
+        return fChargedate;
+    }
+
+    public void setfChargedate(Date fChargedate) {
+        this.fChargedate = fChargedate;
+    }
+
+    public String getfMblno() {
+        return fMblno;
+    }
+
+    public void setfMblno(String fMblno) {
+        this.fMblno = fMblno;
+    }
+
+    public String getfBusinessTypes() {
+        return fBusinessTypes;
+    }
+
+    public void setfBusinessTypes(String fBusinessTypes) {
+        this.fBusinessTypes = fBusinessTypes;
+    }
+
+    public String getfMarks() {
+        return fMarks;
+    }
+
+    public void setfMarks(String fMarks) {
+        this.fMarks = fMarks;
+    }
+
+    public String getfGoodsids() {
+        return fGoodsids;
+    }
+
+    public void setfGoodsids(String fGoodsids) {
+        this.fGoodsids = fGoodsids;
+    }
+
+    public String getfWarehouseids() {
+        return fWarehouseids;
+    }
+
+    public void setfWarehouseids(String fWarehouseids) {
+        this.fWarehouseids = fWarehouseids;
+    }
+
+    public String getfTrademodeid() {
+        return fTrademodeid;
+    }
+
+    public void setfTrademodeid(String fTrademodeid) {
+        this.fTrademodeid = fTrademodeid;
+    }
+
+    public Integer getfQtyD() {
+        return fQtyD;
+    }
+
+    public void setfQtyD(Integer fQtyD) {
+        this.fQtyD = fQtyD;
+    }
+
+    public Float getfGrossweightD() {
+        return fGrossweightD;
+    }
+
+    public void setfGrossweightD(Float fGrossweightD) {
+        this.fGrossweightD = fGrossweightD;
+    }
+
+    public Float getfNetweightD() {
+        return fNetweightD;
+    }
+
+    public void setfNetweightD(Float fNetweightD) {
+        this.fNetweightD = fNetweightD;
+    }
+
+    public Integer getfQtyC() {
+        return fQtyC;
+    }
+
+    public void setfQtyC(Integer fQtyC) {
+        this.fQtyC = fQtyC;
+    }
+
+    public Float getfGrossweightC() {
+        return fGrossweightC;
+    }
+
+    public void setfGrossweightC(Float fGrossweightC) {
+        this.fGrossweightC = fGrossweightC;
+    }
+
+    public Float getfNetweightC() {
+        return fNetweightC;
+    }
+
+    public void setfNetweightC(Float fNetweightC) {
+        this.fNetweightC = fNetweightC;
+    }
+
+    public Integer getfQtyblc() {
+        return fQtyblc;
+    }
+
+    public void setfQtyblc(Integer fQtyblc) {
+        this.fQtyblc = fQtyblc;
+    }
+
+    public Float getfGrossweightblc() {
+        return fGrossweightblc;
+    }
+
+    public void setfGrossweightblc(Float fGrossweightblc) {
+        this.fGrossweightblc = fGrossweightblc;
+    }
+
+    public Float getfNetweightblc() {
+        return fNetweightblc;
+    }
+
+    public void setfNetweightblc(Float fNetweightblc) {
+        this.fNetweightblc = fNetweightblc;
+    }
+
+    public String getfCntrno() {
+        return fCntrno;
+    }
+
+    public void setfCntrno(String fCntrno) {
+        this.fCntrno = fCntrno;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+}

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

@@ -2,6 +2,7 @@ package com.ruoyi.reportManagement.service;
 
 
 import com.ruoyi.reportManagement.domain.TWhgenleg;
+import com.ruoyi.reportManagement.excel.Whgenleg;
 
 import java.util.List;
 import java.util.Map;
@@ -97,5 +98,6 @@ public interface ITWhgenlegService {
 
     List<Map<String, Object>> selectWhgenlegList(TWhgenleg tWhgenleg);
 
+    public List<Whgenleg> whgenlegExport(TWhgenleg tWhgenleg) throws Exception;
 
 }

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

@@ -1,15 +1,16 @@
 package com.ruoyi.reportManagement.service.impl;
 
 
-
-import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.basicData.mapper.TWarehouseMapper;
+import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
+import com.ruoyi.reportManagement.excel.Whgenleg;
 import com.ruoyi.reportManagement.mapper.TWhgenlegMapper;
 import com.ruoyi.reportManagement.service.ITWhgenlegService;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
+import com.ruoyi.warehouseBusiness.excel.ListMapToBeanUtils;
 import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -345,6 +346,22 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
         return tWhgenlegMapper.selectWhgenlegList(tWhgenleg);
     }
 
+    @Override
+    public List<Whgenleg> whgenlegExport(TWhgenleg tWhgenleg) throws Exception {
+        if(StringUtils.isNotNull(tWhgenleg.getfWarehouseLocationid())){
+            // 获取仓库信息
+            TWarehouse tWarehouse =  tWarehouseMapper.selectTWarehouseById(tWhgenleg.getfWarehouseLocationid());
+            if(tWarehouse.getfLocation()==1){
+                tWhgenleg.setfLocation(1L);
+            }else {
+                tWhgenleg.setfLocation(0L);
+            }
+        }
+        List<Map<String, Object>> list =  tWhgenlegMapper.selectInventoryList(tWhgenleg);
+        List<Whgenleg> list1 = ListMapToBeanUtils.castMapToBean(list,Whgenleg.class);
+        return list1;
+    }
+
     /**
      *
      * @param fOriginalbilldate 根据该字段进行合并

+ 4 - 1
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -92,7 +92,7 @@
             area.f_name AS fWarehouseLocationids,
             leg.f_originalbillno AS fOriginalbillno,
             leg.f_warehouse_locationid AS fWarehouseLocationid,
-            leg.f_trademodeid AS fTrademodeid,
+            dict1.dict_label AS fTrademodeid,
             goods.f_name AS fGoodsids,
             goods.f_packagespecs AS fPackagespecs,
             leg.f_goodsid AS fGoodsid,
@@ -126,9 +126,12 @@
             LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
             LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
             LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
+            LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
         <where>
             dict.status = '0'
             AND dict.dict_type = 'storage_type'
+            AND dict1.status = '0'
+            AND dict1.dict_type = 'data_trademodes'
             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>