|
|
|
@ -138,13 +138,24 @@ public class RequestRecordServiceImpl extends MpBaseServiceImpl<RequestRecordDao |
|
|
|
|
if (recordenum.getMethodName().equals(dbRecord.getActiveCall())) { |
|
|
|
|
snPushCheckRecordService = (SNPushCheckRecordService)applicationContext.getBean(recordenum.getClassName()); |
|
|
|
|
log.info("通过反射获取到的snPushCheckRecordService是否为空:{}",JSONObject.toJSONString(snPushCheckRecordService == null)); |
|
|
|
|
Method method = ReflectUtil.getMethod(recordenum.getClass(), recordenum.getMethodName(), recordenum.getArgClass()); |
|
|
|
|
Method method = ReflectUtil.getMethodByName(snPushCheckRecordService.getClass(),recordenum.getMethodName()); |
|
|
|
|
log.info("通过反射获取到的方法是否为空:{}",JSONObject.toJSONString(method == null)); |
|
|
|
|
if (method != null) { |
|
|
|
|
log.info("通过反射获取到的方法名:{}",JSONObject.toJSONString(method.getName())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Object invokeResponse = null; |
|
|
|
|
R data = new R(1000, "default success"); |
|
|
|
|
try { |
|
|
|
|
DynamicContextHolder.push(dbname+DbConstant.BUSINESS_WRITE); |
|
|
|
|
invokeResponse = method.invoke(snPushCheckRecordService, JSONObject.parseObject(dbRecord.getActiveCallRequestDetail(), recordenum.getArgClass())); |
|
|
|
|
List<String> list = JSONObject.parseObject(dbRecord.getActiveCallRequestDetail(),List.class); |
|
|
|
|
if (recordenum.getArgClass().length>1) { |
|
|
|
|
invokeResponse = method.invoke(snPushCheckRecordService, JSONObject.parseObject(list.get(0), recordenum.getArgClass()[0]),JSONObject.parseObject(list.get(1), recordenum.getArgClass()[1])); |
|
|
|
|
}else { |
|
|
|
|
invokeResponse = method.invoke(snPushCheckRecordService, JSONObject.parseObject(list.get(0), recordenum.getArgClass()[0])); |
|
|
|
|
} |
|
|
|
|
log.info("重调后得到的结果:{}",JSONObject.toJSONString(invokeResponse)); |
|
|
|
|
|
|
|
|
|
Map<String,String> map = JSONObject.parseObject(JSONObject.toJSONString(invokeResponse), Map.class); |
|
|
|
|
|
|
|
|
|
data.put("data", invokeResponse); |
|
|
|
@ -168,16 +179,10 @@ public class RequestRecordServiceImpl extends MpBaseServiceImpl<RequestRecordDao |
|
|
|
|
updateSuccessfulRecallRecord(dbRecord, 0, JSONObject.toJSONString(invokeResponse), JSONObject.toJSONString(data)); |
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
} |
|
|
|
|
catch (IllegalAccessException e) { |
|
|
|
|
log.info("重调用出现异常,异常信息:{}",e); |
|
|
|
|
updateFailedRecallRecord(dbRecord, 1, JSONObject.toJSONString(invokeResponse), JSONObject.toJSONString(data), JSONObject.toJSONString(e), 1); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("重调用出现异常,请稍后重试"))); |
|
|
|
|
} catch (InvocationTargetException e) { |
|
|
|
|
log.info("重调用出现异常,异常信息:{}",e); |
|
|
|
|
updateFailedRecallRecord(dbRecord, 1, JSONObject.toJSONString(invokeResponse), JSONObject.toJSONString(data), JSONObject.toJSONString(e), 1); |
|
|
|
|
catch (Exception e) { |
|
|
|
|
log.info("重调出现异常,异常信息:{}",e); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("重调用出现异常,请稍后重试"))); |
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|