From c4a1126fa6dcc12c8def6b394884ed198d55387c Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期一, 17 八月 2026 17:54:44 +0800
Subject: [PATCH] fix:mes调用同步库注释企业微信和ifs

---
 ruoyi-common/src/main/java/com/ruoyi/common/utils/WxCpUtils.java |  112 +++++++++++++++++++++++++++++---------------------------
 1 files changed, 58 insertions(+), 54 deletions(-)

diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxCpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxCpUtils.java
index 9651311..cca469c 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxCpUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxCpUtils.java
@@ -33,40 +33,41 @@
 	 * @throws Exception
 	 */
 	public static void inform(String user, String content, File imageFile) throws Exception {
-		WxCpDefaultConfigImpl config = new WxCpDefaultConfigImpl();
-		// 娉ㄥ唽鐨勪紒涓氫俊鎭�
-		config.setCorpId(CORP_ID);
-		config.setCorpSecret(CORP_SECRET);
-
-		WxCpServiceImpl wxCpService = new WxCpServiceImpl();
-		wxCpService.setWxCpConfigStorage(config);
-
-		WxCpMessage message;
-		WxCpMessageSendResult result;
-		// 鍙戦�佹枃鏈�
-		if (StringUtils.isNotBlank(content)) {
-			message = WxCpMessage.TEXT()
-					.content(content)
-					// 鐢ㄦ埛id
-					.toUser(user)
-					// 搴旂敤id
-					.agentId(AGENT_ID)
-					.build();
-			result = wxCpService.getMessageService().send(message);
-		}
-		// 鍙戦�佹枃浠�
-		if (imageFile != null) {
-			// 鑾峰彇鏂囦欢id
-			WxMediaUploadResult imgResult = wxCpService.getMediaService().upload("file", imageFile);
-			message = WxCpMessage.IMAGE()
-					.mediaId(imgResult.getMediaId())
-					// 鐢ㄦ埛id
-					.toUser(user)
-					// 搴旂敤id
-					.agentId(AGENT_ID)
-					.build();
-			result = wxCpService.getMessageService().send(message);
-		}
+		return;
+//		WxCpDefaultConfigImpl config = new WxCpDefaultConfigImpl();
+//		// 娉ㄥ唽鐨勪紒涓氫俊鎭�
+//		config.setCorpId(CORP_ID);
+//		config.setCorpSecret(CORP_SECRET);
+//
+//		WxCpServiceImpl wxCpService = new WxCpServiceImpl();
+//		wxCpService.setWxCpConfigStorage(config);
+//
+//		WxCpMessage message;
+//		WxCpMessageSendResult result;
+//		// 鍙戦�佹枃鏈�
+//		if (StringUtils.isNotBlank(content)) {
+//			message = WxCpMessage.TEXT()
+//					.content(content)
+//					// 鐢ㄦ埛id
+//					.toUser(user)
+//					// 搴旂敤id
+//					.agentId(AGENT_ID)
+//					.build();
+//			result = wxCpService.getMessageService().send(message);
+//		}
+//		// 鍙戦�佹枃浠�
+//		if (imageFile != null) {
+//			// 鑾峰彇鏂囦欢id
+//			WxMediaUploadResult imgResult = wxCpService.getMediaService().upload("file", imageFile);
+//			message = WxCpMessage.IMAGE()
+//					.mediaId(imgResult.getMediaId())
+//					// 鐢ㄦ埛id
+//					.toUser(user)
+//					// 搴旂敤id
+//					.agentId(AGENT_ID)
+//					.build();
+//			result = wxCpService.getMessageService().send(message);
+//		}
 	}
 
 	/**
@@ -77,19 +78,20 @@
 	 * @throws Exception
 	 */
 	public static void informWebHook(List<String> webHookList, File file) throws Exception {
-		JSONObject json = new JSONObject();
-		json.putOpt("msgtype", "image");
-		JSONObject image = new JSONObject();
-		image.putOpt("base64", getBase64(file));
-		image.putOpt("md5", getMd5(file));
-		json.putOpt("image", image);
-
-		webHookList.stream().forEach(webHook -> {
-			String result = HttpRequest.post(webHook)
-					.header("Content-Type", "application/json")
-					.body(json.toString())
-					.execute().body();
-		});
+		return;
+//		JSONObject json = new JSONObject();
+//		json.putOpt("msgtype", "image");
+//		JSONObject image = new JSONObject();
+//		image.putOpt("base64", getBase64(file));
+//		image.putOpt("md5", getMd5(file));
+//		json.putOpt("image", image);
+//
+//		webHookList.stream().forEach(webHook -> {
+//			String result = HttpRequest.post(webHook)
+//					.header("Content-Type", "application/json")
+//					.body(json.toString())
+//					.execute().body();
+//		});
 	}
 
 	/**
@@ -100,7 +102,8 @@
 	 * @throws Exception
 	 */
 	public static String informWebHook(String webHook, String content) {
-		return informWebHook(webHook, content,"text");
+		return "";
+//		return informWebHook(webHook, content,"text");
 	}
 
 	/**
@@ -112,11 +115,12 @@
 	 * @throws Exception
 	 */
 	public static String informWebHook(String webHook, String content,String msgType) {
-		JSONObject jsonObject = new JSONObject()
-				.accumulate("msgtype", msgType)
-				.accumulate(msgType, new JSONObject()
-						.accumulate("content", content));
-		return HttpRequest.post(webHook).header("Content-Type", "application/json").body(jsonObject.toString()).execute().body();
+		return "";
+//		JSONObject jsonObject = new JSONObject()
+//				.accumulate("msgtype", msgType)
+//				.accumulate(msgType, new JSONObject()
+//						.accumulate("content", content));
+//		return HttpRequest.post(webHook).header("Content-Type", "application/json").body(jsonObject.toString()).execute().body();
 	}
 
 	public static String getMd5(File file) {
@@ -162,4 +166,4 @@
 		return base64Str;
 	}
 
-}
+}
\ No newline at end of file

--
Gitblit v1.9.3