瀏覽代碼

1.财务开票按开票类型导出
2.实收款与大中型导出排序调整

GouGengquan 10 月之前
父節點
當前提交
234ad25869

+ 11 - 0
biz-base/src/main/java/com/dayou/controller/FinanceInvoiceController.java

@@ -12,6 +12,8 @@ import com.dayou.entity.FinanceInvoice;
 import com.dayou.common.RestResponse;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -37,6 +39,15 @@ public class FinanceInvoiceController extends BaseController {
     }
 
     /**
+     * 财务开票列表
+     */
+    @GetMapping("/export")
+    public void page(FinanceInvoice financeInvoice, String keyword, HttpServletResponse response) throws IOException {
+        List<FinanceInvoiceVo> result =financeInvoiceService.exportPage(financeInvoice, keyword);
+        exportPlus(response,financeInvoice.getState() + "发票",result,FinanceInvoiceVo.class);
+    }
+
+    /**
      * 财务开票详情
      */
     @GetMapping("/{id}")

+ 8 - 0
dao/src/main/java/com/dayou/mapper/FinanceInvoiceMapper.java

@@ -21,6 +21,14 @@ public interface FinanceInvoiceMapper extends CustomBaseMapper<FinanceInvoice> {
 
     Page<FinanceInvoiceVo> getPage(Page page, @Param("vo") FinanceInvoice financeInvoice, @Param("keyword") String keyword);
 
+    /**
+     * 开票信息导出
+     * @param financeInvoice 查询条件
+     * @param keyword 关键
+     * @return List<FinanceInvoiceVo>
+     */
+    List<FinanceInvoiceVo> exportPage(@Param("vo") FinanceInvoice financeInvoice, @Param("keyword") String keyword);
+
     List<FinanceInvoiceVo> getInvoiceAmountInfo(@Param("dto") MajorProductionSimpleDTO simpleDTO);
 
     List<FinanceInvoiceVo> getInvoiceAmountInfoEmptyProduction(@Param("dto") MajorProductionSimpleDTO simpleDTO);

+ 4 - 2
dao/src/main/resources/mapper/FinanceClaimMapper.xml

@@ -161,15 +161,17 @@
         <if test="majorStat!=null and majorStat.financial!=null ">
             and m.financial = #{majorStat.financial}
         </if>
-        ORDER BY
-        fc.claim_datetime DESC
     </sql>
     <select id="majorStat" parameterType="com.dayou.vo.RealFundMajorStatVO" resultType="com.dayou.vo.RealFundMajorStatVO">
         <include refid="majorStatQuery" />
+        ORDER BY
+        fc.claim_datetime DESC
     </select>
 
     <select id="majorStatExport" parameterType="com.dayou.vo.RealFundMajorStatVO" resultType="com.dayou.vo.RealFundMajorStatVO">
         <include refid="majorStatQuery" />
+        ORDER BY
+        fc.claim_datetime ASC
     </select>
 
     <!--资产实收款统计-->

+ 25 - 13
dao/src/main/resources/mapper/FinanceInvoiceMapper.xml

@@ -42,24 +42,26 @@
         production_fund_id, title, type, tax_no, plan_amount, real_amount, plan_make_date, real_make_date, state, reason, apply_id, checker_id, maker_id, bank_name, bank_account, bank_address, bank_tel, make_item, item_quantity, item_unit, tax_rate, tax_amount, remark
     </sql>
 
-    <select id="getPage" parameterType="com.dayou.entity.FinanceInvoice" resultType="com.dayou.vo.FinanceInvoiceVo">
+    <!--开票列表查询Sql-->
+    <sql id="getPageSql">
         SELECT
-            fi.*,
-            (case orf.business_type when 'ASSET_BUSINESS' THEN '资产业务' WHEN 'MAJOR_BUSINESS' THEN '大中型业务' else '个贷业务' end) as businessType,
-            orf.order_id,
-            orf.order_name,
-            (orf.should_amount=orf.real_amount) as isPayAll,
-            u.name AS applyName,
+        fi.*,
+        fi.created AS createTime,
+        (case orf.business_type when 'ASSET_BUSINESS' THEN '资产业务' WHEN 'MAJOR_BUSINESS' THEN '大中型业务' else '个贷业务' end) as businessType,
+        orf.order_id,
+        orf.order_name,
+        (orf.should_amount=orf.real_amount) as isPayAll,
+        u.name AS applyName,
         pf.production_no
         FROM
-            finance_invoice fi
-                LEFT JOIN order_fund orf ON fi.order_fund_id = orf.id
-                LEFT JOIN user u ON u.id = fi.apply_id
+        finance_invoice fi
+        LEFT JOIN order_fund orf ON fi.order_fund_id = orf.id
+        LEFT JOIN user u ON u.id = fi.apply_id
         left join production_fund pf on pf.id = fi.production_fund_id
         where fi.deleted = 0 and orf.deleted = 0
-          <if test="vo!=null and vo.state!=null and vo.state!='' and vo.state=='审核中' ">
-              and (fi.state = '申请作废' or fi.state = '审核中')
-          </if>
+        <if test="vo!=null and vo.state!=null and vo.state!='' and vo.state=='审核中' ">
+            and (fi.state = '申请作废' or fi.state = '审核中')
+        </if>
         <if test="vo!=null and vo.state!=null and vo.state!='' and vo.state!='审核中' ">
             and fi.state = #{vo.state}
         </if>
@@ -91,6 +93,16 @@
             and fi.created &lt;= #{vo.aEndDate}
         </if>
         order by fi.created DESC
+    </sql>
+
+    <!--开票分页查询-->
+    <select id="getPage" parameterType="com.dayou.entity.FinanceInvoice" resultType="com.dayou.vo.FinanceInvoiceVo">
+        <include refid="getPageSql" />
+    </select>
+
+    <!--开票信息导出-->
+    <select id="exportPage" resultType="com.dayou.vo.FinanceInvoiceVo">
+        <include refid="getPageSql" />
     </select>
 
     <select id="getInvoiceAmountInfo" parameterType="com.dayou.dto.MajorProductionSimpleDTO" resultType="com.dayou.vo.FinanceInvoiceVo">

+ 3 - 2
dao/src/main/resources/mapper/FinanceRealFundMapper.xml

@@ -74,8 +74,6 @@
         <if test="vo!=null and vo.xEndDate!=null and vo.xEndDate!=''">
             and frf.created &lt;= #{vo.xEndDate}
         </if>
-        ORDER BY
-        ifnull(t.ca,0) ASC ,frf.created DESC
     </sql>
 
     <sql id="pageListSql1">
@@ -150,6 +148,8 @@
 
     <select id="getPage" parameterType="com.dayou.entity.FinanceRealFund" resultType="com.dayou.vo.FinanceRealFundVO">
         <include refid="pageListSql" />
+        ORDER BY
+        ifnull(t.ca,0) ASC ,frf.created DESC
     </select>
 
     <select id="claimPage" resultMap="realAmountClaimMap">
@@ -1847,5 +1847,6 @@
 
     <select id="exportList" parameterType="com.dayou.entity.FinanceRealFund" resultType="com.dayou.dto.FinanceRealFundExportDTO">
         <include refid="pageListSql" />
+        ORDER BY frf.pay_datetime DESC
     </select>
 </mapper>

+ 21 - 7
domain/src/main/java/com/dayou/entity/FinanceInvoice.java

@@ -47,6 +47,7 @@ public class FinanceInvoice extends BaseEntity {
     @ImportCell
     @ExportCell(columnName = "发票抬头")
     @LuceneSearchable
+    @Excel(name = "发票抬头")
     private String title;
 
     /**
@@ -62,6 +63,7 @@ public class FinanceInvoice extends BaseEntity {
     @ImportCell
     @ExportCell(columnName = "税号")
     @LuceneSearchable("tax_no")
+    @Excel(name = "税号")
     private String taxNo;
 
     /**
@@ -69,6 +71,7 @@ public class FinanceInvoice extends BaseEntity {
      */
     @ImportCell
     @ExportCell(columnName = "计划开票金额")
+    @Excel(name = "计划开票金额")
     private BigDecimal planAmount;
 
     /**
@@ -83,6 +86,7 @@ public class FinanceInvoice extends BaseEntity {
      */
     @ImportCell
     @ExportCell(columnName = "计划开票日期")
+    @Excel(name = "计划开票日期")
     private LocalDate planMakeDate;
 
     /**
@@ -97,6 +101,7 @@ public class FinanceInvoice extends BaseEntity {
      */
     @ImportCell
     @ExportCell(columnName = "开票状态(审核中,驳回,作废,待开票,已开票)")
+    @Excel(name = "开票状态")
     private String state;
 
     /**
@@ -191,30 +196,39 @@ public class FinanceInvoice extends BaseEntity {
     @ExportCell(columnName = "发票号码")
     private String ticketNo;
 
-    /**
-     * 备注
-     */
-    @ImportCell
-    @ExportCell(columnName = "备注")
-    private String remark;
-
+    @Excel(name = "订单号")
     @TableField(exist = false)
     private String orderId;
+
+    @Excel(name = "订单名称")
     @TableField(exist = false)
     private String orderName;
+
+    @Excel(name = "申请人")
     @TableField(exist = false)
     private String applyName;
+
     @TableField(exist = false)
     private Boolean isPayAll;
 
     @TableField(exist = false)
     private String pStartDate;
+
     @TableField(exist = false)
     private String pEndDate;
 
     @TableField(exist = false)
     private String aStartDate;
+
     @TableField(exist = false)
     private String aEndDate;
 
+    /**
+     * 备注
+     */
+    @ImportCell
+    @ExportCell(columnName = "备注")
+    @Excel(name = "备注")
+    private String remark;
+
 }

+ 13 - 0
domain/src/main/java/com/dayou/vo/FinanceInvoiceVo.java

@@ -1,9 +1,14 @@
 package com.dayou.vo;
 
+import com.dayou.annotation.Excel;
 import com.dayou.entity.FinanceInvoice;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.Date;
 
 @Data
 public class FinanceInvoiceVo extends FinanceInvoice {
@@ -11,11 +16,13 @@ public class FinanceInvoiceVo extends FinanceInvoice {
     /**
      * 业务类型
      */
+    @Excel(name = "业务类型")
     private String businessType;
 
     /**
      * 产品号
      */
+    @Excel(name = "产品号")
     private String productionNo;
 
     /**
@@ -43,6 +50,12 @@ public class FinanceInvoiceVo extends FinanceInvoice {
      */
     private BigDecimal standardAmount;
 
+    /**
+     * 申请时间
+     */
+    @Excel(name = "申请时间")
+    private LocalDateTime createTime;
+
 
 
 }

+ 16 - 7
service/src/main/java/com/dayou/service/IFinanceInvoiceService.java

@@ -1,4 +1,5 @@
 package com.dayou.service;
+
 import com.dayou.dto.MajorProductionSimpleDTO;
 import com.dayou.entity.FinanceInvoice;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -20,21 +21,29 @@ import java.util.List;
  */
 public interface IFinanceInvoiceService extends IService<FinanceInvoice> {
 
-        Page<FinanceInvoiceVo> selectPage(Page page, FinanceInvoice financeInvoice, String keyword);
+    Page<FinanceInvoiceVo> selectPage(Page page, FinanceInvoice financeInvoice, String keyword);
+
+    /**
+     * 开票信息导出
+     * @param financeInvoice 查询条件
+     * @param keyword 关键
+     * @return List<FinanceInvoiceVo>
+     */
+    List<FinanceInvoiceVo> exportPage(FinanceInvoice financeInvoice, String keyword);
 
-        FinanceInvoice detail(Long id);
+    FinanceInvoice detail(Long id);
 
-        Boolean add(FinanceInvoice financeInvoice);
+    Boolean add(FinanceInvoice financeInvoice);
 
-        Boolean update(FinanceInvoice financeInvoice);
+    Boolean update(FinanceInvoice financeInvoice);
 
-        Boolean invoiceCheck(FinanceInvoice financeInvoice);
+    Boolean invoiceCheck(FinanceInvoice financeInvoice);
 
-        Boolean delete(Long id);
+    Boolean delete(Long id);
 
     List<FinanceInvoice> getList(Long id, Long productionFundId);
 
-        Boolean cancellation(FinanceInvoice financeInvoice);
+    Boolean cancellation(FinanceInvoice financeInvoice);
 
     List<FinanceInvoiceVo> getInvoiceAmountInfo(MajorProductionSimpleDTO simpleDTO);
 

+ 11 - 0
service/src/main/java/com/dayou/service/impl/FinanceInvoiceServiceImpl.java

@@ -66,6 +66,17 @@ public class FinanceInvoiceServiceImpl extends ServiceImpl<FinanceInvoiceMapper,
         return ret;
     }
 
+    /**
+     * 开票信息导出
+     * @param financeInvoice 查询条件
+     * @param keyword 关键
+     * @return List<FinanceInvoiceVo>
+     */
+    @Override
+    public List<FinanceInvoiceVo> exportPage(FinanceInvoice financeInvoice, String keyword) {
+        return financeInvoiceMapper.exportPage(financeInvoice, keyword);
+    }
+
 
     @Override
     public FinanceInvoice detail(Long id){