代码修改

release
xuliangwei 2 years ago
parent 58315ba7ae
commit e7842d69ae
  1. 22
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/RequestRecordServiceImpl.java

@ -146,33 +146,32 @@ public class RequestRecordServiceImpl extends MpBaseServiceImpl<RequestRecordDao
log.info("重调后得到的结果:{}",JSONObject.toJSONString(invokeResponse));
Map<String,String> 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<RequestRecordDao
record.setRecallResponseDetail(JSONObject.toJSONString(recallMap));
} else {
JSONObject.parseObject(record.getRecallResponseDetail(),LinkedHashMap.class).put("第"+ record.getRetryTimes() + 1+"次重调结果", recallResponseDetail);
JSONObject.parseObject(record.getActiveCallRecallResponse(),LinkedHashMap.class).put("第"+ record.getRetryTimes() + 1+"次主动调用重调返回结果", activeCallRecallResponse);
}
}

Loading…
Cancel
Save