mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update
This commit is contained in:
@@ -614,8 +614,6 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService {
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Integer> getPileTypeNum(Long stationId) {
|
||||
StopWatch sw = new StopWatch();
|
||||
sw.start("高德查询-根据站点id查询快、慢充设备数量");
|
||||
int fastTotal = 0;
|
||||
int fastFree = 0;
|
||||
int slowTotal = 0;
|
||||
@@ -641,8 +639,6 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService {
|
||||
map.put("fastFree", fastFree);
|
||||
map.put("slowTotal", slowTotal);
|
||||
map.put("slowFree", slowFree);
|
||||
sw.stop();
|
||||
log.info(sw.prettyPrint());
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jsowell.thirdparty.amap.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
@@ -93,23 +94,23 @@ public class AMapServiceImpl implements AMapService {
|
||||
sw.start("拼装高德格式数据");
|
||||
|
||||
// 使用自定义ForkJoinPool
|
||||
// List<AMapStationInfo> resultList = new ForkJoinPool(10).submit(() ->
|
||||
// stationInfos.parallelStream().map(x -> {
|
||||
// try {
|
||||
// return assembleAMapData(x);
|
||||
// } catch (ExecutionException | InterruptedException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// }).collect(Collectors.toList())
|
||||
// ).fork().join();
|
||||
List<AMapStationInfo> resultList = new ForkJoinPool(4).submit(() ->
|
||||
stationInfos.parallelStream().map(x -> {
|
||||
try {
|
||||
return assembleAMapData(x);
|
||||
} catch (ExecutionException | InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}).collect(Collectors.toList())
|
||||
).fork().join();
|
||||
|
||||
List<AMapStationInfo> resultList = pageInfo.getList().parallelStream().map(x -> {
|
||||
try {
|
||||
return assembleAMapData(x);
|
||||
} catch (ExecutionException | InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
// List<AMapStationInfo> resultList = pageInfo.getList().parallelStream().map(x -> {
|
||||
// try {
|
||||
// return assembleAMapData(x);
|
||||
// } catch (ExecutionException | InterruptedException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// }).collect(Collectors.toList());
|
||||
sw.stop();
|
||||
log.info("接口耗时:{}, 详情:{}", sw.getTotalTimeMillis(), sw.prettyPrint());
|
||||
return resultList;
|
||||
@@ -178,7 +179,9 @@ public class AMapServiceImpl implements AMapService {
|
||||
|
||||
stopWatch.stop();
|
||||
|
||||
log.info("高德查询-拼装高德数据耗时:{}, 详细:{}", stopWatch.getTotalTimeMillis(), stopWatch.prettyPrint());
|
||||
if (stopWatch.getTotalTimeMillis() > 100) {
|
||||
log.info("高德查询-拼装高德数据耗时大于100ms:{}, 详细:{}, stationInfo:{}", stopWatch.getTotalTimeMillis(), stopWatch.prettyPrint(), JSON.toJSONString(stationInfo));
|
||||
}
|
||||
return aMapInfo;
|
||||
}
|
||||
|
||||
@@ -275,8 +278,6 @@ public class AMapServiceImpl implements AMapService {
|
||||
* @return
|
||||
*/
|
||||
private List<AMapPriceChargingInfo> getPriceInfoByStationId(String StationId) {
|
||||
StopWatch sw = new StopWatch();
|
||||
sw.start("高德查询-根据站点id查询计费模板");
|
||||
List<AMapPriceChargingInfo> priceList = new ArrayList<>();
|
||||
// 查询计费模板
|
||||
List<BillingPriceVO> billingPriceList = pileBillingTemplateService.queryBillingPrice(StationId);
|
||||
@@ -288,8 +289,6 @@ public class AMapServiceImpl implements AMapService {
|
||||
|
||||
priceList.add(info);
|
||||
}
|
||||
sw.stop();
|
||||
log.info(sw.prettyPrint());
|
||||
return priceList;
|
||||
}
|
||||
|
||||
@@ -300,8 +299,6 @@ public class AMapServiceImpl implements AMapService {
|
||||
* @return
|
||||
*/
|
||||
private List<AMapEquipmentInfo> getPileListByStationId(String stationId) {
|
||||
StopWatch sw = new StopWatch();
|
||||
sw.start("高德查询-根据站点查询站点下所有桩");
|
||||
List<AMapEquipmentInfo> pileList = new ArrayList<>();
|
||||
// 根据站点查询站点下所有桩
|
||||
List<PileBasicInfo> pileBasicInfoList = pileBasicInfoService.getPileListByStationId(String.valueOf(stationId));
|
||||
@@ -326,8 +323,6 @@ public class AMapServiceImpl implements AMapService {
|
||||
|
||||
pileList.add(info);
|
||||
}
|
||||
sw.stop();
|
||||
log.info(sw.prettyPrint());
|
||||
return pileList;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user