运营区边缘计算:基础支持

This commit is contained in:
PC 2026-03-03 14:19:22 +08:00
parent 8385b592f8
commit a3bcb04f5b
3 changed files with 28 additions and 0 deletions

View File

@ -278,4 +278,16 @@ public class EbikeRegionController {
FeignEbikeRegionVo region = ebikeRegionService.getRegionByLocation(location, radius);
return JsonResult.success(region);
}
/**
* 根据SN编号查询运营区
*
* @param ecuSn 车辆编号
* @return 当前运营区信息
*/
@GetMapping("/api/getRegionByBikeCode")
public JsonResult<EbikeRegion> getRegionByEcuSn(@RequestParam("ecuSn") String ecuSn) {
EbikeRegion region = ebikeRegionService.getRegionByEcuSn(ecuSn);
return JsonResult.success(region);
}
}

View File

@ -46,4 +46,11 @@ public interface EbikeRegionService extends IService<EbikeRegion> {
* @return 运营区信息
*/
FeignEbikeRegionVo getRegionByLocation(Point point,double radius);
/**
* 根据车辆编号查询运营区
* @param ecuSn 车辆编号
* @return 运营区信息
*/
EbikeRegion getRegionByEcuSn(String ecuSn);
}

View File

@ -31,6 +31,7 @@ import static com.cdzy.operations.model.entity.table.EbikeOperationLockConfigTab
import static com.cdzy.operations.model.entity.table.EbikeOperationReturnConfigTableDef.EBIKE_OPERATION_RETURN_CONFIG;
import static com.cdzy.operations.model.entity.table.EbikeOperationUseConfigTableDef.EBIKE_OPERATION_USE_CONFIG;
import static com.cdzy.operations.model.entity.table.EbikeRegionTableDef.EBIKE_REGION;
import static com.cdzy.operations.model.entity.table.EbikeEcuInfoTableDef.EBIKE_ECU_INFO;
/**
* 运营区域表 服务层实现
@ -163,4 +164,12 @@ public class EbikeRegionServiceImpl extends ServiceImpl<EbikeRegionMapper, Ebike
}
return currentRegion;
}
@Override
public EbikeRegion getRegionByEcuSn(String ecuSn) {
QueryWrapper queryWrapper = QueryWrapper.create()
.where(EBIKE_ECU_INFO.ECU_SN.eq(ecuSn))
.leftJoin(EBIKE_ECU_INFO).on(EBIKE_ECU_INFO.OPERATOR_ID.eq(EBIKE_REGION.OPERATOR_ID));
return this.mapper.selectOneByQuery(queryWrapper);
}
}