地址解析,工单车辆详情
This commit is contained in:
parent
576efa234a
commit
508b29c617
@ -36,11 +36,6 @@ public class ResGPSDto {
|
||||
*/
|
||||
private Integer gsm;
|
||||
|
||||
/**
|
||||
* 时间戳
|
||||
*/
|
||||
private Number timestamp;
|
||||
|
||||
/**
|
||||
* 0: 头盔不在位 1: 头盔在位
|
||||
*/
|
||||
|
||||
@ -36,7 +36,6 @@ public class EbikeOrderBikeInfoDto implements Serializable {
|
||||
*/
|
||||
private Long bikeInfoId;
|
||||
|
||||
|
||||
/**
|
||||
* 定位
|
||||
*/
|
||||
@ -51,6 +50,11 @@ public class EbikeOrderBikeInfoDto implements Serializable {
|
||||
*/
|
||||
private Integer usageStatus;
|
||||
|
||||
/**
|
||||
* 最新骑行时间
|
||||
*/
|
||||
private LocalDateTime latestCyclingTime;
|
||||
|
||||
/**
|
||||
* 外接电池电量(该值由控制器提供,若控制器不支持此值为0)
|
||||
*/
|
||||
@ -66,11 +70,6 @@ public class EbikeOrderBikeInfoDto implements Serializable {
|
||||
*/
|
||||
private Integer gsm;
|
||||
|
||||
/**
|
||||
* 时间戳
|
||||
*/
|
||||
private Number timestamp;
|
||||
|
||||
/**
|
||||
* 0: 头盔不在位 1: 头盔在位
|
||||
*/
|
||||
@ -86,11 +85,6 @@ public class EbikeOrderBikeInfoDto implements Serializable {
|
||||
*/
|
||||
private Character isWheelSpin;
|
||||
|
||||
/**
|
||||
* 0:撤防状态 1:设防状态
|
||||
*/
|
||||
private Character isDefendOn;
|
||||
|
||||
/**
|
||||
* 0: 车辆静止 1: 车辆移动(运动状态
|
||||
*/
|
||||
@ -126,24 +120,9 @@ public class EbikeOrderBikeInfoDto implements Serializable {
|
||||
*/
|
||||
private String ecuSn;
|
||||
|
||||
/**
|
||||
* 是否在运营区(记录最后一次用户停车
|
||||
*/
|
||||
private Boolean inOperation;
|
||||
|
||||
/**
|
||||
* 是否在停车区(记录最后一次用户停车
|
||||
*/
|
||||
private Boolean inParking;
|
||||
|
||||
/**
|
||||
* 最后一次上报时间
|
||||
*/
|
||||
private LocalDateTime latestTime;
|
||||
|
||||
/**
|
||||
* 放电状态:0-关闭(断电) 1-打开(通电)
|
||||
*/
|
||||
private Integer mosState;
|
||||
|
||||
}
|
||||
|
||||
@ -14,8 +14,11 @@ import com.cdzy.operations.model.vo.EbikeBatteryClaimReturnVo;
|
||||
import com.cdzy.operations.model.vo.FaultOrderVo;
|
||||
import com.cdzy.operations.model.vo.InspectionSwapOrderVo;
|
||||
import com.cdzy.operations.service.EbikeBikeOrderService;
|
||||
import com.cdzy.operations.utils.GeoCodingUtil;
|
||||
import com.cdzy.operations.utils.MinioUtil;
|
||||
import com.cdzy.operations.utils.RedisUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mybatisflex.core.keygen.impl.SnowFlakeIDKeyGenerator;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.update.UpdateChain;
|
||||
@ -78,6 +81,9 @@ public class EbikeBikeOrderServiceImpl extends ServiceImpl<EbikeBikeOrderMapper,
|
||||
@Resource
|
||||
MinioUtil minioUtil;
|
||||
|
||||
@Resource
|
||||
GeoCodingUtil geoCodingUtil;
|
||||
|
||||
@Resource
|
||||
private EbikeBikeOrderMapper ebikeBikeOrderMapper;
|
||||
|
||||
@ -372,7 +378,34 @@ public class EbikeBikeOrderServiceImpl extends ServiceImpl<EbikeBikeOrderMapper,
|
||||
|
||||
@Override
|
||||
public EbikeOrderBikeInfoDto bikeInfo(String bikeCode) {
|
||||
return null;
|
||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||
.select(EBIKE_BIKE_INFO.BIKE_INFO_ID,EBIKE_BIKE_INFO.LOCATION,EBIKE_BIKE_INFO.USAGE_STATUS,EBIKE_BIKE_INFO.LATEST_CYCLING_TIME,EBIKE_ECU_INFO.ECU_SN)
|
||||
.where(EBIKE_BIKE_INFO.BIKE_CODE.eq(bikeCode))
|
||||
.leftJoin(EBIKE_ECU_INFO).on(EBIKE_ECU_INFO.ECU_ID.eq(EBIKE_BIKE_INFO.ECU_ID));
|
||||
EbikeOrderBikeInfoDto bikeInfo = bikeInfoMapper.selectOneByQueryAs(queryWrapper,EbikeOrderBikeInfoDto.class);
|
||||
if (bikeInfo == null) {
|
||||
throw new EbikeException("车辆编号错误");
|
||||
}
|
||||
ResGPSDto resGPSDto = (ResGPSDto)redisUtil.getEcu(bikeInfo.getEcuSn());
|
||||
bikeInfo.setSoc(resGPSDto.getSoc());
|
||||
bikeInfo.setVoltage(resGPSDto.getVoltage());
|
||||
bikeInfo.setGsm(resGPSDto.getGsm());
|
||||
bikeInfo.setHelmetExit(resGPSDto.getHelmetExit());
|
||||
bikeInfo.setIsHelmetLocked(resGPSDto.getIsHelmetLocked());
|
||||
bikeInfo.setIsWheelSpin(resGPSDto.getIsWheelSpin());
|
||||
bikeInfo.setIsMoving(resGPSDto.getIsMoving());
|
||||
bikeInfo.setAccOn(resGPSDto.getAccOn());
|
||||
bikeInfo.setWheelLocked(resGPSDto.getWheelLocked());
|
||||
bikeInfo.setSeatLocked(resGPSDto.getSeatLocked());
|
||||
bikeInfo.setSpeed(resGPSDto.getSpeed());
|
||||
bikeInfo.setLatestTime(resGPSDto.getLatestTime());
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
ObjectNode objectNode = mapper.createObjectNode();
|
||||
objectNode.put("lng",resGPSDto.getLongitude());
|
||||
objectNode.put("lat",resGPSDto.getLatitude());
|
||||
String locationToAddress = geoCodingUtil.getLocationToAddress(objectNode);
|
||||
bikeInfo.setChineseLocation(locationToAddress);
|
||||
return bikeInfo;
|
||||
}
|
||||
|
||||
EbikeBikeInfo checkBikeCode(String bikeCode) {
|
||||
|
||||
@ -114,3 +114,7 @@ minio:
|
||||
logging:
|
||||
pattern:
|
||||
dateformat: yyyy-MM-dd HH:mm:ss
|
||||
|
||||
geo-coding:
|
||||
api-url: https://restapi.amap.com/v3/geocode
|
||||
access-key: c9bc51e353b49acd42a560f37121929a
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user