소스 검색

评估发票添加报告号展示功能

徐滕 2 주 전
부모
커밋
6e7a9bfd3c

+ 20 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/controller/FinanceInvoiceController.java

@@ -405,6 +405,26 @@ public class FinanceInvoiceController {
             page.setCurrent (0);
             result = financeInvoiceService.findList (page,financeInvoiceDTO).getRecords();
         }
+        // 导出前拼接项目名称和报告号
+        for (FinanceInvoiceDTO record : result) {
+            if (record.getFinanceInvoiceBaseDTOList() != null && !record.getFinanceInvoiceBaseDTOList().isEmpty()) {
+                String programNameStr = record.getFinanceInvoiceBaseDTOList().stream()
+                    .map(item -> {
+                        if (StringUtils.isBlank(item.getProgramId()) && StringUtils.isNotBlank(item.getProgramName())) {
+                            return "其他:" + item.getProgramName();
+                        }
+                        return item.getProgramName();
+                    })
+                    .filter(StringUtils::isNotBlank)
+                    .collect(Collectors.joining(","));
+                record.setProgramName(programNameStr);
+                String reportNoStr = record.getFinanceInvoiceBaseDTOList().stream()
+                    .map(FinanceInvoiceBaseDTO::getReportNo)
+                    .filter(StringUtils::isNotBlank)
+                    .collect(Collectors.joining(","));
+                record.setReportNo(reportNoStr);
+            }
+        }
         EasyPoiUtil.exportExcel ( result, sheetName,  sheetName, FinanceInvoiceDTO.class, fileName, response );
 
     }

+ 4 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/service/FinanceInvoiceService.java

@@ -335,6 +335,10 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
                 }
             }
         }
+        //报告号模糊搜索
+        if (StringUtils.isNotBlank(financeInvoiceDTO.getReportNo())) {
+            queryWrapper.apply("EXISTS (SELECT 1 FROM finance_invoice_base fib_r WHERE fib_r.invoice_id = fi.id AND fib_r.del_flag = '0' AND fib_r.report_no LIKE CONCAT('%',{0},'%'))", financeInvoiceDTO.getReportNo());
+        }
         //关闭自动查询count
         page.setSearchCount(false);
         //自定义count

+ 3 - 3
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/service/dto/FinanceInvoiceDTO.java

@@ -39,6 +39,9 @@ public class FinanceInvoiceDTO extends BaseDTO {
     @Excel(name = "项目名称",width = 25)
     private String programName;
 
+    @Excel(name = "报告号",width = 20)
+    private String reportNo;
+
     /**
      * 实际开票单位
      */
@@ -119,9 +122,6 @@ public class FinanceInvoiceDTO extends BaseDTO {
     @Excel(name = "项目编号",width = 20)
     private String programNo;
 
-    @Excel(name = "报告号",width = 20)
-    private String reportNo;
-
 
     /**
      * 领票时间