修改替换用户的逻辑

master
wjt 1 year ago
parent 39b37f8187
commit bed06f8cb0

@ -16,6 +16,7 @@ import com.baiye.modules.system.service.UserService;
import com.baiye.util.PageUtil;
import com.baiye.util.QueryHelp;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@ -32,6 +33,7 @@ import java.util.stream.Collectors;
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class ChannelManageServiceImpl implements ChannelManageService {
private final ChannelCustomRepository channelCustomRepository;
private final UserService userService;
@ -156,6 +158,7 @@ public class ChannelManageServiceImpl implements ChannelManageService {
channelCustom.setSurplusPhoneBill(0);
channelCustom.setTotalPhoneBill(0);
list.add(channelCustom);
log.info("撤回量:{},话费:{}id{}", num, bill, channelCustom.getId());
if (channelCustom.getParentId() != null) {
channelCustomRepository.updateSurplusNum(channelCustom.getParentId(), num, bill);
}
@ -163,9 +166,11 @@ public class ChannelManageServiceImpl implements ChannelManageService {
channelCustomRepository.saveAll(list);
//同步系统
List<Long> userIdByIds = list.stream().map(ChannelCustom::getUserId).collect(Collectors.toList());
userService.updateUserStatusByCompanyId(false, userIdByIds);
//踢出用户
this.remoteAuthService.delete(new HashSet<>(userIdByIds));
if (CollUtil.isNotEmpty(userIdByIds)) {
userService.updateUserStatusByCompanyId(false, userIdByIds);
//踢出用户
this.remoteAuthService.delete(new HashSet<>(userIdByIds));
}
return CommonResponse.createBySuccess();
}

@ -717,8 +717,8 @@ public class UserServiceImpl implements UserService {
if (replaceUserId == null || replaceRoleIds.contains(RoleNumberConstants.MINUS_NINE_NUMBER)) {
organizeUserRepository.deleteByUserId(userId);
} else {
organizeUserRepository.updateUser(userId, replaceUserId);
organizeUserRepository.deleteByUserId(replaceUserId);
organizeUserRepository.updateUser(userId, replaceUserId);
}
this.sourceDel(userId, replaceUserId);
} else if (roleIds.contains(channelId)) {

Loading…
Cancel
Save