From adf3a1c6591b8db2c47f45c2ac2370e66d505edb Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 22 四月 2022 23:01:55 +0800 Subject: [PATCH] #三方接口日志 --- src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java index f346e05..58d6f25 100644 --- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java @@ -289,27 +289,27 @@ for (DetlDto detlDto : detlDtos) { mesCombParam.getList().add(new MesCombParam.Detl(detlDto.getMatnr(), detlDto.getAnfme())); } - System.out.println(JSON.toJSONString(mesCombParam)); String response; try { - response = new HttpHandler.Builder() + response = new HttpHandler.Builder() .setUri(MesConstant.URL) .setPath(MesConstant.PACK_DOWN_URL) - .setJson(JSON.toJSONString(param)) + .setJson(JSON.toJSONString(mesCombParam)) .build() .doPost(); JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(200)) { log.info("璇锋眰鎺ュ彛鎴愬姛锛侊紒锛�"); -// log.info("璇锋眰鎺ュ彛鎴愬姛锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); + } else if (jsonObject.getInteger("code").equals(500)) { + log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); + throw new CoolException(jsonObject.getString("msg")); } else { log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); throw new CoolException("涓婃姤mes绯荤粺澶辫触"); } } catch (Exception e) { log.error("fail", e); - e.printStackTrace(); - throw new CoolException("涓婃姤mes绯荤粺澶辫触"); + throw new CoolException(e.getMessage()); } } -- Gitblit v1.9.1