区域基础管理功能
This commit is contained in:
parent
547f7ff50d
commit
154dd2fd8e
@ -1,12 +1,15 @@
|
||||
package com.cdzy.operations.controller;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.cdzy.common.model.request.PageParam;
|
||||
import com.cdzy.common.model.response.JsonResult;
|
||||
import com.cdzy.operations.enums.RegionStatus;
|
||||
import com.cdzy.operations.model.entity.EbikeRegion;
|
||||
import com.cdzy.operations.model.vo.EbikeRegionVo;
|
||||
import com.cdzy.operations.service.EbikeRegionService;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.update.UpdateChain;
|
||||
import com.mybatisflex.core.util.StringUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -60,7 +63,7 @@ public class EbikeRegionController {
|
||||
* @param ebikeRegion 运营区域表
|
||||
* @return {@code true} 更新成功,{@code false} 更新失败
|
||||
*/
|
||||
@PutMapping("update")
|
||||
@PostMapping("update")
|
||||
public JsonResult<?> update(@RequestBody EbikeRegionVo ebikeRegion) {
|
||||
ebikeRegionService.update(ebikeRegion);
|
||||
return JsonResult.success();
|
||||
@ -106,4 +109,37 @@ public class EbikeRegionController {
|
||||
return JsonResult.success(page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 开始运营。
|
||||
*
|
||||
* @param regionId 运营区主键
|
||||
* @return 分页对象
|
||||
*/
|
||||
@GetMapping("commenceOperation")
|
||||
public JsonResult<?> commenceOperation(@RequestParam Long regionId) {
|
||||
UpdateChain.of(EbikeRegion.class)
|
||||
.where(EbikeRegion::getRegionId).eq(regionId)
|
||||
.set(EBIKE_REGION.STATUS, RegionStatus.OPERATION)
|
||||
.set(EBIKE_REGION.UPDATED_BY, StpUtil.getLoginIdAsLong())
|
||||
.update();
|
||||
return JsonResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束运营。
|
||||
*
|
||||
* @param regionId 运营区主键
|
||||
* @return 分页对象
|
||||
*/
|
||||
@GetMapping("stopOperation")
|
||||
public JsonResult<?> stopOperation(@RequestParam Long regionId) {
|
||||
UpdateChain.of(EbikeRegion.class)
|
||||
.where(EbikeRegion::getRegionId).eq(regionId)
|
||||
.set(EBIKE_REGION.STATUS, RegionStatus.STOP_OPERATION)
|
||||
.set(EBIKE_REGION.UPDATED_BY, StpUtil.getLoginIdAsLong())
|
||||
.update();
|
||||
return JsonResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -41,8 +41,6 @@ public class PGpolygonSerializer extends JsonSerializer<PGpolygon> {
|
||||
for (int i = 0; i < points.length; i++) {
|
||||
if (points[i] == null) {
|
||||
log.error("错误: 第 {} 个点为 null", i);
|
||||
} else {
|
||||
log.info("点 {}: ({}, {})", i, points[i].x, points[i].y);
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,7 +117,6 @@ public class PGpolygonSerializer extends JsonSerializer<PGpolygon> {
|
||||
Object pointsObj = pointsField.get(polygon);
|
||||
|
||||
if (pointsObj instanceof PGpoint[] points) {
|
||||
log.info("反射成功,获取到 {} 个点", points.length);
|
||||
return points;
|
||||
} else {
|
||||
log.error("反射获取的 points 字段类型不正确: {}", pointsObj != null ? pointsObj.getClass() : "null");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user