【add】数据权限获取新增null判断

This commit is contained in:
nixj 2024-06-27 15:52:54 +08:00
parent d83f96c601
commit a32d491b63
1 changed files with 3 additions and 1 deletions

View File

@ -1,7 +1,6 @@
package com.chint.manage.util;
import com.chint.domain.aggregates.user.User;
import com.chint.domain.value_object.system.SystemOrganizationVO;
import com.chint.infrastructure.util.BaseContext;
import com.chint.manage.entity.RouteOrderExtensionFieldBasic;
import com.chint.manage.mapper.JdbcOrderDetailBasicRepository;
@ -30,17 +29,20 @@ public class BaseUtil {
public List<Long> getRouteIds(){
List<String> list = BaseContext.getCurrentUser().loadRoleOrg().getRoleOrgCodeList().stream().filter(Objects::nonNull).toList();
if (list.isEmpty()) return null;
List<RouteOrderExtensionFieldBasic> result= jdbcRouteOrderExtensionFieldBasicRepository.findAllByBelongDeptCodeIn(list);
return result.stream().map(RouteOrderExtensionFieldBasic::getRouteId).toList();
}
public List<Long> getOrderIds(){
List<Long> routeIds = getRouteIds();
if (routeIds.isEmpty()) return null;
return jdbcOrderDetailBasicRepository.findAllOrderId(routeIds);
}
public List<String> getOrderNos(){
List<Long> routeIds = getRouteIds();
if (routeIds.isEmpty()) return null;
return jdbcOrderDetailBasicRepository.findAllOrderNo(routeIds);
}