开始运营限制:配置了计费规则
This commit is contained in:
parent
a6a0da11c7
commit
12e8ea9c09
@ -1,6 +1,7 @@
|
|||||||
package com.cdzy.operations.controller;
|
package com.cdzy.operations.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
|
import com.cdzy.common.ex.EbikeException;
|
||||||
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.enums.RegionStatus;
|
import com.cdzy.operations.enums.RegionStatus;
|
||||||
@ -131,6 +132,12 @@ public class EbikeRegionController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("commenceOperation")
|
@GetMapping("commenceOperation")
|
||||||
public JsonResult<?> commenceOperation(@RequestParam Long regionId) {
|
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)
|
UpdateChain.of(EbikeRegion.class)
|
||||||
.where(EbikeRegion::getRegionId).eq(regionId)
|
.where(EbikeRegion::getRegionId).eq(regionId)
|
||||||
.set(EBIKE_REGION.STATUS, RegionStatus.OPERATION)
|
.set(EBIKE_REGION.STATUS, RegionStatus.OPERATION)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user