Commit 4182aa8f by 杨林龙

Merge remote-tracking branch 'origin/master'

2 parents 374d88d5 505ffb5c
...@@ -11,5 +11,6 @@ public class OrgVehicleModel { ...@@ -11,5 +11,6 @@ public class OrgVehicleModel {
private String ownerName; private String ownerName;
private String sns; private String sns;
private Long creatorId; private Long creatorId;
private Integer source;
} }
...@@ -33,13 +33,6 @@ public class DeviceMonitorApiService { ...@@ -33,13 +33,6 @@ public class DeviceMonitorApiService {
* @return * @return
*/ */
public List<DeviceLocationBo> listDeviceMonitorInfo(String sn, String deviceCode) { public List<DeviceLocationBo> listDeviceMonitorInfo(String sn, String deviceCode) {
DeviceLocationRequest request = new DeviceLocationRequest();
request.setSns(sn);
request.setDeviceCode(deviceCode);
R<List<DeviceLocationBo>> listR2 = gpsBsService.listDeviceMonitorInfo2(request);
log.info(JsonUtils.toJsonStr(listR2));
R<List<DeviceLocationBo>> listR = gpsBsService.listDeviceMonitorInfo(sn, deviceCode); R<List<DeviceLocationBo>> listR = gpsBsService.listDeviceMonitorInfo(sn, deviceCode);
List<DeviceLocationBo> dataList = listR.getDataList(new TypeToken<List<DeviceLocationBo>>() { List<DeviceLocationBo> dataList = listR.getDataList(new TypeToken<List<DeviceLocationBo>>() {
}.getType()); }.getType());
......
...@@ -19,7 +19,6 @@ import org.springframework.beans.BeanUtils; ...@@ -19,7 +19,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch; import org.springframework.util.StopWatch;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -181,16 +180,19 @@ public class VehicleMonitorSevice { ...@@ -181,16 +180,19 @@ public class VehicleMonitorSevice {
*/ */
private List<OrgVehicleTree> convert2ovt(List<OrgVehicleModel> modelList) { private List<OrgVehicleTree> convert2ovt(List<OrgVehicleModel> modelList) {
List<OrgVehicleTree> vehicleList = Lists.newArrayList(); List<OrgVehicleTree> vehicleList = Lists.newArrayList();
if (CollectionUtils.isEmpty(modelList)) {
return vehicleList;
}
modelList.forEach(model -> { modelList.forEach(model -> {
OrgVehicleTree ovt = new OrgVehicleTree(); OrgVehicleTree ovt = new OrgVehicleTree();
ovt.setId("d" + model.getId());//加个前缀是为了保证前端树形控件id的唯一性(组织o,用户u,车辆v,设备d) ovt.setId("d" + model.getId());//加个前缀是为了保证前端树形控件id的唯一性(组织o,用户u,车辆v,设备d)
ovt.setLabel(model.getSns()); ovt.setLabel(model.getSns());
ovt.setParentId(model.getCreatorId()); ovt.setParentId(model.getCreatorId());
ovt.setVid(model.getVid()); ovt.setVid(model.getVid());
ovt.setLabel1(model.getOwnerName()); ovt.setLabel1(StringUtils.isNotEmpty(model.getOwnerName()) ? model.getOwnerName() : "--");
ovt.setLabel2(model.getVin()); ovt.setLabel2(model.getVin());
ovt.setSource(model.getId() % 2 == 0 ? "有线" : "无线"); ovt.setSource(model.getSource() == null ? "未知" : (model.getSource() == 1 ? "有线" : "无线"));
ovt.setOnline(model.getId() % 3 == 0); //ovt.setOnline(model.getId() % 3 == 0);
vehicleList.add(ovt); vehicleList.add(ovt);
}); });
return vehicleList; return vehicleList;
......
...@@ -250,9 +250,11 @@ ...@@ -250,9 +250,11 @@
tv.vin, tv.vin,
tv.owner_name ownerName, tv.owner_name ownerName,
tvd.sn sns, tvd.sn sns,
tv.created_by creatorId tv.created_by creatorId,
td.source
from t_vehicle tv from t_vehicle tv
left join t_vehicle_device tvd on tv.id = tvd.vehicle_id left join t_vehicle_device tvd on tv.id = tvd.vehicle_id
left join t_device td on td.sn = tvd.sn
where tv.del_flag = 0 where tv.del_flag = 0
and tvd.bind_status = 1 and tvd.bind_status = 1
and tv.created_by is not null and tv.created_by is not null
......
...@@ -38,7 +38,6 @@ public class VehicleMonitorSeviceTest { ...@@ -38,7 +38,6 @@ public class VehicleMonitorSeviceTest {
private VehicleMonitorSevice vehicleMonitorSevice; private VehicleMonitorSevice vehicleMonitorSevice;
@Test @Test
public void getTrackHistory() { public void getTrackHistory() {
LocationHistoryRequest historyRequest = new LocationHistoryRequest(); LocationHistoryRequest historyRequest = new LocationHistoryRequest();
historyRequest.setSn("6200917729"); historyRequest.setSn("6200917729");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!