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