运营车辆
This commit is contained in:
parent
7616f70bb1
commit
bf64b258bc
@ -17,6 +17,8 @@ public class RspBikeInfo {
|
||||
*/
|
||||
private String reginId;
|
||||
|
||||
private Integer soc;
|
||||
|
||||
/**
|
||||
* 中控ID
|
||||
*/
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
package com.cdzy.ebikeoperate.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.cdzy.common.enums.Code;
|
||||
import com.cdzy.common.enums.Message;
|
||||
import com.cdzy.common.model.JsonResult;
|
||||
import com.cdzy.common.model.PageParam;
|
||||
import com.cdzy.common.model.ResGPSDto;
|
||||
import com.cdzy.ebikeoperate.enums.EbikeRegionInOperation;
|
||||
import com.cdzy.ebikeoperate.enums.EbikeRegionType;
|
||||
import com.cdzy.ebikeoperate.enums.ShapeType;
|
||||
@ -254,6 +256,7 @@ public class EbikeRegionServiceImpl extends ServiceImpl<EbikeRegionMapper, Ebike
|
||||
}
|
||||
|
||||
private List<RspBikeInfo> getRspBikeInfos(List<RedisPoint> points) {
|
||||
//TODO:优化为点列表+电量,再通过详情接口获取车辆详情
|
||||
if (points != null && !points.isEmpty()) {
|
||||
List<String> sns = points.stream().map(RedisPoint::getMember).toList();
|
||||
JsonResult<List<RspBikeInfo>> bike = maintenanceFeignClient.getBikeByEcuSn(new ReqEcuSnDto(sns));
|
||||
@ -266,6 +269,9 @@ public class EbikeRegionServiceImpl extends ServiceImpl<EbikeRegionMapper, Ebike
|
||||
if (redisPoint.getMember().equals(rspBikeInfo.getEcuSn())) {
|
||||
rspBikeInfo.setLongitude(redisPoint.getPoint().getX());
|
||||
rspBikeInfo.setLatitude(redisPoint.getPoint().getY());
|
||||
String jsonString = JSONObject.toJSONString(redisUtil.get(rspBikeInfo.getEcuSn()));
|
||||
ResGPSDto resGPSDto = JSONObject.parseObject(jsonString, ResGPSDto.class);
|
||||
rspBikeInfo.setSoc(resGPSDto.getSoc());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ public class UserOrdersServiceImpl extends ServiceImpl<UserOrdersMapper, UserOrd
|
||||
if (!pointInOperation){
|
||||
throw new RuntimeException("当前车辆再运营区外");
|
||||
}
|
||||
//TODO:开锁
|
||||
//TODO:开锁,并且等待结果
|
||||
|
||||
userOrders.setBikeId(bikeInfoDto.getBikeId());
|
||||
String stringBuilder = resGpsDto.getLongitude() + "," + resGpsDto.getLatitude();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user