From edbfa6b1a3a45e79cb17b06f3798535c3b1ba395 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期三, 18 十一月 2026 09:12:39 +0800
Subject: [PATCH] 修改了增值税城建税
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java | 202 +++++++++++++++++++++++++++++--------------------
1 files changed, 119 insertions(+), 83 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 67edad5..6f70343 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
@@ -9,6 +9,7 @@
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
@@ -146,11 +147,47 @@
@GetMapping("/list")
public TableDataInfo list(ServiceFund serviceFund) {
startPage();
- //List<ServiceFund> list = serviceFundService.queryList(serviceFund);
SysUser user = SecurityUtils.getLoginUser().getUser();
- serviceFund.setUsername(user.getNickName());
+ // 2026-11-10锛氭寜瑙掕壊鍒掑垎鍙鑼冨洿锛堝師瀹炵幇涓�寰嬪彧鏌�"鐢宠浜�=鏈汉"锛岀鐞嗗憳/缁勯暱鐪嬩笉鍒板埆浜虹殑鍗曟嵁锛�
+ applyFundDataScope(serviceFund, user);
List<ServiceFund> list = serviceFundService.selectServiceFundList(serviceFund);
return getDataTable(list);
+ }
+
+ /**
+ * 鎶ラ攢鍗曞垪琛ㄦ暟鎹寖鍥达細
+ * 瓒呯锛坲ser_id=1 鎴� role_id=1锛夆啋 鍏ㄩ儴锛�
+ * 涓氬姟缁勯暱锛坮ole_id=13锛夆啋 鏈粍锛圖eptmentNo = 鐧诲綍浜烘墍灞為儴闂級锛�
+ * 鍏朵粬锛堜笓鑱屼汉鍛樼瓑锛夆啋 鏈汉锛圲serName = 鐧诲綍浜烘樀绉帮級銆�
+ */
+ private void applyFundDataScope(ServiceFund serviceFund, SysUser user) {
+ if (user == null) {
+ return;
+ }
+ if (Long.valueOf(1L).equals(user.getUserId()) || hasRole(user, 1L)) {
+ // 瓒呯锛氫笉鍔犱换浣曡繃婊わ紝鐪嬪叏閮�
+ return;
+ }
+ if (hasRole(user, 13L) && user.getDeptId() != null) {
+ // 涓氬姟缁勯暱锛氱湅鏈粍
+ serviceFund.setDeptmentno(String.valueOf(user.getDeptId()));
+ return;
+ }
+ // 榛樿锛氬彧鐪嬫湰浜�
+ serviceFund.setUsername(user.getNickName());
+ }
+
+ /** 鍒ゆ柇鐧诲綍浜烘槸鍚︽嫢鏈夋寚瀹氳鑹� */
+ private boolean hasRole(SysUser user, Long roleId) {
+ if (user == null || user.getRoles() == null) {
+ return false;
+ }
+ for (SysRole role : user.getRoles()) {
+ if (role != null && roleId.equals(role.getRoleId())) {
+ return true;
+ }
+ }
+ return false;
}
@GetMapping("/listnew")
@@ -322,6 +359,23 @@
return AjaxResult.success(serviceFundService.addOrUpdateNew(serviceFundVO));
}
+ /**
+ * 涓撳鍔冲姟璐癸細淇濆瓨鍓嶇殑璐圭敤鎺у埗鏍¢獙锛堝共璺戯紝涓嶈惤搴擄級
+ *
+ * <p>渚涗笓瀹跺姵鍔¤垂濉姤椤靛湪鐐光�滀繚瀛樷�濆墠璋冪敤锛屾妸 9 鏉¤鍒欑殑鏍¢獙缁撴灉
+ * 锛坋rrors 闃绘柇 / warnings 鎻愮ず锛夎繑鍥炲墠绔睍绀猴紱鐪熸鐨勮惤搴撴嫤鎴湪 addOrUpdateNew 涓��
+ */
+ @ApiOperation("涓撳鍔冲姟璐逛繚瀛樺墠鏍¢獙")
+ @PostMapping("/validateExpertFee")
+ public AjaxResult validateExpertFee(@RequestBody ServiceFundVO serviceFundVO) {
+ ExpertFeeCheckResult result = serviceFundService.validateExpertFee(serviceFundVO);
+ AjaxResult ajaxResult = AjaxResult.success();
+ ajaxResult.put("errors", result.getErrors());
+ ajaxResult.put("warnings", result.getWarnings());
+ ajaxResult.put("blocked", result.hasError());
+ return ajaxResult;
+ }
+
/**
* 瀹℃牳璐圭敤
@@ -475,18 +529,16 @@
//杈撳嚭鏂囨。璺緞鍙婂悕绉�
File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
- Writer out = null;
-
- try {
- out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"));
-
- } catch (FileNotFoundException e1) {
- e1.printStackTrace();
+ if (t == null) {
+ throw new ServiceException("妯℃澘鍔犺浇澶辫触锛岃妫�鏌ユā鏉挎枃浠舵槸鍚﹀瓨鍦�", HttpStatus.NO_CONTENT);
}
- try {
+
+ // Writer 蹇呴』鍏抽棴/鍒锋柊锛欱ufferedWriter 甯︾紦鍐诧紝涓嶅叧闂細閫犳垚鏂囦欢鍙ユ焺娉勬紡涓斿唴瀹瑰彲鑳戒笉瀹屾暣
+ try (Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"))) {
t.process(dataMap, out);
- } catch (TemplateException e) {
- e.printStackTrace();
+ } catch (TemplateException | IOException e) {
+ log.error("鐢熸垚妯℃澘鏂囨。澶辫触, name={}", name, e);
+ throw new ServiceException("鐢熸垚鏂囨。澶辫触", HttpStatus.ERROR);
}
Map<String, Object> map = new HashMap<>();
map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc");
@@ -659,18 +711,16 @@
//杈撳嚭鏂囨。璺緞鍙婂悕绉�
File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
- Writer out = null;
-
- try {
- out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"));
-
- } catch (FileNotFoundException e1) {
- e1.printStackTrace();
+ if (t == null) {
+ throw new ServiceException("妯℃澘鍔犺浇澶辫触锛岃妫�鏌ユā鏉挎枃浠舵槸鍚﹀瓨鍦�", HttpStatus.NO_CONTENT);
}
- try {
+
+ // Writer 蹇呴』鍏抽棴/鍒锋柊锛欱ufferedWriter 甯︾紦鍐诧紝涓嶅叧闂細閫犳垚鏂囦欢鍙ユ焺娉勬紡涓斿唴瀹瑰彲鑳戒笉瀹屾暣
+ try (Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"))) {
t.process(dataMap, out);
- } catch (TemplateException e) {
- e.printStackTrace();
+ } catch (TemplateException | IOException e) {
+ log.error("鐢熸垚妯℃澘鏂囨。澶辫触, name={}", name, e);
+ throw new ServiceException("鐢熸垚鏂囨。澶辫触", HttpStatus.ERROR);
}
Map<String, Object> map = new HashMap<>();
map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc");
@@ -756,18 +806,16 @@
//杈撳嚭鏂囨。璺緞鍙婂悕绉�
File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
- Writer out = null;
-
- try {
- out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"));
-
- } catch (FileNotFoundException e1) {
- e1.printStackTrace();
+ if (t == null) {
+ throw new ServiceException("妯℃澘鍔犺浇澶辫触锛岃妫�鏌ユā鏉挎枃浠舵槸鍚﹀瓨鍦�", HttpStatus.NO_CONTENT);
}
- try {
+
+ // Writer 蹇呴』鍏抽棴/鍒锋柊锛欱ufferedWriter 甯︾紦鍐诧紝涓嶅叧闂細閫犳垚鏂囦欢鍙ユ焺娉勬紡涓斿唴瀹瑰彲鑳戒笉瀹屾暣
+ try (Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"))) {
t.process(dataMap, out);
- } catch (TemplateException e) {
- e.printStackTrace();
+ } catch (TemplateException | IOException e) {
+ log.error("鐢熸垚妯℃澘鏂囨。澶辫触, name={}", name, e);
+ throw new ServiceException("鐢熸垚鏂囨。澶辫触", HttpStatus.ERROR);
}
Map<String, Object> map = new HashMap<>();
map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc");
@@ -858,20 +906,16 @@
}
//杈撳嚭鏂囨。璺緞鍙婂悕绉�
File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
- Writer out = null;
- try {
- out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"));
-
- } catch (FileNotFoundException e1) {
- log.error("FileNotFoundException鎶ラ敊淇℃伅鏄細{}", e1.getMessage());
-// e1.printStackTrace();
+ if (t == null) {
+ throw new ServiceException("妯℃澘鍔犺浇澶辫触锛岃妫�鏌ユā鏉挎枃浠舵槸鍚﹀瓨鍦�", HttpStatus.NO_CONTENT);
}
- try {
+ // Writer 蹇呴』鍏抽棴/鍒锋柊锛欱ufferedWriter 甯︾紦鍐诧紝涓嶅叧闂細閫犳垚鏂囦欢鍙ユ焺娉勬紡涓斿唴瀹瑰彲鑳戒笉瀹屾暣
+ try (Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"))) {
t.process(dataMap, out);
- } catch (TemplateException e) {
- log.error("TemplateException鎶ラ敊淇¤嚜鏄細{}", e.getMessage());
- e.getMessage();
+ } catch (TemplateException | IOException e) {
+ log.error("鐢熸垚妯℃澘鏂囨。澶辫触, name={}", name, e);
+ throw new ServiceException("鐢熸垚鏂囨。澶辫触", HttpStatus.ERROR);
}
Map<String, Object> map = new HashMap<>();
map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc");
@@ -1083,18 +1127,16 @@
//杈撳嚭鏂囨。璺緞鍙婂悕绉�
File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
- Writer out = null;
-
- try {
- out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"));
-
- } catch (FileNotFoundException e1) {
- e1.printStackTrace();
+ if (t == null) {
+ throw new ServiceException("妯℃澘鍔犺浇澶辫触锛岃妫�鏌ユā鏉挎枃浠舵槸鍚﹀瓨鍦�", HttpStatus.NO_CONTENT);
}
- try {
+
+ // Writer 蹇呴』鍏抽棴/鍒锋柊锛欱ufferedWriter 甯︾紦鍐诧紝涓嶅叧闂細閫犳垚鏂囦欢鍙ユ焺娉勬紡涓斿唴瀹瑰彲鑳戒笉瀹屾暣
+ try (Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"))) {
t.process(dataMap, out);
- } catch (TemplateException e) {
- e.printStackTrace();
+ } catch (TemplateException | IOException e) {
+ log.error("鐢熸垚妯℃澘鏂囨。澶辫触, name={}", name, e);
+ throw new ServiceException("鐢熸垚鏂囨。澶辫触", HttpStatus.ERROR);
}
Map<String, Object> map = new HashMap<>();
map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc");
@@ -1152,18 +1194,16 @@
//杈撳嚭鏂囨。璺緞鍙婂悕绉�
File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
- Writer out = null;
-
- try {
- out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"));
-
- } catch (FileNotFoundException e1) {
- e1.printStackTrace();
+ if (t == null) {
+ throw new ServiceException("妯℃澘鍔犺浇澶辫触锛岃妫�鏌ユā鏉挎枃浠舵槸鍚﹀瓨鍦�", HttpStatus.NO_CONTENT);
}
- try {
+
+ // Writer 蹇呴』鍏抽棴/鍒锋柊锛欱ufferedWriter 甯︾紦鍐诧紝涓嶅叧闂細閫犳垚鏂囦欢鍙ユ焺娉勬紡涓斿唴瀹瑰彲鑳戒笉瀹屾暣
+ try (Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"))) {
t.process(dataMap, out);
- } catch (TemplateException e) {
- e.printStackTrace();
+ } catch (TemplateException | IOException e) {
+ log.error("鐢熸垚妯℃澘鏂囨。澶辫触, name={}", name, e);
+ throw new ServiceException("鐢熸垚鏂囨。澶辫触", HttpStatus.ERROR);
}
Map<String, Object> map = new HashMap<>();
map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc");
@@ -1652,18 +1692,16 @@
//杈撳嚭鏂囨。璺緞鍙婂悕绉�
File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
- Writer out = null;
-
- try {
- out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"));
-
- } catch (FileNotFoundException e1) {
- e1.printStackTrace();
+ if (t == null) {
+ throw new ServiceException("妯℃澘鍔犺浇澶辫触锛岃妫�鏌ユā鏉挎枃浠舵槸鍚﹀瓨鍦�", HttpStatus.NO_CONTENT);
}
- try {
+
+ // Writer 蹇呴』鍏抽棴/鍒锋柊锛欱ufferedWriter 甯︾紦鍐诧紝涓嶅叧闂細閫犳垚鏂囦欢鍙ユ焺娉勬紡涓斿唴瀹瑰彲鑳戒笉瀹屾暣
+ try (Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"))) {
t.process(dataMap, out);
- } catch (TemplateException e) {
- e.printStackTrace();
+ } catch (TemplateException | IOException e) {
+ log.error("鐢熸垚妯℃澘鏂囨。澶辫触, name={}", name, e);
+ throw new ServiceException("鐢熸垚鏂囨。澶辫触", HttpStatus.ERROR);
}
Map<String, Object> map = new HashMap<>();
map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc");
@@ -1741,18 +1779,16 @@
//杈撳嚭鏂囨。璺緞鍙婂悕绉�
File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
- Writer out = null;
-
- try {
- out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"));
-
- } catch (FileNotFoundException e1) {
- e1.printStackTrace();
+ if (t == null) {
+ throw new ServiceException("妯℃澘鍔犺浇澶辫触锛岃妫�鏌ユā鏉挎枃浠舵槸鍚﹀瓨鍦�", HttpStatus.NO_CONTENT);
}
- try {
+
+ // Writer 蹇呴』鍏抽棴/鍒锋柊锛欱ufferedWriter 甯︾紦鍐诧紝涓嶅叧闂細閫犳垚鏂囦欢鍙ユ焺娉勬紡涓斿唴瀹瑰彲鑳戒笉瀹屾暣
+ try (Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"))) {
t.process(dataMap, out);
- } catch (TemplateException e) {
- e.printStackTrace();
+ } catch (TemplateException | IOException e) {
+ log.error("鐢熸垚妯℃澘鏂囨。澶辫触, name={}", name, e);
+ throw new ServiceException("鐢熸垚鏂囨。澶辫触", HttpStatus.ERROR);
}
Map<String, Object> map = new HashMap<>();
map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc");
--
Gitblit v1.9.3