中控信息
This commit is contained in:
parent
9ac54b6629
commit
ab5d844156
@ -1,6 +1,5 @@
|
|||||||
package com.cdzy.operations.controller;
|
package com.cdzy.operations.controller;
|
||||||
|
|
||||||
import com.cdzy.common.model.dto.ResGPSDto;
|
|
||||||
import com.cdzy.common.model.request.PageParam;
|
import com.cdzy.common.model.request.PageParam;
|
||||||
import com.cdzy.common.model.response.JsonResult;
|
import com.cdzy.common.model.response.JsonResult;
|
||||||
import com.cdzy.operations.model.dto.EbikeBikeInfoDto;
|
import com.cdzy.operations.model.dto.EbikeBikeInfoDto;
|
||||||
@ -8,10 +7,7 @@ import com.cdzy.operations.model.dto.EbikeDto;
|
|||||||
import com.cdzy.operations.model.dto.EbikeUserBikeInfo;
|
import com.cdzy.operations.model.dto.EbikeUserBikeInfo;
|
||||||
import com.cdzy.operations.model.dto.EbikeUserLockDto;
|
import com.cdzy.operations.model.dto.EbikeUserLockDto;
|
||||||
import com.cdzy.operations.model.entity.EbikeBikeInfo;
|
import com.cdzy.operations.model.entity.EbikeBikeInfo;
|
||||||
import com.cdzy.operations.model.vo.EbikeBatchLaunchVo;
|
import com.cdzy.operations.model.vo.*;
|
||||||
import com.cdzy.operations.model.vo.EbikeBatchUnLaunchVo;
|
|
||||||
import com.cdzy.operations.model.vo.EbikeBikeBindVo;
|
|
||||||
import com.cdzy.operations.model.vo.EbikeBikeRadiusVo;
|
|
||||||
import com.cdzy.operations.service.EbikeBikeInfoService;
|
import com.cdzy.operations.service.EbikeBikeInfoService;
|
||||||
import com.ebike.feign.model.vo.EbikeLockVo;
|
import com.ebike.feign.model.vo.EbikeLockVo;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
@ -171,8 +167,8 @@ public class EbikeBikeInfoController {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getEcuMsg")
|
@GetMapping("/getEcuMsg")
|
||||||
public JsonResult<ResGPSDto> getEcuMsg(@RequestParam("ecuSn") String ecuSn) {
|
public JsonResult<EbikeEcuMsgDto> getEcuMsg(@RequestParam("ecuSn") String ecuSn) {
|
||||||
ResGPSDto ecuMsg = ebikeBikeInfoService.getEcuMsg(ecuSn);
|
EbikeEcuMsgDto ecuMsg = ebikeBikeInfoService.getEcuMsg(ecuSn);
|
||||||
return JsonResult.success(ecuMsg);
|
return JsonResult.success(ecuMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,120 @@
|
|||||||
|
package com.cdzy.operations.model.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author attiya
|
||||||
|
* @since 2025-03-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EbikeEcuMsgDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private Double longitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private Double latitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外接电池电量(该值由控制器提供,若控制器不支持此值为0)
|
||||||
|
*/
|
||||||
|
private Integer soc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外接电源电压,单位:毫伏
|
||||||
|
*/
|
||||||
|
private Integer voltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外接电源电压,单位:伏
|
||||||
|
*/
|
||||||
|
private Double realVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GPS信号强度【0-31】
|
||||||
|
*/
|
||||||
|
private Integer gsm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0: 头盔不在位 1: 头盔在位
|
||||||
|
*/
|
||||||
|
private Character helmetExit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0: 头盔锁未上锁 1: 头盔锁已上锁
|
||||||
|
*/
|
||||||
|
private Character isHelmetLocked;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0:后轮静止 1:后轮转动(轮动状态
|
||||||
|
*/
|
||||||
|
private Character isWheelSpin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0:撤防状态 1:设防状态
|
||||||
|
*/
|
||||||
|
private Character isDefendOn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0: 车辆静止 1: 车辆移动(运动状态
|
||||||
|
*/
|
||||||
|
private Character isMoving;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0:电门关闭 1:电门打开
|
||||||
|
*/
|
||||||
|
private Character accOn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0:后轮未锁 1:后轮已锁
|
||||||
|
*/
|
||||||
|
private Character wheelLocked;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0:电池仓未锁 1:电池仓已锁
|
||||||
|
*/
|
||||||
|
private Character seatLocked;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 速度
|
||||||
|
*/
|
||||||
|
private Float speed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中文位置
|
||||||
|
*/
|
||||||
|
private String chineseLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ecuSn
|
||||||
|
*/
|
||||||
|
private String ecuSn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否在运营区(记录最后一次用户停车
|
||||||
|
*/
|
||||||
|
private Boolean inOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否在停车区(记录最后一次用户停车
|
||||||
|
*/
|
||||||
|
private Boolean inParking;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 放电状态:0-关闭(断电) 1-打开(通电)
|
||||||
|
*/
|
||||||
|
private Integer mosState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后一次上报时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime latestTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package com.cdzy.operations.service;
|
package com.cdzy.operations.service;
|
||||||
|
|
||||||
import com.cdzy.common.model.dto.ResGPSDto;
|
|
||||||
import com.cdzy.common.model.request.PageParam;
|
import com.cdzy.common.model.request.PageParam;
|
||||||
import com.cdzy.operations.model.dto.EbikeBikeInfoDto;
|
import com.cdzy.operations.model.dto.EbikeBikeInfoDto;
|
||||||
import com.cdzy.operations.model.dto.EbikeDto;
|
import com.cdzy.operations.model.dto.EbikeDto;
|
||||||
@ -100,5 +99,5 @@ public interface EbikeBikeInfoService extends IService<EbikeBikeInfo> {
|
|||||||
* 根据EcuSn获取信息
|
* 根据EcuSn获取信息
|
||||||
* @param ecuSn 中控编号
|
* @param ecuSn 中控编号
|
||||||
*/
|
*/
|
||||||
ResGPSDto getEcuMsg(String ecuSn);
|
EbikeEcuMsgDto getEcuMsg(String ecuSn);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,11 +39,7 @@ import com.cdzy.operations.model.entity.EbikeRegion;
|
|||||||
import com.cdzy.operations.model.entity.EbikeSpecialBillingConfiguration;
|
import com.cdzy.operations.model.entity.EbikeSpecialBillingConfiguration;
|
||||||
import com.cdzy.operations.model.entity.EbikeSpecialDay;
|
import com.cdzy.operations.model.entity.EbikeSpecialDay;
|
||||||
import com.cdzy.operations.model.entity.EbikeSpecialTime;
|
import com.cdzy.operations.model.entity.EbikeSpecialTime;
|
||||||
import com.cdzy.operations.model.vo.EbikeBatchLaunchVo;
|
import com.cdzy.operations.model.vo.*;
|
||||||
import com.cdzy.operations.model.vo.EbikeBatchUnLaunchVo;
|
|
||||||
import com.cdzy.operations.model.vo.EbikeBikeBindVo;
|
|
||||||
import com.cdzy.operations.model.vo.EbikeBikeRadiusVo;
|
|
||||||
import com.cdzy.operations.model.vo.EbikeInventoryVo;
|
|
||||||
import com.cdzy.operations.service.EbikeBikeInfoService;
|
import com.cdzy.operations.service.EbikeBikeInfoService;
|
||||||
import com.cdzy.operations.service.EbikeDispatchConfigurationService;
|
import com.cdzy.operations.service.EbikeDispatchConfigurationService;
|
||||||
import com.cdzy.operations.service.EbikeEcuInfoService;
|
import com.cdzy.operations.service.EbikeEcuInfoService;
|
||||||
@ -51,6 +47,7 @@ import com.cdzy.operations.service.EbikeInventoryRecordService;
|
|||||||
import com.cdzy.operations.service.EbikeInventoryService;
|
import com.cdzy.operations.service.EbikeInventoryService;
|
||||||
import com.cdzy.operations.utils.RedisUtil;
|
import com.cdzy.operations.utils.RedisUtil;
|
||||||
import com.ebike.feign.model.vo.EbikeLockVo;
|
import com.ebike.feign.model.vo.EbikeLockVo;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import com.mybatisflex.core.update.UpdateChain;
|
import com.mybatisflex.core.update.UpdateChain;
|
||||||
@ -561,14 +558,18 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResGPSDto getEcuMsg(String ecuSn) {
|
public EbikeEcuMsgDto getEcuMsg(String ecuSn) {
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||||
.where(EBIKE_ECU_INFO.ECU_SN.eq(ecuSn));
|
.where(EBIKE_ECU_INFO.ECU_SN.eq(ecuSn));
|
||||||
EbikeEcuInfo ebikeEcuInfo = ebikeEcuInfoService.getOne(queryWrapper);
|
EbikeEcuInfo ebikeEcuInfo = ebikeEcuInfoService.getOne(queryWrapper);
|
||||||
if (ebikeEcuInfo == null) {
|
if (ebikeEcuInfo == null) {
|
||||||
throw new EbikeException("中控编号错误,该中控仓库中不存在");
|
throw new EbikeException("中控编号错误,该中控仓库中不存在");
|
||||||
}
|
}
|
||||||
return (ResGPSDto) redisUtil.getEcu(ecuSn);
|
ResGPSDto ecu = (ResGPSDto) redisUtil.getEcu(ecuSn);
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
EbikeEcuMsgDto ebikeEcuMsgDto = objectMapper.convertValue(ecu, EbikeEcuMsgDto.class);
|
||||||
|
ebikeEcuMsgDto.setRealVoltage(ecu.getVoltage()/1000.0);
|
||||||
|
return ebikeEcuMsgDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user