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;
|
2025-05-07 10:57:33 +08:00
|
|
|
|
import com.cdzy.ebikeoperate.enums.RegionLevelType;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.mapper.EbikeRegionLevelMapper;
|
2025-04-14 09:35:36 +08:00
|
|
|
|
import com.cdzy.ebikeoperate.mapper.EbikeRegionoperationMapper;
|
2025-05-06 16:42:59 +08:00
|
|
|
|
import com.cdzy.ebikeoperate.mapper.EbikeSiteTypeMapper;
|
2025-04-14 09:35:36 +08:00
|
|
|
|
import com.cdzy.ebikeoperate.model.dto.request.ReqAuthorizeOperationDto;
|
2025-05-06 15:32:41 +08:00
|
|
|
|
import com.cdzy.ebikeoperate.model.dto.request.ReqBatchRegionDto;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.model.dto.request.ReqEbikeOperationRegionDto;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.model.dto.request.ReqSiteRegionDto;
|
2025-05-07 10:19:55 +08:00
|
|
|
|
import com.cdzy.ebikeoperate.model.dto.response.*;
|
2025-05-06 16:42:59 +08:00
|
|
|
|
import com.cdzy.ebikeoperate.model.pojo.*;
|
2025-04-14 09:35:36 +08:00
|
|
|
|
import com.cdzy.ebikeoperate.service.EbikeAdministrationZoneService;
|
2025-05-06 15:32:41 +08:00
|
|
|
|
import com.cdzy.ebikeoperate.service.EbikeOperationRegionService;
|
|
|
|
|
|
import com.cdzy.ebikeoperate.service.EbikeSiteRegionService;
|
2025-04-14 09:35:36 +08:00
|
|
|
|
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.*;
|
2025-05-08 09:43:28 +08:00
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
2025-04-14 09:35:36 +08:00
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
2025-05-06 15:32:41 +08:00
|
|
|
|
import java.util.Objects;
|
2025-04-14 09:35:36 +08:00
|
|
|
|
|
|
|
|
|
|
import static com.cdzy.ebikeoperate.model.pojo.table.EbikeAdministrationZoneTableDef.EBIKE_ADMINISTRATION_ZONE;
|
2025-05-06 15:32:41 +08:00
|
|
|
|
import static com.cdzy.ebikeoperate.model.pojo.table.EbikeOperationRegionTableDef.EBIKE_OPERATION_REGION;
|
2025-05-07 10:57:33 +08:00
|
|
|
|
import static com.cdzy.ebikeoperate.model.pojo.table.EbikeRegionLevelTableDef.EBIKE_REGION_LEVEL;
|
2025-04-14 09:35:36 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2025-05-06 15:32:41 +08:00
|
|
|
|
* 区域控制层。
|
2025-04-14 09:35:36 +08:00
|
|
|
|
*
|
|
|
|
|
|
* @author attiya
|
|
|
|
|
|
* @since 2025-04-01
|
|
|
|
|
|
*/
|
|
|
|
|
|
@RestController
|
|
|
|
|
|
@RequestMapping("/ebikeRegion")
|
|
|
|
|
|
@Validated
|
|
|
|
|
|
public class EbikeRegionController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
private EbikeAdministrationZoneService zoneService;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
private StaffFeignClient staffFeignClient;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
private EbikeRegionoperationMapper ebikeRegionoperationMapper;
|
|
|
|
|
|
|
2025-05-06 15:32:41 +08:00
|
|
|
|
@Resource
|
|
|
|
|
|
private EbikeOperationRegionService operationRegionService;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
private EbikeSiteRegionService siteRegionService;
|
|
|
|
|
|
|
2025-05-06 16:42:59 +08:00
|
|
|
|
@Resource
|
|
|
|
|
|
private EbikeSiteTypeMapper siteTypeMapper;
|
|
|
|
|
|
|
2025-05-07 10:57:33 +08:00
|
|
|
|
@Resource
|
|
|
|
|
|
private EbikeRegionLevelMapper levelMapper;
|
|
|
|
|
|
|
2025-04-14 09:35:36 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 添加运营区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("saveOperation")
|
2025-05-06 15:32:41 +08:00
|
|
|
|
public JsonResult<?> saveOperation(@RequestBody @Validated ReqEbikeOperationRegionDto operationRegionDto) {
|
|
|
|
|
|
operationRegionService.createOperationRegion(operationRegionDto);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 分页查询运营区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param pageParam 分页参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("pageOperation")
|
|
|
|
|
|
public JsonResult<?> pageOperation(@Validated PageParam pageParam,
|
2025-05-06 15:32:41 +08:00
|
|
|
|
@RequestParam(required = false, name = "simpleName") String simpleName,
|
|
|
|
|
|
@RequestParam(required = false, name = "regionName") String regionName,
|
|
|
|
|
|
@RequestParam(required = false, name = "inOperation") Integer inOperation) {
|
2025-05-07 10:19:55 +08:00
|
|
|
|
Page<EbikeOperationRegionPageDto> page = operationRegionService.pageOperationRegion(pageParam, simpleName, regionName, inOperation);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success(page);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* ID查询运营区信息。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param regionId 区域id
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getOperationById")
|
|
|
|
|
|
public JsonResult<?> getOperationById(@RequestParam(name = "regionId") Long regionId) {
|
2025-05-06 15:32:41 +08:00
|
|
|
|
ResOperationRegionInfo info = operationRegionService.operationRegionInfo(regionId);
|
|
|
|
|
|
return JsonResult.success(info);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 修改运营区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("updateOperation")
|
2025-05-06 15:32:41 +08:00
|
|
|
|
public JsonResult<?> updateOperation(@RequestBody @Validated ReqEbikeOperationRegionDto operationRegionDto) {
|
|
|
|
|
|
operationRegionService.updateOperation(operationRegionDto);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 删除运营区。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("delOperation")
|
2025-05-06 15:32:41 +08:00
|
|
|
|
public JsonResult<?> delOperation(@RequestBody @Validated ReqBatchRegionDto delRegionDto) {
|
|
|
|
|
|
operationRegionService.delOperation(delRegionDto);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取运营状态列表。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("listOperationStatus")
|
|
|
|
|
|
public JsonResult<?> listOperationStatus() {
|
2025-05-06 15:32:41 +08:00
|
|
|
|
List<EbikeRegionoperation> list = ebikeRegionoperationMapper.selectAll();
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success(list);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 批量停止运营。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("stopOperation")
|
2025-05-06 15:32:41 +08:00
|
|
|
|
public JsonResult<?> stopOperation(@RequestBody @Validated ReqBatchRegionDto batchRegionDto) {
|
|
|
|
|
|
UpdateChain.of(EbikeOperationRegion.class)
|
|
|
|
|
|
.set(EBIKE_OPERATION_REGION.IN_OPERATION, EbikeRegionInOperation.OUT)
|
|
|
|
|
|
.where(EBIKE_OPERATION_REGION.OPERATION_REGION_ID.in(batchRegionDto.getIds()))
|
2025-04-14 09:35:36 +08:00
|
|
|
|
.update();
|
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取当前登录用户所有运营区。
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getOperation")
|
2025-05-06 15:32:41 +08:00
|
|
|
|
public JsonResult<?> getOperation(@RequestParam(value = "zoneId", required = false) String zoneId) {
|
2025-05-06 16:42:59 +08:00
|
|
|
|
List<ResEbikeOperationRegionDto> list = operationRegionService.getOperation(zoneId);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success(list);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-06 16:42:59 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 站点类型列表;
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("siteType")
|
|
|
|
|
|
public JsonResult<?> siteType() {
|
|
|
|
|
|
List<EbikeSiteType> ebikeSiteTypes = siteTypeMapper.selectAll();
|
|
|
|
|
|
return JsonResult.success(ebikeSiteTypes);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-14 09:35:36 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 添加站点。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param regionDto 创建区域参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
2025-05-07 18:03:43 +08:00
|
|
|
|
@PostMapping(value = "saveSite")
|
|
|
|
|
|
public JsonResult<?> saveSite(@RequestBody @Validated ReqSiteRegionDto regionDto) throws Exception {
|
|
|
|
|
|
siteRegionService.createSiteRegion(regionDto);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 分页查询站点。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param pageParam 分页参数
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("pageSite")
|
2025-05-07 11:14:06 +08:00
|
|
|
|
public JsonResult<?> pageSite(@Validated PageParam pageParam,Long operationRegionId, String zoneId, String siteName) {
|
|
|
|
|
|
Page<ResEbikeSiteRegionPageDto> page = siteRegionService.pageSite(pageParam,operationRegionId, zoneId, siteName);
|
2025-05-06 16:09:33 +08:00
|
|
|
|
return JsonResult.success(page);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-06 16:27:24 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 站点详情。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param siteRegionId 站点ID
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("siteInfo")
|
|
|
|
|
|
public JsonResult<?> siteInfo(@NotNull(message = "站点ID不能为空") Long siteRegionId) {
|
|
|
|
|
|
ResEbikeSiteRegionInfoDto info = siteRegionService.siteInfo(siteRegionId);
|
|
|
|
|
|
return JsonResult.success(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-14 09:35:36 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 修改站点。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("updateSite")
|
2025-05-07 18:03:43 +08:00
|
|
|
|
public JsonResult<?> updateSite(@RequestBody @Validated ReqSiteRegionDto regionDto) throws Exception {
|
|
|
|
|
|
siteRegionService.updateSiteRegion(regionDto);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 批量删除站点。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("delSite")
|
2025-05-06 15:32:41 +08:00
|
|
|
|
public JsonResult<?> delSite(@RequestBody @Validated ReqBatchRegionDto delRegionDto) {
|
|
|
|
|
|
siteRegionService.delSite(delRegionDto);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取当前登录用户所有行政区。
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getZone")
|
2025-05-06 15:32:41 +08:00
|
|
|
|
public JsonResult<?> getZone() {
|
|
|
|
|
|
List<ZoneDto> zone = operationRegionService.listZoneByToken();
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success(zone);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2025-05-06 15:32:41 +08:00
|
|
|
|
* 获取当前登录用户所有站点。
|
2025-04-14 09:35:36 +08:00
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getRegion")
|
2025-05-06 16:09:33 +08:00
|
|
|
|
public JsonResult<?> getRegion(@RequestParam(value = "regionId", required = false) Long regionId) {
|
2025-05-07 15:11:10 +08:00
|
|
|
|
List<ResEbikeSiteRegionPageDto> list = siteRegionService.listByToken(regionId);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success(list);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2025-05-07 17:17:00 +08:00
|
|
|
|
* 获取运营区所属车辆及其位置。
|
2025-04-14 09:35:36 +08:00
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getOperationBike")
|
2025-05-06 15:32:41 +08:00
|
|
|
|
public JsonResult<?> getOperationBike(@RequestParam(value = "regionId") String regionId) {
|
|
|
|
|
|
List<RspBikeInfo> list = operationRegionService.getOperationBike(regionId);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success(list);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 分页获取同运营商员工。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @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);
|
2025-05-06 15:32:41 +08:00
|
|
|
|
if (result.getCode() == Code.SUCCESS) {
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success(result.getData());
|
2025-05-06 15:32:41 +08:00
|
|
|
|
} else {
|
2025-04-14 09:35:36 +08:00
|
|
|
|
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")
|
2025-05-06 15:32:41 +08:00
|
|
|
|
public JsonResult<?> getOperationByZone(@RequestParam(value = "zoneId", required = false) String zoneId) {
|
2025-04-14 09:35:36 +08:00
|
|
|
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
2025-05-06 15:32:41 +08:00
|
|
|
|
.where(EBIKE_OPERATION_REGION.ZONE_ID.eq(zoneId, Objects::nonNull));
|
|
|
|
|
|
List<EbikeOperationRegion> list = operationRegionService.list(queryWrapper);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success(list);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 批量授权运营区。
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("authorizeOperation")
|
2025-05-06 15:32:41 +08:00
|
|
|
|
public JsonResult<?> authorizeOperation(@RequestBody @Validated ReqAuthorizeOperationDto authorizeOperationDto) {
|
|
|
|
|
|
operationRegionService.authorizeOperation(authorizeOperationDto);
|
2025-04-14 09:35:36 +08:00
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
}
|
2025-04-21 16:26:53 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 根据行政区名称获取运营区域ID列表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param zoneName 区域名称
|
|
|
|
|
|
* @return 详情
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("getRegionIdsByZone")
|
2025-05-06 15:32:41 +08:00
|
|
|
|
public JsonResult<?> getRegionIdsByZone(@RequestParam(name = "zoneName") String zoneName) {
|
|
|
|
|
|
List<Long> regions = operationRegionService.getRegionIdsByZone(zoneName);
|
|
|
|
|
|
if (regions == null) {
|
2025-04-21 16:26:53 +08:00
|
|
|
|
return JsonResult.failed("未查询到该行政区内的运营区域");
|
|
|
|
|
|
}
|
|
|
|
|
|
return JsonResult.success(regions);
|
|
|
|
|
|
}
|
2025-05-07 10:57:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取运营区等级列表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return 等级列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("operationLevelList")
|
|
|
|
|
|
public JsonResult<?> operationLevelList() {
|
|
|
|
|
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
|
|
|
|
|
.where(EBIKE_REGION_LEVEL.LEVEL_TYPE.eq(RegionLevelType.OPERATION));
|
|
|
|
|
|
List<EbikeRegionLevel> levels = levelMapper.selectListByQuery(queryWrapper);
|
|
|
|
|
|
return JsonResult.success(levels);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取运站点等级列表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return 等级列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("siteLevelList")
|
|
|
|
|
|
public JsonResult<?> siteLevelList() {
|
|
|
|
|
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
|
|
|
|
|
.where(EBIKE_REGION_LEVEL.LEVEL_TYPE.eq(RegionLevelType.SITE));
|
|
|
|
|
|
List<EbikeRegionLevel> levels = levelMapper.selectListByQuery(queryWrapper);
|
|
|
|
|
|
return JsonResult.success(levels);
|
|
|
|
|
|
}
|
2025-05-08 09:43:28 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 站点附件上传
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return 等级列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("siteImagesUpload")
|
|
|
|
|
|
public JsonResult<?> siteImagesUpload(MultipartFile file) throws Exception {
|
|
|
|
|
|
Long imageId = siteRegionService.saveImages(file);
|
|
|
|
|
|
return JsonResult.success(imageId);
|
|
|
|
|
|
}
|
2025-04-14 09:35:36 +08:00
|
|
|
|
}
|