From 0154e179e58077dfbbe8e65c45b7309945802a15 Mon Sep 17 00:00:00 2001 From: xiaohanzi Date: Wed, 15 Dec 2021 17:39:32 +0800 Subject: [PATCH] fix bug --- .../park/impl/haikangweishi/HaiKangWeiShiUtil.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiUtil.java b/mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiUtil.java index 4ef53114c..ec80a1e89 100644 --- a/mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiUtil.java +++ b/mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiUtil.java @@ -200,13 +200,13 @@ public class HaiKangWeiShiUtil { throw new MallinkException(errStatus,"haikang getFee error.["+result.getString("error")+"]"+result.getString("message")); } - if (!result.getString("code").equals("200") ) { + if (!result.getString("code").equals("0") ) { String message = result.getString("msg"); - throw new MallinkException(result.getInteger("code"), "haikang getFee error."+message); + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikang getFee error.["+result.getString("code")+"]"+message); } JSONObject attribute = result.getJSONObject("data"); if (null == attribute) { - throw new MallinkException(result.getInteger("code"), "haikang getFee error. no result"+carNumber); + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikang getFee error. no result ["+result.getInteger("code")+"]"+carNumber); } return attribute; } @@ -317,10 +317,10 @@ public class HaiKangWeiShiUtil { if (null != pairs) { try { - StringEntity entity = new StringEntity(JSON.toJSONString(pairs)); + StringEntity entity = new StringEntity(JSON.toJSONString(pairs),"UTF-8"); entity.setContentType("application/json"); httpPost.setEntity(entity); - } catch (UnsupportedEncodingException e) { + } catch (Exception e) { log.error(e.getLocalizedMessage(),e); } }