修改替换用户的逻辑

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

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

Loading…
Cancel
Save