From 00725594304734230846ae85a9b3b0fb81cca76c Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 08 八月 2023 12:07:42 +0800
Subject: [PATCH] 加日志

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java  |    4 +++-
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java                 |   29 +++++++++++++++++++++++++++--
 ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java |   10 ++++++----
 3 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
index c9ad1ed..b2ac01f 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
@@ -20,8 +20,11 @@
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.management.*;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.lang.management.ManagementFactory;
+import java.util.Set;
 
 /**
  * 閫氱敤璇锋眰澶勭悊
@@ -68,6 +71,9 @@
      */
     @PostMapping("/common/upload")
     public AjaxResult uploadFile(MultipartFile file) throws Exception {
+
+        int tomcatPort1 = getTomcatPort();
+        log.info("tomcatPort1鐨勫�间负锛� {}", tomcatPort1);
         //杩欎釜鐪佷汉姘戞槸8099锛屾墍浠ョ洿鎺ュ啓姝�
         int tomcatPort = 8099;
         try {
@@ -78,7 +84,7 @@
             String url1 = serverConfig.getUrl();
             log.info("url1鐨勫�紀ld :{}", url1);
             //杩欓噷鐨�8032涓嶆槸tomcat鐨勶紝鎵�浠ヨ杞垚tomcat鐨�
-            url1 =  url1.replace("8032", "8099");
+            url1 = url1.replace("8032", "8099");
             log.info("url1鐨勫�糿ew :{}", url1);
             String url = url1 + fileName;
             AjaxResult ajax = AjaxResult.success();
@@ -113,4 +119,23 @@
             log.error("涓嬭浇鏂囦欢澶辫触", e);
         }
     }
-}
+
+
+    public int getTomcatPort() {
+        MBeanServer beanServer = ManagementFactory.getPlatformMBeanServer();
+        try {
+            QueryExp protocol = Query.match(Query.attr("protocol"), Query.value("HTTP/1.1"));
+            ObjectName name = new ObjectName("*:type=Connector,*");
+            Set<ObjectName> objectNames = beanServer.queryNames(name, protocol);
+            for (ObjectName objectName : objectNames) {
+                String catalina = objectName.getDomain();
+                if ("Catalina".equals(catalina)) {
+                    return Integer.parseInt(objectName.getKeyProperty("port"));
+                }
+            }
+        } catch (MalformedObjectNameException e) {
+            e.printStackTrace();
+        }
+        return 0;
+    }
+}
\ No newline at end of file
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
index f2220b6..b7533d6 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
@@ -601,9 +601,9 @@
                     serviceFundflowAuto.setFlowcontent("闈炰笓鑱屼汉鍛樹簩绾у鏍告嫆缁濆悗鐩存帴閫�鍥炲埌淇敼鐘舵��");
                     serviceFundflowAuto.setFlowlevel(1);
                     serviceFundflowService.save(serviceFundflowAuto);
-
                     serviceReimbursement.setRecordstatus(1);
                 }
+
             }
 
             serviceReimbursementService.updateById(serviceReimbursement);
@@ -618,10 +618,12 @@
             serviceSystemmessage.setIsread(0);
             serviceSystemmessage.setMessagetype(1);
             serviceSystemmessage.setRelevantno(serviceReimbursement.getId());
+            log.info("CheckFlag鐨勫�� : {}", CheckFlag);
             if (CheckFlag == 1) {
                 //閫氳繃
                 serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "绾у鏍搁�氳繃");
                 serviceSystemmessage.setMessagecontent("鎮�" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime()) + "鎻愪氦鐨勫叧浜庢崘鐚渚嬨��" + serviceReimbursement.getDonorname() + "銆戠殑宸梾璐圭敵璇峰凡閫氳繃" + (OriginalFlowLevel + 1) + "绾у鏍�");
+                log.info("totalLevel鐨勫�� : {},  OriginalFlowLevel鐨勫��:{}", totalLevel,OriginalFlowLevel);
                 if (totalLevel == OriginalFlowLevel + 1) {
                     //鎵�鏈夋暟鎹柊澧炲埌澶囦唤琛�
                     serviceReimbursementService.addSharedData(checkFundVO.getFundid());
diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java
index eb06291..3cd071b 100644
--- a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java
+++ b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java
@@ -19,6 +19,7 @@
 import com.ruoyi.project.service.IServiceReimbursementdetailSharedService;
 import com.ruoyi.project.service.IServiceReimbursementpayeeSharedService;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -117,10 +118,11 @@
 
     @Override
     public List<ServiceReimbursementdetailVO> getRBDetailList(Long id) {
+        log.info("getRBDetailList鐨勫叆鍙�:{}", id);
         List<ServiceReimbursementdetailVO> serviceReimbursementdetailVOS = new ArrayList<>();
         List<ServiceReimbursementdetail> rbDetailList = serviceReimbursementdetailMapper.getRBDetailList(id);
+        log.info("getRBDetailList鐨勫叆鍙�:{}", CollectionUtils.isEmpty(rbDetailList) ? null : rbDetailList.size());
         for (int j = 0; j < rbDetailList.size(); j++) {
-
             ServiceReimbursementdetail serviceReimbursementdetail = rbDetailList.get(j);
             String annexfiles = serviceReimbursementdetail.getAnnexfiles();
             ServiceReimbursementdetailVO serviceReimbursementdetailVO = DtoConversionUtils.sourceToTarget(serviceReimbursementdetail, ServiceReimbursementdetailVO.class);
@@ -147,10 +149,10 @@
         columnMap.put("rbid", id);
         //鑾峰彇璇︽儏鏁版嵁
         List<ServiceReimbursementdetail> details = serviceReimbursementdetailMapper.selectByMap(columnMap);
-        log.info("serviceReimbursementdetailMapper.selectByMap鏂规硶鐨勮繑鍙傚弬 :{}", details.size());
+        log.info("serviceReimbursementdetailMapper.selectByMap鏂规硶鐨勮繑鍙傚弬 :{}", CollectionUtils.isEmpty(details) ? null : details.size());
         //鑾峰彇鏀粯鏁版嵁
         List<ServiceReimbursementpayee> serviceReimbursementpayees = reimbursementpayeeMapper.selectByMap(columnMap);
-        log.info("reimbursementpayeeMapper.selectByMap鏂规硶鐨勮繑鍙傚弬 :{}", serviceReimbursementpayees.size());
+        log.info("reimbursementpayeeMapper.selectByMap鏂规硶鐨勮繑鍙傚弬 :{}", CollectionUtils.isEmpty(serviceReimbursementpayees) ? null : serviceReimbursementpayees.size());
         //鏁版嵁缁勮
         ServiceReimbursementShared serviceReimbursementShared = DtoConversionUtils.sourceToTarget(serviceReimbursement, ServiceReimbursementShared.class);
         serviceReimbursementShared.setReimid(id);
@@ -231,7 +233,7 @@
 
         JSONObject json1 = JSONObject.parseObject(strRes);
         strRes = json1.get("id").toString();
-
+        log.info("strRes鐨勫�� : {}", strRes);
         String filePath = RuoYiConfig.getUploadPath();
         String strFUrl = "http://129.88.242.39:8899/seeyon/rest/attachment?token=" + strRes;
 

--
Gitblit v1.9.3