Commit f09461bb by 杨林龙

Merge remote-tracking branch 'origin/v1.5.0' into v1.5.0

2 parents 8320c19e 24aaa5b9
...@@ -53,6 +53,9 @@ public class VehicleMonitorSevice { ...@@ -53,6 +53,9 @@ public class VehicleMonitorSevice {
@Autowired @Autowired
private WorkOrderService workOrderService; private WorkOrderService workOrderService;
@Autowired
private UserApiService userApiService;
/** /**
* 车辆监控树-设备维度 * 车辆监控树-设备维度
* *
...@@ -68,9 +71,16 @@ public class VehicleMonitorSevice { ...@@ -68,9 +71,16 @@ public class VehicleMonitorSevice {
//模糊搜索业务数据,反向生成组织+车辆树结构 //模糊搜索业务数据,反向生成组织+车辆树结构
if (search.getTermType() != null && StringUtils.isNotBlank(search.getTerm())) { if (search.getTermType() != null && StringUtils.isNotBlank(search.getTerm())) {
sw.start("task1"); sw.start("task1");
//搜索车辆或设备 //搜索车辆或设备-常规数据
List<OrgVehicleModel> modelList = vehicleMapper.selectOrgVehicleSns(search); 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)) { if (CollectionUtils.isEmpty(modelList)) {
return Lists.newArrayList(); return Lists.newArrayList();
} }
......
...@@ -334,7 +334,7 @@ ...@@ -334,7 +334,7 @@
tv.vin, tv.vin,
tv.owner_name ownerName, tv.owner_name ownerName,
tvd.sn sns, tvd.sn sns,
tv.created_by creatorId, tvp.receiver_id creatorId,
td.source, td.source,
td.device_type deviceType td.device_type deviceType
from t_vehicle tv from t_vehicle tv
...@@ -343,12 +343,10 @@ ...@@ -343,12 +343,10 @@
left join t_vehicle_permit tvp on tvp.content_id = tv.id 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 where tv.del_flag = 0 and tvd.del_flag = 0 and tvp.del_flag = 0
and tvd.bind_status = 1 and tvd.bind_status = 1
<if test="userIds != null and userIds.size() > 0"> and tvp.receiver_id in
and tvp.receiver_id in <foreach collection="userIds" separator="," open="(" close=")" item="item">
<foreach collection="userIds" separator="," open="(" close=")" item="item"> #{item}
#{item} </foreach>
</foreach>
</if>
<choose> <choose>
<when test="termType == 1"> <when test="termType == 1">
and tvd.sn like concat('%',#{term},'%') 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!