Commit a6b0d894 authored by 杨锐's avatar 杨锐

业务限制API。

parent 49a234a7
package cn.quantgroup.xyqb.controller.modifyphoneno.resp;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* Date: 2019/11/5
* Time: 上午11:49
*
* @author: yangrui
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UserLoanStatusResp implements Serializable {
private static final long serialVersionUID = 6325390529584723230L;
private boolean bizSuc;
private String businessCode;
private String code;
/**
* true:没有订单; false: 存在订单
*/
private boolean data;
private String msg;
private boolean success;
}
...@@ -8,9 +8,9 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.req.ModifyPhoneNoQueryReq; ...@@ -8,9 +8,9 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.req.ModifyPhoneNoQueryReq;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step1Req; import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step1Req;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step2Req; import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step2Req;
import cn.quantgroup.xyqb.controller.modifyphoneno.resp.ProgressResp; import cn.quantgroup.xyqb.controller.modifyphoneno.resp.ProgressResp;
import cn.quantgroup.xyqb.controller.modifyphoneno.resp.UserLoanStatusResp;
import cn.quantgroup.xyqb.entity.ModifyPhoneNo; import cn.quantgroup.xyqb.entity.ModifyPhoneNo;
import cn.quantgroup.xyqb.exception.DataException; import cn.quantgroup.xyqb.exception.DataException;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.repository.IModifyPhoneNoRepository; import cn.quantgroup.xyqb.repository.IModifyPhoneNoRepository;
import cn.quantgroup.xyqb.repository.IUserDetailRepository; import cn.quantgroup.xyqb.repository.IUserDetailRepository;
import cn.quantgroup.xyqb.repository.IUserRepository; import cn.quantgroup.xyqb.repository.IUserRepository;
...@@ -19,6 +19,7 @@ import cn.quantgroup.xyqb.service.sms.ISmsService; ...@@ -19,6 +19,7 @@ import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.service.user.IModifyPhoneNoService; import cn.quantgroup.xyqb.service.user.IModifyPhoneNoService;
import cn.quantgroup.xyqb.service.user.IUserService; import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.DateUtils; import cn.quantgroup.xyqb.util.DateUtils;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.qiniu.util.Auth; import com.qiniu.util.Auth;
...@@ -248,20 +249,20 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService { ...@@ -248,20 +249,20 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
throw new DataException("信息填写有误,请重新填写。"); throw new DataException("信息填写有误,请重新填写。");
} }
log.info("allowModify userId = 【{}】", userId); log.info("allowModify userId = 【{}】", userId);
String res = httpService.get(apiHttps + "/ex/loan/user/loan_status?userId=" + userId); String res = httpService.get(apiHttps + "/ex/loan/user/loan_status.json?userId=" + userId);
log.info("allowModify res = 【{}】", res); log.info("allowModify res = 【{}】", res);
if (StringUtils.isBlank(res)) { if (StringUtils.isBlank(res)) {
throw new DataException("系统内部错误。"); throw new DataException("系统内部错误。");
} else { } else {
try { try {
UserLoanStatusResp userLoanStatusResp = JSONObject.parseObject(res, UserLoanStatusResp.class); JsonResult jsonResult = JSONObject.parseObject(res, JsonResult.class);
if (userLoanStatusResp == null) { if (jsonResult == null) {
throw new DataException("系统内部错误。"); throw new DataException("系统内部错误。");
} }
if (!userLoanStatusResp.isSuccess() || !userLoanStatusResp.isData()) { if (!jsonResult.isSuccess() || !"true".equals(jsonResult.getData())) {
throw new DataException("用户存在订单,不支持修改。"); throw new DataException(jsonResult.getMsg());
} }
} catch (Exception e) { } catch (JSONException e) {
log.error("allowModify4Audit e = 【{}】", e); log.error("allowModify4Audit e = 【{}】", e);
throw new DataException("系统内部错误。"); throw new DataException("系统内部错误。");
} }
......
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