Commit 81e83535 by levphon

车辆归属显示全层级

1 parent 300d7d7f
......@@ -1023,6 +1023,8 @@ public class VehicleService extends AbstractCommonService {
List<VehicleInfoPageDTO> vehicleInfoList = vehicleMapper.searchVehicleInfo(search);
organizationApiService.drawAllLevel(vehicleInfoList);
//过滤DeviceType为空的数据,预防空指针
Map<String, Integer> snsMap = vehicleInfoList.stream().filter(m -> m.getDeviceType() != null)
.collect(Collectors.toMap(VehicleInfoPageDTO::getSn, VehicleInfoPageDTO::getDeviceType, (o, n) -> n));
......@@ -1032,6 +1034,7 @@ public class VehicleService extends AbstractCommonService {
String supAdjFreq = PropertiesUtils.getProperty("support.adj.freq");
for (VehicleInfoPageDTO vehicleInfo : vehicleInfoList) {
vehicleInfo.setCreator(vehicleInfo.getBelongLevels());
//设置车辆类型
vehicleInfo.setVehicleTypeStr(VehicleTypeEnum.getNameByCode(vehicleInfo.getVehicleType()));
vehicleInfo.setVehicleUsageStr(VehicleUsageEnum.getNameByCode(vehicleInfo.getVehicleUsages()));
......@@ -1048,7 +1051,6 @@ public class VehicleService extends AbstractCommonService {
}
}
organizationApiService.drawAllLevel(vehicleInfoList);
return new PageInfo<>(vehicleInfoList);
}
......
......@@ -471,7 +471,6 @@
tv.settle_flag settleFlag,
tv.created_date activateTime,
ddf.`status` AS freqStatus,
concat(tdept.department_name,'/',tu.username) creator,
tv.created_by createdBy
from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
......@@ -479,7 +478,6 @@
left join t_device td on td.sn = tvd.sn
left join t_device_location tdl on tdl.sn = tvd.sn
left join t_user tu on tu.id = tv.created_by
left join t_department tdept on tdept.id = tu.department_id
left join (select vehicle_id, sn, status from (SELECT * FROM t_device_freq order by created_date desc) temp GROUP BY temp.sn) ddf on ddf.vehicle_id = tv.id and ddf.sn =
td.sn
where tv.del_flag = 0
......@@ -568,7 +566,6 @@
ddf.timer AS timer,
ddf.`week` AS `week`,
ddf.week_timer AS weekTimer,
concat(tdept.department_name,'/',tu2.username) creator,
tu.username,
tu.account operation
from t_vehicle tv
......@@ -579,7 +576,6 @@
left join (select * from (SELECT * FROM t_device_freq order by created_date desc) temp GROUP BY temp.sn) ddf on ddf.vehicle_id = tv.id and ddf.sn = td.sn
left join t_user tu on tu.id = ddf.created_by
left join t_user tu2 on tu2.id = tv.created_by
left join t_department tdept on tdept.id = tu2.department_id
where tv.del_flag = 0
and tvd.bind_status = 1
and tvd.del_flag = 0
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!