fix: 修复一些问题
This commit is contained in:
parent
9da6db4960
commit
aca359088d
|
|
@ -314,6 +314,9 @@ public class TicketController extends ControllerBase {
|
|||
public ApiResult<Void> addTicketHandle(@Valid @RequestBody TicketHandleAddRequest request){
|
||||
Ticket ticket=ticketService.getById(request.getTicketId());
|
||||
List<Integer> handleIds= Arrays.stream(ticket.getHandle().split(",")).map(Integer::parseInt).collect(Collectors.toList());
|
||||
VUtils.trueThrowBusinessError(handleIds.stream().anyMatch(uid -> Objects.equals(uid, AdminUserUtil.getUserId()))
|
||||
&& request.getUserIds().stream().noneMatch(uid -> Objects.equals(uid, AdminUserUtil.getUserId())))
|
||||
.throwMessage("不可以移除自己");
|
||||
Ticket ticket1=ticketService.addTicketHandle(request);
|
||||
request.getUserIds().removeAll(handleIds);
|
||||
if(CollectionUtil.isNotEmpty(request.getUserIds())) {
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
List<Integer> companyIds = lambdaQuery()
|
||||
.select(AppUser::getCompanyId)
|
||||
.eq(AppUser::getIsPrimary, true)
|
||||
.eq(AppUser::getIsDel, false)
|
||||
.list()
|
||||
.stream()
|
||||
.map(AppUser::getCompanyId)
|
||||
|
|
@ -196,6 +197,9 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
|
||||
@Override
|
||||
public List<AppUser> getChildren(AppUser primaryUser) {
|
||||
if (!primaryUser.getIsPrimary()){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
String[] companyIds = primaryUser.getCompanyId().split(",");
|
||||
LambdaQueryWrapper<AppUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AppUser::getIsDel, false);
|
||||
|
|
@ -249,6 +253,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
.eq(AppUser::getId, id)
|
||||
.update();
|
||||
AppUser primaryUser=getById(id);
|
||||
if (primaryUser.getIsPrimary()) {
|
||||
List<AppUser> children = getChildren(primaryUser);
|
||||
if (CollectionUtil.isNotEmpty(children)) {
|
||||
lambdaUpdate()
|
||||
|
|
@ -258,6 +263,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaSimpleVO> getSimpleAreas(Integer userId) {
|
||||
|
|
@ -685,7 +691,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
return lambdaQuery()
|
||||
.eq(AppUser::getIsDel,false)
|
||||
.eq(AppUser::getCompanyId, companyId.toString())
|
||||
.eq(AppUser::getState, UserState.Activated.getState())
|
||||
// .eq(AppUser::getState, UserState.Activated.getState())
|
||||
.eq(AppUser::getIsPrimary, false)
|
||||
.list()
|
||||
.stream()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
|
@ -78,7 +79,9 @@ public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Diction
|
|||
public void delete(List<Integer> ids) {
|
||||
removeByIds(ids);
|
||||
List<Integer> itemIds=dictionaryItemService.lambdaQuery().eq(DictionaryItem::getDictionaryId, ids).list().stream().map(DictionaryItem::getId).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(itemIds)) {
|
||||
dictionaryItemService.removeByIds(itemIds);
|
||||
dictionaryItemTranslateService.remove(new LambdaQueryWrapper<DictionaryItemTranslate>().in(DictionaryItemTranslate::getDictionaryItemId, itemIds));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue