2025-04-14 09:35:36 +08:00
|
|
|
|
package com.cdzy.ebikeoperate.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
|
|
|
import com.cdzy.common.enums.Code;
|
|
|
|
|
|
import com.cdzy.common.model.JsonResult;
|
|
|
|
|
|
import com.cdzy.common.model.PageParam;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.enums.EbikeRegionInOperation;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.enums.EbikeRegionType;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.mapper.EbikeRegionoperationMapper;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.model.dto.request.ReqAuthorizeOperationDto;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.model.dto.request.ReqDelRegionDto;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.model.dto.request.ReqEbikeRegionDto;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.model.dto.request.ReqSaveRegionDto;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.model.dto.response.EbikeRegionDto;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.model.dto.response.ZoneDto;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.model.pojo.EbikeAdministrationZone;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.model.pojo.EbikeRegion;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.model.pojo.EbikeRegionoperation;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.service.EbikeAdministrationZoneService;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.service.EbikeRegionService;
|
|
|
|
|
|
import com.ebike.feign.clients.StaffFeignClient;
|
|
|
|
|
|
import com.ebike.feign.model.rsp.RspBikeInfo;
|
|
|
|
|
|
import com.ebike.feign.model.rsp.StaffFeign;
|
|
|
|
|
|
import com.mybatisflex.core.paginate.Page;
|
|
|
|
|
|
import com.mybatisflex.core.query.QueryMethods;
|
|
|
|
|
|
import com.mybatisflex.core.query.QueryWrapper;
|
|
|
|
|
|
import com.mybatisflex.core.update.UpdateChain;
|
|
|
|
|
|
import jakarta.annotation.Resource;
|
|
|
|
|
|
import jakarta.validation.constraints.NotNull;
|
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
import static com.cdzy.ebikeoperate.model.pojo.table.EbikeAdministrationZoneTableDef.EBIKE_ADMINISTRATION_ZONE;
|
|
|
|
|
|
import static com.cdzy.ebikeoperate.model.pojo.table.EbikeRegionTableDef.EBIKE_REGION;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 区域控制层。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @author attiya
|
|
|
|
|
|
* @since 2025-04-01
|
|
|
|
|
|
*/
|
|
|
|
|
|
@RestController
|
|
|
|
|
|
@RequestMapping("/ebikeRegion")
|
|
|
|
|
|
@Validated
|
|
|
|
|
|
public class EbikeRegionController {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
private EbikeRegionService ebikeRegionService;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
private EbikeAdministrationZoneService zoneService;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
private StaffFeignClient staffFeignClient;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
private EbikeRegionoperationMapper ebikeRegionoperationMapper;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 添加运营区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param ebikeRegion 创建区域参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("saveOperation")
|
|
|
|
|
|
public JsonResult<?> saveOperation(@RequestBody @Validated ReqEbikeRegionDto ebikeRegion) {
|
|
|
|
|
|
ebikeRegionService.createRegion(ebikeRegion, EbikeRegionType.OPERATION);
|
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 分页查询运营区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param pageParam 分页参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("pageOperation")
|
|
|
|
|
|
public JsonResult<?> pageOperation(@Validated PageParam pageParam,
|
|
|
|
|
|
@RequestParam(required = false,name = "simpleName") String simpleName,
|
|
|
|
|
|
@RequestParam(required = false,name = "regionName")String regionName,
|
|
|
|
|
|
@RequestParam(required = false,name = "inOperation")Integer inOperation) {
|
|
|
|
|
|
Page<EbikeRegionDto> page = ebikeRegionService.pageRegion(pageParam, EbikeRegionType.OPERATION,simpleName,regionName,inOperation);
|
|
|
|
|
|
return JsonResult.success(page);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* ID查询运营区信息。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param regionId 区域id
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getOperationById")
|
|
|
|
|
|
public JsonResult<?> getOperationById(@RequestParam(name = "regionId") Long regionId) {
|
|
|
|
|
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
|
|
|
|
|
.where(EBIKE_REGION.REGION_ID.eq(regionId));
|
|
|
|
|
|
EbikeRegion region = ebikeRegionService.getOne(queryWrapper);
|
|
|
|
|
|
return JsonResult.success(region);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 修改运营区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param ebikeRegion 运营区信息
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("updateOperation")
|
|
|
|
|
|
public JsonResult<?> updateOperation(@RequestBody @Validated ReqEbikeRegionDto ebikeRegion) {
|
|
|
|
|
|
ebikeRegionService.updateRegion(ebikeRegion,EbikeRegionType.OPERATION);
|
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 删除运营区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param delRegionDto 运营区ID集合
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("delOperation")
|
|
|
|
|
|
public JsonResult<?> delOperation(@RequestBody @Validated ReqDelRegionDto delRegionDto) {
|
2025-04-25 13:56:16 +08:00
|
|
|
|
ebikeRegionService.delOperation(delRegionDto);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取运营状态列表。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("listOperationStatus")
|
|
|
|
|
|
public JsonResult<?> listOperationStatus() {
|
|
|
|
|
|
List<EbikeRegionoperation> list = ebikeRegionoperationMapper.selectListByQuery(null);
|
|
|
|
|
|
return JsonResult.success(list);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 批量停止运营。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param delRegionDto 运营区ID集合
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("stopOperation")
|
|
|
|
|
|
public JsonResult<?> stopOperation(@RequestBody @Validated ReqDelRegionDto delRegionDto) {
|
|
|
|
|
|
UpdateChain.of(EbikeRegion.class)
|
|
|
|
|
|
.set(EbikeRegion::getInOperation, EbikeRegionInOperation.OUT)
|
|
|
|
|
|
.where(EbikeRegion::getRegionId).in(delRegionDto.getRegionIds())
|
|
|
|
|
|
.update();
|
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取当前登录用户所有运营区。
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getOperation")
|
|
|
|
|
|
public JsonResult<?> getOperation(@RequestParam(value = "zoneId",required = false)String zoneId) {
|
|
|
|
|
|
List<EbikeRegion> list = ebikeRegionService.getOperation(zoneId);
|
|
|
|
|
|
return JsonResult.success(list);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 添加站点。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param regionDto 创建区域参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("saveSite")
|
|
|
|
|
|
public JsonResult<?> saveSite(@RequestBody @Validated ReqSaveRegionDto regionDto) {
|
|
|
|
|
|
ebikeRegionService.createRegion(regionDto, EbikeRegionType.SITE);
|
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 分页查询站点。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param pageParam 分页参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("pageSite")
|
|
|
|
|
|
public JsonResult<?> pageSite(@Validated PageParam pageParam) {
|
|
|
|
|
|
Page<EbikeRegionDto> ebikeRegionPage = ebikeRegionService.pageRegion(pageParam, EbikeRegionType.SITE,null,null,null);
|
|
|
|
|
|
return JsonResult.success(ebikeRegionPage);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 修改站点。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param regionDto 修改区域参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("updateSite")
|
|
|
|
|
|
public JsonResult<?> updateSite(@RequestBody @Validated ReqEbikeRegionDto regionDto) {
|
|
|
|
|
|
ebikeRegionService.updateRegion(regionDto, EbikeRegionType.SITE);
|
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 批量删除站点。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param delRegionDto 运营区ID集合
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("delSite")
|
|
|
|
|
|
public JsonResult<?> delSite(@RequestBody @Validated ReqDelRegionDto delRegionDto) {
|
|
|
|
|
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
|
|
|
|
|
.where(EBIKE_REGION.TYPE.eq(EbikeRegionType.SITE))
|
|
|
|
|
|
.where(EBIKE_REGION.REGION_ID.in(delRegionDto.getRegionIds()));
|
|
|
|
|
|
ebikeRegionService.remove(queryWrapper);
|
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 添加停车区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param regionDto 创建区域参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("savePark")
|
|
|
|
|
|
public JsonResult<?> savePark(@RequestBody @Validated ReqSaveRegionDto regionDto) {
|
|
|
|
|
|
ebikeRegionService.createRegion(regionDto, EbikeRegionType.PARKING);
|
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2025-04-25 13:56:16 +08:00
|
|
|
|
* 分页查询停车区。
|
2025-04-14 09:35:36 +08:00
|
|
|
|
*
|
|
|
|
|
|
* @param pageParam 分页参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("pagePark")
|
|
|
|
|
|
public JsonResult<?> pagePark(@Validated PageParam pageParam) {
|
|
|
|
|
|
Page<EbikeRegionDto> ebikeRegionPage = ebikeRegionService.pageRegion(pageParam, EbikeRegionType.PARKING,null,null,null);
|
|
|
|
|
|
return JsonResult.success(ebikeRegionPage);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 修改站点。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param regionDto 修改区域参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("updatePark")
|
|
|
|
|
|
public JsonResult<?> updatePark(@RequestBody @Validated ReqEbikeRegionDto regionDto) {
|
|
|
|
|
|
ebikeRegionService.updateRegion(regionDto, EbikeRegionType.PARKING);
|
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 批量删除停车区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param delRegionDto 运营区ID集合
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("delPark")
|
|
|
|
|
|
public JsonResult<?> delPark(@RequestBody @Validated ReqDelRegionDto delRegionDto) {
|
2025-04-25 13:56:16 +08:00
|
|
|
|
ebikeRegionService.delPark(delRegionDto);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取当前登录用户所有行政区。
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getZone")
|
|
|
|
|
|
public JsonResult<?> getZone() {
|
|
|
|
|
|
List<ZoneDto> zone = ebikeRegionService.getZone();
|
|
|
|
|
|
return JsonResult.success(zone);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取当前登录用户所有站点、停车区。
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getRegion")
|
|
|
|
|
|
public JsonResult<?> getRegion(@RequestParam("regionId") @NotNull(message = "运营区ID不能为空")Long regionId) {
|
|
|
|
|
|
List<EbikeRegion> list = ebikeRegionService.getRegion(regionId);
|
|
|
|
|
|
return JsonResult.success(list);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取运营区内车辆。
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getOperationBike")
|
|
|
|
|
|
public JsonResult<?> getOperationBike(@RequestParam(value = "regionId")String regionId) {
|
|
|
|
|
|
List<RspBikeInfo> list = ebikeRegionService.getOperationBike(regionId);
|
|
|
|
|
|
return JsonResult.success(list);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取区域详情。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param regionId 区域id
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getRegionInfo/{regionId}")
|
|
|
|
|
|
public JsonResult<?> getOperationInfo(@PathVariable("regionId") Long regionId) {
|
|
|
|
|
|
EbikeRegion ebikeRegion = ebikeRegionService.regionInfo(regionId);
|
|
|
|
|
|
return JsonResult.success(ebikeRegion);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 分页获取同运营商员工。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param pageParam 分页参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("pageStaff")
|
|
|
|
|
|
public JsonResult<?> pageStaff(@Validated PageParam pageParam) {
|
|
|
|
|
|
String tokenValue = StpUtil.getTokenValue();
|
|
|
|
|
|
JsonResult<Page<StaffFeign>> result = staffFeignClient.getStaffsByLoginOrg(pageParam, tokenValue);
|
|
|
|
|
|
if (result.getCode() == Code.SUCCESS){
|
|
|
|
|
|
return JsonResult.success(result.getData());
|
|
|
|
|
|
}else {
|
|
|
|
|
|
return JsonResult.failed(result.getMessage());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取省级行政区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("province")
|
|
|
|
|
|
public JsonResult<?> province() {
|
|
|
|
|
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
|
|
|
|
|
.where(QueryMethods.length(EBIKE_ADMINISTRATION_ZONE.ID).eq(2));
|
|
|
|
|
|
List<EbikeAdministrationZone> zones = zoneService.list(queryWrapper);
|
|
|
|
|
|
return JsonResult.success(zones);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取市级行政区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("city")
|
|
|
|
|
|
public JsonResult<?> city(@RequestParam("zoneId") @NotNull(message = "省级行政区ID不能为空") String zoneId) {
|
|
|
|
|
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
|
|
|
|
|
.where(QueryMethods.length(EBIKE_ADMINISTRATION_ZONE.ID).eq(4))
|
|
|
|
|
|
.where(EBIKE_ADMINISTRATION_ZONE.ID.likeLeft(zoneId));
|
|
|
|
|
|
List<EbikeAdministrationZone> zones = zoneService.list(queryWrapper);
|
|
|
|
|
|
return JsonResult.success(zones);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取区级行政区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("zone")
|
|
|
|
|
|
public JsonResult<?> zone(@RequestParam("zoneId") @NotNull(message = "省级行政区ID不能为空") String zoneId) {
|
|
|
|
|
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
|
|
|
|
|
.where(QueryMethods.length(EBIKE_ADMINISTRATION_ZONE.ID).eq(6))
|
|
|
|
|
|
.where(EBIKE_ADMINISTRATION_ZONE.ID.likeLeft(zoneId));
|
|
|
|
|
|
List<EbikeAdministrationZone> zones = zoneService.list(queryWrapper);
|
|
|
|
|
|
return JsonResult.success(zones);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取行政区下所有运营区。
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getOperationByZone")
|
|
|
|
|
|
public JsonResult<?> getOperationByZone(@RequestParam(value = "zoneId",required = false)String zoneId) {
|
|
|
|
|
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
|
|
|
|
|
.where(EBIKE_REGION.ZONE_ID.eq(zoneId))
|
|
|
|
|
|
.where(EBIKE_REGION.TYPE.eq(EbikeRegionType.OPERATION));
|
|
|
|
|
|
List<EbikeRegion> list = ebikeRegionService.list(queryWrapper);
|
|
|
|
|
|
return JsonResult.success(list);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 批量授权运营区。
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("authorizeOperation")
|
|
|
|
|
|
public JsonResult<?> authorizeOperation(@RequestBody @Validated ReqAuthorizeOperationDto authorizeOperationDto) {
|
|
|
|
|
|
ebikeRegionService.authorizeOperation(authorizeOperationDto);
|
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
2025-04-21 16:26:53 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 根据行政区名称获取运营区域ID列表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param zoneName 区域名称
|
|
|
|
|
|
* @return 详情
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getRegionIdsByZone")
|
|
|
|
|
|
public JsonResult<?> getRegionIdsByZone(@RequestParam(name = "zoneName") String zoneName){
|
|
|
|
|
|
List<Long> regions = ebikeRegionService.getRegionIdsByZone(zoneName);
|
|
|
|
|
|
if (regions == null){
|
|
|
|
|
|
return JsonResult.failed("未查询到该行政区内的运营区域");
|
|
|
|
|
|
}
|
|
|
|
|
|
return JsonResult.success(regions);
|
|
|
|
|
|
}
|
2025-04-14 09:35:36 +08:00
|
|
|
|
}
|