@@ -6,6 +6,7 @@ import com.taauav.common.service.IBaseService; | |||
import com.taauav.front.entity.UserAuthGroup; | |||
import com.taauav.front.query.UserAuthGroupQuery; | |||
import java.math.BigInteger; | |||
import java.util.List; | |||
/** | |||
@@ -89,4 +90,12 @@ public interface IUserAuthGroupService extends IBaseService<UserAuthGroup> { | |||
*/ | |||
List<UserAuthGroup> getAuthGroups(Integer adminId); | |||
/** | |||
* 根据用户ID获取数据权限 | |||
* | |||
* @param userId 用户ID | |||
* @return | |||
*/ | |||
List<BigInteger> getDriverAreaList(Integer userId); | |||
} |
@@ -4,18 +4,24 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.taauav.admin.entity.SysAuthGroup; | |||
import com.taauav.admin.service.ISysCityService; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.common.service.impl.BaseServiceImpl; | |||
import com.taauav.common.util.StringUtils; | |||
import com.taauav.front.entity.UserAdmin; | |||
import com.taauav.front.entity.UserAuthGroup; | |||
import com.taauav.front.mapper.UserAdminMapper; | |||
import com.taauav.front.mapper.UserAuthGroupMapper; | |||
import com.taauav.front.query.UserAuthGroupQuery; | |||
import com.taauav.front.service.IUserAdminService; | |||
import com.taauav.front.service.IUserAuthGroupService; | |||
import com.taauav.front.utils.LoginUtils; | |||
import com.taauav.front.vo.UserAuthGroupListVo; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.math.BigInteger; | |||
import java.util.ArrayList; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
@@ -34,7 +40,12 @@ public class UserAuthGroupServiceImpl extends BaseServiceImpl<UserAuthGroupMappe | |||
@Autowired | |||
private UserAuthGroupMapper userAuthGroupMapper; | |||
@Autowired | |||
private UserAdminMapper userAdminMapper; | |||
@Autowired | |||
private IUserAdminService userAdminService; | |||
@Autowired | |||
private ISysCityService cityService; | |||
@Autowired | |||
private Response response; | |||
@@ -233,4 +244,50 @@ public class UserAuthGroupServiceImpl extends BaseServiceImpl<UserAuthGroupMappe | |||
return userAuthGroupMapper.getAuthGroups(adminId); | |||
} | |||
/** | |||
* 根据用户ID获取数据权限 | |||
* | |||
* @param userId 用户ID | |||
* @return | |||
*/ | |||
@Override | |||
public List<BigInteger> getDriverAreaList(Integer userId) { | |||
List<BigInteger> driverAreaList = new ArrayList<>(); | |||
// 获取当前登录人员信息 | |||
UserAdmin userAdmin = userAdminMapper.selectById(userId); | |||
// 遍历数据权限 | |||
Map<Integer, String> map = userAdminService.getAdminAuthData(userId); | |||
for (Map.Entry<Integer, String> entry : map.entrySet()) { | |||
if (entry.getKey() == 1) { | |||
// 查看本人负责的河湖 | |||
if (userAdmin.getDriverArea() != null && !driverAreaList.contains(userAdmin.getDriverArea())) { | |||
driverAreaList.add(userAdmin.getDriverArea()); | |||
} | |||
} else if (entry.getKey() == 2) { | |||
// 查看本人及下属人员负责的河湖 | |||
if (userAdmin.getDriverArea() != null && !driverAreaList.contains(userAdmin.getDriverArea())) { | |||
driverAreaList.add(userAdmin.getDriverArea()); | |||
} | |||
// 获取下属人员负责的河流 | |||
List<BigInteger> cityIdsList = cityService.getChildCityIds(userAdmin.getDriverArea()); | |||
if (!cityIdsList.isEmpty()) { | |||
cityIdsList.forEach(item -> { | |||
driverAreaList.add(item); | |||
}); | |||
} | |||
} else if (entry.getKey() == 3) { | |||
// 查看指定部门下人员负责河湖数据 | |||
if (!com.taauav.common.util.StringUtils.isEmpty(entry.getValue())) { | |||
String[] itemArr = entry.getValue().split(","); | |||
for (String s : itemArr) { | |||
if (driverAreaList.contains(userAdmin.getDriverArea())) { | |||
continue; | |||
} | |||
driverAreaList.add(BigInteger.valueOf(Long.valueOf(s))); | |||
} | |||
} | |||
} | |||
} | |||
return driverAreaList; | |||
} | |||
} |
@@ -20,7 +20,9 @@ import com.taauav.common.util.ShiroUtils; | |||
import com.taauav.front.dto.IndexInspectDto; | |||
import com.taauav.front.mapper.UserAdminMapper; | |||
import com.taauav.front.service.IUserAdminService; | |||
import com.taauav.front.service.IUserAuthGroupService; | |||
import com.taauav.front.service.IUserInspectDriverService; | |||
import com.taauav.front.utils.LoginUtils; | |||
import com.taauav.front.vo.IndexInspectFileVo; | |||
import com.taauav.front.vo.IndexInspectListVo; | |||
import com.taauav.front.vo.UserAdminVo; | |||
@@ -32,6 +34,7 @@ import org.springframework.util.StringUtils; | |||
import java.io.File; | |||
import java.math.BigDecimal; | |||
import java.math.BigInteger; | |||
import java.util.*; | |||
/** | |||
@@ -75,6 +78,8 @@ public class UserInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
private TauvInspectMapper inspectMapper; | |||
@Autowired | |||
private ITauvInspectFileService inspectFileService; | |||
@Autowired | |||
private IUserAuthGroupService userAuthGroupService; | |||
@Override | |||
public String batchAddData(TauvInspect inspect) { | |||
@@ -169,6 +174,17 @@ public class UserInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
} else { | |||
map = new HashMap<>(); | |||
} | |||
// 数据权限 | |||
if (ShiroUtils.getAdminId() != 1) { | |||
List<BigInteger> driverAreaList = userAuthGroupService.getDriverAreaList(ShiroUtils.getAdminId()); | |||
if (StringUtils.isEmpty(map.get("driverArea"))) { | |||
// 获取数据权限 | |||
BigInteger[] driverArea = driverAreaList.toArray(new BigInteger[driverAreaList.size()]); | |||
map.put("driverArea", driverArea); | |||
} else if (!driverAreaList.contains(BigInteger.valueOf(Long.valueOf((((String[]) map.get("driverArea"))[0]))))) { | |||
map.put("driverArea", new String[]{"-1"}); | |||
} | |||
} | |||
Page<TauvInspectDriverDTO> page = new Page<>(pageNo, pageSize); | |||
List<TauvInspectDriverDTO> data = inspectDriverMapper.getPageList(page, map); | |||
TauvInspect tauvInspect = new TauvInspect(); | |||
@@ -323,7 +339,7 @@ public class UserInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
// 执行中 | |||
QueryWrapper wrapper = new QueryWrapper(); | |||
wrapper.eq("mark", 1); | |||
wrapper.in("status", 3,5,6); | |||
wrapper.in("status", 3, 5, 6); | |||
Integer inExecution = count(wrapper); | |||
// 已完成 | |||
QueryWrapper wrapper1 = new QueryWrapper(); | |||
@@ -339,6 +355,7 @@ public class UserInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
/** | |||
* 指挥大屏-任务管理列表 | |||
* | |||
* @param indexInspectDto | |||
* @return | |||
*/ |
@@ -20,6 +20,7 @@ import com.taauav.front.entity.UserAdmin; | |||
import com.taauav.front.mapper.UserAdminMapper; | |||
import com.taauav.front.mapper.UserInspectQuestionMapper; | |||
import com.taauav.front.query.UserInspectQuestionQuery; | |||
import com.taauav.front.service.IUserAuthGroupService; | |||
import com.taauav.front.service.IUserInspectQuestionService; | |||
import com.taauav.front.vo.IndexQuestionDetailVo; | |||
import com.taauav.front.vo.IndexQuestionListVo; | |||
@@ -58,6 +59,8 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ | |||
private ISysCityService sysCityService; | |||
@Autowired | |||
private UserAdminMapper userAdminMapper; | |||
@Autowired | |||
private IUserAuthGroupService userAuthGroupService; | |||
@Value("${server.UPLOAD_URL}") | |||
private String uploadUrl; | |||
@@ -74,13 +77,35 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ | |||
*/ | |||
@Override | |||
public Response getList(UserInspectQuestionQuery query) { | |||
// 区划ID处理 | |||
if (query.getDriverArea() != null) { | |||
List<BigInteger> cityIds = sysCityService.getChildCityIds(query.getDriverArea()); | |||
// 加入当前选中的区划 | |||
cityIds.add(query.getDriverArea()); | |||
BigInteger[] integers = cityIds.toArray(new BigInteger[cityIds.size()]); | |||
query.setDriverAreaList(integers); | |||
// // 区划ID处理 | |||
// if (query.getDriverArea() != null) { | |||
// List<BigInteger> cityIds = sysCityService.getChildCityIds(query.getDriverArea()); | |||
// // 加入当前选中的区划 | |||
// cityIds.add(query.getDriverArea()); | |||
// BigInteger[] integers = cityIds.toArray(new BigInteger[cityIds.size()]); | |||
// query.setDriverAreaList(integers); | |||
// } | |||
// 数据权限 | |||
if (ShiroUtils.getAdminId() != 1) { | |||
List<BigInteger> driverAreaList = userAuthGroupService.getDriverAreaList(ShiroUtils.getAdminId()); | |||
if (StringUtils.isEmpty(query.getDriverArea())) { | |||
// 获取数据权限 | |||
BigInteger[] driverArea = driverAreaList.toArray(new BigInteger[driverAreaList.size()]); | |||
query.setDriverAreaList(driverArea); | |||
} else { | |||
List<BigInteger> bigIntegerList = new ArrayList<>(); | |||
if (driverAreaList.contains(query.getDriverArea())) { | |||
bigIntegerList.add(query.getDriverArea()); | |||
query.setDriverAreaList(bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} else { | |||
bigIntegerList.add(BigInteger.valueOf(Long.valueOf("-1"))); | |||
query.setDriverAreaList(bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} | |||
} | |||
} else { | |||
List<BigInteger> bigIntegerList = new ArrayList<>(); | |||
bigIntegerList.add(query.getDriverArea()); | |||
query.setDriverAreaList(bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} | |||
// 巡检时间处理 | |||
if (!StringUtils.isEmpty(query.getInspectTime())) { |
@@ -19,6 +19,7 @@ import com.taauav.front.dto.WaterAlarmAssignDto; | |||
import com.taauav.front.mapper.UserInspectQuestionMapper; | |||
import com.taauav.front.mapper.UserWaterAlarmMapper; | |||
import com.taauav.front.query.UserWaterAlarmQuery; | |||
import com.taauav.front.service.IUserAuthGroupService; | |||
import com.taauav.front.service.IUserWaterAlarmInfoService; | |||
import com.taauav.front.service.IUserWaterAlarmService; | |||
import com.taauav.front.vo.wateralarm.UserWaterAlarmInfoListVo; | |||
@@ -55,6 +56,8 @@ public class UserWaterAlarmServiceImpl extends BaseServiceImpl<UserWaterAlarmMap | |||
private IUserWaterAlarmInfoService userWaterAlarmInfoService; | |||
@Autowired | |||
private UserInspectQuestionMapper userInspectQuestionMapper; | |||
@Autowired | |||
private IUserAuthGroupService userAuthGroupService; | |||
/** | |||
* 获取水质报警列表 | |||
@@ -71,18 +74,40 @@ public class UserWaterAlarmServiceImpl extends BaseServiceImpl<UserWaterAlarmMap | |||
if (!StringUtils.isEmpty(query.getAlarmSn())) { | |||
queryWrapper.like("alarm_sn", query.getAlarmSn()); | |||
} | |||
// 区划ID | |||
if (query.getDriverArea() != null) { | |||
// 获取所有自己区划ID | |||
List<BigInteger> driverAreaList = new ArrayList<>(); | |||
driverAreaList.add(query.getDriverArea()); | |||
List<BigInteger> cityIdsList = sysCityService.getChildCityIds(query.getDriverArea()); | |||
if (!cityIdsList.isEmpty()) { | |||
cityIdsList.forEach(item -> { | |||
driverAreaList.add(item); | |||
}); | |||
// // 区划ID | |||
// if (query.getDriverArea() != null) { | |||
// // 获取所有自己区划ID | |||
// List<BigInteger> driverAreaList = new ArrayList<>(); | |||
// driverAreaList.add(query.getDriverArea()); | |||
// List<BigInteger> cityIdsList = sysCityService.getChildCityIds(query.getDriverArea()); | |||
// if (!cityIdsList.isEmpty()) { | |||
// cityIdsList.forEach(item -> { | |||
// driverAreaList.add(item); | |||
// }); | |||
// } | |||
// queryWrapper.in("driver_area", driverAreaList); | |||
// } | |||
// 数据权限 | |||
if (ShiroUtils.getAdminId() != 1) { | |||
List<BigInteger> driverAreaList = userAuthGroupService.getDriverAreaList(ShiroUtils.getAdminId()); | |||
if (org.springframework.util.StringUtils.isEmpty(query.getDriverArea())) { | |||
// 获取数据权限 | |||
BigInteger[] driverArea = driverAreaList.toArray(new BigInteger[driverAreaList.size()]); | |||
queryWrapper.in("driver_area", driverArea); | |||
} else { | |||
List<BigInteger> bigIntegerList = new ArrayList<>(); | |||
if (driverAreaList.contains(query.getDriverArea())) { | |||
bigIntegerList.add(query.getDriverArea()); | |||
queryWrapper.in("driver_area", bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} else { | |||
bigIntegerList.add(BigInteger.valueOf(Long.valueOf("-1"))); | |||
queryWrapper.in("driver_area", bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} | |||
} | |||
queryWrapper.in("driver_area", driverAreaList); | |||
} else { | |||
List<BigInteger> bigIntegerList = new ArrayList<>(); | |||
bigIntegerList.add(query.getDriverArea()); | |||
queryWrapper.in("driver_area", bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} | |||
// 河湖名称 | |||
if (!StringUtils.isEmpty(query.getDriverName())) { |
@@ -7,8 +7,10 @@ import com.taauav.admin.service.ISysCityService; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.common.service.impl.BaseServiceImpl; | |||
import com.taauav.common.util.FunctionUtils; | |||
import com.taauav.common.util.ShiroUtils; | |||
import com.taauav.front.mapper.UserWaterDataMapper; | |||
import com.taauav.front.query.UserWaterDataQuery; | |||
import com.taauav.front.service.IUserAuthGroupService; | |||
import com.taauav.front.service.IUserWaterDataService; | |||
import com.taauav.front.vo.waterdata.UserWaterDataListVo; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
@@ -16,6 +18,7 @@ import org.springframework.stereotype.Service; | |||
import org.springframework.util.StringUtils; | |||
import java.math.BigInteger; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
/** | |||
@@ -34,6 +37,8 @@ public class UserWaterDataServiceImpl extends BaseServiceImpl<UserWaterDataMappe | |||
@Autowired | |||
private UserWaterDataMapper userWaterDataMapper; | |||
@Autowired | |||
private IUserAuthGroupService userAuthGroupService; | |||
@Autowired | |||
private Response response; | |||
@@ -46,13 +51,34 @@ public class UserWaterDataServiceImpl extends BaseServiceImpl<UserWaterDataMappe | |||
*/ | |||
@Override | |||
public Response getList(UserWaterDataQuery query) { | |||
// 区划ID处理 | |||
if (query.getDriverArea() != null) { | |||
List<BigInteger> cityIds = sysCityService.getChildCityIds(query.getDriverArea()); | |||
// 加入当前选中的区划 | |||
cityIds.add(query.getDriverArea()); | |||
BigInteger[] integers = cityIds.toArray(new BigInteger[cityIds.size()]); | |||
query.setDriverAreaList(integers); | |||
// // 区划ID处理 | |||
// if (query.getDriverArea() != null) { | |||
// List<BigInteger> cityIds = sysCityService.getChildCityIds(query.getDriverArea()); | |||
// // 加入当前选中的区划 | |||
// cityIds.add(query.getDriverArea()); | |||
// BigInteger[] integers = cityIds.toArray(new BigInteger[cityIds.size()]); | |||
// query.setDriverAreaList(integers); | |||
// } | |||
if (ShiroUtils.getAdminId() != 1) { | |||
List<BigInteger> driverAreaList = userAuthGroupService.getDriverAreaList(ShiroUtils.getAdminId()); | |||
if (org.springframework.util.StringUtils.isEmpty(query.getDriverArea())) { | |||
// 获取数据权限 | |||
BigInteger[] driverArea = driverAreaList.toArray(new BigInteger[driverAreaList.size()]); | |||
query.setDriverAreaList(driverArea); | |||
} else { | |||
List<BigInteger> bigIntegerList = new ArrayList<>(); | |||
if (driverAreaList.contains(query.getDriverArea())) { | |||
bigIntegerList.add(query.getDriverArea()); | |||
query.setDriverAreaList(bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} else { | |||
bigIntegerList.add(BigInteger.valueOf(Long.valueOf("-1"))); | |||
query.setDriverAreaList(bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} | |||
} | |||
} else { | |||
List<BigInteger> bigIntegerList = new ArrayList<>(); | |||
bigIntegerList.add(query.getDriverArea()); | |||
query.setDriverAreaList(bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} | |||
// 巡检时间处理 | |||
if (!StringUtils.isEmpty(query.getInspectTime())) { |
@@ -11,8 +11,10 @@ import com.taauav.common.bean.Response; | |||
import com.taauav.common.service.impl.BaseServiceImpl; | |||
import com.taauav.common.util.FunctionUtils; | |||
import com.taauav.common.util.RedisUtils; | |||
import com.taauav.common.util.ShiroUtils; | |||
import com.taauav.front.mapper.UserWaterSpectrumMapper; | |||
import com.taauav.front.query.UserWaterSpectrumQuery; | |||
import com.taauav.front.service.IUserAuthGroupService; | |||
import com.taauav.front.service.IUserWaterSpectrumService; | |||
import com.taauav.front.vo.IndexDriverVo; | |||
import com.taauav.front.vo.userwaterspectrum.UserWaterSpectrumListVo; | |||
@@ -51,6 +53,8 @@ public class UserWaterSpectrumServiceImpl extends BaseServiceImpl<UserWaterSpect | |||
private RedisUtils redisUtils; | |||
@Autowired | |||
private ITauvDriverService driverService; | |||
@Autowired | |||
private IUserAuthGroupService userAuthGroupService; | |||
/** | |||
* 获取多光谱数据列表 | |||
@@ -66,13 +70,34 @@ public class UserWaterSpectrumServiceImpl extends BaseServiceImpl<UserWaterSpect | |||
if (!StringUtils.isEmpty(query.getInspectNo())) { | |||
queryWrapper.like("inspect_no", query.getInspectNo()); | |||
} | |||
// 区划ID处理 | |||
if (query.getDriverArea() != null) { | |||
List<BigInteger> cityIds = sysCityService.getChildCityIds(query.getDriverArea()); | |||
// 加入当前选中的区划 | |||
cityIds.add(query.getDriverArea()); | |||
BigInteger[] integers = cityIds.toArray(new BigInteger[cityIds.size()]); | |||
queryWrapper.in("area_id", integers); | |||
// // 区划ID处理 | |||
// if (query.getDriverArea() != null) { | |||
// List<BigInteger> cityIds = sysCityService.getChildCityIds(query.getDriverArea()); | |||
// // 加入当前选中的区划 | |||
// cityIds.add(query.getDriverArea()); | |||
// BigInteger[] integers = cityIds.toArray(new BigInteger[cityIds.size()]); | |||
// queryWrapper.in("area_id", integers); | |||
// } | |||
if (ShiroUtils.getAdminId() != 1) { | |||
List<BigInteger> driverAreaList = userAuthGroupService.getDriverAreaList(ShiroUtils.getAdminId()); | |||
if (org.springframework.util.StringUtils.isEmpty(query.getDriverArea())) { | |||
// 获取数据权限 | |||
BigInteger[] driverArea = driverAreaList.toArray(new BigInteger[driverAreaList.size()]); | |||
queryWrapper.in("area_id", driverArea); | |||
} else { | |||
List<BigInteger> bigIntegerList = new ArrayList<>(); | |||
if (driverAreaList.contains(query.getDriverArea())) { | |||
bigIntegerList.add(query.getDriverArea()); | |||
queryWrapper.in("area_id", bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} else { | |||
bigIntegerList.add(BigInteger.valueOf(Long.valueOf("-1"))); | |||
queryWrapper.in("area_id", bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} | |||
} | |||
} else { | |||
List<BigInteger> bigIntegerList = new ArrayList<>(); | |||
bigIntegerList.add(query.getDriverArea()); | |||
queryWrapper.in("area_id", bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} | |||
// 河道名称 | |||
if (!StringUtils.isEmpty(query.getDriverName())) { |
@@ -8,10 +8,12 @@ import com.taauav.admin.service.ISysCityService; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.common.service.impl.BaseServiceImpl; | |||
import com.taauav.common.util.FunctionUtils; | |||
import com.taauav.common.util.ShiroUtils; | |||
import com.taauav.common.util.StringUtils; | |||
import com.taauav.front.constant.UserWaterWarnConstant; | |||
import com.taauav.front.mapper.UserWaterWarnMapper; | |||
import com.taauav.front.query.UserWaterWarnQuery; | |||
import com.taauav.front.service.IUserAuthGroupService; | |||
import com.taauav.front.service.IUserWaterWarnService; | |||
import com.taauav.front.vo.waterwarn.UserWaterWarnListVo; | |||
import org.springframework.beans.BeanUtils; | |||
@@ -40,6 +42,8 @@ public class UserWaterWarnServiceImpl extends BaseServiceImpl<UserWaterWarnMappe | |||
@Autowired | |||
private ISysCityService sysCityService; | |||
@Autowired | |||
private IUserAuthGroupService userAuthGroupService; | |||
@Autowired | |||
private Response response; | |||
@@ -58,18 +62,40 @@ public class UserWaterWarnServiceImpl extends BaseServiceImpl<UserWaterWarnMappe | |||
if (!StringUtils.isEmpty(query.getWarnSn())) { | |||
queryWrapper.like("warn_sn", query.getWarnSn()); | |||
} | |||
// 区划ID | |||
if (query.getDriverArea() != null) { | |||
// 获取所有自己区划ID | |||
List<BigInteger> driverAreaList = new ArrayList<>(); | |||
driverAreaList.add(query.getDriverArea()); | |||
List<BigInteger> cityIdsList = sysCityService.getChildCityIds(query.getDriverArea()); | |||
if (!cityIdsList.isEmpty()) { | |||
cityIdsList.forEach(item -> { | |||
driverAreaList.add(item); | |||
}); | |||
// // 区划ID | |||
// if (query.getDriverArea() != null) { | |||
// // 获取所有自己区划ID | |||
// List<BigInteger> driverAreaList = new ArrayList<>(); | |||
// driverAreaList.add(query.getDriverArea()); | |||
// List<BigInteger> cityIdsList = sysCityService.getChildCityIds(query.getDriverArea()); | |||
// if (!cityIdsList.isEmpty()) { | |||
// cityIdsList.forEach(item -> { | |||
// driverAreaList.add(item); | |||
// }); | |||
// } | |||
// queryWrapper.in("driver_area", driverAreaList); | |||
// } | |||
// 数据权限 | |||
if (ShiroUtils.getAdminId() != 1) { | |||
List<BigInteger> driverAreaList = userAuthGroupService.getDriverAreaList(ShiroUtils.getAdminId()); | |||
if (org.springframework.util.StringUtils.isEmpty(query.getDriverArea())) { | |||
// 获取数据权限 | |||
BigInteger[] driverArea = driverAreaList.toArray(new BigInteger[driverAreaList.size()]); | |||
queryWrapper.in("driver_area", driverArea); | |||
} else { | |||
List<BigInteger> bigIntegerList = new ArrayList<>(); | |||
if (driverAreaList.contains(query.getDriverArea())) { | |||
bigIntegerList.add(query.getDriverArea()); | |||
queryWrapper.in("driver_area", bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} else { | |||
bigIntegerList.add(BigInteger.valueOf(Long.valueOf("-1"))); | |||
queryWrapper.in("driver_area", bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} | |||
} | |||
queryWrapper.in("driver_area", driverAreaList); | |||
} else { | |||
List<BigInteger> bigIntegerList = new ArrayList<>(); | |||
bigIntegerList.add(query.getDriverArea()); | |||
queryWrapper.in("driver_area", bigIntegerList.toArray(new BigInteger[bigIntegerList.size()])); | |||
} | |||
// 河湖名称 | |||
if (!StringUtils.isEmpty(query.getDriverName())) { |