Commit 1f671038 by 杨林龙

Merge remote-tracking branch 'origin/master'

2 parents 85728b78 e06b8558
......@@ -18,6 +18,7 @@ import org.apache.commons.lang.StringUtils;
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;
......@@ -55,7 +56,10 @@ public class VehicleMonitorSevice {
List<OrgTreeModel> orgTreeModelList = Lists.newArrayList();
StopWatch sw = new StopWatch();
if (search.getTermType() != null && StringUtils.isNotBlank(search.getTerm())) {
sw.start("task1");
//搜索车辆或设备
List<OrgVehicleModel> modelList = vehicleMapper.selectVehicleSns(search);
......@@ -77,12 +81,19 @@ public class VehicleMonitorSevice {
return convert2ovt(modelList);
}
} else {
sw.start("task2");
orgTreeModelList = organizationApiService.orgTree(search);
}
sw.stop();
log.info("{} 耗时:{} s", sw.getLastTaskName(), sw.getLastTaskTimeMillis());
sw.start("task3");
//线性结构转树型结构
List<? extends TreeModel> orgTree = TreeModelUtil.fastConvertByRootMark(orgTreeModelList, 1);
sw.stop();
log.info(sw.prettyPrint());
log.info("总耗时:{} s", sw.getTotalTimeSeconds());
return orgTree;
}
......@@ -213,6 +224,7 @@ public class VehicleMonitorSevice {
/**
* 构建位置信息 无gps、基站、wifi定位的返回null
*
* @param deviceBo
* @return
*/
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!