mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-31 17:40:05 +08:00
trade: 分销业务后台功能:清除推广员、修改推广员
This commit is contained in:
parent
f97c7a0f6e
commit
259734964d
@ -46,7 +46,7 @@ public class BrokerageUserController {
|
||||
@Operation(summary = "修改推广员")
|
||||
@PreAuthorize("@ss.hasPermission('trade:brokerage-user:update-brokerage-user')")
|
||||
public CommonResult<Boolean> updateBrokerageUser(@Valid @RequestBody BrokerageUserUpdateBrokerageUserReqVO updateReqVO) {
|
||||
brokerageUserService.updateBrokerageUserId(updateReqVO.getId(), updateReqVO.getBrokerageUserId());
|
||||
brokerageUserService.updateBrokerageUserId(updateReqVO.getId(), updateReqVO.getBindUserId());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,6 @@ public class BrokerageUserUpdateBrokerageUserReqVO {
|
||||
|
||||
@Schema(description = "推广员编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4587")
|
||||
@NotNull(message = "推广员编号不能为空")
|
||||
private Long brokerageUserId;
|
||||
private Long bindUserId;
|
||||
|
||||
}
|
||||
|
@ -100,4 +100,9 @@ public interface BrokerageUserMapper extends BaseMapperX<BrokerageUserDO> {
|
||||
return update(null, lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
default void updateBindUserIdAndBindUserTimeToNull(Long id) {
|
||||
update(null, new LambdaUpdateWrapper<BrokerageUserDO>()
|
||||
.eq(BrokerageUserDO::getId, id)
|
||||
.set(BrokerageUserDO::getBindUserId, null).set(BrokerageUserDO::getBindUserTime, null));
|
||||
}
|
||||
}
|
||||
|
@ -41,10 +41,10 @@ public interface BrokerageUserService {
|
||||
/**
|
||||
* 修改推广员编号
|
||||
*
|
||||
* @param id 用户编号
|
||||
* @param brokerageUserId 推广员编号
|
||||
* @param id 用户编号
|
||||
* @param bindUserId 推广员编号
|
||||
*/
|
||||
void updateBrokerageUserId(Long id, Long brokerageUserId);
|
||||
void updateBrokerageUserId(Long id, Long bindUserId);
|
||||
|
||||
/**
|
||||
* 修改推广资格
|
||||
|
@ -54,10 +54,17 @@ public class BrokerageUserServiceImpl implements BrokerageUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBrokerageUserId(Long id, Long brokerageUserId) {
|
||||
public void updateBrokerageUserId(Long id, Long bindUserId) {
|
||||
// 校验存在
|
||||
validateBrokerageUserExists(id);
|
||||
// TODO @疯狂:貌似没实现完
|
||||
if (bindUserId == null) {
|
||||
// 清除推广员
|
||||
brokerageUserMapper.updateBindUserIdAndBindUserTimeToNull(id);
|
||||
} else {
|
||||
// 修改推广员
|
||||
brokerageUserMapper.updateById(new BrokerageUserDO().setId(id)
|
||||
.setBindUserId(bindUserId).setBindUserTime(LocalDateTime.now()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user