From 34a716e48e49743083953113bfc2e8011d52444f Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 15 九月 2025 19:08:05 +0800
Subject: [PATCH] 日志修改
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java | 326 ++++++++++++++++-------------------------------------
1 files changed, 99 insertions(+), 227 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 d322936..2c26721 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
@@ -20,7 +20,6 @@
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.project.domain.*;
import com.ruoyi.project.domain.vo.*;
-import com.ruoyi.project.mapper.ServiceFunddetailMapper;
import com.ruoyi.project.service.*;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysUserService;
@@ -31,14 +30,7 @@
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Options;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.datasource.DataSourceTransactionManager;
-import org.springframework.transaction.TransactionDefinition;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@@ -67,17 +59,12 @@
@Autowired
private IServiceFundService serviceFundService;
@Autowired
- private IServiceFundSharedService fundSharedService;
- @Autowired
- private ServiceFunddetailMapper serviceFunddetailMapper;
+ private IServiceFundSharedService serviceFundSharedService;
@Autowired
private IServiceFunddetailService serviceFunddetailService;
@Autowired
- private IServiceFunddetailSharedService funddetailSharedService;
- @Autowired
private IServiceFundflowruleService serviceFundflowruleService;
- @Autowired
- private IServiceFundflowService serviceFundflowService;
+
@Autowired
private IServiceDonatebaseinfoService serviceDonatebaseinfoService;
@@ -85,20 +72,10 @@
private IServiceReimbursementService serviceReimbursementService;
@Autowired
- private IServiceSystemmessageService ServiceSystemmessage;
-
- @Autowired
private IServiceExternalpersonService externalpersonService;
@Autowired
private ISysPostService postService;
-
-
- @Autowired
- private DingTalkService dingTalkService;
-
- @Autowired
- private ISysUserService sysUserService;
public ServiceFundController() {
configuration = new Configuration();
@@ -106,10 +83,66 @@
}
/**
+ * 鑷磋繙绯荤粺娴佺▼閫�鍥�
+ *
+ * @param serviceProcessDocVO
+ * @return
+ */
+ @PostMapping("/backdocument")
+ public AjaxResult backDocument(@RequestBody ServiceProcessDocVO serviceProcessDocVO) {
+ log.info("鑷磋繙绯荤粺娴佺▼閫�鍥炲叆鍙傦細{}", serviceProcessDocVO);
+ if (serviceProcessDocVO.getBackCode() == null || StringUtils.isEmpty(serviceProcessDocVO.getApplytype())) {
+ return AjaxResult.error("鍏ヨ兘涓虹┖,璇锋鏌ュ叆鍙�!!");
+ }
+
+ serviceFundService.backDocument(serviceProcessDocVO);
+ return AjaxResult.success("閫�鍥炴垚鍔�");
+ }
+
+
+ /**
+ * 鑷磋繙绯荤粺娴佺▼閫�鍥炲鎵规棩蹇�
+ *
+ * @param serviceProcessVO
+ * @return
+ */
+ @PostMapping("/processlog")
+ public AjaxResult processlog(@RequestBody ServiceProcessVO serviceProcessVO) {
+ log.info("鑷磋繙绯荤粺娴佺▼閫�鍥炲鎵规棩蹇楀叆鍙傦細{}", serviceProcessVO);
+ if (serviceProcessVO.getBackCode() == null && StringUtils.isEmpty(serviceProcessVO.getApplytype())) {
+ return AjaxResult.error("鍏ヨ兘涓虹┖,璇锋鏌ュ叆鍙�!!");
+ }
+
+ Boolean processlog = serviceFundService.processlog(serviceProcessVO);
+ if (!processlog) return AjaxResult.error("瀹℃壒璁板綍澶辫触");
+ return AjaxResult.success("瀹℃壒璁板綍鎴愬姛");
+ }
+
+ /**
+ * 淇敼缂栧彿涓庢敮浠樻柟寮�
+ *
+ * @param serviceCodeAndPyaWay
+ * @return
+ */
+ @PostMapping("/updatecodepayway")
+ public AjaxResult updatecodepay(@RequestBody ServiceCodeAndPyaWay serviceCodeAndPyaWay) {
+ log.info("鑷磋繙绯荤粺缂栧彿涓庢敮浠樻柟寮忓叆鍙傦細{}", serviceCodeAndPyaWay);
+ if (StringUtils.isEmpty(serviceCodeAndPyaWay.getApplytype()) || StringUtils.isEmpty(serviceCodeAndPyaWay.getBh()) || StringUtils.isEmpty(serviceCodeAndPyaWay.getZffs())) {
+ return AjaxResult.error("鍏ヨ兘涓虹┖,璇锋鏌ュ叆鍙�!!");
+ }
+
+ Boolean result = serviceFundService.updatecodepay(serviceCodeAndPyaWay);
+ if (!result) return AjaxResult.error("淇敼澶辫触");
+
+ return AjaxResult.success("淇敼鎴愬姛");
+ }
+
+
+ /**
* 鏌ヨ璐圭敤鐢宠涓诲垪琛�
*/
@ApiOperation("鏌ヨ璐圭敤鐢宠涓诲垪琛�")
- //@PreAuthorize("@ss.hasPermi('project:fund:list')")
+ //// @PreAuthorize("@ss.hasPermi('project:fund:list')")
@GetMapping("/list")
public TableDataInfo list(ServiceFund serviceFund) {
startPage();
@@ -175,7 +208,10 @@
if (StringUtils.isNotEmpty(spFinancialExpensesIn.getDonorname())) {
list = list.stream().filter(obj -> obj.getDonorname().contains(spFinancialExpensesIn.getDonorname())).collect(Collectors.toList());
}
-
+ //閫氳繃涓氬姟缁勮繃婊�
+ if (StringUtils.isNotEmpty(spFinancialExpensesIn.getDeptnos())) {
+ list = list.stream().filter(obj -> obj.getDeptmentno().contains(spFinancialExpensesIn.getDeptnos())).collect(Collectors.toList());
+ }
//閫氳繃閲戦杩囨护
if (spFinancialExpensesIn.getMoney() != null) {
list = list.stream().filter(reimbursementOut -> new BigDecimal(reimbursementOut.getPretaxcost()).compareTo(new BigDecimal(spFinancialExpensesIn.getMoney())) == 0).collect(Collectors.toList());
@@ -185,7 +221,7 @@
Collections.sort(list, new Comparator<SpFinancialExpensesFundOut>() {
@Override
public int compare(SpFinancialExpensesFundOut o1, SpFinancialExpensesFundOut o2) {
- return o1.getCreateTime().compareTo(o2.getCreateTime());
+ return o1.getApplyTime().compareTo(o2.getApplyTime());
}
});
return getCustomDataTable(list, pageNum, pageSize);
@@ -203,7 +239,7 @@
}
@ApiOperation("鏌ヨ璐圭敤鐢宠涓诲垪琛�")
- //@PreAuthorize("@ss.hasPermi('project:fund:list')")
+ //// @PreAuthorize("@ss.hasPermi('project:fund:list')")
@GetMapping(value = "/getInfo/{infoid}")
public AjaxResult getInfoByInfoId(@PathVariable("infoid") Long infoid) {
return AjaxResult.success(serviceFundService.getInfoByInfoId(infoid));
@@ -225,7 +261,7 @@
* 瀵煎嚭璐圭敤鐢宠涓诲垪琛�
*/
@ApiOperation("瀵煎嚭璐圭敤鐢宠涓诲垪琛�")
- //@PreAuthorize("@ss.hasPermi('project:fund:export')")
+ //// @PreAuthorize("@ss.hasPermi('project:fund:export')")
@Log(title = "璐圭敤鐢宠涓�", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(ServiceFund serviceFund) {
@@ -239,7 +275,7 @@
* 鑾峰彇璐圭敤鐢宠涓昏缁嗕俊鎭�
*/
@ApiOperation("鑾峰彇璐圭敤鐢宠涓昏缁嗕俊鎭�")
- //@PreAuthorize("@ss.hasPermi('project:fund:query')")
+ //// @PreAuthorize("@ss.hasPermi('project:fund:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(serviceFundService.getById(id));
@@ -249,7 +285,7 @@
* 鏂板璐圭敤鐢宠涓�
*/
@ApiOperation("鏂板璐圭敤鐢宠涓�")
- //@PreAuthorize("@ss.hasPermi('project:fund:add')")
+ //// @PreAuthorize("@ss.hasPermi('project:fund:add')")
@Log(title = "璐圭敤鐢宠涓�", businessType = BusinessType.INSERT)
@PostMapping("/add")
@RepeatSubmit
@@ -296,192 +332,13 @@
@PostMapping("/checkfund")
public AjaxResult checkFund(@RequestBody CheckFundVO checkFundVO) {
log.info("serviceFundController---checkFund鐨勫叆鍙傚�糲heckFundVO :{}", checkFundVO);
- ServiceFund serviceFund = serviceFundService.getById(checkFundVO.getFundid());
- if (serviceFund != null) {
- Integer TotalLevel = 0;
- LoginUser loginUser = getLoginUser();
- ServiceFundflowrule serviceFundflowrule = new ServiceFundflowrule();
- serviceFundflowrule.setFundtype(2);
- serviceFundflowrule.setApplytype(serviceFund.getApplytype());
- serviceFundflowrule.setCheckuserno(loginUser.getUsername());
- log.info("serviceFundController---checkFund---queryList鐨勫叆鍙傚�約erviceFundflowrule:{}", serviceFundflowrule);
- List<ServiceFundflowrule> serviceFundflowrules = serviceFundflowruleService.queryList(serviceFundflowrule);
-
- if (serviceFundflowrules == null || serviceFundflowrules.stream().count() == 0) {
- return AjaxResult.error(HttpStatus.ERROR, "褰撳墠浜哄憳鏃犳璁板綍瀹℃牳鏉冮檺");
- }
-
- if (serviceFundflowrules.get(0).getFlowlevel() - 1 != serviceFund.getFlowlevel()) {
- return AjaxResult.error(HttpStatus.ERROR, "褰撳墠浜哄憳涓庢璁板綍鐨勫鏍哥骇鍒笉绗�");
- }
-
- if (serviceFundflowrules != null && serviceFundflowrules.stream().count() > 0) {
- TotalLevel = serviceFundflowrules.get(0).getTotallevel();
- }
-
- Integer CheckFlag = 0;
- Integer RecordStatus = serviceFund.getRecordstatus();
- Integer FlowLevel = serviceFund.getFlowlevel().intValue();
- Integer OriginalFlowLevel = FlowLevel;
- if (checkFundVO.getFlowconclusion() == 1) {
- CheckFlag = 1;
- if (TotalLevel == 0) {
- RecordStatus = 99;
- } else {
- if (TotalLevel == FlowLevel + 1) {
- RecordStatus = 99;
- } else {
- RecordStatus = (FlowLevel + 1) * 2;
- }
- }
- FlowLevel = FlowLevel + 1;
-
- if (serviceFund.getFlowlevel() == Long.valueOf(serviceFundflowrules.get(0).getFlowlevel() - 1) && serviceFund.getBackflowlevel() == 100) {
- log.info("璐㈠姟閫�鍥炲啀鎻愪氦锛屽嚭绾冲啀娆″鎵癸紝涔嬪悗鎻愪氦鍒拌储鍔�");
- //璇存槑鏄储鍔¢��鍥炲啀鎻愪氦鐨�.闇�瑕佸嚭绾冲啀鐪嬩竴閬嶏紝娌¢棶棰樹箣鍚庯紝寰�鍒嗕韩琛ㄩ噷鏂板
-// serviceFundService.addFundSharedInfo(serviceFund.getId());
- serviceFund.setFlowlevel(serviceFundflowrules.get(0).getTotallevel().longValue());
- serviceFund.setRecordstatus(99);
- serviceFund.setUploadStates(1);
- serviceFundService.updateById(serviceFund);
-
- //淇濆瓨瀹℃壒娴佺▼琛�
- ServiceFundflow serviceFundflow = new ServiceFundflow();
- SysUser user = loginUser.getUser();
- serviceFundflow.setFundid(serviceFund.getId());
- serviceFundflow.setCheckuserno(user.getUserName());
- serviceFundflow.setCheckusername(user.getNickName());
- serviceFundflow.setFundtype(2);
- serviceFundflow.setApplytype(serviceFund.getApplytype());
- serviceFundflow.setFlowconclusion(CheckFlag);
- serviceFundflow.setFlowcontent("閫氳繃");
- Boolean aBoolean = serviceFundflowService.saveData(serviceFundflow);
- return AjaxResult.success();
- }
- //璁板綍涓�涓嬶紝涓嬩竴绾х殑瀹℃壒锛屼互渚夸簬涓嬩竴绾ч��鍥炲悗锛屽彂璧疯�呮彁浜ゆ椂锛岃兘鍐嶆彁鍒板綋鍓嶅鎵瑰眰绾�
- serviceFund.setBackflowlevel(FlowLevel);
- } else {
- CheckFlag = 2;
- if (CheckFlag == 2) {
- //搴斿尰闄㈣姹傚鏋滃嚭鐜伴��鍥烇紝鐩存帴閫�鍒板彂璧疯��
- FlowLevel = 0;
- RecordStatus = -1;
- logger.info("serviceFund杩涙潵浜嗗悧锛燂紵锛燂紵锛燂紵 :{},{}", RecordStatus, FlowLevel);
- System.out.println("serviceFund杩涙潵浜嗗悧锛燂紵锛燂紵锛燂紵");
- } else {
- RecordStatus = (FlowLevel + 1) * 2 - 1;
- FlowLevel = (FlowLevel - 1);
- if (FlowLevel < 0) {
- FlowLevel = 0;
- }
- }
-
- SysUser sysUser = sysUserService.selectUserByUserName(serviceFund.getUserno());
- ArrayList<ConcurrentHashMap<String, Object>> contentList = new ArrayList<>();
- ConcurrentHashMap map = new ConcurrentHashMap();
- map.put("瀹℃壒浜猴細", loginUser.getUser().getUserName());
- map.put("瀹℃壒鏃堕棿锛�", new Date());
- map.put("鎰忚锛�", "涓嶉�氳繃");
- if (StringUtils.isNotBlank(checkFundVO.getFlowcontent())) map.put("鎰忚锛�", checkFundVO.getFlowcontent());
- contentList.add(map);
- DingTalkReqVo dingTalkReqVo = new DingTalkReqVo();
- dingTalkReqVo.setTitle("璐㈠姟绯荤粺椹冲洖淇℃伅");
- dingTalkReqVo.setNumber(sysUser.getPhonenumber());
- dingTalkReqVo.setContents(contentList);
- dingTalkService.sendNotification(dingTalkReqVo);
- }
-
- serviceFund.setRecordstatus(RecordStatus);
- serviceFund.setFlowlevel(FlowLevel.longValue());
- // serviceFund.setBackflowlevel(serviceFund.getFlowlevel());
-
- ServiceFundflow serviceFundflow = new ServiceFundflow();
- SysUser user = loginUser.getUser();
- serviceFundflow.setFundid(serviceFund.getId());
- serviceFundflow.setCheckuserno(user.getUserName());
- serviceFundflow.setCheckusername(user.getNickName());
- serviceFundflow.setFundtype(2);
- serviceFundflow.setApplytype(serviceFund.getApplytype());
- serviceFundflow.setFlowconclusion(CheckFlag);
- if (org.apache.commons.lang.StringUtils.isNotBlank(checkFundVO.getFlowcontent())) {
- serviceFundflow.setFlowcontent(checkFundVO.getFlowcontent());
- } else {
- serviceFundflow.setFlowcontent(checkFundVO.getFlowconclusion() == 1 ? "閫氳繃" : "涓嶉�氳繃");
- }
- serviceFundflow.setFlowlevel(OriginalFlowLevel + 1);
-
- Boolean aBoolean = serviceFundflowService.saveData(serviceFundflow);
- log.info("sserviceFund淇濆瓨鐨勭殑鍊兼槸-------- :{}", aBoolean);
-
- //001瀹℃壒閫氳繃涔嬪悗锛屽氨闇�瑕佹妸鈥滃姙鍏涓讳换鈥濈殑鍚嶅瓧濉笂
- if (checkFundVO.getFlowconclusion() == 1 && user.getUserName().equals("001")) {
- serviceFund.setOfficedirector(user.getNickName());
- serviceFund.setUploadStates(1);
- }
- System.out.println("serviceFund鐨勫�兼槸--------:" + serviceFund);
- log.info("寮�濮嬫洿鏂扮殑鐨勫�兼槸--------");
-// ServiceFund updateServiceFund = new ServiceFund();
-// updateServiceFund.setRecordstatus(serviceFund.getRecordstatus());
-// updateServiceFund.setFlowlevel(serviceFund.getFlowlevel());
-
- Boolean aBoolean1 = serviceFundService.updateById(serviceFund);
- log.info("integer鏇存柊鐨勭殑鍊兼槸-------- :{}", aBoolean1);
- ServiceSystemmessage serviceSystemmessage = new ServiceSystemmessage();
- serviceSystemmessage.setFundtype(2);
- serviceSystemmessage.setApplytype(serviceFund.getApplytype());
- serviceSystemmessage.setSenduserno(user.getUserName());
- serviceSystemmessage.setSendusername(user.getNickName());
- serviceSystemmessage.setReceiveuserno(serviceFund.getUserno());
- serviceSystemmessage.setReceiveusername(serviceFund.getUsername());
- serviceSystemmessage.setUpdateTime(new Date());
- serviceSystemmessage.setUpdateBy(user.getNickName());
- serviceSystemmessage.setIsread(0);
- serviceSystemmessage.setMessagetype(1);
- serviceSystemmessage.setRelevantno(serviceFund.getId());
-
- if (CheckFlag == 1) {
-
- //閫氳繃
- if (serviceFund.getApplytype().equals("1")) {
- serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "绾у鏍搁�氳繃");
- serviceSystemmessage.setMessagecontent("鎮�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceFund.getCreateTime()) + "鎻愪氦鐨勪笓瀹跺姵鍔¤垂鎹愮尞妗堜緥銆�" + serviceFund.getDonorname() + "銆戠殑璐圭敤鐢宠宸查�氳繃");
- } else if (serviceFund.getApplytype().equals("2")) {
- serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "绾у鏍搁�氳繃");
- serviceSystemmessage.setMessagecontent("鎮�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceFund.getCreateTime()) + "鎻愪氦鐨勪鸡鐞嗕笓瀹跺姵鍔¤垂鎹愮尞妗堜緥銆�" + serviceFund.getDonorname() + "銆戠殑璐圭敤鐢宠宸查�氳繃");
- } else if (serviceFund.getApplytype().equals("3")) {
- serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "绾у鏍搁�氳繃");
- serviceSystemmessage.setMessagecontent("鎮�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceFund.getCreateTime()) + "鎻愪氦鐨勫尰瀛︽垚鏈崘鐚渚嬨��" + serviceFund.getDonorname() + "銆戠殑璐圭敤鐢宠宸查�氳繃");
- } else if (serviceFund.getApplytype().equals("4")) {
- serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "绾у鏍搁�氳繃");
- serviceSystemmessage.setMessagecontent("鎮�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceFund.getCreateTime()) + "鎻愪氦鐨勫姙鍏垂鐢ㄧ敵璇峰凡閫氳繃");
- } else if (serviceFund.getApplytype().equals("5")) {
- serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "绾у鏍搁�氳繃");
- serviceSystemmessage.setMessagecontent("鎮�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceFund.getCreateTime()) + "鎻愪氦鐨勭哗鏁堢敵璇峰凡閫氳繃");
- }
- } else {
- //椹冲洖
- if (serviceFund.getApplytype().equals("1")) {
- serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "绾у鏍搁┏鍥�");
- serviceSystemmessage.setMessagecontent("鎮�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceFund.getCreateTime()) + "鎻愪氦鐨勪笓瀹跺姵鍔¤垂鎹愮尞妗堜緥銆�" + serviceFund.getDonorname() + "銆戠殑璐圭敤鐢宠宸茶椹冲洖锛屽師鍥�: " + checkFundVO.getFlowcontent() + "");
- } else if (serviceFund.getApplytype().equals("2")) {
- serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "绾у鏍搁┏鍥�");
- serviceSystemmessage.setMessagecontent("鎮�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceFund.getCreateTime()) + "鎻愪氦鐨勪鸡鐞嗕笓瀹跺姵鍔¤垂鎹愮尞妗堜緥銆�" + serviceFund.getDonorname() + "銆戠殑璐圭敤鐢宠宸茶椹冲洖锛屽師鍥�: " + checkFundVO.getFlowcontent() + "");
- } else if (serviceFund.getApplytype().equals("3")) {
- serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "绾у鏍搁┏鍥�");
- serviceSystemmessage.setMessagecontent("鎮�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceFund.getCreateTime()) + "鎻愪氦鐨勫尰瀛︽垚鏈崘鐚渚嬨��" + serviceFund.getDonorname() + "銆戠殑璐圭敤鐢宠宸茶椹冲洖锛屽師鍥�: " + checkFundVO.getFlowcontent() + "");
- } else if (serviceFund.getApplytype().equals("4")) {
- serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "绾у鏍搁┏鍥�");
- serviceSystemmessage.setMessagecontent("鎮�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceFund.getCreateTime()) + "鎻愪氦鐨勫姙鍏垂鐢ㄧ敵璇峰凡椹冲洖锛屽師鍥�: " + checkFundVO.getFlowcontent() + "");
- } else if (serviceFund.getApplytype().equals("5")) {
- serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "绾у鏍搁┏鍥�");
- serviceSystemmessage.setMessagecontent("鎮�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceFund.getCreateTime()) + "鎻愪氦鐨勭哗鏁堢敵璇峰凡椹冲洖锛屽師鍥�: " + checkFundVO.getFlowcontent() + "");
- }
- }
- ServiceSystemmessage.save(serviceSystemmessage);
- return AjaxResult.success();
- } else {
- return AjaxResult.error(HttpStatus.NO_CONTENT, "璐圭敤缂栧彿涓嶆纭�");
+ LoginUser loginUser = getLoginUser();
+ Map<String, String> map = serviceFundService.checkFund(checkFundVO, loginUser);
+ Set<String> keys = map.keySet();
+ for (String s : keys) {
+ if (!s.equals("200")) return AjaxResult.error(map.get(s));
}
+ return AjaxResult.success();
}
@@ -578,7 +435,7 @@
* 鍒犻櫎璐圭敤鐢宠涓�
*/
@ApiOperation("鍒犻櫎璐圭敤鐢宠涓�")
- //@PreAuthorize("@ss.hasPermi('project:fund:remove')")
+ //// @PreAuthorize("@ss.hasPermi('project:fund:remove')")
@Log(title = "璐圭敤鐢宠涓�", businessType = BusinessType.DELETE)
@GetMapping("/remove/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
@@ -592,7 +449,7 @@
@GetMapping(value = "/downloadLW/{id}")
public Map downloadInfoLW(@PathVariable("id") Long id) throws IOException {
Map dataMap = new HashMap();
- getDataLW(dataMap, id);
+ String dataLW = getDataLW(dataMap, id);
String filePath = getClass().getResource("/template/").getPath();
System.out.println(filePath);
//璁剧疆妯℃湰瑁呯疆鏂规硶鍜岃矾寰�,FreeMarker鏀寔澶氱妯℃澘瑁呰浇鏂规硶銆傚彲浠ラ噸servlet锛宑lasspath锛屾暟鎹簱鏁欑▼瑁呰浇锛�
@@ -606,7 +463,15 @@
e.printStackTrace();
}
String newTime = String.valueOf(Calendar.getInstance().getTimeInMillis());
- String name = "涓撳鍔冲姟璐瑰彂鏀剧敵璇峰崟_" + dataMap.get("XM") + "_" + newTime;
+
+ String newName = null;
+ if (Objects.isNull(dataMap.get("XM"))) {
+ newName = dataMap.get("XM").toString().trim();
+ }
+ String name = "涓撳鍔冲姟璐瑰彂鏀剧敵璇峰崟_" + newName + "_" + newTime;
+ if (dataLW.equals("4")) {
+ name = "鍔炲叕璐圭敤鐢宠鍗昣" + newName + "_" + newTime;
+ }
//杈撳嚭鏂囨。璺緞鍙婂悕绉�
File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
@@ -629,7 +494,7 @@
return map;
}
- private void getDataLW(Map dataMap, Long id) {
+ private String getDataLW(Map dataMap, Long id) {
ServiceFund serviceFund = serviceFundService.getById(id);
if (serviceFund == null) {
throw new ServiceException("涓嬭浇澶辫触锛岀敤鎴蜂俊鎭嚭閿�", HttpStatus.NO_CONTENT);
@@ -646,7 +511,11 @@
dataMap.put("JXZXM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname());
dataMap.put("JSR", serviceFund.getUsername() == null ? "" : serviceFund.getUsername());
// dataMap.put("FYXM1", "鏀粯涓撳璐圭敤锛屽叾涓◣鍓嶉噾棰�" + serviceFund.getPretaxcost() + "鍏冿紝绋庡悗閲戦" + serviceFund.getTaxedcost() + "鍏冦��");
- dataMap.put("FYXM1", "浜轰綋鍣ㄥ畼鎹愮尞涓撳鍔冲姟璐�:" + serviceFund.getPretaxcost() + "鍏� (鍏朵腑绋庡悗璐圭敤鐢变腑蹇冩壙鎷呯◣璐�)銆�");
+ if (serviceFund.getApplytype().equals("1")) {
+ dataMap.put("FYXM1", "浜轰綋鍣ㄥ畼鎹愮尞涓撳鍔冲姟璐�:" + serviceFund.getPretaxcost() + "鍏� (鍏朵腑绋庡悗璐圭敤鐢变腑蹇冩壙鎷呯◣璐�)銆�");
+ } else if (serviceFund.getApplytype().equals("4")) {
+ dataMap.put("FYXM1", "鍔炲叕璐圭敤:" + serviceFund.getPretaxcost());
+ }
dataMap.put("FYXM2", "");
dataMap.put("FYXM3", "");
dataMap.put("JEXS", serviceFund.getPretaxcost());
@@ -761,6 +630,7 @@
dataMap.put("KSLJ", kslj);
dataMap.put("SHLJ", shlj);
+ return serviceFund.getApplytype();
}
@@ -958,6 +828,7 @@
Map dataMap = new HashMap();
String dataYX = getDataYX(dataMap, id);
String filePath = getClass().getResource("/template/").getPath();
+ log.info("filePath鐨勫�间负:{}", filePath);
System.out.println(filePath);
//璁剧疆妯℃湰瑁呯疆鏂规硶鍜岃矾寰�,FreeMarker鏀寔澶氱妯℃澘瑁呰浇鏂规硶銆傚彲浠ラ噸servlet锛宑lasspath锛屾暟鎹簱鏁欑▼瑁呰浇锛�
configuration.setDirectoryForTemplateLoading(new File(filePath));
@@ -988,18 +859,19 @@
//杈撳嚭鏂囨。璺緞鍙婂悕绉�
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();
+ log.error("FileNotFoundException鎶ラ敊淇℃伅鏄細{}", e1.getMessage());
+// e1.printStackTrace();
}
try {
t.process(dataMap, out);
} catch (TemplateException e) {
- e.printStackTrace();
+ log.error("TemplateException鎶ラ敊淇¤嚜鏄細{}", e.getMessage());
+ e.getMessage();
}
Map<String, Object> map = new HashMap<>();
map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc");
@@ -1014,7 +886,7 @@
throw new ServiceException("涓嬭浇澶辫触锛岀敤鎴蜂俊鎭嚭閿�", HttpStatus.NO_CONTENT);
}
ServiceExternalperson infoByUserNo = null;
- if (StringUtils.isNotBlank(serviceFund.getUserno())) {
+ if (StringUtils.isNotBlank(serviceFund.getUserno()) && serviceFund.getApplytype().equals("5")) {
infoByUserNo = externalpersonService.getInfoByUserNo(serviceFund.getUserno());
}
@@ -1141,7 +1013,7 @@
dataMap.put("CWSH", serviceFund.getFinancechecher() == null ? "" : serviceFund.getFinancechecher());
dataMap.put("YYMMDD", time);
- dataMap.put("XM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname());
+ dataMap.put("XM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname().trim());
dataMap.put("GZRY", serviceFund.getUsername() == null ? "" : serviceFund.getUsername());
dataMap.put("ZZ", serviceFund.getManagername() == null ? "" : serviceFund.getManagername());
--
Gitblit v1.9.3