Commit fbfd5afd authored by suntao's avatar suntao

Merge branch 'v1' of http://git.quantgroup.cn/QG/cash-loan-flow-boss into v1

# By junquan.wang@quantgroup.cn
# Via junquan.wang@quantgroup.cn
* 'v1' of http://git.quantgroup.cn/QG/cash-loan-flow-boss:
  添加操作日志(清除用户数据)
parents 8a88df58 49ff472e
......@@ -556,7 +556,7 @@ public class OrderServiceImpl implements OrderService{
data.put("flowNo", UUID.randomUUID());
String id = clothoCenterService.cancelAfterLoan(data);
return new Tuple<>(false,"贷后关单成功");
return new Tuple<>(true,"贷后关单成功");
}
/**
......
......@@ -111,17 +111,6 @@ public class UserController {
return Result.buildSuccess(userService.getUserDetailInfo());
}
/**
* 清除用户信息
*
* @param id 用户ID
* @return
*/
@PutMapping("/clean")
public Boolean cleanUser(@RequestParam @Valid @NotEmpty(message = "无效的用户ID") String phoneNo) {
return this.xyqbUserService.cleanUserExtInfo(phoneNo);
}
/**
* 清除用户活跃订单
*
......@@ -134,14 +123,15 @@ public class UserController {
}
/**
* 删除订单
* 清除用户信息
*
* @param mobile 用户ID
* @return
*/
@PutMapping("/info/clean")
public Boolean deleteByUserId(@RequestParam @Valid @NotEmpty(message = "无效的用户手机号") String mobile) {
return this.xyqbUserService.deleteByUserId(mobile);
Tuple<Boolean, String> result = this.xyqbUserService.deleteByUserId(mobile);
return result.getKey();
}
}
......@@ -52,12 +52,6 @@ public interface XyqbUserService {
*/
UserInfo findUserByUuid(String uuid);
/**
* 清除用户信息
* @param phoneNo
* @return
*/
Boolean cleanUserExtInfo(String phoneNo);
/**
* 清除用户活跃订单
......@@ -69,5 +63,5 @@ public interface XyqbUserService {
/**
* 删除记录
*/
Boolean deleteByUserId(String phoneNo);
Tuple<Boolean,String> deleteByUserId(String phoneNo);
}
......@@ -141,26 +141,6 @@ public class XyqbUserServiceImpl implements XyqbUserService {
return userInfo.getData();
}
/**
* 清除用户信息
*/
@Override public Boolean cleanUserExtInfo(String phoneNo) {
if (StringUtils.isEmpty(phoneNo)) {
return false;
}
UserSysResult<XUser> user = userSysService.getService().findUserByPhoneNo(phoneNo);
if (Objects.isNull(user) || Objects.isNull(user.getData())) {
return false;
}
Long user_id = user.getData().getId();
UserSysResult<Boolean> result = userSysService.getService().disableUser(user_id);
UserSysResult<XUserExtInfo> userExtInfo = userSysService.getService().updateUserExtInfo(user_id, IncomeEnum.UNKNOWN,
IncomeRangeEnum.UNKNOWN, null, null, null, null, null, null, null);
if (!userExtInfo.isSuccess() || userExtInfo.getData() == null) {
return false;
}
return true;
}
/**
* 清除用户活跃订单
......@@ -190,12 +170,13 @@ public class XyqbUserServiceImpl implements XyqbUserService {
return new Tuple<>(result,result?"清除用户活跃订单成功":"清除用户活跃订单失败");
}
@Override public Boolean deleteByUserId(String phoneNo) {
@OperationAnno(channelNo = "#this[0]", opt = OptEnumName.USER_INFO_CLEAN, succSPEL = "#this.key", optDetailSPEL = "#this.value")
@Override public Tuple<Boolean,String> deleteByUserId(String phoneNo) {
try{
UserSysResult<XUser> xUser = userSysService.getService().findUserByPhoneNo(phoneNo);
if (xUser == null || xUser.getData() == null) {
LOGGER.error("cleanUserOrder,删除用户信息失败,未找到用户 phoneNo={}", phoneNo);
return false;
return new Tuple<>(false,"删除用户信息失败,未找到用户");
}
Long userId = xUser.getData().getId();
int i = userDetailRepository.deleteByUserId(userId);
......@@ -216,8 +197,8 @@ public class XyqbUserServiceImpl implements XyqbUserService {
}
}catch (Exception e){
LOGGER.error("cleanUserOrder,删除用户信息失败,phoneNo={}", phoneNo);
return false;
return new Tuple<>(false,"删除用户信息失败");
}
return true;
return new Tuple<>(true,"删除用户信息成功");
}
}
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