Commit 4182aa8f by 杨林龙

Merge remote-tracking branch 'origin/master'

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