Commit c2d7dbb0 authored by 吴琼's avatar 吴琼

修改返回前端结果

parent dae80c4a
...@@ -812,15 +812,15 @@ public class UserServiceImpl implements IUserService { ...@@ -812,15 +812,15 @@ public class UserServiceImpl implements IUserService {
userJsonObject = JSONObject.parseObject(userResult); userJsonObject = JSONObject.parseObject(userResult);
String userBusinessCode = userJsonObject.getString("businessCode"); String userBusinessCode = userJsonObject.getString("businessCode");
if("0000".equals(userBusinessCode)){ if("0000".equals(userBusinessCode)){
return JsonResult.buildSuccessResult(userJsonObject.getString("msg"),jsonObject.get("data")); return JsonResult.buildSuccessResult(userJsonObject.getString("msg"),userJsonObject.get("data"));
}else{ }else{
return JsonResult.buildErrorStateResult(userJsonObject.getString("msg"),jsonObject.get("data")); return JsonResult.buildErrorStateResult(userJsonObject.getString("msg"),userJsonObject.get("data"));
} }
}else{ }else{
return JsonResult.buildErrorStateResult(userJsonObject.getString("msg"),jsonObject.get("data")); return JsonResult.buildErrorStateResult(jsonObject.getString("msg"),jsonObject.get("data"));
} }
}else{ }else{
return JsonResult.buildErrorStateResult("",null); return JsonResult.buildErrorStateResult("调用第三方接口报错",null);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("[user][modifyAccountStatusDisableNew] 网络通讯异常,userId:{},ex:{}", userId, ExceptionUtils.getStackTrace(e)); log.error("[user][modifyAccountStatusDisableNew] 网络通讯异常,userId:{},ex:{}", userId, ExceptionUtils.getStackTrace(e));
...@@ -828,6 +828,49 @@ public class UserServiceImpl implements IUserService { ...@@ -828,6 +828,49 @@ public class UserServiceImpl implements IUserService {
} }
} }
//新逻辑
/* @Override
public JsonResult modifyAccountStatusDisableNew(Long userId) {
try {
//调用kdsp接口校验是否有在途数据(订单在途+金融在途)
Map<String, String> header = Maps.newHashMap();
header.put("Content-type", "application/x-www-form-urlencoded");
header.put("qg-tenant-id", "560761");
String kdsp = kdspUrl + "/api/kdsp/user/customer/validate/can-logged-off";
Map param = Maps.newHashMap();
param.put("userId", userId.toString());
param.put("tenantId", "560761");
String result = httpService.post(kdsp, header, param);
if(result!=null){
JSONObject jsonObject = JSONObject.parseObject(result);;
String businessCode = jsonObject.getString("businessCode");
//返回信息
JSONObject userJsonObject = null;
if("0000".equals(businessCode)){
//调用用户中心,将账户状态更新为冻结
Map param1 = Maps.newHashMap();
param1.put("userId", userId.toString());
String userUrl = userSysUrl + "/innerapi/user/disable";
String userResult = httpService.post(userUrl, header, param1);
userJsonObject = JSONObject.parseObject(userResult);
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(jsonObject.getString("msg"),jsonObject.get("data"));
}
}else{
return JsonResult.buildErrorStateResult("调用kdsp接口报错",null);
}
} catch (Exception e) {
log.error("[user][modifyAccountStatusDisableNew] 网络通讯异常,userId:{},ex:{}", userId, ExceptionUtils.getStackTrace(e));
throw new BusinessException(ErrorCodeEnum.NET_ERROR);
}
}*/
/** /**
* 真正的注销账户,删除账户信息 * 真正的注销账户,删除账户信息
* @param userId * @param userId
...@@ -1054,28 +1097,28 @@ public class UserServiceImpl implements IUserService { ...@@ -1054,28 +1097,28 @@ public class UserServiceImpl implements IUserService {
return null; return null;
} }
//新逻辑 //新逻辑,新用户不需要实名认证
@Override @Override
public JsonResult findUserInfoByUserParamNew(UserQueryParam userQueryParam) { public JsonResult findUserInfoByUserParamNew(UserQueryParam userQueryParam) {
final String LOG_PRE = "UserServiceImpl.findUserInfoByUserParamNew"; final String LOG_PRE = "UserServiceImpl.findUserInfoByUserParamNew";
log.info("{} 查询用户信息 UserQueryParam={}", LOG_PRE, userQueryParam); log.info("{} 查询用户信息 UserQueryParam={}", LOG_PRE, userQueryParam);
//通过userId查询 //通过userId查询
UserSysResult<XUser> userByUserId = null; UserSysResult<XUser> userByUserId = null;
UserSysResult<XUserDetail> userDetailByUserId= null; //UserSysResult<XUserDetail> userDetailByUserId= null;
if (Objects.nonNull(userQueryParam.getUserId())) { if (Objects.nonNull(userQueryParam.getUserId())) {
log.info("{} 通过userId查询 userId={}", LOG_PRE, userQueryParam.getUserId()); log.info("{} 通过userId查询 userId={}", LOG_PRE, userQueryParam.getUserId());
userByUserId = userSdk.getService().findUserByUserId(userQueryParam.getUserId()); userByUserId = userSdk.getService().findUserByUserId(userQueryParam.getUserId());
userDetailByUserId = userSdk.getService().findUserDetailByUserId(userQueryParam.getUserId()); //userDetailByUserId = userSdk.getService().findUserDetailByUserId(userQueryParam.getUserId());
} }
UserSysResult<XUser> userByPhoneNo = null; UserSysResult<XUser> userByPhoneNo = null;
UserSysResult<XUserDetail> userDetailByPhone = null; //UserSysResult<XUserDetail> userDetailByPhone = null;
if (StringUtils.isNotBlank(userQueryParam.getPhoneNo())) { if (StringUtils.isNotBlank(userQueryParam.getPhoneNo())) {
log.info("{} 通过phoneNo查询 phoneNo={}", LOG_PRE, userQueryParam.getPhoneNo()); log.info("{} 通过phoneNo查询 phoneNo={}", LOG_PRE, userQueryParam.getPhoneNo());
userByPhoneNo = userSdk.getService().findUserByPhoneNo(userQueryParam.getPhoneNo()); userByPhoneNo = userSdk.getService().findUserByPhoneNo(userQueryParam.getPhoneNo());
userDetailByPhone = userSdk.getService().findUserDetailByPhone(userQueryParam.getPhoneNo()); //userDetailByPhone = userSdk.getService().findUserDetailByPhone(userQueryParam.getPhoneNo());
//根据传入的身份证和查询出的用户信息中身份证进行比较,如果不一致返回查询失败 //根据传入的身份证和查询出的用户信息中身份证进行比较,如果不一致返回查询失败
if (StringUtils.isNotEmpty(userQueryParam.getIdNo()) && userDetailByPhone != null && userDetailByPhone.getData() != null) { /*if (StringUtils.isNotEmpty(userQueryParam.getIdNo()) && userDetailByPhone != null && userDetailByPhone.getData() != null) {
XUserDetail xUserDetail = userDetailByPhone.getData(); XUserDetail xUserDetail = userDetailByPhone.getData();
String idNo = xUserDetail.getIdNo(); String idNo = xUserDetail.getIdNo();
if (StringUtils.isNotEmpty(idNo)) { if (StringUtils.isNotEmpty(idNo)) {
...@@ -1085,7 +1128,7 @@ public class UserServiceImpl implements IUserService { ...@@ -1085,7 +1128,7 @@ public class UserServiceImpl implements IUserService {
if (!paramIdNo.equals(idNo)) { if (!paramIdNo.equals(idNo)) {
return JsonResult.buildErrorStateResult("无有效查询参数", null); return JsonResult.buildErrorStateResult("无有效查询参数", null);
} }
} }*/
} }
//校验手机号查不到用户的情况 //校验手机号查不到用户的情况
...@@ -1101,7 +1144,7 @@ public class UserServiceImpl implements IUserService { ...@@ -1101,7 +1144,7 @@ public class UserServiceImpl implements IUserService {
} }
//校验手机号和userid不是一个人 //校验手机号和userid不是一个人
if(Objects.nonNull(userQueryParam.getUserId()) && StringUtils.isNotBlank(userQueryParam.getPhoneNo())){ if(Objects.nonNull(userQueryParam.getUserId()) && StringUtils.isNotBlank(userQueryParam.getPhoneNo())){
if(userByUserId != null && userDetailByUserId != null && userByPhoneNo != null && userDetailByPhone != null){ if(userByUserId != null && userByPhoneNo != null){
if(userByUserId.getData() != null && userByPhoneNo.getData() != null if(userByUserId.getData() != null && userByPhoneNo.getData() != null
&& !userByUserId.getData().getId().equals(userByPhoneNo.getData().getId())){ && !userByUserId.getData().getId().equals(userByPhoneNo.getData().getId())){
return JsonResult.buildErrorStateResult("用户不存在", null); return JsonResult.buildErrorStateResult("用户不存在", null);
...@@ -1127,10 +1170,10 @@ public class UserServiceImpl implements IUserService { ...@@ -1127,10 +1170,10 @@ public class UserServiceImpl implements IUserService {
throw new BusinessException(ErrorCodeEnum.NET_ERROR); throw new BusinessException(ErrorCodeEnum.NET_ERROR);
} }
if (Objects.nonNull(userQueryParam.getUserId())) { if (Objects.nonNull(userQueryParam.getUserId())) {
return getUserBasicInfoResultAndUserBenefits(userByUserId, userDetailByUserId,result); return getUserBasicInfoResultAndUserBenefits(userByUserId, null,result);
} }
if (StringUtils.isNotBlank(userQueryParam.getPhoneNo())) { if (StringUtils.isNotBlank(userQueryParam.getPhoneNo())) {
return getUserBasicInfoResultAndUserBenefits(userByPhoneNo, userDetailByPhone,result); return getUserBasicInfoResultAndUserBenefits(userByPhoneNo, null,result);
} }
return null; return 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