Commit a3010499 authored by xiaozhe.chen's avatar xiaozhe.chen

运营系统替换中台接口

parent 935a1e78
...@@ -13,7 +13,7 @@ public class MoResult<T> implements Serializable { ...@@ -13,7 +13,7 @@ public class MoResult<T> implements Serializable {
private String msg = ""; private String msg = "";
// 0成功,1失败 // 0成功,1失败
private String code = "0"; private String code = "0";
// 业务错误码
private T data = null; private T data = null;
......
...@@ -6,6 +6,7 @@ import cn.quantgroup.customer.exception.BusinessException; ...@@ -6,6 +6,7 @@ import cn.quantgroup.customer.exception.BusinessException;
import cn.quantgroup.customer.rest.param.repay.RepayOrderInfoQuery; import cn.quantgroup.customer.rest.param.repay.RepayOrderInfoQuery;
import cn.quantgroup.customer.rest.param.repay.RepayOrderQuery; import cn.quantgroup.customer.rest.param.repay.RepayOrderQuery;
import cn.quantgroup.customer.rest.vo.JsonResult; import cn.quantgroup.customer.rest.vo.JsonResult;
import cn.quantgroup.customer.rest.vo.MoResult;
import cn.quantgroup.customer.rest.vo.repay.RepayInfoResult; import cn.quantgroup.customer.rest.vo.repay.RepayInfoResult;
import cn.quantgroup.customer.rest.vo.repay.RepayOptRecord; import cn.quantgroup.customer.rest.vo.repay.RepayOptRecord;
import cn.quantgroup.customer.rest.vo.repay.XyqbRepayInfo; import cn.quantgroup.customer.rest.vo.repay.XyqbRepayInfo;
...@@ -102,9 +103,9 @@ public class RepayServiceImpl implements IRepayService { ...@@ -102,9 +103,9 @@ public class RepayServiceImpl implements IRepayService {
return JsonResult.buildErrorStateResult(ErrorCodeEnum.RETURN_ERROR.getMessage(), ErrorCodeEnum.RETURN_ERROR.getCode()); return JsonResult.buildErrorStateResult(ErrorCodeEnum.RETURN_ERROR.getMessage(), ErrorCodeEnum.RETURN_ERROR.getCode());
} }
JsonResult<List<XyqbRepayInfo>> xyqbRepayInfoResult; MoResult<List<XyqbRepayInfo>> xyqbRepayInfoResult;
try { try {
Type jsonType = new com.google.gson.reflect.TypeToken<JsonResult<List<XyqbRepayInfo>>>() { Type jsonType = new com.google.gson.reflect.TypeToken<MoResult<List<XyqbRepayInfo>>>() {
}.getType(); }.getType();
xyqbRepayInfoResult = Constant.GSON.fromJson(repayInfoStr, jsonType); xyqbRepayInfoResult = Constant.GSON.fromJson(repayInfoStr, jsonType);
} catch (Exception e) { } catch (Exception e) {
...@@ -140,9 +141,9 @@ public class RepayServiceImpl implements IRepayService { ...@@ -140,9 +141,9 @@ public class RepayServiceImpl implements IRepayService {
return JsonResult.buildErrorStateResult(ErrorCodeEnum.RETURN_ERROR.getMessage(), ErrorCodeEnum.RETURN_ERROR.getCode()); return JsonResult.buildErrorStateResult(ErrorCodeEnum.RETURN_ERROR.getMessage(), ErrorCodeEnum.RETURN_ERROR.getCode());
} }
JsonResult<List<RepayOptRecord>> repayOptRecordResult; MoResult<List<RepayOptRecord>> repayOptRecordResult;
try { try {
Type jsonType = new com.google.gson.reflect.TypeToken<JsonResult<List<RepayOptRecord>>>() { Type jsonType = new com.google.gson.reflect.TypeToken<MoResult<List<RepayOptRecord>>>() {
}.getType(); }.getType();
repayOptRecordResult = Constant.GSON.fromJson(optRecordsStr, jsonType); repayOptRecordResult = Constant.GSON.fromJson(optRecordsStr, jsonType);
} catch (Exception e) { } catch (Exception e) {
...@@ -151,6 +152,6 @@ public class RepayServiceImpl implements IRepayService { ...@@ -151,6 +152,6 @@ public class RepayServiceImpl implements IRepayService {
} }
log.info("[查询还款操作记录],返回 repayOptRecordResult={}", repayOptRecordResult); log.info("[查询还款操作记录],返回 repayOptRecordResult={}", repayOptRecordResult);
return repayOptRecordResult; return JsonResult.buildSuccessResult("处理成功", repayOptRecordResult.getData());
} }
} }
...@@ -3,6 +3,7 @@ package cn.quantgroup.customer.service.impl; ...@@ -3,6 +3,7 @@ package cn.quantgroup.customer.service.impl;
import cn.quantgroup.customer.model.order.OrderRepayment; import cn.quantgroup.customer.model.order.OrderRepayment;
import cn.quantgroup.customer.rest.param.repay.RepayOrderInfoQuery; import cn.quantgroup.customer.rest.param.repay.RepayOrderInfoQuery;
import cn.quantgroup.customer.rest.vo.JsonResult; import cn.quantgroup.customer.rest.vo.JsonResult;
import cn.quantgroup.customer.rest.vo.MoResult;
import cn.quantgroup.customer.service.ISidecarService; import cn.quantgroup.customer.service.ISidecarService;
import cn.quantgroup.customer.service.http.IHttpService; import cn.quantgroup.customer.service.http.IHttpService;
import cn.quantgroup.customer.util.JSONTools; import cn.quantgroup.customer.util.JSONTools;
...@@ -45,11 +46,10 @@ public class SidecarServiceImpl implements ISidecarService { ...@@ -45,11 +46,10 @@ public class SidecarServiceImpl implements ISidecarService {
log.error("{} 查询还款计划失败 loanId={} result={}", logPre, loanId, result); log.error("{} 查询还款计划失败 loanId={} result={}", logPre, loanId, result);
return JsonResult.buildErrorStateResult("查询还款计划失败", null); return JsonResult.buildErrorStateResult("查询还款计划失败", null);
} else { } else {
TypeReference<JsonResult<OrderRepayment>> typeToken = new TypeReference<JsonResult<OrderRepayment>>() { JsonResult<OrderRepayment> OrderRepaymentResult = JSONTools.deserialize(result, new TypeReference<MoResult<OrderRepayment>>() {
}; });
JsonResult<OrderRepayment> result1 = JSONTools.deserialize(result, typeToken); if (OrderRepaymentResult != null) {
if (result1 != null) { return OrderRepaymentResult;
return result1;
} else { } else {
return JsonResult.buildErrorStateResult("还款计划查询失败", null); return JsonResult.buildErrorStateResult("还款计划查询失败", null);
} }
......
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