From 82de5a307466894bbb0258f8a63a26a7bb96d80d Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期四, 16 十月 2025 09:55:35 +0800 Subject: [PATCH] 13 --- src/main/java/com/zy/erp/kingdee/utils/PostMesDataUtils.java | 38 ++++++++++++++++++++------------------ 1 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/zy/erp/kingdee/utils/PostMesDataUtils.java b/src/main/java/com/zy/erp/kingdee/utils/PostMesDataUtils.java index 1b89571..e21a059 100644 --- a/src/main/java/com/zy/erp/kingdee/utils/PostMesDataUtils.java +++ b/src/main/java/com/zy/erp/kingdee/utils/PostMesDataUtils.java @@ -15,12 +15,12 @@ @Slf4j public class PostMesDataUtils extends AbstractHandler<String> { - public ReturnT<String> postMesData(String name, String URL, String mesPath, Object combParam){ + public ReturnT<String> postMesData(String name, String URL, String mesPath, Object combParam) { // if (true){ // System.out.println("name:"+name+",URL:"+URL+",mesPath:"+mesPath+",combParam:"+combParam); // return SUCCESS; // } - if(combParam != null){ + if (combParam != null) { String response = ""; boolean success = false; try { @@ -33,17 +33,17 @@ .setJson(JSON.toJSONString(combParam)) .build() .doPost(); - System.out.println("response:"+response); + System.out.println("response:" + response); JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(200)) { success = true; } else { - log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", URL+"/"+mesPath, JSON.toJSONString(combParam), response); - throw new CoolException("涓婃姤"+name); + log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", URL + "/" + mesPath, JSON.toJSONString(combParam), response); + throw new CoolException("涓婃姤" + name); } } catch (Exception e) { - log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", URL+"/"+mesPath, JSON.toJSONString(combParam), response); + log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", URL + "/" + mesPath, JSON.toJSONString(combParam), response); // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return FAIL.setMsg(e.getMessage()); } finally { @@ -51,8 +51,8 @@ // 淇濆瓨鎺ュ彛鏃ュ織 ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class); apiLogService.save( - "涓婃姤"+name, - URL +"/"+ mesPath, + "涓婃姤" + name, + URL + "/" + mesPath, null, "127.0.0.1", JSON.toJSONString(combParam), @@ -60,18 +60,19 @@ success ); } catch (Exception e) { - log.error("", e); } + log.error("", e); + } } } return SUCCESS; } - public ReturnT<String> postMesData(String name, String URL, String mesPath, Object combParam,Map<String, Object> map){ + public ReturnT<String> postMesData(String name, String URL, String mesPath, Object combParam, Map<String, Object> map) { // if (true){ // System.out.println("name:"+name+",URL:"+URL+",mesPath:"+mesPath+",combParam:"+combParam); // return SUCCESS; // } - if(combParam != null){ + if (combParam != null) { String response = ""; boolean success = false; try { @@ -84,17 +85,17 @@ .setJson(JSON.toJSONString(combParam)) .build() .doPost(); - System.out.println("response:"+response); + System.out.println("response:" + response); JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(200)) { success = true; } else { - log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", URL+"/"+mesPath, JSON.toJSONString(combParam), response); - throw new CoolException("涓婃姤"+name); + log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", URL + "/" + mesPath, JSON.toJSONString(combParam), response); + throw new CoolException("涓婃姤" + name); } } catch (Exception e) { - log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", URL+"/"+mesPath, JSON.toJSONString(combParam), response); + log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", URL + "/" + mesPath, JSON.toJSONString(combParam), response); // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return FAIL.setMsg(e.getMessage()); } finally { @@ -102,8 +103,8 @@ // 淇濆瓨鎺ュ彛鏃ュ織 ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class); apiLogService.save( - "涓婃姤"+name, - URL +"/"+ mesPath, + "涓婃姤" + name, + URL + "/" + mesPath, null, "127.0.0.1", JSON.toJSONString(combParam), @@ -111,7 +112,8 @@ success ); } catch (Exception e) { - log.error("", e); } + log.error("", e); + } } } return SUCCESS; -- Gitblit v1.9.1