From e7842d69ae1cf2c03e65083cf5fc55250594ee2d Mon Sep 17 00:00:00 2001 From: xuliangwei Date: Wed, 19 Jul 2023 14:22:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RequestRecordServiceImpl.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/RequestRecordServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/RequestRecordServiceImpl.java index 2f238dfd..f9be9d4e 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/RequestRecordServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/RequestRecordServiceImpl.java @@ -146,33 +146,32 @@ public class RequestRecordServiceImpl extends MpBaseServiceImpl map = JSONObject.parseObject(JSONObject.toJSONString(invokeResponse), Map.class); + JSONObject rspJson = JSONObject.parseObject(JSONObject.toJSONString(invokeResponse), JSONObject.class); data.put("data", invokeResponse); - if (map.containsKey("SAPKEY")) { - if (!map.containsValue("处理成功")) { - updateFailedRecallRecord(dbRecord, 1, JSONObject.toJSONString(invokeResponse), JSONObject.toJSONString(data), map.get("ZMESSAGE"), 0); + if (rspJson.containsKey("SAPKEY")) { + if (!rspJson.containsKey("处理成功")) { + updateFailedRecallRecord(dbRecord, 1, JSONObject.toJSONString(invokeResponse), JSONObject.toJSONString(data), rspJson.getString("ZMESSAGE"), 0); return ResponseEntity.ok(JSONObject.toJSONString(data)); } } - if (map.containsKey("code")) { - updateFailedRecallRecord(dbRecord, 1, JSONObject.toJSONString(invokeResponse), JSONObject.toJSONString(data), map.get("message"), 0); + if (rspJson.containsKey("code")) { + updateFailedRecallRecord(dbRecord, 1, JSONObject.toJSONString(invokeResponse), JSONObject.toJSONString(data), rspJson.getString("message"), 0); return ResponseEntity.ok(JSONObject.toJSONString(data)); } else { - if (map.containsKey("cyjg")) { - updateFailedRecallRecord(dbRecord, 1, JSONObject.toJSONString(invokeResponse), JSONObject.toJSONString(data), map.get("cyjgxx"), 0); + if (rspJson.containsKey("cyjg")) { + updateFailedRecallRecord(dbRecord, 1, JSONObject.toJSONString(invokeResponse), JSONObject.toJSONString(data), rspJson.getString("cyjgxx"), 0); return ResponseEntity.ok(JSONObject.toJSONString(data)); } } updateSuccessfulRecallRecord(dbRecord, 0, JSONObject.toJSONString(invokeResponse), JSONObject.toJSONString(data)); return ResponseEntity.ok(JSONObject.toJSONString(data)); - } - catch (Exception e) { + }catch (Exception e) { log.info("重调出现异常,异常信息:{}",e); updateFailedRecallRecord(dbRecord, 1, JSONObject.toJSONString(invokeResponse), - JSONObject.toJSONString(data), "重调用失败,异常信息:{}"+JSONObject.toJSONString(e.getMessage()), 0); + JSONObject.toJSONString(data), "重调用出现异常:"+JSONObject.toJSONString(e.getMessage()), 0); return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT))); } @@ -217,7 +216,6 @@ public class RequestRecordServiceImpl extends MpBaseServiceImpl