From 13a735f1870f01f7d8f13db3de2d0359d928fde0 Mon Sep 17 00:00:00 2001
From: sinake <sinake1@qq.com>
Date: 星期三, 14 十月 2026 15:34:42 +0800
Subject: [PATCH] 钉钉通知调整
---
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java | 75 +++++++++++++++++++++++--------------
1 files changed, 46 insertions(+), 29 deletions(-)
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 296e3ec..17d1ed3 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
@@ -559,27 +559,25 @@
FlowLevel = 0;
}
}
-
- SysUser sysUser = sysUserService.selectUserByUserName(serviceFund.getUserno());
- //瀹℃壒鏈�氳繃锛氬崟鎹俊鎭� + 瀹℃壒浜�/瀹℃壒鏃堕棿/鎰忚锛堟剰瑙� = "瀹℃壒鏈�氳繃銆�" + 椹冲洖鎰忚锛�
- List<ConcurrentHashMap<String, Object>> contentList = FundNotifyMessageBuilder.newRows();
- FundNotifyMessageBuilder.addBillInfo(contentList, serviceFund.getApplytype(),
- serviceFund.getUsername(), serviceFund.getPretaxcost(), serviceFund.getDonorname(),
- FundNotifyMessageBuilder.billNo(serviceFund.getBh(), serviceFund.getId()));
- FundNotifyMessageBuilder.addAuditResult(contentList, loginUser.getUser().getNickName(), new Date(),
- FundNotifyMessageBuilder.opinion(FundNotifyMessageBuilder.CONCLUSION_REJECT,
- checkFundVO.getFlowcontent()));
- try {
- DingTalkReqVo dingTalkReqVo = new DingTalkReqVo();
- dingTalkReqVo.setTitle(FundNotifyMessageBuilder.TITLE);
- dingTalkReqVo.setNumber(sysUser.getPhonenumber());
- dingTalkReqVo.setContents(contentList);
- dingTalkService.sendNotification(dingTalkReqVo);
- } catch (Exception e) {
- log.error("璐圭敤---瀹℃壒鏈�氳繃閽夐拤閫氱煡澶辫触锛宖undId={}", serviceFund.getId(), e);
- }
}
-
+ SysUser sysUser = sysUserService.selectUserByUserName(serviceFund.getUserno());
+ //瀹℃壒鏈�氳繃锛氬崟鎹俊鎭� + 瀹℃壒浜�/瀹℃壒鏃堕棿/鎰忚锛堟剰瑙� = "瀹℃壒鏈�氳繃銆�" + 椹冲洖鎰忚锛�
+ List<ConcurrentHashMap<String, Object>> contentList = FundNotifyMessageBuilder.newRows();
+ FundNotifyMessageBuilder.addBillInfo(contentList, serviceFund.getApplytype(),
+ serviceFund.getUsername(), serviceFund.getPretaxcost(), serviceFund.getDonorname(),
+ FundNotifyMessageBuilder.billNo(serviceFund.getBh(), serviceFund.getId()));
+ FundNotifyMessageBuilder.addAuditResult(contentList, loginUser.getUser().getNickName(), new Date(),
+ FundNotifyMessageBuilder.opinion(checkFundVO.getFlowconclusion()+"",
+ checkFundVO.getFlowcontent()));
+ try {
+ DingTalkReqVo dingTalkReqVo = new DingTalkReqVo();
+ dingTalkReqVo.setTitle(FundNotifyMessageBuilder.TITLE);
+ dingTalkReqVo.setNumber(sysUser.getPhonenumber());
+ dingTalkReqVo.setContents(contentList);
+ dingTalkService.sendNotification(dingTalkReqVo);
+ } catch (Exception e) {
+ log.error("璐圭敤---瀹℃壒鏈�氳繃閽夐拤閫氱煡澶辫触锛宖undId={}", serviceFund.getId(), e);
+ }
serviceFund.setRecordstatus(RecordStatus);
serviceFund.setFlowlevel(FlowLevel.longValue());
// serviceFund.setBackflowlevel(serviceFund.getFlowlevel());
@@ -609,8 +607,16 @@
sysUsers = sysUserMapper.selectUserByUserName(user.getUserName());
log.info("璐圭敤sysUsers杩斿洖鐨勫�间负:{}", sysUsers);
}
- if (checkFundVO.getFlowconclusion() == 1 && sysUsers != null && sysUsers.getRoles() != null && sysUsers.getRoles().stream().anyMatch(role -> "officedirector".equals(role.getRoleKey()))) {
- serviceFund.setOfficedirector(user.getNickName());
+ // 2026-10-09锛氭帹閫佹潯浠剁敱"褰撳墠瀹℃牳浜烘湁 officedirector 瑙掕壊"鏀逛负"鏈瀹℃壒鍚庡埌杈炬渶鍚庝竴绾�"銆�
+ // 鍘熷啓娉曞湪"鏈�鍚庝竴绾у鏍镐汉娌℃湁璇ヨ鑹�"鏃舵案杩滀笉浼氭帹閫侊紝鑰�"闈炴渶鍚庝竴绾х殑 officedirector"浼氭彁鍓嶆帹閫併��
+ boolean uploadAtLastLevel = checkFundVO.getFlowconclusion() == 1
+ && TotalLevel != null && TotalLevel != 0 && TotalLevel == OriginalFlowLevel + 1;
+ if (uploadAtLastLevel) {
+ // 浠嶅彧鍦ㄨ瑙掕壊瀹℃壒鏃惰褰曞姙鍏涓讳换锛屼繚鎸佸瓧娈佃涔変笉鍙�
+ if (sysUsers != null && sysUsers.getRoles() != null
+ && sysUsers.getRoles().stream().anyMatch(role -> "officedirector".equals(role.getRoleKey()))) {
+ serviceFund.setOfficedirector(user.getNickName());
+ }
serviceFund.setUploadStates(1);
//鏁版嵁鍙戦��
Boolean aBoolean1 = null;
@@ -709,8 +715,12 @@
}
private Boolean doSendData(ServiceFund serviceFund) {
- // fund鍜宖unddetail鐨勬暟鎹幏鍙�
- addFundSharedInfo(serviceFund.getId());
+ // 2026-10-09锛氭帴浣� addFundSharedInfo 鐨勫け璐ヤ俊鍙凤紙闄勪欢涓婁紶澶辫触鏃跺畠浼氬洖婊氬垎浜〃骞惰繑鍥� false锛�
+ Boolean sharedOk = addFundSharedInfo(serviceFund.getId());
+ if (sharedOk == null || !sharedOk) {
+ log.error("璐圭敤鎶ラ攢鍗曚笂浼犲け璐ワ細鍒嗕韩琛�/闄勪欢鐜妭澶辫触锛屽鎵逛笉鐢熸晥锛宖undId={}", serviceFund.getId());
+ return false;
+ }
List<ServiceFundShared> fundShareInfos = serviceFundSharedMapper.getFundShareInfoById(serviceFund.getId());
if (CollectionUtils.isEmpty(fundShareInfos)) return false;
@@ -1011,11 +1021,10 @@
try {
if (isUploadOaEnabled()) uploadOAFileAndUpdateDb(serviceFunddetailShareds.get(i));
} catch (Exception e) {
- e.printStackTrace();
- log.error("Exception涓叆鍙傜殑ID涓猴細{},寮傚父淇℃伅涓� 锛� {}", id, e.getMessage());
+ log.error("璐圭敤闄勪欢涓婁紶鍖婚櫌鍗忓弸绯荤粺澶辫触锛氬崟鎹甶d={}锛堟湰娆℃姤閿�鍗曚笂浼犳暣浣撳け璐ワ紝瀹℃壒涓嶇敓鏁堬級", id, e);
if (id != null) {
Boolean aBoolean = sharedService.delfundsharedInfoById(null, id);
- log.error("fund2鍒嗕韩琛ㄩ噷鐨勬暟鎹槸鍚﹀垹闄ゆ垚鍔燂細{}", aBoolean);
+ log.error("宸插洖婊氬垎浜〃鏁版嵁锛歿}", aBoolean);
}
return false;
}
@@ -1843,7 +1852,7 @@
Map<String, Object> map = new HashMap<String, Object>();
map.put("userName", "opo");
map.put("password", "4126407a-9821-4874-be41-6568abd6dbe5");
- map.put("loginName", "OPO绯荤粺瀹℃壒");
+ map.put("loginName", "OPO绯荤粺");
JSONObject jsonObj = new JSONObject(map);
@@ -1860,10 +1869,18 @@
log.info("filePath鐨勪慨鏀�:{}", filePath);
String url = rbDetailFile.getUrl();
//file鐢ㄧ殑鏄粷瀵逛綅缃�
- String substring = url.substring(url.indexOf("/profile/upload") + "/profile/upload".length());
+ // 2026-10-09锛氶檮浠跺湴鍧�瑙f瀽鍔犲浐锛岄伩鍏� url 寮傚父/鏂囦欢缂哄け鏃舵姏 NPE 瀵艰嚧鐪嬩笉鍒板け璐ュ師鍥�
+ int profileIdx = url == null ? -1 : url.indexOf("/profile/upload");
+ if (profileIdx < 0) {
+ throw new ServiceException("闄勪欢鍦板潃鏍煎紡涓嶆纭紙缂哄皯 /profile/upload锛夛紝鏃犳硶涓婁紶鍗忓弸锛�" + url);
+ }
+ String substring = url.substring(profileIdx + "/profile/upload".length());
// String strFile = rbDetailFile.getUrl().replace(filePath, "/profile/upload");
System.out.println("fund鏈嶅姟鐨刦ilePath + substring: " + filePath + substring);
File filetest = new File(filePath + substring);
+ if (!filetest.exists()) {
+ throw new ServiceException("闄勪欢鏂囦欢鍦ㄦ湇鍔″櫒涓婁笉瀛樺湪锛屾棤娉曚笂浼犲崗鍙嬶細" + filetest.getAbsolutePath());
+ }
String struploadResult = HttpClientKit.sendPostWithFile(filetest, strFUrl);
log.info("绗笁鏂逛紶鍥炵殑鏁版嵁: {}", struploadResult);
--
Gitblit v1.9.3