From 12e8ea9c0908d9a1f97df07868f245f65922818bbc17a14e049db769d935aaea Mon Sep 17 00:00:00 2001 From: attiya <2413103649@qq.com> Date: Fri, 24 Oct 2025 16:07:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E8=BF=90=E8=90=A5=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=9A=E9=85=8D=E7=BD=AE=E4=BA=86=E8=AE=A1=E8=B4=B9?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cdzy/operations/controller/EbikeRegionController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeRegionController.java b/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeRegionController.java index bfbf100..6313289 100644 --- a/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeRegionController.java +++ b/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeRegionController.java @@ -1,6 +1,7 @@ package com.cdzy.operations.controller; import cn.dev33.satoken.stp.StpUtil; +import com.cdzy.common.ex.EbikeException; import com.cdzy.common.model.request.PageParam; import com.cdzy.common.model.response.JsonResult; import com.cdzy.operations.enums.RegionStatus; @@ -131,6 +132,12 @@ public class EbikeRegionController { */ @GetMapping("commenceOperation") public JsonResult commenceOperation(@RequestParam Long regionId) { + QueryWrapper queryWrapper = QueryWrapper.create() + .where(EBIKE_DEFAULT_BILLING_CONFIGURATION.REGION_ID.eq(regionId)); + EbikeDefaultBillingConfiguration configuration = defaultConfigurationService.getOne(queryWrapper); + if (configuration == null) { + throw new EbikeException("请配置计费规则后再开始运营"); + } UpdateChain.of(EbikeRegion.class) .where(EbikeRegion::getRegionId).eq(regionId) .set(EBIKE_REGION.STATUS, RegionStatus.OPERATION)