【update】数据权限修改为按照companyCode查询

This commit is contained in:
nixj 2024-06-28 17:23:43 +08:00
parent c0c7365341
commit 3939cc2c91
3 changed files with 6 additions and 1 deletions

View File

@ -26,5 +26,8 @@ private static final long serialVersionUID = 1L;
/****/ /****/
private String belongDeptCode; private String belongDeptCode;
/****/
private String companyCode;
} }

View File

@ -17,4 +17,6 @@ import java.util.List;
public interface JdbcRouteOrderExtensionFieldBasicRepository extends CrudRepository<RouteOrderExtensionFieldBasic,Long> { public interface JdbcRouteOrderExtensionFieldBasicRepository extends CrudRepository<RouteOrderExtensionFieldBasic,Long> {
List<RouteOrderExtensionFieldBasic> findAllByBelongDeptCodeIn(@Param("belongDeptCode") List<String> belongDeptCode); List<RouteOrderExtensionFieldBasic> findAllByBelongDeptCodeIn(@Param("belongDeptCode") List<String> belongDeptCode);
List<RouteOrderExtensionFieldBasic> findAllByCompanyCodeIn(@Param("code") List<String> code);
} }

View File

@ -30,7 +30,7 @@ public class BaseUtil {
public List<Long> getRouteIds(){ public List<Long> getRouteIds(){
List<String> list = BaseContext.getCurrentUser().loadRoleOrg().getRoleOrgCodeList().stream().filter(Objects::nonNull).toList(); List<String> list = BaseContext.getCurrentUser().loadRoleOrg().getRoleOrgCodeList().stream().filter(Objects::nonNull).toList();
if (list.isEmpty()) return null; if (list.isEmpty()) return null;
List<RouteOrderExtensionFieldBasic> result= jdbcRouteOrderExtensionFieldBasicRepository.findAllByBelongDeptCodeIn(list); List<RouteOrderExtensionFieldBasic> result= jdbcRouteOrderExtensionFieldBasicRepository.findAllByCompanyCodeIn(list);
return result.stream().map(RouteOrderExtensionFieldBasic::getRouteId).toList(); return result.stream().map(RouteOrderExtensionFieldBasic::getRouteId).toList();
} }