From 9c39825700c4ce97e95efdf1524c743fb404751d Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 04 九月 2023 17:34:42 +0800
Subject: [PATCH] 代码提交
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java | 69 ++++++++++++++++++++++++++++------
1 files changed, 56 insertions(+), 13 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 7bf6d64..a708d1e 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
@@ -19,6 +19,7 @@
import com.ruoyi.project.domain.vo.*;
import com.ruoyi.project.mapper.ServiceFunddetailMapper;
import com.ruoyi.project.service.*;
+import com.ruoyi.system.service.ISysPostService;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
@@ -78,6 +79,9 @@
@Autowired
private IServiceExternalpersonService externalpersonService;
+
+ @Autowired
+ private ISysPostService postService;
public ServiceFundController() {
@@ -144,6 +148,11 @@
//startPage();
List<SpFinancialExpensesFundOut> list = serviceFundService.getListBypower(loginUser.getUsername(), 2, APPLICANT, APPLICATIONBEGTIME, APPLICATIONENDTIME, loginUser.getDeptId().toString(), CHECKFLAG, APPLYTYPE);
+ //閫氳繃鎹愮尞鑰呰繃婊�
+ if (StringUtils.isNotEmpty(spFinancialExpensesIn.getDonorname())) {
+ list = list.stream().filter(obj -> obj.getDonorname().contains(spFinancialExpensesIn.getDonorname())).collect(Collectors.toList());
+ }
+
Collections.sort(list, new Comparator<SpFinancialExpensesFundOut>() {
@Override
public int compare(SpFinancialExpensesFundOut o1, SpFinancialExpensesFundOut o2) {
@@ -558,10 +567,10 @@
/**
- * 淇敼璐圭敤鐢宠
+ * 璐圭敤涓婃姤
*/
- @ApiOperation("淇敼璐圭敤鐢宠")
- @Log(title = "璐圭敤鐢宠涓�", businessType = BusinessType.UPDATE)
+ @ApiOperation("璐圭敤涓婃姤")
+ @Log(title = "璐圭敤涓婃姤", businessType = BusinessType.UPDATE)
@PostMapping("/fundEdit")
@RepeatSubmit
public AjaxResult fundEdit(@RequestBody ServiceFund serviceFund) {
@@ -573,7 +582,7 @@
}
for (ServiceFund sf : infoByInfoIdList) {
//濡傛灉绛変簬100锛岃鏄庡凡缁忚蛋鍒板尰闄㈣储鍔¢偅杈逛簡锛涜储鍔¢偅杈瑰彇鏁版嵁鏄粠鍒嗕韩琛ㄥ彇锛屾墍浠ワ紝杩欓噷鐩存帴寰�鍒嗕韩琛ㄩ噷娣诲姞鏁版嵁灏辫浜�
- if (sf.getBackflowlevel() == 199) {
+ if (sf.getBackflowlevel() != null && sf.getBackflowlevel() == 199) {
//灏唂und琛ㄧ殑瀹℃牳鐘舵�佹敼鎴�100
sf.setBackflowlevel(100);
serviceFundService.updateById(sf);
@@ -583,7 +592,30 @@
return success();
} else {
- serviceFund.setFlowlevel(sf.getBackflowlevel());
+
+ Integer TotalLevel = 0;
+ LoginUser loginUser = getLoginUser();
+ SysUser user = loginUser.getUser();
+ List<Integer> postids = postService.selectPostListByUserId(loginUser.getUserId());
+ if (!postids.contains(2)) {
+ serviceFund.setRecordstatus(2);
+ if (serviceFund.getBackflowlevel() != null) {
+ serviceFund.setFlowlevel(serviceFund.getBackflowlevel());
+ } else {
+ serviceFund.setBackflowlevel(1);
+ serviceFund.setFlowlevel(1);
+ }
+ } else {
+ serviceFund.setRecordstatus(0);
+ if (serviceFund.getBackflowlevel() != null) {
+ serviceFund.setFlowlevel(serviceFund.getBackflowlevel());
+ } else {
+ serviceFund.setFlowlevel(0);
+ serviceFund.setBackflowlevel(0);
+ }
+
+ }
+ // serviceFund.setFlowlevel(sf.getBackflowlevel());
boolean bret = serviceFundService.updateById(serviceFund);
log.info("serviceFundService.updateById杩斿弬:{}", bret);
@@ -658,6 +690,7 @@
String date = formatter.format(dt);
String time = date.substring(0, 10);
+ dataMap.put("XZBH", serviceFund.getBh() == null ? "" : serviceFund.getBh());
dataMap.put("TBYYMMDD", time);
dataMap.put("BXDFJ", serviceFund.getAttachcount() == 0 ? " " : serviceFund.getAttachcount());
dataMap.put("JXZXM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname());
@@ -971,7 +1004,7 @@
@GetMapping(value = "/downloadYX/{id}")
public Map downloadInfoYX(@PathVariable("id") Long id) throws IOException {
Map dataMap = new HashMap();
- getDataYX(dataMap, id);
+ String dataYX = getDataYX(dataMap, id);
String filePath = getClass().getResource("/template/").getPath();
System.out.println(filePath);
//璁剧疆妯℃湰瑁呯疆鏂规硶鍜岃矾寰�,FreeMarker鏀寔澶氱妯℃澘瑁呰浇鏂规硶銆傚彲浠ラ噸servlet锛宑lasspath锛屾暟鎹簱鏁欑▼瑁呰浇锛�
@@ -980,15 +1013,22 @@
Template t = null;
try {
//鎹愮尞琛�.ftl涓鸿瑁呰浇鐨勬ā鏉�
-// t = configuration.getTemplate("鍖诲鎴愭湰璐圭敤鐢宠鍗�.ftl");
- t = configuration.getTemplate("鍔炲叕璐圭敤鐢宠鍗�.ftl");
+ //涓撳鍔冲姟璐圭敵璇� 1 浼︾悊璇勪及鍔冲姟璐圭敵璇� 2 鍖诲鎴愭湰璐圭敤鐢宠 3 鍔炲叕璐圭敤鎶ラ攢鐢宠 4
+ if (dataYX.equals("3")) {
+ t = configuration.getTemplate("鍖诲鎴愭湰璐圭敤鐢宠鍗�.ftl");
+ } else if (dataYX.equals("4")) {
+ t = configuration.getTemplate("鍔炲叕璐圭敤鐢宠鍗�.ftl");
+ }
} catch (IOException e) {
e.printStackTrace();
}
String newTime = String.valueOf(Calendar.getInstance().getTimeInMillis());
-// String name = "鍖诲鎴愭湰璐圭敤鐢宠鍗昣" + dataMap.get("XM") + "_" + newTime;
- String name = "鍔炲叕璐圭敤鐢宠鍗昣" + dataMap.get("XM") + "_" + newTime;
-
+ String name = null;
+ if (dataYX.equals("3")) {
+ name = "鍖诲鎴愭湰璐圭敤鐢宠鍗昣" + dataMap.get("XM") + "_" + newTime;
+ } else if (dataYX.equals("4")) {
+ name = "鍔炲叕璐圭敤鐢宠鍗昣" + dataMap.get("XM") + "_" + newTime;
+ }
//杈撳嚭鏂囨。璺緞鍙婂悕绉�
File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
Writer out = null;
@@ -1009,7 +1049,7 @@
return map;
}
- private void getDataYX(Map dataMap, Long id) {
+ private String getDataYX(Map dataMap, Long id) {
ServiceFund serviceFund = serviceFundService.getById(id);
if (serviceFund == null) {
throw new ServiceException("涓嬭浇澶辫触锛岀敤鎴蜂俊鎭嚭閿�", HttpStatus.NO_CONTENT);
@@ -1032,6 +1072,7 @@
List<Map<String, Object>> newList = new ArrayList<Map<String, Object>>();
int seqno = 0;
+ dataMap.put("XZBH", serviceFund.getBh() == null ? "" : serviceFund.getBh());
dataMap.put("TBYYMMDD", time);
dataMap.put("BXDFJ", serviceFund.getAttachcount() == 0 ? " " : serviceFund.getAttachcount());
dataMap.put("JXZXM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname());
@@ -1103,6 +1144,7 @@
dataMap.put("CWBZR2", serviceFund.getFinancedirector() == null ? "" : serviceFund.getFinancedirector());
dataMap.put("CWSH2", serviceFund.getFinancechecher() == null ? "" : serviceFund.getFinancechecher());
+ return serviceFund.getApplytype();
}
public List<Map<String, Object>> checkList(List<Map<String, Object>> list) {
@@ -1737,6 +1779,7 @@
String date = formatter.format(dt);
String time = date.substring(0, 10);
+ dataMap.put("XZBH", serviceFund.getBh() == null ? "" : serviceFund.getBh());
dataMap.put("YYMMDD", time);
dataMap.put("XM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname());
dataMap.put("GZRY", serviceFund.getUsername() == null ? "" : serviceFund.getUsername());
@@ -1823,6 +1866,7 @@
String date = formatter.format(dt);
String time = date.substring(0, 10);
+ dataMap.put("XZBH", serviceFund.getBh() == null ? "" : serviceFund.getBh());
dataMap.put("TBYYMMDD", time);
dataMap.put("BXDFJ", serviceFund.getAttachcount() == 0 ? " " : serviceFund.getAttachcount());
dataMap.put("JXZXM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname());
@@ -1914,6 +1958,5 @@
return AjaxResult.success(serviceFundService.countItem(infoid, itemid));
}
-
}
--
Gitblit v1.9.3