Commit ac7b1113 authored by 赵浩琳's avatar 赵浩琳

用户提交修改手机号申请及客服审核,不在调用金融校验是否在贷,改为调用金融同步修改手机号(其中包含校验在贷逻辑)

parent 8d7c8ab9
...@@ -6,6 +6,7 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.resp.ProgressResp; ...@@ -6,6 +6,7 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.resp.ProgressResp;
import cn.quantgroup.xyqb.entity.ModifyPhoneNo; import cn.quantgroup.xyqb.entity.ModifyPhoneNo;
import cn.quantgroup.xyqb.entity.User; import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserModifyPhoneRecord; import cn.quantgroup.xyqb.entity.UserModifyPhoneRecord;
import cn.quantgroup.xyqb.entity.enums.Reason;
import cn.quantgroup.xyqb.exception.AppletException; import cn.quantgroup.xyqb.exception.AppletException;
import cn.quantgroup.xyqb.exception.DataException; import cn.quantgroup.xyqb.exception.DataException;
import cn.quantgroup.xyqb.model.JsonResult; import cn.quantgroup.xyqb.model.JsonResult;
...@@ -239,10 +240,27 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService { ...@@ -239,10 +240,27 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
if (userRepository.findByPhoneNo(modifyPhoneNo.getCurPhoneNo()) != null) { if (userRepository.findByPhoneNo(modifyPhoneNo.getCurPhoneNo()) != null) {
throw new DataException("新手机号已存在,不支持更换。"); throw new DataException("新手机号已存在,不支持更换。");
} }
checkLoanStatus(modifyPhoneNo.getUserId()); // 请求其他系统信息
userService.modifyPhoneNo(modifyPhoneNo.getPrevPhoneNo(), modifyPhoneNo.getCurPhoneNo()); HashMap<String, String> parameters = new HashMap<>();
modifyPhoneNo.setApplyStatus(ModifyPhoneNoApplyStatusEnum.DONE.ordinal()); HashMap<String, String> headers = new HashMap<>();
modifyPhoneNo.setProcessingStatus(ModifyPhoneNoProcessingStatusEnum.WAIT_4_USER_FEEDBACK.ordinal()); headers.put("qg-tenant-id", TenantUtil.TENANT_DEFAULT.toString());
parameters.put("oldPhoneNo", modifyPhoneNo.getPrevPhoneNo());
parameters.put("phoneNo", modifyPhoneNo.getCurPhoneNo());
parameters.put("exUserId", String.valueOf(modifyPhoneNo.getUserId()));
// parameters.put("remark", modifyPhoneNo.getApplyStatusReason());
parameters.put("changeRecord", Reason.SYNCHRONOUSCHANGE.toString());
String resultStr = httpService.postJson(userHost + "/api/finance-gateway/finance-user/shop/notify/changePhoneNo", headers, parameters);
JsonResult resultStrJson = JSONObject.parseObject(resultStr, JsonResult.class);
// 如果有返回值
if ("0000".equals(resultStrJson.getBusinessCode()) || "4014".equals(resultStrJson.getBusinessCode())) {
// 同步金融修改电商
userService.modifyPhoneNo(modifyPhoneNo.getPrevPhoneNo(), modifyPhoneNo.getCurPhoneNo());
modifyPhoneNo.setApplyStatus(ModifyPhoneNoApplyStatusEnum.DONE.ordinal());
modifyPhoneNo.setProcessingStatus(ModifyPhoneNoProcessingStatusEnum.WAIT_4_USER_FEEDBACK.ordinal());
} else {
String msg = resultStrJson.getMsg();
throw new DataException("金融返回失败" + (StringUtils.isNotBlank(msg) ? ":" + msg : ""));
}
} }
} }
...@@ -393,12 +411,14 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService { ...@@ -393,12 +411,14 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
if (userService.findByPhoneInDb(curPhoneNo) != null) { if (userService.findByPhoneInDb(curPhoneNo) != null) {
throw new DataException("填写信息有误,新手机号已注册。"); throw new DataException("填写信息有误,新手机号已注册。");
} }
checkLoanStatus(userId); // checkLoanStatus(userId); 调用金融接口方式是错误的,改为同步金融一起修改手机号
} }
/** /**
* @param userId user.id * @param userId user.id
* 弃用,这里调金融传的是电商userId,结果不可信
*/ */
@Deprecated
public void checkLoanStatus(Long userId) { public void checkLoanStatus(Long userId) {
log.info("allowModify userId = 【{}】", userId); log.info("allowModify userId = 【{}】", userId);
String res = httpService.get(apiHttps + "/ex/loan/user/loan_status.json?userId=" + userId); String res = httpService.get(apiHttps + "/ex/loan/user/loan_status.json?userId=" + userId);
......
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