From 19b8481dd1b30368f97a2a983f61ff93a340a98c Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 10 十一月 2023 18:28:20 +0800
Subject: [PATCH] 代码提交
---
ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceFundService.java | 3 ++-
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java | 24 +++++++++++++++---------
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java | 18 ++++++++++++++----
3 files changed, 31 insertions(+), 14 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
index 39789a9..c4f23c9 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
@@ -1,6 +1,7 @@
package com.ruoyi.web.controller.project;
import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
@@ -13,6 +14,7 @@
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.tax.TaxtUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
@@ -2126,12 +2128,20 @@
@PostMapping("/totaltax")
@RepeatSubmit
public AjaxResult totaltax(@RequestBody TotalTaxVO totalTaxVO) {
- Boolean totaltax = serviceFundService.totaltax(totalTaxVO);
- if (totaltax) {
- return AjaxResult.success("鍚堣涓◣鎴愬姛,璇峰幓E:\\OPO\\WEB\\Upload\\download 涓煡鎵炬枃浠�");
+ Map<String, List<ServiceFunddetailExcel>> totaltax = serviceFundService.totaltax(totalTaxVO);
+ if (ObjectUtils.isEmpty(totaltax)) {
+ throw new BaseException("鍚堣涓◣澶辫触");
}
- return AjaxResult.success("鍚堣澶辫触锛岃绋嶅悗閲嶈瘯");
+ Set<String> strings = totaltax.keySet();
+ String key2 = null;
+ for (String key : strings) {
+ key2 = key;
+ }
+ ExcelUtil<ServiceFunddetailExcel> util = new ExcelUtil<ServiceFunddetailExcel>(ServiceFunddetailExcel.class);
+ return AjaxResult.success(util.exportExcel(totaltax.get(key2), key2));
+
+
}
}
diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceFundService.java b/ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceFundService.java
index 85836bb..af3b14b 100644
--- a/ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceFundService.java
+++ b/ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceFundService.java
@@ -6,6 +6,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.project.domain.ServiceFund;
import com.ruoyi.project.domain.ServiceFunddetail;
+import com.ruoyi.project.domain.ServiceFunddetailExcel;
import com.ruoyi.project.domain.vo.*;
import org.springframework.web.bind.annotation.PathVariable;
@@ -66,6 +67,6 @@
*/
Map<String, Long> performance(ServiceFundVO serviceFundVO);
- Boolean totaltax(TotalTaxVO totalTaxVO);
+ Map<String, List<ServiceFunddetailExcel>> totaltax(TotalTaxVO totalTaxVO);
}
\ No newline at end of file
diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java
index 2e2f0b6..d0a0f78 100644
--- a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java
+++ b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java
@@ -758,7 +758,9 @@
}
@Override
- public Boolean totaltax(TotalTaxVO totalTaxVO) {
+ public Map<String, List<ServiceFunddetailExcel>> totaltax(TotalTaxVO totalTaxVO) {
+ Map<String, List<ServiceFunddetailExcel>> map = new HashMap<>();
+
if (totalTaxVO.getIsTaxAfter() == null) {
//濡備綍涓虹┖锛岄粯璁ゅ綋娌℃湁绠楄繃绋庯紝杩涜鍚堣
totalTaxVO.setIsTaxAfter(0);
@@ -770,8 +772,6 @@
//鐢ㄤ簬杩斿洖excel
List<ServiceFunddetailExcel> serviceFunddetailList = new ArrayList<>();
- //鎵撳嵃excel
- ExcelUtil<ServiceFunddetailExcel> util = new ExcelUtil<ServiceFunddetailExcel>(ServiceFunddetailExcel.class);
if (totalTaxVO.getIsTaxAfter() == 1) {
//閫氳繃鍙楃泭浜哄悕绉帮紝灏嗙◣鍓嶃�佺◣鍚庣殑鍊肩浉鍔�
@@ -796,8 +796,10 @@
}
serviceFunddetailList.add(serviceFunddetailExcel);
}
- //鎵撳嵃绠楄繃绋庝箣鍚庣殑锛屽悎璁xcel
- util.exportExcel(serviceFunddetailList, "鍚堣涓◣锛堢◣鍚庯級");
+ //杩斿洖绠楄繃绋庝箣鍚庣殑锛屽悎璁�
+ map.put("鍚堣涓◣锛堢◣鍚庯級", serviceFunddetailList);
+ return map;
+
} else {
a:
for (ServiceFunddetail serviceFunddetail : serviceFunddetails) {
@@ -814,7 +816,11 @@
for (ServiceFunddetail serviceFunddetail2 : serviceFunddetails) {
if (StringUtils.isEmpty(serviceFunddetail2.getServicesscopename())) {
- throw new BaseException("鏈嶅姟璇存槑涓虹┖,璇锋鏌ュ悗鍐嶈绠�");
+ ServiceFund serviceFund = null;
+ if (serviceFunddetail2.getFundid() == null) {
+ serviceFund = serviceFundMapper.selectById(serviceFunddetail2.getFundid());
+ }
+ throw new BaseException("鏈嶅姟璇存槑涓虹┖,璇锋鏌ュ悗鍐嶈绠�,鎹愮尞鑰呬负 :" + serviceFund.getDonorname());
}
if (serviceFunddetail.getBeneficiaryname().equals(serviceFunddetail2.getBeneficiaryname()) && !(serviceFunddetail2.getServicesscopename().equals("绋庡悗"))) {
//绱绋庡墠
@@ -856,10 +862,10 @@
if (ObjectUtils.isNotEmpty(sfeAfter.getBeneficiaryname())) serviceFunddetailList.add(sfeAfter);
}
- //鎵撳嵃绠楃◣涔嬪墠鐨勶紝鍚堣excel
- util.exportExcel(serviceFunddetailList, "鍚堣涓◣锛堢◣鍓嶏級");
+ //杩斿洖绠楃◣涔嬪墠鐨勶紝鍚堣
+ map.put("鍚堣涓◣锛堢◣鍓嶏級", serviceFunddetailList);
+ return map;
}
- return true;
}
--
Gitblit v1.9.3