Commit 24aaa5b9 by levphon

指定授权bug修复

1 parent 35a2ca5c
......@@ -53,6 +53,9 @@ public class VehicleMonitorSevice {
@Autowired
private WorkOrderService workOrderService;
@Autowired
private UserApiService userApiService;
/**
* 车辆监控树-设备维度
*
......@@ -68,9 +71,16 @@ public class VehicleMonitorSevice {
//模糊搜索业务数据,反向生成组织+车辆树结构
if (search.getTermType() != null && StringUtils.isNotBlank(search.getTerm())) {
sw.start("task1");
//搜索车辆或设备
//搜索车辆或设备-常规数据
List<OrgVehicleModel> modelList = vehicleMapper.selectOrgVehicleSns(search);
//搜索车辆或设备-授权数据
Set<Long> subordinateIds = userApiService.getSubordinateById(ShieldContextHolder.getUserId());
log.info("资源用户列表:{}", JSONUtil.toJsonStr(subordinateIds));
List<OrgVehicleModel> sharedModelList = vehicleMapper.selectAbsolutelyVehicleSns(search.setUserIds(subordinateIds));
modelList.addAll(sharedModelList);
if (CollectionUtils.isEmpty(modelList)) {
return Lists.newArrayList();
}
......
......@@ -334,7 +334,7 @@
tv.vin,
tv.owner_name ownerName,
tvd.sn sns,
tv.created_by creatorId,
tvp.receiver_id creatorId,
td.source,
td.device_type deviceType
from t_vehicle tv
......@@ -343,12 +343,10 @@
left join t_vehicle_permit tvp on tvp.content_id = tv.id
where tv.del_flag = 0 and tvd.del_flag = 0 and tvp.del_flag = 0
and tvd.bind_status = 1
<if test="userIds != null and userIds.size() > 0">
and tvp.receiver_id in
<foreach collection="userIds" separator="," open="(" close=")" item="item">
#{item}
</foreach>
</if>
and tvp.receiver_id in
<foreach collection="userIds" separator="," open="(" close=")" item="item">
#{item}
</foreach>
<choose>
<when test="termType == 1">
and tvd.sn like concat('%',#{term},'%')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!