From b0d0169d6cfe1f1e00a69794e9023e1040d211d1 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 28 八月 2026 17:38:24 +0800
Subject: [PATCH] 修改一下,如果钉钉报错,不影响提交
---
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java | 89 +++++++++++++++++++++++++++++---------------
1 files changed, 58 insertions(+), 31 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 556c138..a2cfd8d 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
@@ -15,11 +15,13 @@
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.enums.ApplyTypeEnum;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.HttpClientKit;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.DtoConversionUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.project.common.IdGeneratorUtils;
import com.ruoyi.project.domain.*;
import com.ruoyi.project.domain.vo.*;
import com.ruoyi.project.mapper.*;
@@ -486,11 +488,15 @@
cmap.put("鎰忚锛�", "涓嶉�氳繃");
if (StringUtils.isNotBlank(checkFundVO.getFlowcontent())) cmap.put("鎰忚锛�", checkFundVO.getFlowcontent());
contentList.add(cmap);
+ try{
DingTalkReqVo dingTalkReqVo = new DingTalkReqVo();
dingTalkReqVo.setTitle("璐㈠姟绯荤粺椹冲洖淇℃伅");
dingTalkReqVo.setNumber(sysUser.getPhonenumber());
dingTalkReqVo.setContents(contentList);
dingTalkService.sendNotification(dingTalkReqVo);
+ }catch (Exception e){
+ log.error("璐圭敤---璐㈠姟绯荤粺椹冲洖淇℃伅鎶ラ敊浜�", e);
+ }
}
serviceFund.setRecordstatus(RecordStatus);
@@ -516,13 +522,19 @@
Boolean aBoolean = serviceFundflowService.saveData(serviceFundflow);
log.info("sserviceFund淇濆瓨鐨勭殑鍊兼槸-------- :{}", aBoolean);
- //053瀹℃壒閫氳繃涔嬪悗锛屽氨闇�瑕佹妸鈥滃姙鍏涓讳换鈥濈殑鍚嶅瓧濉笂
- if (checkFundVO.getFlowconclusion() == 1 && user.getUserName().equals("053")) {
+ //鍔炲叕瀹ゅ鎵归�氳繃涔嬪悗锛屽氨闇�瑕佹妸鈥滃姙鍏涓讳换鈥濈殑鍚嶅瓧濉笂
+ SysUser sysUsers = null;
+ if (StringUtils.isNotEmpty(user.getUserName())) {
+ 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());
serviceFund.setUploadStates(1);
//鏁版嵁鍙戦��
Boolean aBoolean1 = null;
if (newSwitch == 1) {
+ log.info("璐圭敤newSwitch杩斿洖鐨勫�间负:{}", newSwitch);
//鎼炰竴涓紑鍏筹紝鍒奖鍝嶈�佹祦绋�
aBoolean1 = sendData(serviceFund);
if (!aBoolean1) {
@@ -681,14 +693,16 @@
return true;
}
- private static final AtomicLong COUNTER = new AtomicLong(System.currentTimeMillis());
-
private Map<String, List<Map<String, Object>>> formson_0832(List<ServiceFunddetailShared> serviceFunddetailSharedList) {
Map<String, List<Map<String, Object>>> allMap = new HashMap<>();
List<Map<String, Object>> list = new ArrayList<>();
List<Map<String, Object>> annexfilesList = new ArrayList<>();
for (ServiceFunddetailShared serviceFunddetailShared : serviceFunddetailSharedList) {
+ //闄勪欢澶勭悊
+ String annexfiles = serviceFunddetailShared.getAnnexfiles();
+ String invoicefiles = serviceFunddetailShared.getInvoicefiles();
+
Map<String, Object> map = new HashMap<>();
map.put("搴忓彿1", serviceFunddetailShared.getOrderno());
map.put("璐圭敤椤圭洰", serviceFunddetailShared.getItemname());
@@ -696,15 +710,21 @@
map.put("寮�鎴烽摱琛�", serviceFunddetailShared.getDepositbank());
map.put("鍗″彿", serviceFunddetailShared.getBankcardno());
map.put("鏀剁泭浜哄灞炴垨涓撳", serviceFunddetailShared.getBeneficiaryname());
- map.put("绋庡悗閲戦", serviceFunddetailShared.getTaxamount());
+ map.put("绋庡悗閲戦", serviceFunddetailShared.getTaxedamount());
map.put("浣滃簾鏈�缁堥噾棰�", null);
- Long fpuuid = COUNTER.incrementAndGet();
- map.put("鍙戠エ闄勪欢", fpuuid);
+ Long fpuuid = IdGeneratorUtils.nextId();
+ map.put("鍙戠エ闄勪欢", "");
+ if (StringUtils.isNotEmpty(invoicefiles)) {
+ map.put("鍙戠エ闄勪欢", fpuuid);
+ }
map.put("鍙戠エ璇嗗埆", null);
map.put("璇嗗埆浜�", null);
- map.put("绋庨", null);
- long qtuuid = COUNTER.incrementAndGet();
- map.put("鍏朵粬闄勪欢", qtuuid);
+ map.put("绋庨", serviceFunddetailShared.getTaxamount());
+ long qtuuid = IdGeneratorUtils.nextId();
+ map.put("鍏朵粬闄勪欢", "");
+ if (StringUtils.isNotEmpty(annexfiles)) {
+ map.put("鍏朵粬闄勪欢", qtuuid);
+ }
map.put("椤圭洰缂栫爜", serviceFunddetailShared.getItemcode());
map.put("棰勭畻椤圭洰", null);
map.put("璐锋柟绉戠洰", null);
@@ -714,9 +734,6 @@
map.put("璐圭敤璇存槑", null);
list.add(map);
- //闄勪欢澶勭悊
- String annexfiles = serviceFunddetailShared.getAnnexfiles();
- String invoicefiles = serviceFunddetailShared.getInvoicefiles();
int i = 0;
if (StringUtils.isNotEmpty(annexfiles)) {
@@ -765,18 +782,24 @@
formmain_0831.put("澶囨敞", null);
formmain_0831.put("璐㈠姟瀹℃壒", null);
formmain_0831.put("璐㈠姟閮ㄨ礋璐d汉瀹℃壒", getLastApprovalInfo(serviceFundflows, serviceFund.getFinancedirector()));
- formmain_0831.put("鍔炲叕瀹や富浠诲鎵�", getLastApprovalInfo(serviceFundflows, serviceFund.getOfficedirector()));
+
+// formmain_0831.put("鍔炲叕瀹や富浠诲鎵�", "鍔炲叕瀹や富浠诲鎵�", "瀹℃壒浜猴細鍚村織寮� & 瀹℃壒鏃堕棿锛�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + " & 瀹℃壒缁撴灉锛氶�氳繃");
+ if (serviceFund.getBackflowlevel() == 3)
+ formmain_0831.put("鍔炲叕瀹や富浠诲鎵�", "瀹℃壒浜猴細鍚村織寮� & 瀹℃壒鏃堕棿锛�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + " & 瀹℃壒缁撴灉锛氶�氳繃");
+ else formmain_0831.put("鍔炲叕瀹や富浠诲鎵�", getLastApprovalInfo(serviceFundflows, "鍚村織寮�"));
+
formmain_0831.put("涓氬姟鍓櫌闀垮鎵�", serviceFund.getBusvicepresident());
formmain_0831.put("璐㈠姟鍓櫌闀垮鎵�", serviceFund.getFinvicepresident());
formmain_0831.put("涓績璐熻矗浜哄鎵�", serviceFund.getOpochecker());
formmain_0831.put("鏀粯鏂瑰紡", serviceFund.getZffs());
- formmain_0831.put("缁勯暱", getLastApprovalInfo(serviceFundflows, serviceFund.getManagername()));
+ String lastApprovalInfo = getLastApprovalInfo(serviceFundflows, serviceFund.getManagername());
+ formmain_0831.put("缁勯暱", lastApprovalInfo.contains("鍚村織寮�") ? null : lastApprovalInfo);
formmain_0831.put("瀹℃壒浜哄憳", StringUtils.isEmpty(getLastApprovalInfo(serviceFundflows, serviceFund.getFinancechecher())) ? "闄堟厱鍗�" : getLastApprovalInfo(serviceFundflows, serviceFund.getFinancechecher()));
formmain_0831.put("鏀粯鏃ユ湡", serviceFund.getRiqi());
formmain_0831.put("璇嗗埆浜�-浣滃簾", null);
formmain_0831.put("璐㈠姟瀹℃壒绛惧瓧", serviceFund.getFinancedirector());
formmain_0831.put("璐㈠姟閮ㄨ礋璐d汉绛惧瓧", serviceFund.getFinancedirector());
- formmain_0831.put("琛ㄨ揪绫诲瀷", null);
+ formmain_0831.put("琛ㄨ揪绫诲瀷", StringUtils.isEmpty(serviceFund.getApplytype()) ? null : ApplyTypeEnum.getDescByCode(serviceFund.getApplytype()));
formmain_0831.put("绋庡墠閲戦鍚堣", serviceFund.getPretaxcost());
formmain_0831.put("绋庨鍚堣", serviceFund.getPretaxcost() - serviceFund.getTaxedcost());
formmain_0831.put("琛ㄥ崟缂栧彿1", null);
@@ -806,8 +829,9 @@
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return "瀹℃壒浜猴細" + managerName + " & 瀹℃壒鏃堕棿锛�" + sd.format(new Date()) + " & 瀹℃壒缁撴灉锛氶�氳繃";
}
-
- Optional<ServiceFundflow> lastApproval = serviceFundflows.stream().filter(flow -> managerName.contains(flow.getCheckusername())).max(Comparator.comparing(ServiceFundflow::getCreateTime));
+ //鍘讳竴涓嬬┖鏍�
+ String mn = managerName.trim();
+ Optional<ServiceFundflow> lastApproval = serviceFundflows.stream().filter(flow -> mn.trim().contains(flow.getCheckusername())).max(Comparator.comparing(ServiceFundflow::getCreateTime));
if (lastApproval.isPresent()) {
ServiceFundflow flow = lastApproval.get();
@@ -1813,18 +1837,21 @@
serviceFundflow.setApplytype(serviceProcessVO.getApplytype());
serviceFundflow.setFundid(StringUtils.isNotEmpty(serviceProcessVO.getBackCode()) ? Long.valueOf(serviceProcessVO.getBackCode()) : null);
fundflowService.save(serviceFundflow);
-
- ArrayList<ConcurrentHashMap<String, Object>> contentList = new ArrayList<>();
- ConcurrentHashMap map = new ConcurrentHashMap();
- map.put("瀹℃壒浜猴細", serviceProcessVO.getCheckusername());
- map.put("瀹℃壒鏃堕棿锛�", serviceProcessVO.getCheckTime());
- map.put("鎰忚锛�", serviceProcessVO.getFlowcontent());
- contentList.add(map);
- DingTalkReqVo dingTalkReqVo = new DingTalkReqVo();
- dingTalkReqVo.setTitle("璐㈠姟绯荤粺淇℃伅");
- dingTalkReqVo.setNumber(phone);
- dingTalkReqVo.setContents(contentList);
- log.info("閽夐拤鍙戦�佹秷鎭�:{}", dingTalkReqVo);
- dingTalkService.sendNotification(dingTalkReqVo);
+ try {
+ ArrayList<ConcurrentHashMap<String, Object>> contentList = new ArrayList<>();
+ ConcurrentHashMap map = new ConcurrentHashMap();
+ map.put("瀹℃壒浜猴細", serviceProcessVO.getCheckusername());
+ map.put("瀹℃壒鏃堕棿锛�", serviceProcessVO.getCheckTime());
+ map.put("鎰忚锛�", serviceProcessVO.getFlowcontent());
+ contentList.add(map);
+ DingTalkReqVo dingTalkReqVo = new DingTalkReqVo();
+ dingTalkReqVo.setTitle("璐㈠姟绯荤粺淇℃伅");
+ dingTalkReqVo.setNumber(phone);
+ dingTalkReqVo.setContents(contentList);
+ log.info("閽夐拤鍙戦�佹秷鎭�:{}", dingTalkReqVo);
+ dingTalkService.sendNotification(dingTalkReqVo);
+ } catch (Exception e) {
+ log.error("璐㈠姟绯荤粺淇℃伅---閽夐拤娑堟伅鍙戦�佸け璐ワ紝涓嶅奖鍝嶄富娴佺▼", e);
+ }
}
}
--
Gitblit v1.9.3