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

修改手机号记录接口

parent 10630b07
......@@ -39,4 +39,9 @@ public class UserModifyPhoneController {
@RequestParam(defaultValue = "10", required = false) int pageSize) {
return userService.modifyPhoneNolist(userId, pageNo, pageSize);
}
@GetMapping("/modifyRecord")
public JsonResult modifyRecord(@RequestParam("prevPhoneNo") String prevPhoneNo){
return userService.modifyRecord(prevPhoneNo);
}
}
......@@ -122,4 +122,6 @@ public interface IUserService extends UserDetailsService {
JsonResult submitModiyPhoneNo(ModifyPhoneRecord modifyPhoneRecord);
JsonResult modifyPhoneNolist(Long userId, int pageNo, int pageSize);
JsonResult modifyRecord(String prevPhoneNo);
}
......@@ -36,11 +36,13 @@ import cn.quantgroup.user.retbean.XUserDetail;
import cn.quantgroup.user.vo.UserSysResult;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -1339,6 +1341,31 @@ public class UserServiceImpl implements IUserService {
}
}
@Override
public JsonResult modifyRecord(String prevPhoneNo) {
String url = userSysUrl + "/v1/user/modify/phone_no/modifyRecord";
ImmutableMap<String, String> param = ImmutableMap.of("prevPhoneNo", prevPhoneNo);
JSONObject userJsonObject = null;
try {
String response = httpService.get(url, param);
// log.info("[user][query modify phone list] 请求业务系统返回值,modifyPhoneQuery:{},response={}", modifyPhoneQuery, response);
if(response != null){
userJsonObject = JSONObject.parseObject(response);
String userBusinessCode = userJsonObject.getString("businessCode");
if("0000".equals(userBusinessCode)){
return JsonResult.buildSuccessResult(userJsonObject.getString("msg"),userJsonObject.get("data"));
}else{
return JsonResult.buildErrorStateResult(userJsonObject.getString("msg"),userJsonObject.get("data"));
}
}else{
return JsonResult.buildErrorStateResult(userJsonObject.getString("msg"),userJsonObject.get("data"));
}
} catch (Exception e) {
log.error("[user][query modify phone record] 网络通讯异常,modifyPhoneQuery:{},ex:{}", prevPhoneNo, ExceptionUtils.getStackTrace(e));
throw new BusinessException(ErrorCodeEnum.NET_ERROR);
}
}
/**
*根据userid和phoneNo获取基本信息
* @param xUserUserSysResult
......
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