Commit 81b95099 authored by 王俊权's avatar 王俊权

添加操作日志(清除用户数据)

parent a7a3715a
...@@ -557,7 +557,7 @@ public class OrderServiceImpl implements OrderService{ ...@@ -557,7 +557,7 @@ public class OrderServiceImpl implements OrderService{
data.put("flowNo", UUID.randomUUID()); data.put("flowNo", UUID.randomUUID());
String id = clothoCenterService.cancelAfterLoan(data); String id = clothoCenterService.cancelAfterLoan(data);
return new Tuple<>(false,"贷后关单成功"); return new Tuple<>(true,"贷后关单成功");
} }
/** /**
......
...@@ -111,17 +111,6 @@ public class UserController { ...@@ -111,17 +111,6 @@ public class UserController {
return Result.buildSuccess(userService.getUserDetailInfo()); 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 { ...@@ -134,14 +123,15 @@ public class UserController {
} }
/** /**
* 删除订单 * 清除用户信息
* *
* @param mobile 用户ID * @param mobile 用户ID
* @return * @return
*/ */
@PutMapping("/info/clean") @PutMapping("/info/clean")
public Boolean deleteByUserId(@RequestParam @Valid @NotEmpty(message = "无效的用户手机号") String mobile) { 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 { ...@@ -52,12 +52,6 @@ public interface XyqbUserService {
*/ */
UserInfo findUserByUuid(String uuid); UserInfo findUserByUuid(String uuid);
/**
* 清除用户信息
* @param phoneNo
* @return
*/
Boolean cleanUserExtInfo(String phoneNo);
/** /**
* 清除用户活跃订单 * 清除用户活跃订单
...@@ -69,5 +63,5 @@ public interface XyqbUserService { ...@@ -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 { ...@@ -141,26 +141,6 @@ public class XyqbUserServiceImpl implements XyqbUserService {
return userInfo.getData(); 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 { ...@@ -190,12 +170,13 @@ public class XyqbUserServiceImpl implements XyqbUserService {
return new Tuple<>(result,result?"清除用户活跃订单成功":"清除用户活跃订单失败"); 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{ try{
UserSysResult<XUser> xUser = userSysService.getService().findUserByPhoneNo(phoneNo); UserSysResult<XUser> xUser = userSysService.getService().findUserByPhoneNo(phoneNo);
if (xUser == null || xUser.getData() == null) { if (xUser == null || xUser.getData() == null) {
LOGGER.error("cleanUserOrder,删除用户信息失败,未找到用户 phoneNo={}", phoneNo); LOGGER.error("cleanUserOrder,删除用户信息失败,未找到用户 phoneNo={}", phoneNo);
return false; return new Tuple<>(false,"删除用户信息失败,未找到用户");
} }
Long userId = xUser.getData().getId(); Long userId = xUser.getData().getId();
int i = userDetailRepository.deleteByUserId(userId); int i = userDetailRepository.deleteByUserId(userId);
...@@ -216,8 +197,8 @@ public class XyqbUserServiceImpl implements XyqbUserService { ...@@ -216,8 +197,8 @@ public class XyqbUserServiceImpl implements XyqbUserService {
} }
}catch (Exception e){ }catch (Exception e){
LOGGER.error("cleanUserOrder,删除用户信息失败,phoneNo={}", phoneNo); 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