记得上下班打卡 | git大法好,push需谨慎

Commit 0645415c authored by jiangxiulong's avatar jiangxiulong

异常处理

parent 1b2aa1b9
......@@ -182,8 +182,13 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
String result = shunfengSignUtils.generateSignatureAndRequest(hBody, "/public/order/v1/placeOrder");
HashMap hashMap = JsonUtils.fromJson(result, HashMap.class);
System.out.println(result);
if (hashMap.get("succ").equals("fail")) {
String msg = (String) hashMap.get("msg");
if (null == hashMap.get("succ") || hashMap.get("succ").equals("fail")) {
String msg = "";
if (null == hashMap.get("succ")) {
msg = result;
} else {
msg = (String) hashMap.get("msg");
}
return ResponseDto.failure(msg);
} else {
HashMap hashMapResult = (HashMap) hashMap.get("result");
......
......@@ -97,25 +97,14 @@ public class ShunfengSignUtils {
return EntityUtils.toString(entity, "utf-8");
}
} catch (Exception e) {
KylinOrderExpress kylinOrderExpresstest = new KylinOrderExpress();
kylinOrderExpresstest.setRemark(e.getMessage());
kylinOrderExpressMapper.update(
kylinOrderExpresstest
, new UpdateWrapper<KylinOrderExpress>().in("order_express_id", "4277059374923776311218")
);
System.out.println("发送请求失败");
e.printStackTrace();
return e.getMessage();
} finally {
if (client != null) {
try {
client.close();
} catch (IOException e) {
KylinOrderExpress kylinOrderExpresstest = new KylinOrderExpress();
kylinOrderExpresstest.setRemark(e.getMessage());
kylinOrderExpressMapper.update(
kylinOrderExpresstest
, new UpdateWrapper<KylinOrderExpress>().in("order_express_id", "4277155059580928598770")
);
e.printStackTrace();
}
}
......@@ -123,12 +112,6 @@ public class ShunfengSignUtils {
try {
response.close();
} catch (IOException e) {
KylinOrderExpress kylinOrderExpresstest = new KylinOrderExpress();
kylinOrderExpresstest.setRemark(e.getMessage());
kylinOrderExpressMapper.update(
kylinOrderExpresstest
, new UpdateWrapper<KylinOrderExpress>().in("order_express_id", "4283919842787328538414")
);
e.printStackTrace();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment