Explorar el Código

添加车队对账列表、明细表导出功能,解决查询费用信息需要对账金额为0不显示问题

阿伏兔 hace 4 años
padre
commit
6c046a2848

+ 31 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/fleet/finance/FTmsaccbillsController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.web.controller.fleet.finance;
 
+import com.ruoyi.common.annotation.DataScope;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
@@ -9,11 +10,15 @@ import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.finance.excel.FTmsaccbillsFeesExcel;
+import com.ruoyi.finance.excel.FTmsaccbillsFeesItemsExcel;
 import com.ruoyi.framework.web.service.TokenService;
 import com.ruoyi.orderManagement.finance.domain.FTmsaccbills;
 import com.ruoyi.orderManagement.finance.domain.FTmsaccbillsFees;
 import com.ruoyi.orderManagement.finance.service.IFTmsaccbillsService;
+import com.ruoyi.warehouseBusiness.excel.ListMapToBeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -83,6 +88,32 @@ public class FTmsaccbillsController extends BaseController {
     }
 
     /**
+     * 导出财务数据主列表
+     */
+    @Log(title = "财务数据主", businessType = BusinessType.EXPORT)
+    @DataScope(deptAlias = "d", userAlias = "u")
+    @GetMapping("/export")
+    public AjaxResult export(FTmsaccbills fTmsaccbills) throws Exception {
+        fTmsaccbills.setfBilltype("SFDZ");
+        startPage();
+        List<Map<String, Object>> maps = fTmsaccbillsService.selectFTmsaccbillsMapList(fTmsaccbills);
+        List<FTmsaccbillsFeesExcel> list = ListMapToBeanUtils.castMapToBean(maps, FTmsaccbillsFeesExcel.class);
+        ExcelUtil<FTmsaccbillsFeesExcel> util = new ExcelUtil<FTmsaccbillsFeesExcel>(FTmsaccbillsFeesExcel.class);
+        return util.exportExcel(list, "对账");
+    }
+
+    /**
+     * 导出对账详情表列表
+     */
+    @GetMapping("/exportItems/{fId}")
+    public AjaxResult exportItems(@PathVariable("fId") Long fId) throws Exception {
+        List<Map<String, Object>> maps = fTmsaccbillsService.selectFTmsaccbillsItemsList(fId);
+        List<FTmsaccbillsFeesItemsExcel> list = ListMapToBeanUtils.castMapToBean(maps, FTmsaccbillsFeesItemsExcel.class);
+        ExcelUtil<FTmsaccbillsFeesItemsExcel> util = new ExcelUtil<FTmsaccbillsFeesItemsExcel>(FTmsaccbillsFeesItemsExcel.class);
+        return util.exportExcel(list, "对账明细");
+    }
+
+    /**
      * 删除财务数据主
      */
     @PreAuthorize("@ss.hasPermi('finance:contrast:remove')")

+ 2 - 0
ruoyi-fleet/src/main/java/com/ruoyi/orderManagement/finance/service/IFTmsaccbillsService.java

@@ -45,4 +45,6 @@ public interface IFTmsaccbillsService
     public AjaxResult queryRemove(Long fId);
 
     public AjaxResult confirm(String tfee, String tfeeDo ,String fBilltype);
+
+    public List<Map<String, Object>> selectFTmsaccbillsItemsList(Long fId);
 }

+ 5 - 0
ruoyi-fleet/src/main/java/com/ruoyi/orderManagement/finance/service/impl/FTmsaccbillsServiceImpl.java

@@ -161,6 +161,11 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService {
     }
 
     @Override
+    public List<Map<String, Object>> selectFTmsaccbillsItemsList(Long fId) {
+        return fTmsaccbillsitemsMapper.selectItemsMapById(fId);
+    }
+
+    @Override
     public List<Map<String, Object>> selectFTmsaccbillsMapList(FTmsaccbills fTmsaccbills) {
         return fTmsaccbillsMapper.selectFTmsaccbillsMapList(fTmsaccbills);
     }

+ 0 - 2
ruoyi-fleet/src/main/resources/mapper/finance/FTmsaccbillsMapper.xml

@@ -281,7 +281,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{id}
                 </foreach>
             </if>
-            and  ifnull(w.f_amount, 0) - ifnull(w.f_accamount, 0) != 0
             GROUP BY  w.f_id
         </where>
     </select>
@@ -356,7 +355,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test=' timeReconci != null and  timeReconci[1] != null and  timeReconci[1]!= ""'>
                 and w.f_stlamount_date &lt;= #{ timeReconci[1]}
             </if>
-            and  ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) != 0
             GROUP BY  w.f_id
         </where>
     </select>

+ 142 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/excel/FTmsaccbillsFeesExcel.java

@@ -0,0 +1,142 @@
+package com.ruoyi.finance.excel;
+
+import com.ruoyi.common.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * excel ftmsaccbills费用
+ *
+ * @author 阿伏兔
+ * @date 2021/06/16
+ */
+public class FTmsaccbillsFeesExcel {
+
+    /**
+     * 系统编号
+     */
+    @Excel(name = "系统编号")
+    private String fBillno;
+
+    /**
+     * 对账单位
+     */
+    @Excel(name = "对账单位")
+    private String fCorpidName;
+
+    /**
+     * 金额
+     */
+    @Excel(name = "金额")
+    private Float amt;
+
+    /**
+     * 制单人
+     */
+    @Excel(name = "制单人")
+    private String createBy;
+
+    /**
+     * 对账日期
+     */
+    @Excel(name = "对账日期")
+    private Date fAccbilldate;
+
+
+    /**
+     * 制单日期
+     */
+    @Excel(name = "制单日期")
+    private Date createTime;
+
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态")
+    private String fBillstatus;
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    private String fRemarks;
+
+    public String getfBillno() {
+        return fBillno;
+    }
+
+    public void setfBillno(String fBillno) {
+        this.fBillno = fBillno;
+    }
+
+    public String getfCorpidName() {
+        return fCorpidName;
+    }
+
+    public void setfCorpidName(String fCorpidName) {
+        this.fCorpidName = fCorpidName;
+    }
+
+    public Float getAmt() {
+        return amt;
+    }
+
+    public void setAmt(Float amt) {
+        this.amt = amt;
+    }
+
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    public Date getfAccbilldate() {
+        return fAccbilldate;
+    }
+
+    public void setfAccbilldate(Date fAccbilldate) {
+        this.fAccbilldate = fAccbilldate;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getfBillstatus() {
+        return fBillstatus;
+    }
+
+    public void setfBillstatus(String fBillstatus) {
+        this.fBillstatus = fBillstatus;
+    }
+
+    public String getfRemarks() {
+        return fRemarks;
+    }
+
+    public void setfRemarks(String fRemarks) {
+        this.fRemarks = fRemarks;
+    }
+
+    @Override
+    public String toString() {
+        return "FTmsaccbillsFeesExcel{" +
+                "fBillno='" + fBillno + '\'' +
+                ", fCorpidName='" + fCorpidName + '\'' +
+                ", amt=" + amt +
+                ", createBy='" + createBy + '\'' +
+                ", fAccbilldate=" + fAccbilldate +
+                ", createTime=" + createTime +
+                ", fBillstatus='" + fBillstatus + '\'' +
+                ", fRemarks='" + fRemarks + '\'' +
+                '}';
+    }
+}

+ 243 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/excel/FTmsaccbillsFeesItemsExcel.java

@@ -0,0 +1,243 @@
+package com.ruoyi.finance.excel;
+
+import com.ruoyi.common.annotation.Excel;
+
+/**
+ * excel ftmsaccbills费用
+ *
+ * @author 阿伏兔
+ * @date 2021/06/16
+ */
+public class FTmsaccbillsFeesItemsExcel {
+
+    /**
+     * 客户名称
+     */
+    @Excel(name = "客户名称")
+    private String fFeesName;
+
+    /**
+     * 提单号
+     */
+    @Excel(name = "提单号")
+    private String fMblno;
+
+    /**
+     * 金额
+     */
+    @Excel(name = "金额")
+    private Float amt;
+
+    /**
+     * 运单号
+     */
+    @Excel(name = "运单号")
+    private String orderNo;
+
+    /**
+     * 车牌号
+     */
+    @Excel(name = "车牌号")
+    private String carregNo;
+
+    /**
+     * 业务类型
+     */
+    @Excel(name = "业务类型")
+    private String billType;
+
+    /**
+     * 提箱地点
+     */
+    @Excel(name = "提箱地点")
+    private String loadAddr;
+
+    /**
+     * 卸货地点
+     */
+    @Excel(name = "卸货地点")
+    private String mdLoadAddr;
+
+    /**
+     * 接单日期
+     */
+    @Excel(name = "接单日期")
+    private String acceptDate;
+
+    /**
+     * 箱量
+     */
+    @Excel(name = "箱量")
+    private Float fQty;
+
+    /**
+     * 箱型
+     */
+    @Excel(name = "箱型")
+    private String cntrId;
+
+    /**
+     * 司机
+     */
+    @Excel(name = "司机")
+    private String driverName;
+
+    /**
+     * 费用名称
+     */
+    @Excel(name = "费用名称")
+    private String fFeeName;
+
+    /**
+     * 费用金额
+     */
+    @Excel(name = "费用金额")
+    private Float fAmtdr;
+
+    /**
+     * 本次金额
+     */
+    @Excel(name = "本次金额")
+    private Float fAmt;
+
+    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 Float getAmt() {
+        return amt;
+    }
+
+    public void setAmt(Float amt) {
+        this.amt = amt;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getCarregNo() {
+        return carregNo;
+    }
+
+    public void setCarregNo(String carregNo) {
+        this.carregNo = carregNo;
+    }
+
+    public String getBillType() {
+        return billType;
+    }
+
+    public void setBillType(String billType) {
+        this.billType = billType;
+    }
+
+    public String getLoadAddr() {
+        return loadAddr;
+    }
+
+    public void setLoadAddr(String loadAddr) {
+        this.loadAddr = loadAddr;
+    }
+
+    public String getMdLoadAddr() {
+        return mdLoadAddr;
+    }
+
+    public void setMdLoadAddr(String mdLoadAddr) {
+        this.mdLoadAddr = mdLoadAddr;
+    }
+
+    public String getAcceptDate() {
+        return acceptDate;
+    }
+
+    public void setAcceptDate(String acceptDate) {
+        this.acceptDate = acceptDate;
+    }
+
+    public Float getfQty() {
+        return fQty;
+    }
+
+    public void setfQty(Float fQty) {
+        this.fQty = fQty;
+    }
+
+    public String getCntrId() {
+        return cntrId;
+    }
+
+    public void setCntrId(String cntrId) {
+        this.cntrId = cntrId;
+    }
+
+    public String getDriverName() {
+        return driverName;
+    }
+
+    public void setDriverName(String driverName) {
+        this.driverName = driverName;
+    }
+
+    public String getfFeeName() {
+        return fFeeName;
+    }
+
+    public void setfFeeName(String fFeeName) {
+        this.fFeeName = fFeeName;
+    }
+
+    public Float getfAmtdr() {
+        return fAmtdr;
+    }
+
+    public void setfAmtdr(Float fAmtdr) {
+        this.fAmtdr = fAmtdr;
+    }
+
+    public Float getfAmt() {
+        return fAmt;
+    }
+
+    public void setfAmt(Float fAmt) {
+        this.fAmt = fAmt;
+    }
+
+    @Override
+    public String toString() {
+        return "FTmsaccbillsFeesItemsExcel{" +
+                "fFeesName='" + fFeesName + '\'' +
+                ", fMblno='" + fMblno + '\'' +
+                ", amt=" + amt +
+                ", orderNo='" + orderNo + '\'' +
+                ", carregNo='" + carregNo + '\'' +
+                ", billType='" + billType + '\'' +
+                ", loadAddr='" + loadAddr + '\'' +
+                ", mdLoadAddr='" + mdLoadAddr + '\'' +
+                ", acceptDate=" + acceptDate +
+                ", fQty='" + fQty + '\'' +
+                ", cntrId='" + cntrId + '\'' +
+                ", driverName='" + driverName + '\'' +
+                ", fFeeName='" + fFeeName + '\'' +
+                ", fAmtdr='" + fAmtdr + '\'' +
+                ", fAmt='" + fAmt + '\'' +
+                '}';
+    }
+}