浏览代码

账单明细新增新增费用名称、结算方式查询

sunhz 3 年之前
父节点
当前提交
7541b75199

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

@@ -85,7 +85,7 @@ public class ReceivableController extends BaseController {
         feeDTO.setFDc("D");
         List<GeneralLedgerDetailExcel> list = tFeeService.financialLedgerDetailsExport(feeDTO);
         ExcelUtil<GeneralLedgerDetailExcel> util = new ExcelUtil<GeneralLedgerDetailExcel>(GeneralLedgerDetailExcel.class);
-        return util.exportExcel(list, "应总账明细");
+        return util.exportExcel(list, "应总账明细");
     }
 
 

+ 13 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehousebillsfees.java

@@ -318,6 +318,19 @@ public class TWarehousebillsfees extends BaseEntity {
     }
 
     /**
+     * 费用列表
+     */
+    private List<Long> fFeeids;
+
+    public List<Long> getfFeeids() {
+        return fFeeids;
+    }
+
+    public void setfFeeids(List<Long> fFeeids) {
+        this.fFeeids = fFeeids;
+    }
+
+    /**
      * 是否可修改 0 手动录入
      */
     private Long fSrcTypeId;

+ 14 - 20
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/excel/ListMapToBeanUtils.java

@@ -1,7 +1,10 @@
 package com.ruoyi.warehouseBusiness.excel;
 
-import java.lang.reflect.Field;
-import java.util.ArrayList;
+import cn.hutool.core.bean.BeanUtil;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.compress.utils.Lists;
+import org.springframework.beans.BeanUtils;
+
 import java.util.List;
 import java.util.Map;
 
@@ -10,30 +13,21 @@ public class ListMapToBeanUtils {
      * List<Map<String, Object>>转List<T>
      */
     public static <T> List<T> castMapToBean(List<Map<String, Object>> list, Class<T> clazz) throws Exception {
+
         if (list == null || list.size()==0) {
             return null;
         }
-        List<T> tList = new ArrayList<T>();
-        // 获取类中声明的所有字段
-        Field[] fields = clazz.getDeclaredFields();
 
-        T t;
-        for (Map<String, Object> map : list) {
-            // 每次都先初始化一遍,然后再设置值
-            t = clazz.newInstance();
-            for (Field field : fields) {
-                // 把序列化的字段去除掉
-                if (!"serialVersionUID".equals(field.getName())) {
-                    // 由于Field都是私有属性,所有需要允许修改
-                    field.setAccessible(true);
-
-                    // 设置值, 类型要和vo中的属性名称对应好,不然会报类型转换错误
-                    field.set(t, map.get(field.getName()));
-                }
+        List<T> output = Lists.newArrayList();
+        if (CollectionUtils.isNotEmpty(list)) {
+            for (Map<String, Object> source : list) {
+                T target = BeanUtils.instantiateClass(clazz);
+                BeanUtil.copyProperties(source, target);
+                output.add(target);
             }
-            tList.add(t); // 把转换好的数据添加到集合中
         }
-        return tList;
+        return output;
+
     }
 
 }

+ 19 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/excel/QueryMenu.java

@@ -1,5 +1,6 @@
 package com.ruoyi.warehouseBusiness.excel;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.common.annotation.Excel;
 
 import java.math.BigDecimal;
@@ -30,11 +31,13 @@ public class QueryMenu {
      * 业务日期
      */
     @Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date fBsdate;
 
     /**
      * 审核日期
      */
+    @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "审核日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date fReviewDate;
 
@@ -96,6 +99,7 @@ public class QueryMenu {
      * 对账日期
      */
     @Excel(name = "对账日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date fAccamountDate;
 
     /**
@@ -135,6 +139,12 @@ public class QueryMenu {
     private String fProductName;
 
     /**
+     * 结算方式
+     */
+    @Excel(name = "结算方式", dictType = "data_stltype_type")
+    private Long fStltypeid;
+
+    /**
      * 备注
      */
     @Excel(name = "备注")
@@ -300,6 +310,14 @@ public class QueryMenu {
         this.fProductName = fProductName;
     }
 
+    public Long getfStltypeid() {
+        return fStltypeid;
+    }
+
+    public void setfStltypeid(Long fStltypeid) {
+        this.fStltypeid = fStltypeid;
+    }
+
     public String getRemark() {
         return remark;
     }
@@ -331,6 +349,7 @@ public class QueryMenu {
                 ", fUnitprice=" + fUnitprice +
                 ", fBilltype='" + fBilltype + '\'' +
                 ", fProductName='" + fProductName + '\'' +
+                ", fStltypeid=" + fStltypeid +
                 ", remark='" + remark + '\'' +
                 '}';
     }

+ 8 - 0
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

@@ -880,6 +880,7 @@
             tf.f_unitprice AS fUnitprice,
             tf.f_billtype AS fBilltype,
             tf.f_product_name AS fProductName,
+            tf.f_stltypeid AS fStltypeid,
             tf.remark AS remark,
             CASE
                 WHEN tf.f_billstatus = '1' THEN '录入'
@@ -897,6 +898,13 @@
             <if test="fDc != null  and fDc != ''">and tf.f_dc = #{fDc}</if>
             <if test="fMblno != null  and fMblno != ''">and tf.f_mblno like concat('%', #{fMblno}, '%')</if>
             <if test="fCorpid != null  and fCorpid != ''">and tf.f_corpid = #{fCorpid}</if>
+            <if test="fStltypeid != null">and tf.f_stltypeid = #{fStltypeid}</if>
+            <if test='fFeeids != null'>
+                and tf.f_feeid in
+                <foreach item="fFeeid" collection="fFeeids" open="(" separator="," close=")">
+                    #{fFeeid}
+                </foreach>
+            </if>
             <if test='fReviewDateList != null and fReviewDateList[0] != null and fReviewDateList[0]!= ""'>
                 and tf.f_review_date &gt;= #{fReviewDateList[0]}
             </if>