工匠学院 - 祸水东引,给工匠学院找点儿事(优化报错信息)

xuyifeng-0724-人员中台对接-dev
water_xu 2024-07-10 17:39:40 +08:00
parent 13ab1247b6
commit 9d98be6430
1 changed files with 3 additions and 2 deletions

View File

@ -72,11 +72,12 @@ public class GJSendMessageUtil {
Map<String, String> _body = JSONObject.parseObject(body, new TypeReference<Map<String, String>>() {});
Map<String, String> data = JSONObject.parseObject(_body.get("data"), new TypeReference<Map<String, String>>() {});
if (!"1".equals(_body.get("code"))) {
throw new RuntimeException(_body.get("message"));
System.out.println(_body.get("message"));
throw new RuntimeException("工匠学院异常,请联系学院老师");
}
if (!data.get("syncUserTotal").equals(data.get("syncSuccessCount"))){
String errorMsg = JSONObject.parseArray(data.get("msgList"), Map.class).stream().map(e -> "[" + e.get("msg") + "]").collect(Collectors.joining());
throw new RuntimeException("错误信息:" + errorMsg);
throw new RuntimeException("工匠学院异常,请联系学院老师。错误信息:" + errorMsg);
}
System.out.println("==========================");
System.out.println(body);