中控换绑

This commit is contained in:
attiya 2025-12-10 16:54:23 +08:00
parent a24aa7db13
commit 1fc76e9fa1
3 changed files with 32 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package com.cdzy.operations.controller;
import com.cdzy.common.model.dto.ResGPSDto;
import com.cdzy.common.model.request.PageParam;
import com.cdzy.common.model.response.JsonResult;
import com.cdzy.operations.model.dto.EbikeBikeInfoDto;
@ -148,4 +149,17 @@ public class EbikeBikeInfoController {
ebikeBikeInfoService.changeEcu(bikeCode, ecuSn);
return JsonResult.success();
}
/**
* 根据中控编号获取设备信息
*
* @param ecuSn 中控编号
* @return 结果
*/
@GetMapping("/getEcuMsg")
public JsonResult<ResGPSDto> getEcuMsg(@RequestParam("ecuSn") String ecuSn) {
ResGPSDto ecuMsg = ebikeBikeInfoService.getEcuMsg(ecuSn);
return JsonResult.success(ecuMsg);
}
}

View File

@ -1,5 +1,6 @@
package com.cdzy.operations.service;
import com.cdzy.common.model.dto.ResGPSDto;
import com.cdzy.common.model.request.PageParam;
import com.cdzy.operations.model.dto.EbikeBikeInfoDto;
import com.cdzy.operations.model.dto.EbikeDto;
@ -96,4 +97,10 @@ public interface EbikeBikeInfoService extends IService<EbikeBikeInfo> {
* @param ecuSn 中控编号
*/
void changeEcu(String bikeCode, String ecuSn);
/**
* 根据EcuSn获取信息
* @param ecuSn 中控编号
*/
ResGPSDto getEcuMsg(String ecuSn);
}

View File

@ -504,6 +504,17 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
updateById(bikeInfo);
}
@Override
public ResGPSDto getEcuMsg(String ecuSn) {
QueryWrapper queryWrapper = QueryWrapper.create()
.where(EBIKE_ECU_INFO.ECU_SN.eq(ecuSn));
EbikeEcuInfo ebikeEcuInfo = ebikeEcuInfoService.getOne(queryWrapper);
if (ebikeEcuInfo == null) {
throw new EbikeException("中控编号错误,该中控仓库中不存在");
}
return (ResGPSDto)redisUtil.getEcu(ecuSn);
}
static EbikeSpecialDay getEbikeSpecialDay(List<EbikeSpecialDay> ebikeSpecialDays) {
LocalDate today = LocalDate.now();