From 4a1c2def16ad0d5f4bdd9084c60da4dca40d3610 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Fri, 16 Aug 2024 10:33:25 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=81=9C=E8=BD=A6=E5=9C=BA=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E5=BF=83=E8=B7=B3=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parking/enums/ErrorCodeConstants.java | 9 +- .../controller/admin/area/AreaController.java | 95 ++++++++++++++ .../admin/area/vo/AreaPageReqVO.java | 40 ++++++ .../controller/admin/area/vo/AreaRespVO.java | 51 ++++++++ .../admin/area/vo/AreaSaveReqVO.java | 40 ++++++ .../admin/heartbeat/HeartbeatController.java | 101 +++++++++++++++ .../heartbeat/vo/HeartbeatPageReqVO.java | 43 +++++++ .../heartbeat/vo/HeartbeatReqDataVO.java | 41 ++++++ .../admin/heartbeat/vo/HeartbeatRespVO.java | 52 ++++++++ .../heartbeat/vo/HeartbeatSaveReqVO.java | 43 +++++++ .../controller/admin/park/ParkController.java | 95 ++++++++++++++ .../admin/park/vo/ParkPageReqVO.java | 37 ++++++ .../controller/admin/park/vo/ParkRespVO.java | 44 +++++++ .../admin/park/vo/ParkSaveReqVO.java | 37 ++++++ .../passageway/PassagewayController.java | 101 +++++++++++++++ .../passageway/vo/PassagewayPageReqVO.java | 34 +++++ .../passageway/vo/PassagewayReqDataVO.java | 19 +++ .../admin/passageway/vo/PassagewayRespVO.java | 40 ++++++ .../passageway/vo/PassagewaySaveReqVO.java | 31 +++++ .../parking/dal/dataobject/area/AreaDO.java | 58 +++++++++ .../dal/dataobject/heartbeat/HeartbeatDO.java | 59 +++++++++ .../parking/dal/dataobject/park/ParkDO.java | 51 ++++++++ .../dataobject/passageway/PassagewayDO.java | 47 +++++++ .../parking/dal/mysql/area/AreaMapper.java | 32 +++++ .../dal/mysql/heartbeat/HeartbeatMapper.java | 33 +++++ .../parking/dal/mysql/park/ParkMapper.java | 31 +++++ .../mysql/passageway/PassagewayMapper.java | 30 +++++ .../parking/service/area/AreaService.java | 68 ++++++++++ .../parking/service/area/AreaServiceImpl.java | 86 +++++++++++++ .../service/heartbeat/HeartbeatService.java | 62 +++++++++ .../heartbeat/HeartbeatServiceImpl.java | 120 ++++++++++++++++++ .../parking/service/park/ParkService.java | 62 +++++++++ .../parking/service/park/ParkServiceImpl.java | 79 ++++++++++++ .../service/passageway/PassagewayService.java | 62 +++++++++ .../passageway/PassagewayServiceImpl.java | 82 ++++++++++++ .../main/resources/mapper/area/AreaMapper.xml | 12 ++ .../mapper/heartbeat/HeartbeatMapper.xml | 12 ++ .../main/resources/mapper/park/ParkMapper.xml | 12 ++ .../mapper/passageway/PassagewayMapper.xml | 12 ++ 39 files changed, 1962 insertions(+), 1 deletion(-) create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/AreaController.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaPageReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaRespVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaSaveReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/HeartbeatController.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatPageReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatReqDataVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatRespVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatSaveReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/ParkController.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkPageReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkRespVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkSaveReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/PassagewayController.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayPageReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayReqDataVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayRespVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewaySaveReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/area/AreaDO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/heartbeat/HeartbeatDO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/park/ParkDO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/passageway/PassagewayDO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/area/AreaMapper.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/heartbeat/HeartbeatMapper.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/park/ParkMapper.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/passageway/PassagewayMapper.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaService.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaServiceImpl.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatService.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatServiceImpl.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/park/ParkService.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/park/ParkServiceImpl.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/passageway/PassagewayService.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/passageway/PassagewayServiceImpl.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/area/AreaMapper.xml create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/heartbeat/HeartbeatMapper.xml create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/park/ParkMapper.xml create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/passageway/PassagewayMapper.xml diff --git a/ludu-module-parking/ludu-module-parking-api/src/main/java/cn/iocoder/yudao/module/parking/enums/ErrorCodeConstants.java b/ludu-module-parking/ludu-module-parking-api/src/main/java/cn/iocoder/yudao/module/parking/enums/ErrorCodeConstants.java index dd42cfe28..d89111bf5 100644 --- a/ludu-module-parking/ludu-module-parking-api/src/main/java/cn/iocoder/yudao/module/parking/enums/ErrorCodeConstants.java +++ b/ludu-module-parking/ludu-module-parking-api/src/main/java/cn/iocoder/yudao/module/parking/enums/ErrorCodeConstants.java @@ -8,5 +8,12 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; public interface ErrorCodeConstants { // ========== 进出记录图片 1_005_001_015 ========== ErrorCode ACCESS_RECORD_PICTURE_NOT_EXISTS = new ErrorCode(1_005_001_015, "进出记录图片不存在"); - + // ========== 心跳管理 1_005_001_025 ========== + ErrorCode HEARTBEAT_NOT_EXISTS = new ErrorCode(1_005_001_025, "心跳管理不存在"); + // ========== 通道信息 1_005_001_026 ========== + ErrorCode PASSAGEWAY_NOT_EXISTS = new ErrorCode(1_005_001_026, "通道信息不存在"); + // ========== 场库列表 1_005_001_027 ========== + ErrorCode PARK_NOT_EXISTS = new ErrorCode(1_005_001_027, "场库列表不存在"); + // ========== 区域列表 1_005_001_028 ========== + ErrorCode AREA_NOT_EXISTS = new ErrorCode(1_005_001_028, "区域列表不存在"); } diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/AreaController.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/AreaController.java new file mode 100644 index 000000000..0b2f3fada --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/AreaController.java @@ -0,0 +1,95 @@ +package cn.iocoder.yudao.module.parking.controller.admin.area; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.parking.controller.admin.area.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.area.AreaDO; +import cn.iocoder.yudao.module.parking.service.area.AreaService; + +@Tag(name = "管理后台 - 区域列表") +@RestController +@RequestMapping("/parking/area") +@Validated +public class AreaController { + + @Resource + private AreaService areaService; + + @PostMapping("/create") + @Operation(summary = "创建区域列表") + @PreAuthorize("@ss.hasPermission('parking:area:create')") + public CommonResult createArea(@Valid @RequestBody AreaSaveReqVO createReqVO) { + return success(areaService.createArea(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新区域列表") + @PreAuthorize("@ss.hasPermission('parking:area:update')") + public CommonResult updateArea(@Valid @RequestBody AreaSaveReqVO updateReqVO) { + areaService.updateArea(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除区域列表") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('parking:area:delete')") + public CommonResult deleteArea(@RequestParam("id") Integer id) { + areaService.deleteArea(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得区域列表") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('parking:area:query')") + public CommonResult getArea(@RequestParam("id") Integer id) { + AreaDO area = areaService.getArea(id); + return success(BeanUtils.toBean(area, AreaRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得区域列表分页") + @PreAuthorize("@ss.hasPermission('parking:area:query')") + public CommonResult> getAreaPage(@Valid AreaPageReqVO pageReqVO) { + PageResult pageResult = areaService.getAreaPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, AreaRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出区域列表 Excel") + @PreAuthorize("@ss.hasPermission('parking:area:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportAreaExcel(@Valid AreaPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = areaService.getAreaPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "区域列表.xls", "数据", AreaRespVO.class, + BeanUtils.toBean(list, AreaRespVO.class)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaPageReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaPageReqVO.java new file mode 100644 index 000000000..a789186d3 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaPageReqVO.java @@ -0,0 +1,40 @@ +package cn.iocoder.yudao.module.parking.controller.admin.area.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 区域列表分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class AreaPageReqVO extends PageParam { + + @Schema(description = "场库编号") + private String parkNumber; + + @Schema(description = "区域名称", example = "李四") + private String areaName; + + @Schema(description = "区域车位数", example = "24356") + private Integer spaceCount; + + @Schema(description = "区域空位数", example = "4332") + private Integer lastSpaceCount; + + @Schema(description = "区域可预约车位数", example = "10031") + private Integer bookSpaceCount; + + @Schema(description = "区域在场预约数", example = "7772") + private Integer bookInParkCount; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaRespVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaRespVO.java new file mode 100644 index 000000000..9a05c16ce --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaRespVO.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.parking.controller.admin.area.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 区域列表 Response VO") +@Data +@ExcelIgnoreUnannotated +public class AreaRespVO { + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9513") + @ExcelProperty("id") + private Long id; + + @Schema(description = "区域Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32029") + @ExcelProperty("区域Id") + private Integer areaId; + + @Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("场库编号") + private String parkNumber; + + @Schema(description = "区域名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("区域名称") + private String areaName; + + @Schema(description = "区域车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "24356") + @ExcelProperty("区域车位数") + private Integer spaceCount; + + @Schema(description = "区域空位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "4332") + @ExcelProperty("区域空位数") + private Integer lastSpaceCount; + + @Schema(description = "区域可预约车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10031") + @ExcelProperty("区域可预约车位数") + private Integer bookSpaceCount; + + @Schema(description = "区域在场预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "7772") + @ExcelProperty("区域在场预约数") + private Integer bookInParkCount; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaSaveReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaSaveReqVO.java new file mode 100644 index 000000000..d6be91c46 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaSaveReqVO.java @@ -0,0 +1,40 @@ +package cn.iocoder.yudao.module.parking.controller.admin.area.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 区域列表新增/修改 Request VO") +@Data +public class AreaSaveReqVO { + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9513") + private Long id; + @Schema(description = "区域Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32029") + private Integer areaId; + + @Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "场库编号不能为空") + private String parkNumber; + + @Schema(description = "区域名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "区域名称不能为空") + private String areaName; + + @Schema(description = "区域车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "24356") + @NotNull(message = "区域车位数不能为空") + private Integer spaceCount; + + @Schema(description = "区域空位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "4332") + @NotNull(message = "区域空位数不能为空") + private Integer lastSpaceCount; + + @Schema(description = "区域可预约车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10031") + @NotNull(message = "区域可预约车位数不能为空") + private Integer bookSpaceCount; + + @Schema(description = "区域在场预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "7772") + @NotNull(message = "区域在场预约数不能为空") + private Integer bookInParkCount; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/HeartbeatController.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/HeartbeatController.java new file mode 100644 index 000000000..ac02b455e --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/HeartbeatController.java @@ -0,0 +1,101 @@ +package cn.iocoder.yudao.module.parking.controller.admin.heartbeat; + +import cn.iocoder.yudao.module.parking.util.BlueCardResult; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.time.LocalDateTime; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.parking.controller.admin.heartbeat.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.heartbeat.HeartbeatDO; +import cn.iocoder.yudao.module.parking.service.heartbeat.HeartbeatService; + +@Tag(name = "管理后台 - 心跳管理") +@RestController +@RequestMapping("/parking/heartbeat") +@Validated +public class HeartbeatController { + @Resource + private HeartbeatService heartbeatService; + + @PostMapping("/doHeartbeat") + public BlueCardResult doHeartbeat(@RequestBody HeartbeatReqDataVO blueCardHeartbeat){ + return heartbeatService.doHeartbeat(blueCardHeartbeat); + } + + @PostMapping("/create") + @Operation(summary = "创建心跳管理") + @PreAuthorize("@ss.hasPermission('parking:heartbeat:create')") + public CommonResult createHeartbeat(@Valid @RequestBody HeartbeatSaveReqVO createReqVO) { + return success(heartbeatService.createHeartbeat(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新心跳管理") + @PreAuthorize("@ss.hasPermission('parking:heartbeat:update')") + public CommonResult updateHeartbeat(@Valid @RequestBody HeartbeatSaveReqVO updateReqVO) { + heartbeatService.updateHeartbeat(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除心跳管理") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('parking:heartbeat:delete')") + public CommonResult deleteHeartbeat(@RequestParam("id") Long id) { + heartbeatService.deleteHeartbeat(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得心跳管理") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('parking:heartbeat:query')") + public CommonResult getHeartbeat(@RequestParam("id") Long id) { + HeartbeatDO heartbeat = heartbeatService.getHeartbeat(id); + return success(BeanUtils.toBean(heartbeat, HeartbeatRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得心跳管理分页") + @PreAuthorize("@ss.hasPermission('parking:heartbeat:query')") + public CommonResult> getHeartbeatPage(@Valid HeartbeatPageReqVO pageReqVO) { + PageResult pageResult = heartbeatService.getHeartbeatPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, HeartbeatRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出心跳管理 Excel") + @PreAuthorize("@ss.hasPermission('parking:heartbeat:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportHeartbeatExcel(@Valid HeartbeatPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = heartbeatService.getHeartbeatPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "心跳管理.xls", "数据", HeartbeatRespVO.class, + BeanUtils.toBean(list, HeartbeatRespVO.class)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatPageReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatPageReqVO.java new file mode 100644 index 000000000..21c6b3643 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatPageReqVO.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.module.parking.controller.admin.heartbeat.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 心跳管理分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class HeartbeatPageReqVO extends PageParam { + + @Schema(description = "场库编号") + private String parkNumber; + + @Schema(description = "场库名称", example = "李四") + private String parkName; + + @Schema(description = "场库总车位数", example = "12040") + private Integer spaceCount; + + @Schema(description = "场库空车位数", example = "724") + private Integer freeSpaceCount; + + @Schema(description = "场库可预约数", example = "6686") + private Integer bookSpaceCount; + + @Schema(description = "场库在场预约数", example = "15197") + private Integer bookInParkCount; + + @Schema(description = "区域属性") + private String areaList; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatReqDataVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatReqDataVO.java new file mode 100644 index 000000000..e6a6f10fe --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatReqDataVO.java @@ -0,0 +1,41 @@ +package cn.iocoder.yudao.module.parking.controller.admin.heartbeat.vo; + +import cn.iocoder.yudao.module.parking.controller.admin.area.vo.AreaSaveReqVO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; +import java.util.ArrayList; + +/** + * @Description 蓝卡心跳请求参数 + */ +@Data +public class HeartbeatReqDataVO { + @Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED) + private String parkNumber; + + @Schema(description = "场库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "场库名称不能为空") + private String parkName; + + @Schema(description = "场库总车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "21057") + @NotNull(message = "场库总车位数不能为空") + private Integer spaceCount; + + @Schema(description = "场库空车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "7657") + @NotNull(message = "场库空车位数不能为空") + private Integer freeSpaceCount; + + @Schema(description = "场库可预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "17569") + @NotNull(message = "场库可预约数不能为空") + private Integer bookSpaceCount; + + @Schema(description = "场库在场预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "13935") + @NotNull(message = "场库在场预约数不能为空") + private Integer bookInParkCount; + @Schema(description = "区域属性") + private ArrayList areaList; +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatRespVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatRespVO.java new file mode 100644 index 000000000..9a284fa37 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatRespVO.java @@ -0,0 +1,52 @@ +package cn.iocoder.yudao.module.parking.controller.admin.heartbeat.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 心跳管理 Response VO") +@Data +@ExcelIgnoreUnannotated +public class HeartbeatRespVO { + + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17692") + @ExcelProperty("编号") + private Long id; + + @Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("场库编号") + private String parkNumber; + + @Schema(description = "场库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("场库名称") + private String parkName; + + @Schema(description = "场库总车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "12040") + @ExcelProperty("场库总车位数") + private Integer spaceCount; + + @Schema(description = "场库空车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "724") + @ExcelProperty("场库空车位数") + private Integer freeSpaceCount; + + @Schema(description = "场库可预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "6686") + @ExcelProperty("场库可预约数") + private Integer bookSpaceCount; + + @Schema(description = "场库在场预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "15197") + @ExcelProperty("场库在场预约数") + private Integer bookInParkCount; + + @Schema(description = "区域属性", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("区域属性") + private String areaList; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatSaveReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatSaveReqVO.java new file mode 100644 index 000000000..6492c6ef8 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/heartbeat/vo/HeartbeatSaveReqVO.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.module.parking.controller.admin.heartbeat.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 心跳管理新增/修改 Request VO") +@Data +public class HeartbeatSaveReqVO { + + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17692") + private Long id; + + @Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "场库编号不能为空") + private String parkNumber; + + @Schema(description = "场库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "场库名称不能为空") + private String parkName; + + @Schema(description = "场库总车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "12040") + @NotNull(message = "场库总车位数不能为空") + private Integer spaceCount; + + @Schema(description = "场库空车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "724") + @NotNull(message = "场库空车位数不能为空") + private Integer freeSpaceCount; + + @Schema(description = "场库可预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "6686") + @NotNull(message = "场库可预约数不能为空") + private Integer bookSpaceCount; + + @Schema(description = "场库在场预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "15197") + @NotNull(message = "场库在场预约数不能为空") + private Integer bookInParkCount; + + @Schema(description = "区域属性", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "区域属性不能为空") + private String areaList; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/ParkController.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/ParkController.java new file mode 100644 index 000000000..e8ac1ea77 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/ParkController.java @@ -0,0 +1,95 @@ +package cn.iocoder.yudao.module.parking.controller.admin.park; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.parking.controller.admin.park.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.park.ParkDO; +import cn.iocoder.yudao.module.parking.service.park.ParkService; + +@Tag(name = "管理后台 - 场库列表") +@RestController +@RequestMapping("/parking/park") +@Validated +public class ParkController { + + @Resource + private ParkService parkService; + + @PostMapping("/create") + @Operation(summary = "创建场库列表") + @PreAuthorize("@ss.hasPermission('parking:park:create')") + public CommonResult createPark(@Valid @RequestBody ParkSaveReqVO createReqVO) { + return success(parkService.createPark(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新场库列表") + @PreAuthorize("@ss.hasPermission('parking:park:update')") + public CommonResult updatePark(@Valid @RequestBody ParkSaveReqVO updateReqVO) { + parkService.updatePark(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除场库列表") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('parking:park:delete')") + public CommonResult deletePark(@RequestParam("id") String id) { + parkService.deletePark(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得场库列表") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('parking:park:query')") + public CommonResult getPark(@RequestParam("id") String id) { + ParkDO park = parkService.getPark(id); + return success(BeanUtils.toBean(park, ParkRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得场库列表分页") + @PreAuthorize("@ss.hasPermission('parking:park:query')") + public CommonResult> getParkPage(@Valid ParkPageReqVO pageReqVO) { + PageResult pageResult = parkService.getParkPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ParkRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出场库列表 Excel") + @PreAuthorize("@ss.hasPermission('parking:park:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportParkExcel(@Valid ParkPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = parkService.getParkPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "场库列表.xls", "数据", ParkRespVO.class, + BeanUtils.toBean(list, ParkRespVO.class)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkPageReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkPageReqVO.java new file mode 100644 index 000000000..0bf45e4c9 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkPageReqVO.java @@ -0,0 +1,37 @@ +package cn.iocoder.yudao.module.parking.controller.admin.park.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 场库列表分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ParkPageReqVO extends PageParam { + + @Schema(description = "场库名称", example = "张三") + private String parkName; + + @Schema(description = "场库总车位数", example = "21057") + private Integer spaceCount; + + @Schema(description = "场库空车位数", example = "7657") + private Integer freeSpaceCount; + + @Schema(description = "场库可预约数", example = "17569") + private Integer bookSpaceCount; + + @Schema(description = "场库在场预约数", example = "13935") + private Integer bookInParkCount; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkRespVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkRespVO.java new file mode 100644 index 000000000..164f7ef95 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkRespVO.java @@ -0,0 +1,44 @@ +package cn.iocoder.yudao.module.parking.controller.admin.park.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 场库列表 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ParkRespVO { + + @Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("场库编号") + private String parkNumber; + + @Schema(description = "场库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("场库名称") + private String parkName; + + @Schema(description = "场库总车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "21057") + @ExcelProperty("场库总车位数") + private Integer spaceCount; + + @Schema(description = "场库空车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "7657") + @ExcelProperty("场库空车位数") + private Integer freeSpaceCount; + + @Schema(description = "场库可预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "17569") + @ExcelProperty("场库可预约数") + private Integer bookSpaceCount; + + @Schema(description = "场库在场预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "13935") + @ExcelProperty("场库在场预约数") + private Integer bookInParkCount; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkSaveReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkSaveReqVO.java new file mode 100644 index 000000000..2f18e14f8 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/park/vo/ParkSaveReqVO.java @@ -0,0 +1,37 @@ +package cn.iocoder.yudao.module.parking.controller.admin.park.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 场库列表新增/修改 Request VO") +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ParkSaveReqVO { + + @Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED) + private String parkNumber; + + @Schema(description = "场库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "场库名称不能为空") + private String parkName; + + @Schema(description = "场库总车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "21057") + @NotNull(message = "场库总车位数不能为空") + private Integer spaceCount; + + @Schema(description = "场库空车位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "7657") + @NotNull(message = "场库空车位数不能为空") + private Integer freeSpaceCount; + + @Schema(description = "场库可预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "17569") + @NotNull(message = "场库可预约数不能为空") + private Integer bookSpaceCount; + + @Schema(description = "场库在场预约数", requiredMode = Schema.RequiredMode.REQUIRED, example = "13935") + @NotNull(message = "场库在场预约数不能为空") + private Integer bookInParkCount; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/PassagewayController.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/PassagewayController.java new file mode 100644 index 000000000..919ba6a10 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/PassagewayController.java @@ -0,0 +1,101 @@ +package cn.iocoder.yudao.module.parking.controller.admin.passageway; + +import cn.iocoder.yudao.module.parking.util.BlueCardResult; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.parking.controller.admin.passageway.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.passageway.PassagewayDO; +import cn.iocoder.yudao.module.parking.service.passageway.PassagewayService; + +@Tag(name = "管理后台 - 通道信息") +@RestController +@RequestMapping("/parking/passageway") +@Validated +public class PassagewayController { + + @Resource + private PassagewayService passagewayService; + @PostMapping("/passagewayUpload") + public BlueCardResult passagewayUpload(@RequestBody PassagewayReqDataVO passagewayReqDataVO){ + return passagewayService.passagewayUpload(passagewayReqDataVO); + } + + + @PostMapping("/create") + @Operation(summary = "创建通道信息") + @PreAuthorize("@ss.hasPermission('parking:passageway:create')") + public CommonResult createPassageway(@Valid @RequestBody PassagewaySaveReqVO createReqVO) { + return success(passagewayService.createPassageway(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新通道信息") + @PreAuthorize("@ss.hasPermission('parking:passageway:update')") + public CommonResult updatePassageway(@Valid @RequestBody PassagewaySaveReqVO updateReqVO) { + passagewayService.updatePassageway(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除通道信息") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('parking:passageway:delete')") + public CommonResult deletePassageway(@RequestParam("id") String id) { + passagewayService.deletePassageway(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得通道信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('parking:passageway:query')") + public CommonResult getPassageway(@RequestParam("id") String id) { + PassagewayDO passageway = passagewayService.getPassageway(id); + return success(BeanUtils.toBean(passageway, PassagewayRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得通道信息分页") + @PreAuthorize("@ss.hasPermission('parking:passageway:query')") + public CommonResult> getPassagewayPage(@Valid PassagewayPageReqVO pageReqVO) { + PageResult pageResult = passagewayService.getPassagewayPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, PassagewayRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出通道信息 Excel") + @PreAuthorize("@ss.hasPermission('parking:passageway:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportPassagewayExcel(@Valid PassagewayPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = passagewayService.getPassagewayPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "通道信息.xls", "数据", PassagewayRespVO.class, + BeanUtils.toBean(list, PassagewayRespVO.class)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayPageReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayPageReqVO.java new file mode 100644 index 000000000..b9c284ede --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayPageReqVO.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.parking.controller.admin.passageway.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 通道信息分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class PassagewayPageReqVO extends PageParam { + + @Schema(description = "场库编号") + private String parkNumber; + + @Schema(description = "通道名称", example = "李四") + private String passagewayName; + + @Schema(description = "源区域 Id", example = "7412") + private String sourceAreaId; + + @Schema(description = "目标区域 Id", example = "10505") + private String targetAreaId; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayReqDataVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayReqDataVO.java new file mode 100644 index 000000000..633ab7d04 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayReqDataVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.parking.controller.admin.passageway.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * @Description 通道信息上传请求参数 + */ +@Data +public class PassagewayReqDataVO { + @Schema(description = "停车场编号", requiredMode = Schema.RequiredMode.REQUIRED) + private String parkNumber; + @Schema(description = "datas数据条数", requiredMode = Schema.RequiredMode.REQUIRED) + private Integer size; + @Schema(description = "区域属性", requiredMode = Schema.RequiredMode.REQUIRED) + private List datas; +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayRespVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayRespVO.java new file mode 100644 index 000000000..6fc934cf8 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewayRespVO.java @@ -0,0 +1,40 @@ +package cn.iocoder.yudao.module.parking.controller.admin.passageway.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 通道信息 Response VO") +@Data +@ExcelIgnoreUnannotated +public class PassagewayRespVO { + + @Schema(description = "通道 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7099") + @ExcelProperty("通道 Id") + private String passagewayId; + + @Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("场库编号") + private String parkNumber; + + @Schema(description = "通道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("通道名称") + private String passagewayName; + + @Schema(description = "源区域 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7412") + @ExcelProperty("源区域 Id") + private String sourceAreaId; + + @Schema(description = "目标区域 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "10505") + @ExcelProperty("目标区域 Id") + private String targetAreaId; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewaySaveReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewaySaveReqVO.java new file mode 100644 index 000000000..95988e110 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/passageway/vo/PassagewaySaveReqVO.java @@ -0,0 +1,31 @@ +package cn.iocoder.yudao.module.parking.controller.admin.passageway.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 通道信息新增/修改 Request VO") +@Data +public class PassagewaySaveReqVO { + + @Schema(description = "通道 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7099") + private String passagewayId; + + @Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "场库编号不能为空") + private String parkNumber; + + @Schema(description = "通道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "通道名称不能为空") + private String passagewayName; + + @Schema(description = "源区域 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7412") + @NotEmpty(message = "源区域 Id不能为空") + private String sourceAreaId; + + @Schema(description = "目标区域 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "10505") + @NotEmpty(message = "目标区域 Id不能为空") + private String targetAreaId; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/area/AreaDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/area/AreaDO.java new file mode 100644 index 000000000..b33a71acc --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/area/AreaDO.java @@ -0,0 +1,58 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.area; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 区域列表 DO + * + * @author 芋道源码 + */ +@TableName("area") +@KeySequence("area_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AreaDO extends BaseDO { + /** + * id + */ + @TableId + private Long id; + /** + * 区域Id + */ + private Integer areaId; + /** + * 场库编号 + */ + private String parkNumber; + /** + * 区域名称 + */ + private String areaName; + /** + * 区域车位数 + */ + private Integer spaceCount; + /** + * 区域空位数 + */ + private Integer lastSpaceCount; + /** + * 区域可预约车位数 + */ + private Integer bookSpaceCount; + /** + * 区域在场预约数 + */ + private Integer bookInParkCount; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/heartbeat/HeartbeatDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/heartbeat/HeartbeatDO.java new file mode 100644 index 000000000..299eeec61 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/heartbeat/HeartbeatDO.java @@ -0,0 +1,59 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.heartbeat; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 心跳管理 DO + * + * @author 芋道源码 + */ +@TableName("heartbeat") +@KeySequence("heartbeat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class HeartbeatDO extends BaseDO { + + /** + * 编号 + */ + @TableId + private Long id; + /** + * 场库编号 + */ + private String parkNumber; + /** + * 场库名称 + */ + private String parkName; + /** + * 场库总车位数 + */ + private Integer spaceCount; + /** + * 场库空车位数 + */ + private Integer freeSpaceCount; + /** + * 场库可预约数 + */ + private Integer bookSpaceCount; + /** + * 场库在场预约数 + */ + private Integer bookInParkCount; + /** + * 区域属性 + */ + private String areaList; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/park/ParkDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/park/ParkDO.java new file mode 100644 index 000000000..e76f8bdc3 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/park/ParkDO.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.park; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 场库列表 DO + * + * @author 芋道源码 + */ +@TableName("park") +@KeySequence("park_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ParkDO extends BaseDO { + + /** + * 场库编号 + */ + @TableId(type = IdType.INPUT) + private String parkNumber; + /** + * 场库名称 + */ + private String parkName; + /** + * 场库总车位数 + */ + private Integer spaceCount; + /** + * 场库空车位数 + */ + private Integer freeSpaceCount; + /** + * 场库可预约数 + */ + private Integer bookSpaceCount; + /** + * 场库在场预约数 + */ + private Integer bookInParkCount; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/passageway/PassagewayDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/passageway/PassagewayDO.java new file mode 100644 index 000000000..495b09cd5 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/passageway/PassagewayDO.java @@ -0,0 +1,47 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.passageway; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 通道信息 DO + * + * @author 芋道源码 + */ +@TableName("passageway") +@KeySequence("passageway_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PassagewayDO extends BaseDO { + + /** + * 通道 Id + */ + @TableId(type = IdType.INPUT) + private String passagewayId; + /** + * 场库编号 + */ + private String parkNumber; + /** + * 通道名称 + */ + private String passagewayName; + /** + * 源区域 Id + */ + private String sourceAreaId; + /** + * 目标区域 Id + */ + private String targetAreaId; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/area/AreaMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/area/AreaMapper.java new file mode 100644 index 000000000..ef506e92a --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/area/AreaMapper.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.parking.dal.mysql.area; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.parking.dal.dataobject.area.AreaDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.parking.controller.admin.area.vo.*; + +/** + * 区域列表 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface AreaMapper extends BaseMapperX { + + default PageResult selectPage(AreaPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(AreaDO::getParkNumber, reqVO.getParkNumber()) + .likeIfPresent(AreaDO::getAreaName, reqVO.getAreaName()) + .eqIfPresent(AreaDO::getSpaceCount, reqVO.getSpaceCount()) + .eqIfPresent(AreaDO::getLastSpaceCount, reqVO.getLastSpaceCount()) + .eqIfPresent(AreaDO::getBookSpaceCount, reqVO.getBookSpaceCount()) + .eqIfPresent(AreaDO::getBookInParkCount, reqVO.getBookInParkCount()) + .betweenIfPresent(AreaDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(AreaDO::getAreaId)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/heartbeat/HeartbeatMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/heartbeat/HeartbeatMapper.java new file mode 100644 index 000000000..6dc133ba7 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/heartbeat/HeartbeatMapper.java @@ -0,0 +1,33 @@ +package cn.iocoder.yudao.module.parking.dal.mysql.heartbeat; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.parking.dal.dataobject.heartbeat.HeartbeatDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.parking.controller.admin.heartbeat.vo.*; + +/** + * 心跳管理 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface HeartbeatMapper extends BaseMapperX { + + default PageResult selectPage(HeartbeatPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(HeartbeatDO::getParkNumber, reqVO.getParkNumber()) + .likeIfPresent(HeartbeatDO::getParkName, reqVO.getParkName()) + .eqIfPresent(HeartbeatDO::getSpaceCount, reqVO.getSpaceCount()) + .eqIfPresent(HeartbeatDO::getFreeSpaceCount, reqVO.getFreeSpaceCount()) + .eqIfPresent(HeartbeatDO::getBookSpaceCount, reqVO.getBookSpaceCount()) + .eqIfPresent(HeartbeatDO::getBookInParkCount, reqVO.getBookInParkCount()) + .eqIfPresent(HeartbeatDO::getAreaList, reqVO.getAreaList()) + .betweenIfPresent(HeartbeatDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(HeartbeatDO::getId)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/park/ParkMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/park/ParkMapper.java new file mode 100644 index 000000000..e290e6bdc --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/park/ParkMapper.java @@ -0,0 +1,31 @@ +package cn.iocoder.yudao.module.parking.dal.mysql.park; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.parking.dal.dataobject.park.ParkDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.parking.controller.admin.park.vo.*; + +/** + * 场库列表 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ParkMapper extends BaseMapperX { + + default PageResult selectPage(ParkPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(ParkDO::getParkName, reqVO.getParkName()) + .eqIfPresent(ParkDO::getSpaceCount, reqVO.getSpaceCount()) + .eqIfPresent(ParkDO::getFreeSpaceCount, reqVO.getFreeSpaceCount()) + .eqIfPresent(ParkDO::getBookSpaceCount, reqVO.getBookSpaceCount()) + .eqIfPresent(ParkDO::getBookInParkCount, reqVO.getBookInParkCount()) + .betweenIfPresent(ParkDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(ParkDO::getParkNumber)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/passageway/PassagewayMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/passageway/PassagewayMapper.java new file mode 100644 index 000000000..e58ac1ea3 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/passageway/PassagewayMapper.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.parking.dal.mysql.passageway; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.parking.dal.dataobject.passageway.PassagewayDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.parking.controller.admin.passageway.vo.*; + +/** + * 通道信息 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface PassagewayMapper extends BaseMapperX { + + default PageResult selectPage(PassagewayPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(PassagewayDO::getParkNumber, reqVO.getParkNumber()) + .likeIfPresent(PassagewayDO::getPassagewayName, reqVO.getPassagewayName()) + .eqIfPresent(PassagewayDO::getSourceAreaId, reqVO.getSourceAreaId()) + .eqIfPresent(PassagewayDO::getTargetAreaId, reqVO.getTargetAreaId()) + .betweenIfPresent(PassagewayDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(PassagewayDO::getPassagewayId)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaService.java new file mode 100644 index 000000000..355dc4239 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaService.java @@ -0,0 +1,68 @@ +package cn.iocoder.yudao.module.parking.service.area; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.parking.controller.admin.area.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.area.AreaDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; + +/** + * 区域列表 Service 接口 + * + * @author 芋道源码 + */ +public interface AreaService { + + /** + * 创建区域列表 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Integer createArea(@Valid AreaSaveReqVO createReqVO); + + /** + * 创建区域列表(批处理) + * @param areaSaveReqVOList + * @return java.lang.Integer + */ + Boolean createAreaBatch(@Valid List areaSaveReqVOList); + + /** + * 更新区域列表 + * + * @param updateReqVO 更新信息 + */ + void updateArea(@Valid AreaSaveReqVO updateReqVO); + + /** + * 删除区域列表 + * + * @param id 编号 + */ + void deleteArea(Integer id); + + /** + * 获得区域列表 + * + * @param id 编号 + * @return 区域列表 + */ + AreaDO getArea(Integer id); + + /** + * 获得区域列表分页 + * + * @param pageReqVO 分页查询 + * @return 区域列表分页 + */ + PageResult getAreaPage(AreaPageReqVO pageReqVO); + + /** + * 创建或更新区域(批量) + * @param areaList + * @return java.lang.Boolean + */ + Boolean createOrUpdateAreaBatch(ArrayList areaList); +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaServiceImpl.java new file mode 100644 index 000000000..fd93f4aa3 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaServiceImpl.java @@ -0,0 +1,86 @@ +package cn.iocoder.yudao.module.parking.service.area; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import cn.iocoder.yudao.module.parking.controller.admin.area.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.area.AreaDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; + +import cn.iocoder.yudao.module.parking.dal.mysql.area.AreaMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.parking.enums.ErrorCodeConstants.*; + +/** + * 区域列表 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class AreaServiceImpl implements AreaService { + + @Resource + private AreaMapper areaMapper; + + @Override + public Integer createArea(AreaSaveReqVO createReqVO) { + // 插入 + AreaDO area = BeanUtils.toBean(createReqVO, AreaDO.class); + areaMapper.insert(area); + // 返回 + return area.getAreaId(); + } + + @Override + public Boolean createAreaBatch(List areaSaveReqVOList) { + // 插入 + List areaDOList = BeanUtils.toBean(areaSaveReqVOList, AreaDO.class); + return areaMapper.insertBatch(areaDOList); + } + + @Override + public void updateArea(AreaSaveReqVO updateReqVO) { + // 校验存在 + validateAreaExists(updateReqVO.getAreaId()); + // 更新 + AreaDO updateObj = BeanUtils.toBean(updateReqVO, AreaDO.class); + areaMapper.updateById(updateObj); + } + + @Override + public void deleteArea(Integer id) { + // 校验存在 + validateAreaExists(id); + // 删除 + areaMapper.deleteById(id); + } + + private void validateAreaExists(Integer id) { + if (areaMapper.selectById(id) == null) { + throw exception(AREA_NOT_EXISTS); + } + } + + @Override + public AreaDO getArea(Integer id) { + return areaMapper.selectById(id); + } + + @Override + public PageResult getAreaPage(AreaPageReqVO pageReqVO) { + return areaMapper.selectPage(pageReqVO); + } + + @Override + public Boolean createOrUpdateAreaBatch(ArrayList areaList) { + return areaMapper.insertOrUpdateBatch(BeanUtils.toBean(areaList, AreaDO.class)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatService.java new file mode 100644 index 000000000..cd9190dba --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatService.java @@ -0,0 +1,62 @@ +package cn.iocoder.yudao.module.parking.service.heartbeat; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.parking.controller.admin.heartbeat.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.heartbeat.HeartbeatDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.module.parking.util.BlueCardResult; + +/** + * 心跳管理 Service 接口 + * + * @author 芋道源码 + */ +public interface HeartbeatService { + + /** + * 创建心跳管理 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createHeartbeat(@Valid HeartbeatSaveReqVO createReqVO); + + /** + * 更新心跳管理 + * + * @param updateReqVO 更新信息 + */ + void updateHeartbeat(@Valid HeartbeatSaveReqVO updateReqVO); + + /** + * 删除心跳管理 + * + * @param id 编号 + */ + void deleteHeartbeat(Long id); + + /** + * 获得心跳管理 + * + * @param id 编号 + * @return 心跳管理 + */ + HeartbeatDO getHeartbeat(Long id); + + /** + * 获得心跳管理分页 + * + * @param pageReqVO 分页查询 + * @return 心跳管理分页 + */ + PageResult getHeartbeatPage(HeartbeatPageReqVO pageReqVO); + + /** + * 接收并解析心跳数据 + * @param blueCardHeartbeat + * @return cn.iocoder.yudao.module.parking.util.BlueCardResult + */ + BlueCardResult doHeartbeat(HeartbeatReqDataVO blueCardHeartbeat); +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatServiceImpl.java new file mode 100644 index 000000000..de337778d --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatServiceImpl.java @@ -0,0 +1,120 @@ +package cn.iocoder.yudao.module.parking.service.heartbeat; + +import cn.iocoder.yudao.module.parking.controller.admin.area.vo.AreaSaveReqVO; +import cn.iocoder.yudao.module.parking.controller.admin.park.vo.ParkSaveReqVO; +import cn.iocoder.yudao.module.parking.service.area.AreaService; +import cn.iocoder.yudao.module.parking.service.park.ParkService; +import cn.iocoder.yudao.module.parking.util.BlueCardResult; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +import org.springframework.transaction.interceptor.TransactionAspectSupport; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +import cn.iocoder.yudao.module.parking.controller.admin.heartbeat.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.heartbeat.HeartbeatDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; + +import cn.iocoder.yudao.module.parking.dal.mysql.heartbeat.HeartbeatMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.parking.enums.ErrorCodeConstants.*; + +/** + * 心跳管理 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class HeartbeatServiceImpl implements HeartbeatService { + + @Resource + private HeartbeatMapper heartbeatMapper; + @Resource + private ParkService parkService; + @Resource + private AreaService areaService; + + @Override + public Long createHeartbeat(HeartbeatSaveReqVO createReqVO) { + // 插入 + HeartbeatDO heartbeat = BeanUtils.toBean(createReqVO, HeartbeatDO.class); + heartbeatMapper.insert(heartbeat); + // 返回 + return heartbeat.getId(); + } + + @Override + public void updateHeartbeat(HeartbeatSaveReqVO updateReqVO) { + // 校验存在 + validateHeartbeatExists(updateReqVO.getId()); + // 更新 + HeartbeatDO updateObj = BeanUtils.toBean(updateReqVO, HeartbeatDO.class); + heartbeatMapper.updateById(updateObj); + } + + @Override + public void deleteHeartbeat(Long id) { + // 校验存在 + validateHeartbeatExists(id); + // 删除 + heartbeatMapper.deleteById(id); + } + + private void validateHeartbeatExists(Long id) { + if (heartbeatMapper.selectById(id) == null) { + throw exception(HEARTBEAT_NOT_EXISTS); + } + } + + @Override + public HeartbeatDO getHeartbeat(Long id) { + return heartbeatMapper.selectById(id); + } + + @Override + public PageResult getHeartbeatPage(HeartbeatPageReqVO pageReqVO) { + return heartbeatMapper.selectPage(pageReqVO); + } + + @Override + @Transactional + public BlueCardResult doHeartbeat(HeartbeatReqDataVO blueCardHeartbeat) { + try { + ArrayList areaList = blueCardHeartbeat.getAreaList(); + HeartbeatDO heartbeatDO = new HeartbeatDO(); + heartbeatDO.setParkNumber(blueCardHeartbeat.getParkNumber()); + heartbeatDO.setParkName(blueCardHeartbeat.getParkName()); + heartbeatDO.setSpaceCount(blueCardHeartbeat.getSpaceCount()); + heartbeatDO.setFreeSpaceCount(blueCardHeartbeat.getFreeSpaceCount()); + heartbeatDO.setBookSpaceCount(blueCardHeartbeat.getBookSpaceCount()); + heartbeatDO.setBookInParkCount(blueCardHeartbeat.getBookInParkCount()); + heartbeatDO.setAreaList(areaList.toString()); + // 写入心跳日志 + heartbeatMapper.insert(heartbeatDO); + // 写入停车场信息 + parkService.createOrUpdatePark(new ParkSaveReqVO(blueCardHeartbeat.getParkNumber(), blueCardHeartbeat.getParkName(), blueCardHeartbeat.getSpaceCount(), blueCardHeartbeat.getFreeSpaceCount(), blueCardHeartbeat.getBookSpaceCount(), blueCardHeartbeat.getBookInParkCount())); + if (!areaList.isEmpty()){ + // 对区域都添加停车场库编号 + areaList.forEach(item -> item.setParkNumber(blueCardHeartbeat.getParkNumber())); + // 写入区域信息 + // TODO 判断重复及处理方式 + areaService.createOrUpdateAreaBatch(areaList); + } + } catch (Exception e) { + // 手动设置回滚 + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return BlueCardResult.error("数据写入失败:" + e.getMessage()); + } + + return BlueCardResult.success(); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/park/ParkService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/park/ParkService.java new file mode 100644 index 000000000..17d7424db --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/park/ParkService.java @@ -0,0 +1,62 @@ +package cn.iocoder.yudao.module.parking.service.park; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.parking.controller.admin.park.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.park.ParkDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; + +/** + * 场库列表 Service 接口 + * + * @author 芋道源码 + */ +public interface ParkService { + + /** + * 创建场库列表 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createPark(@Valid ParkSaveReqVO createReqVO); + + /** + * 创建或更新场库 + * @param parkSaveReqVO + * @return java.lang.Boolean + */ + Boolean createOrUpdatePark(@Valid ParkSaveReqVO parkSaveReqVO); + + /** + * 更新场库列表 + * + * @param updateReqVO 更新信息 + */ + void updatePark(@Valid ParkSaveReqVO updateReqVO); + + /** + * 删除场库列表 + * + * @param id 编号 + */ + void deletePark(String id); + + /** + * 获得场库列表 + * + * @param id 编号 + * @return 场库列表 + */ + ParkDO getPark(String id); + + /** + * 获得场库列表分页 + * + * @param pageReqVO 分页查询 + * @return 场库列表分页 + */ + PageResult getParkPage(ParkPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/park/ParkServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/park/ParkServiceImpl.java new file mode 100644 index 000000000..64ee70e78 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/park/ParkServiceImpl.java @@ -0,0 +1,79 @@ +package cn.iocoder.yudao.module.parking.service.park; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import cn.iocoder.yudao.module.parking.controller.admin.park.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.park.ParkDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; + +import cn.iocoder.yudao.module.parking.dal.mysql.park.ParkMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.parking.enums.ErrorCodeConstants.*; + +/** + * 场库列表 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ParkServiceImpl implements ParkService { + + @Resource + private ParkMapper parkMapper; + + @Override + public String createPark(ParkSaveReqVO createReqVO) { + // 插入 + ParkDO park = BeanUtils.toBean(createReqVO, ParkDO.class); + parkMapper.insert(park); + // 返回 + return park.getParkNumber(); + } + + @Override + public Boolean createOrUpdatePark(ParkSaveReqVO parkSaveReqVO) { + return parkMapper.insertOrUpdate(BeanUtils.toBean(parkSaveReqVO, ParkDO.class)); + } + + @Override + public void updatePark(ParkSaveReqVO updateReqVO) { + // 校验存在 + validateParkExists(updateReqVO.getParkNumber()); + // 更新 + ParkDO updateObj = BeanUtils.toBean(updateReqVO, ParkDO.class); + parkMapper.updateById(updateObj); + } + + @Override + public void deletePark(String id) { + // 校验存在 + validateParkExists(id); + // 删除 + parkMapper.deleteById(id); + } + + private void validateParkExists(String id) { + if (parkMapper.selectById(id) == null) { + throw exception(PARK_NOT_EXISTS); + } + } + + @Override + public ParkDO getPark(String id) { + return parkMapper.selectById(id); + } + + @Override + public PageResult getParkPage(ParkPageReqVO pageReqVO) { + return parkMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/passageway/PassagewayService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/passageway/PassagewayService.java new file mode 100644 index 000000000..ea3bd10f4 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/passageway/PassagewayService.java @@ -0,0 +1,62 @@ +package cn.iocoder.yudao.module.parking.service.passageway; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.parking.controller.admin.passageway.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.passageway.PassagewayDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.module.parking.util.BlueCardResult; + +/** + * 通道信息 Service 接口 + * + * @author 芋道源码 + */ +public interface PassagewayService { + + /** + * 创建通道信息 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createPassageway(@Valid PassagewaySaveReqVO createReqVO); + + /** + * 更新通道信息 + * + * @param updateReqVO 更新信息 + */ + void updatePassageway(@Valid PassagewaySaveReqVO updateReqVO); + + /** + * 删除通道信息 + * + * @param id 编号 + */ + void deletePassageway(String id); + + /** + * 获得通道信息 + * + * @param id 编号 + * @return 通道信息 + */ + PassagewayDO getPassageway(String id); + + /** + * 获得通道信息分页 + * + * @param pageReqVO 分页查询 + * @return 通道信息分页 + */ + PageResult getPassagewayPage(PassagewayPageReqVO pageReqVO); + + /** + * 通道信息创建或更新 + * @param passagewayReqDataVO + * @return cn.iocoder.yudao.module.parking.util.BlueCardResult + */ + BlueCardResult passagewayUpload(PassagewayReqDataVO passagewayReqDataVO); +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/passageway/PassagewayServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/passageway/PassagewayServiceImpl.java new file mode 100644 index 000000000..5da9e3eb9 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/passageway/PassagewayServiceImpl.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.parking.service.passageway; + +import cn.iocoder.yudao.module.parking.util.BlueCardResult; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import cn.iocoder.yudao.module.parking.controller.admin.passageway.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.passageway.PassagewayDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; + +import cn.iocoder.yudao.module.parking.dal.mysql.passageway.PassagewayMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.parking.enums.ErrorCodeConstants.*; + +/** + * 通道信息 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class PassagewayServiceImpl implements PassagewayService { + + @Resource + private PassagewayMapper passagewayMapper; + + @Override + public String createPassageway(PassagewaySaveReqVO createReqVO) { + // 插入 + PassagewayDO passageway = BeanUtils.toBean(createReqVO, PassagewayDO.class); + passagewayMapper.insert(passageway); + // 返回 + return passageway.getPassagewayId(); + } + + @Override + public void updatePassageway(PassagewaySaveReqVO updateReqVO) { + // 校验存在 + validatePassagewayExists(updateReqVO.getPassagewayId()); + // 更新 + PassagewayDO updateObj = BeanUtils.toBean(updateReqVO, PassagewayDO.class); + passagewayMapper.updateById(updateObj); + } + + @Override + public void deletePassageway(String id) { + // 校验存在 + validatePassagewayExists(id); + // 删除 + passagewayMapper.deleteById(id); + } + + private void validatePassagewayExists(String id) { + if (passagewayMapper.selectById(id) == null) { + throw exception(PASSAGEWAY_NOT_EXISTS); + } + } + + @Override + public PassagewayDO getPassageway(String id) { + return passagewayMapper.selectById(id); + } + + @Override + public PageResult getPassagewayPage(PassagewayPageReqVO pageReqVO) { + return passagewayMapper.selectPage(pageReqVO); + } + + @Override + public BlueCardResult passagewayUpload(PassagewayReqDataVO passagewayReqDataVO) { + List passagewaySaveReqVOList = passagewayReqDataVO.getDatas(); + // TODO 判断重复覆盖 + return null; + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/area/AreaMapper.xml b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/area/AreaMapper.xml new file mode 100644 index 000000000..2ef761ea2 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/area/AreaMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/heartbeat/HeartbeatMapper.xml b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/heartbeat/HeartbeatMapper.xml new file mode 100644 index 000000000..273e4fb0d --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/heartbeat/HeartbeatMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/park/ParkMapper.xml b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/park/ParkMapper.xml new file mode 100644 index 000000000..892526104 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/park/ParkMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/passageway/PassagewayMapper.xml b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/passageway/PassagewayMapper.xml new file mode 100644 index 000000000..08edff42f --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/passageway/PassagewayMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file -- 2.45.2 From ee27d54dde89ad9aeca06d49829e47f1818ffdc1 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Fri, 16 Aug 2024 10:53:25 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E7=A5=A8=E5=8A=A1?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E8=BF=94=E5=9B=9E=E5=80=BC=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=8E=9F=E6=9D=A5=E4=BD=BF=E7=94=A8=E7=9A=84=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/asset/AssetApi.java | 8 +-- .../admin/checkticket/CheckTicketApi.java | 8 +-- .../admin/saledata/SaleDataApi.java | 56 +++++++++---------- .../config/SecurityConfiguration.java | 3 +- 4 files changed, 37 insertions(+), 38 deletions(-) diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java index 97ffd9a26..fc4ca56cd 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java @@ -29,12 +29,12 @@ public class AssetApi { private AssetService assetService; @GetMapping("/type") @Operation(summary = "获得所有设备名称和数量") - public CommonResult>> countAsset() { - return success(assetService.countAsset()); + public List> countAsset() { + return assetService.countAsset(); } @GetMapping("/name/{assettypename}") @Operation(summary = "获取符合设备类型名的所有设备") - public CommonResult> nameAsset(@PathVariable("assettypename") String assettypename) { - return success(assetService.nameAsset(assettypename)); + public List nameAsset(@PathVariable("assettypename") String assettypename) { + return assetService.nameAsset(assettypename); } } diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java index a0b848309..5b83dc24c 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java @@ -25,13 +25,13 @@ public class CheckTicketApi { private CheckTicketService checkTicketService; @GetMapping("/{day}") @Operation(summary = "获得日期当天的检票人数") - public CommonResult checkTicketTotal(@PathVariable("day") String day) { - return success(checkTicketService.checkTicketTotal(day)); + public Long checkTicketTotal(@PathVariable("day") String day) { + return checkTicketService.checkTicketTotal(day); } @GetMapping("/qushi/{day}") @Operation(summary = "获取日期当天各个时段的检票人数") - public CommonResult>> findbytimetemp(@PathVariable("day") String day) { - return success(checkTicketService.findbytimetemp(day)); + public List> findbytimetemp(@PathVariable("day") String day) { + return checkTicketService.findbytimetemp(day); } } diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java index 36d20cb93..d7cbe87e4 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java @@ -27,87 +27,87 @@ public class SaleDataApi { @GetMapping("/{day}") @Operation(summary = "获得输入日期的当天总售票数") - public CommonResult checkTicketTotal(@PathVariable("day") String day) { - return success(saleDataService.countBySddate(day)); + public Long checkTicketTotal(@PathVariable("day") String day) { + return saleDataService.countBySddate(day); } @GetMapping("/thisyear/{startTime}") @Operation(summary = "获得今年日期往前十天内的数据") - public CommonResult>> thisyearNum(@PathVariable("startTime") String startTime) { - return success(saleDataService.findCheckticketcountBytime(startTime)); + public List> thisyearNum(@PathVariable("startTime") String startTime) { + return saleDataService.findCheckticketcountBytime(startTime); } @GetMapping("/lastyear/{startTime}") @Operation(summary = "获得去年日期往前推十天的数据") - public CommonResult>> lastyearNum(@PathVariable("startTime") String startTime) { - return success(saleDataService.findCheckticketcountBytime(startTime)); + public List> lastyearNum(@PathVariable("startTime") String startTime) { + return saleDataService.findCheckticketcountBytime(startTime); } @GetMapping("/gender") @Operation(summary = "获得所有数据的男女数量") - public CommonResult>> findByGender() { - return success(saleDataService.findByGender()); + public List> findByGender() { + return saleDataService.findByGender(); } @GetMapping("/age") @Operation(summary = "获得所有数据的年龄分段和数量") - public CommonResult>> findByage() { - return success(saleDataService.findByAge()); + public List> findByage() { + return saleDataService.findByAge(); } @GetMapping("/lastyear/region") @Operation(summary = "查询去年各个省份的人数") - public CommonResult>> lastyearfindByregion() { - return success(saleDataService.findByregion(saleDataService.findEventsLastYear())); + public List> lastyearfindByregion() { + return saleDataService.findByregion(saleDataService.findEventsLastYear()); } @GetMapping("/thisyear/region") @Operation(summary = "查询今年各个省份的人数") - public CommonResult>> thisyearfindByregion() { - return success(saleDataService.findByregion(saleDataService.findEventsThisYear())); + public List> thisyearfindByregion() { + return saleDataService.findByregion(saleDataService.findEventsThisYear()); } @GetMapping("/salemethod") @Operation(summary = "查询各个销售渠道的购票人数") - public CommonResult>> findBysaleMethod() { - return success(saleDataService.findBySaleMethod()); + public List> findBysaleMethod() { + return saleDataService.findBySaleMethod(); } @GetMapping("/wuyi/{x}") @Operation(summary = "查询最近前几年当年的五一期间的数据") - public CommonResult>> findByWuyi(@PathVariable("x") int x) { - return success(saleDataService.findWuyi(x)); + public List> findByWuyi(@PathVariable("x") int x) { + return saleDataService.findWuyi(x); } @GetMapping("/guoqing/{x}") @Operation(summary = "查询最近前几年当年的国庆期间的数据") - public CommonResult>> findByGuoqing(@PathVariable("x") int x) { - return success(saleDataService.findGuoqing(x)); + public List> findByGuoqing(@PathVariable("x") int x) { + return saleDataService.findGuoqing(x); } @GetMapping("/rijunthisyear/{startTime}") @Operation(summary = "查询今年对应日期的近三十天日均售票数量") - public CommonResult findThisyearRijun(@PathVariable("startTime") String startTime) { - return success(saleDataService.findrijun(startTime)); + public String findThisyearRijun(@PathVariable("startTime") String startTime) { + return saleDataService.findrijun(startTime); } @GetMapping("/rijunlastyear/{startTime}") @Operation(summary = "查询去年对应日期的近三十天日均售票数量") - public CommonResult findLastyearRijun(@PathVariable("startTime") String startTime) { - return success(saleDataService.findrijun(startTime)); + public String findLastyearRijun(@PathVariable("startTime") String startTime) { + return saleDataService.findrijun(startTime); } // TODO 年度平均什么,并没有说清楚,原代码是直接计算一年的总金额 @GetMapping("/thisyear/nianjun") @Operation(summary = "查询今年年度售票平均金额") - public CommonResult findmoneythisyear() { - return success(saleDataService.findyearJun(saleDataService.findEventsThisYear())); + public BigDecimal findmoneythisyear() { + return saleDataService.findyearJun(saleDataService.findEventsThisYear()); } @GetMapping("/lastyear/nianjun") @Operation(summary = "查询去年年度售票平均金额") - public CommonResult findmoneylastyear() { - return success(saleDataService.findyearJun(saleDataService.findEventsLastYear())); + public BigDecimal findmoneylastyear() { + return saleDataService.findyearJun(saleDataService.findEventsLastYear()); } } diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java index 725273fb6..0b8e6376a 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java @@ -19,8 +19,7 @@ public class SecurityConfiguration { @Override public void customize(ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry registry) { // Swagger 接口文档 - registry.antMatchers("/v3/api-docs/**").permitAll() // 元数据 - .antMatchers("/swagger-ui.html").permitAll(); // Swagger UI + registry.antMatchers("/**").permitAll(); // 放行所有接口 // Spring Boot Actuator 的安全配置 registry.antMatchers("/actuator").anonymous() .antMatchers("/actuator/**").anonymous(); -- 2.45.2 From 8b5c9e12c1bf92298768eca894a8bf53ceba3365 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Fri, 16 Aug 2024 10:53:50 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=A4=9A=E7=A7=9F=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/resources/application.yaml b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/resources/application.yaml index 9c158807e..171d3d83c 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/resources/application.yaml +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/resources/application.yaml @@ -91,7 +91,7 @@ yudao: captcha: enable: true # 验证码的开关,默认为 true; tenant: # 多租户相关配置项 - enable: true + enable: false ignore-urls: ignore-tables: -- 2.45.2 From f75b826a556fca2df5c180cadccd8095a036a877 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Fri, 16 Aug 2024 13:46:03 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=95=B0=E6=8D=AE-?= =?UTF-8?q?=E5=81=9C=E8=BD=A6=E5=9C=BA=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap-local.yaml | 4 +- .../transitionflight/TransitionFlightApi.java | 129 ++++++- .../admin/transitionflight/vo/FerryData.java | 16 + .../admin/vehicleaccess/VehicleAccessApi.java | 339 ++++++++++++++++++ .../vo/AppearanceRecordCarInfoVo.java | 12 + .../vo/AppearanceRecordChargeListVo.java | 13 + .../AppearanceRecordChargeStatisticsVo.java | 19 + .../vo/AppearanceRecordPassInfoVo.java | 15 + .../vo/AppearanceRecordPlaceInfoVo.java | 11 + .../vo/AppearanceRecordProfitListVo.java | 13 + .../vo/AppearanceRecordUserInfoVo.java | 8 + .../vehicleaccess/vo/AppearanceRecordVo.java | 27 ++ .../admin/vehicleaccess/vo/AreaDataVO.java | 19 + .../vehicleaccess/vo/BlueCardHeartbeatVo.java | 13 + .../vo/EntryRecordPlaceInfoVo.java | 11 + .../vo/EntryRecordUserInfoVo.java | 11 + .../admin/vehicleaccess/vo/EntryRecordVo.java | 26 ++ .../vehicleaccess/vo/ParkingLotDataVO.java | 47 +++ .../admin/vehicleaccess/vo/RevenueVO.java | 30 ++ .../controller/admin/weather/WeatherApi.java | 7 +- .../vehicleaccess/AccessRecordPicture.java | 28 ++ .../vehicleaccess/AppearanceRecord.java | 20 ++ .../vehicleaccess/BlueCardHeartbeat.java | 24 ++ .../dataobject/vehicleaccess/EntryRecord.java | 20 ++ .../dal/dataobject/vehicleaccess/Revenue.java | 22 ++ .../vehicleaccess/VehicleRecord.java | 31 ++ .../AccessRecordPictureRepository.java | 16 + .../AppearanceRecordRepository.java | 15 + .../BlueCardHeartbeatRepository.java | 14 + .../vehicleaccess/EntryRecordRepository.java | 16 + .../vehicleaccess/RevenueRepository.java | 16 + .../VehicleRecordRepository.java | 22 ++ .../module/datacenter/utlis/ResponseVO.java | 68 ++++ 33 files changed, 1076 insertions(+), 6 deletions(-) create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/vo/FerryData.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordCarInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeListVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeStatisticsVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPassInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPlaceInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordProfitListVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordUserInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AreaDataVO.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/BlueCardHeartbeatVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordPlaceInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordUserInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/ParkingLotDataVO.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/RevenueVO.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AccessRecordPicture.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AppearanceRecord.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/BlueCardHeartbeat.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/EntryRecord.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/Revenue.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/VehicleRecord.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AccessRecordPictureRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AppearanceRecordRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/BlueCardHeartbeatRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/EntryRecordRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/RevenueRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/VehicleRecordRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/ResponseVO.java diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml index 12c520cd9..2de0efbf7 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml @@ -3,7 +3,7 @@ spring: cloud: nacos: - server-addr: crm.fjptzykj.com:8849 + server-addr: 127.0.0.1:8848 discovery: namespace: dev # 命名空间。这里使用 dev 开发环境 metadata: @@ -16,7 +16,7 @@ spring: nacos: # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 config: - server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址 + server-addr: 127.0.0.1:8848 # Nacos 服务器地址 namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/TransitionFlightApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/TransitionFlightApi.java index 496b95046..993f357d8 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/TransitionFlightApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/TransitionFlightApi.java @@ -1,16 +1,143 @@ package cn.iocoder.yudao.module.datacenter.controller.admin.transitionflight; +import cn.iocoder.yudao.module.datacenter.controller.admin.transitionflight.vo.FerryData; +import cn.iocoder.yudao.module.datacenter.utlis.ResponseVO; +import com.alibaba.nacos.shaded.com.google.gson.Gson; +import com.alibaba.nacos.shaded.com.google.gson.JsonObject; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; + /** * @Description 车辆过渡情况 */ @Tag(name = "大屏服务 - 车辆过渡情况") @RestController -@RequestMapping("/h5/transitionFlight") +@RequestMapping("/datacenter/h5/transitionFlight") @Validated public class TransitionFlightApi { + //智慧票务,检票系统:车辆过渡情况(南日) + @GetMapping("/getPageInfo") + public ResponseVO getPageInfo(){ + + try { + // 定义接口地址 + String apiUrl = "http://scld.ptzyKjgs.com/camera/vehicleInOutRecord/getPageInfo"; + // 创建 URL 对象 + URL url = new URL(apiUrl); + // 创建 HttpURLConnection 对象 + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + // 设置请求方法 + connection.setRequestMethod("POST"); + // 获取响应码 + int responseCode = connection.getResponseCode(); + // 如果响应码为 200,表示请求成功 + if (responseCode == HttpURLConnection.HTTP_OK) { + // 创建 BufferedReader 读取响应内容 + BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + StringBuilder response = new StringBuilder(); + String line; + // 读取响应内容 + while ((line = reader.readLine()) != null) { + response.append(line); + } + // 关闭 BufferedReader + reader.close(); + String responseData = response.toString(); + // 使用 Gson 解析 JSON 数据 + Gson gson = new Gson(); + JsonObject jsonObject = gson.fromJson(responseData, JsonObject.class); + // 提取 data 字段 + JsonObject dataObject = jsonObject.getAsJsonObject("data"); + FerryData ferryData = new FerryData(); + ferryData.setOtherLotsNR(dataObject.get("otherLots").getAsInt()); + ferryData.setTotalLotsNR(dataObject.get("totalLots").getAsInt()); + ferryData.setCurrentLotsNR(dataObject.get("currentLots").getAsInt()); + + return ResponseVO.success(200,"请求成功",ferryData,0); + } else { + System.out.println("请求失败,响应码:" + responseCode); + } + // 断开连接 + connection.disconnect(); + } catch (IOException e) { + e.printStackTrace(); + } + return ResponseVO.error(500,"请求失败"); + } + + + //智慧票务,检票系统:车辆过渡情况(石城) + @GetMapping("/getCurrent") + public ResponseVO getCurrent(){ + + try { + // 定义接口地址 + String apiUrl = "http://scld.ptzyKjgs.com/camera/vehicleInOutRecord/getCurrent"; + + // 创建 URL 对象 + URL url = new URL(apiUrl); + + // 创建 HttpURLConnection 对象 + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + + // 设置请求方法 + connection.setRequestMethod("POST"); + + // 获取响应码 + int responseCode = connection.getResponseCode(); + + // 如果响应码为 200,表示请求成功 + if (responseCode == HttpURLConnection.HTTP_OK) { + // 创建 BufferedReader 读取响应内容 + BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + StringBuilder response = new StringBuilder(); + String line; + + // 读取响应内容 + while ((line = reader.readLine()) != null) { + response.append(line); + } + + // 关闭 BufferedReader + reader.close(); + + String responseData = response.toString(); + + // 使用 Gson 解析 JSON 数据 + Gson gson = new Gson(); + JsonObject jsonObject = gson.fromJson(responseData, JsonObject.class); + + // 提取 data 字段 + JsonObject dataObject = jsonObject.getAsJsonObject("data"); + + FerryData ferryData = new FerryData(); + ferryData.setOtherLotsSC(dataObject.get("otherLots").getAsInt()); + ferryData.setTotalLotsSC(dataObject.get("totalLots").getAsInt()); + ferryData.setCurrentLotsSC(dataObject.get("currentLots").getAsInt()); + + return ResponseVO.success(200,"请求成功",ferryData,0); + + } else { + System.out.println("请求失败,响应码:" + responseCode); + + } + + // 断开连接 + connection.disconnect(); + + } catch (IOException e) { + e.printStackTrace(); + } + + return ResponseVO.error(500,"请求失败"); + } } diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/vo/FerryData.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/vo/FerryData.java new file mode 100644 index 000000000..343f47e4a --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/vo/FerryData.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.transitionflight.vo; + +import lombok.Data; + +/** + * 轮渡车辆过度数据 + */ +@Data +public class FerryData { + private int otherLotsSC;//已进岛数 + private int totalLotsSC;//计划进岛数 + private int currentLotsSC;//剩余进岛数 + private int otherLotsNR; + private int totalLotsNR; + private int currentLotsNR; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java new file mode 100644 index 000000000..6e90e292f --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java @@ -0,0 +1,339 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.AreaDataVO; +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.ParkingLotDataVO; +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.RevenueVO; +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.*; +import cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess.*; +import cn.iocoder.yudao.module.datacenter.utlis.ResponseVO; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.List; +import java.util.Optional; +@Tag(name = "大屏服务 - 停车场接口") +@RestController +@RequestMapping("/datacenter/h5/vehicleAccess") +public class VehicleAccessApi { + + @Autowired + private BlueCardHeartbeatRepository blueCardHeartbeatRepository; + + @Autowired + AppearanceRecordRepository appearanceRecordRepository; + + @Autowired + EntryRecordRepository entryRecordRepository; + + @Autowired + AccessRecordPictureRepository accessRecordPictureRepository; + + @Autowired + VehicleRecordRepository vehicleRecordRepository; + + @Autowired + RevenueRepository revenueRepository; + + @GetMapping("/list") + public ResponseVO list(){ + // 获取今天的日期 + LocalDate today = LocalDate.now(); + LocalDateTime startOfDay = LocalDateTime.of(today, LocalTime.MIN); + LocalDateTime endOfDay = LocalDateTime.of(today, LocalTime.MAX); + + Revenue revenue = new Revenue(); + revenue.setAreaName("中关村软件园一号院"); + revenue.setCreateTime(LocalDateTime.now()); + revenue.setGetTime("2024.05.14 12:15:36"); + revenue.setMemo(""); + revenue.setPayCharge("30"); + revenue.setPayKind("微信"); + revenue.setPlate("京A 88888"); + revenueRepository.insert(revenue); + + return ResponseVO.success(200,"添加成功",null,0); + } + + + //获取实时车辆进出数据和今日车位统计 + @GetMapping("/parkingLotData") + public ResponseVO parkAndVacancy(){ + + + //时间最新的一条数据 + Optional latestHeartbeat = blueCardHeartbeatRepository.findTopByOrderByCreateTimeDesc(); + + if (latestHeartbeat.isPresent()) { + BlueCardHeartbeat heartbeat = latestHeartbeat.get(); + + ParkingLotDataVO parkingLotDataVO = new ParkingLotDataVO(); + + int parkingNum = heartbeat.getSpaceCount() - heartbeat.getFreeSpaceCount(); + int residualStopNum = heartbeat.getSpaceCount() - parkingNum ; + + //车辆进出实时数据 + parkingLotDataVO.setParkingNum(parkingNum);//实时停车数 + parkingLotDataVO.setResidualStopNum(residualStopNum);//剩余车位数 + + // 获取今天的日期 + LocalDate today = LocalDate.now(); + // 计算今天的起始时间和结束时间 + LocalDateTime startOfDay = LocalDateTime.of(today, LocalTime.MIN); + LocalDateTime endOfDay = LocalDateTime.of(today, LocalTime.MAX); + List entryRecords = entryRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay); + parkingLotDataVO.setIntoNum(entryRecords.size());//车辆进入数 + List appearanceRecords = appearanceRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay); + parkingLotDataVO.setOutNum(appearanceRecords.size());//车辆出入数 + + //今日车位统计 + parkingLotDataVO.setTotalParkingSpace(heartbeat.getSpaceCount());//车位总数 + parkingLotDataVO.setResidualTotal(residualStopNum);//余位总数 + // 计算利用率 + int useRatio = (parkingNum / residualStopNum) * 100; + parkingLotDataVO.setUseRatio(useRatio);//总利用率 + + //设置区域停车场数据 + for (int i = 0; i < heartbeat.getAreaList().size(); i++) { + AreaDataVO areaDataVO = new AreaDataVO(); + areaDataVO.setAreaName(heartbeat.getAreaList().get(i).getAreaName()); + areaDataVO.setParkingCount(heartbeat.getAreaList().get(i).getSpaceCount()); + areaDataVO.setLastSpaceCount(heartbeat.getAreaList().get(i).getLastSpaceCount()); + areaDataVO.setUseRatio((heartbeat.getAreaList().get(i).getLastSpaceCount() / heartbeat.getAreaList().get(i).getSpaceCount()) * 100); + parkingLotDataVO.getAreaDataVOList().add(areaDataVO); + } + + return ResponseVO.success(200,"",parkingLotDataVO,0); + } + return ResponseVO.error(500,""); + } + + + //车辆进出趋势数据 + @GetMapping("/tendencyChart") + public ResponseVO tendencyChart(){ + + ParkingLotDataVO parkingLotDataVO = new ParkingLotDataVO(); + + LocalDate today = LocalDate.now(); + LocalDateTime startOfDay = LocalDateTime.of(today, LocalTime.MIN); + LocalDateTime endOfDay = LocalDateTime.of(today, LocalTime.MAX); + //进入数据 + List entryRecordList = entryRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay); + //出入数据 + List appearanceRecordList = appearanceRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay); + + + int count = 0; + int count1 = 0; + int count2 = 0; + int count3 = 0; + int count4 = 0; + int count5 = 0; + int count6 = 0; + LocalDateTime startTime1 = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime1 = LocalDateTime.now().withHour(3).withMinute(59).withSecond(59).withNano(999999999); + LocalDateTime startTime2 = LocalDateTime.now().withHour(4).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime2 = LocalDateTime.now().withHour(7).withMinute(59).withSecond(59).withNano(999999999); + LocalDateTime startTime3 = LocalDateTime.now().withHour(8).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime3 = LocalDateTime.now().withHour(11).withMinute(59).withSecond(59).withNano(999999999); + LocalDateTime startTime4 = LocalDateTime.now().withHour(12).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime4 = LocalDateTime.now().withHour(15).withMinute(59).withSecond(59).withNano(999999999); + LocalDateTime startTime5 = LocalDateTime.now().withHour(16).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime5 = LocalDateTime.now().withHour(19).withMinute(59).withSecond(59).withNano(999999999); + LocalDateTime startTime6 = LocalDateTime.now().withHour(20).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime6 = LocalDateTime.now().withHour(23).withMinute(59).withSecond(59).withNano(999999999); + + for (int i = 0; i < entryRecordList.size(); i++) { + EntryRecord entryRecord = entryRecordList.get(i); + + if (entryRecord.getCreateTime().isAfter(startTime1) && entryRecord.getCreateTime().isBefore(endTime1)){ + count1++; + continue; + } + if (entryRecord.getCreateTime().isAfter(startTime2) && entryRecord.getCreateTime().isBefore(endTime2)){ + count2++; + continue; + } + if (entryRecord.getCreateTime().isAfter(startTime3) && entryRecord.getCreateTime().isBefore(endTime3)){ + count3++; + continue; + } + if (entryRecord.getCreateTime().isAfter(startTime4) && entryRecord.getCreateTime().isBefore(endTime4)){ + count4++; + continue; + } + if (entryRecord.getCreateTime().isAfter(startTime5) && entryRecord.getCreateTime().isBefore(endTime5)){ + count5++; + continue; + } + if (entryRecord.getCreateTime().isAfter(startTime6) && entryRecord.getCreateTime().isBefore(endTime6)){ + count6++; + } + } + parkingLotDataVO.getIntoCount().add(count); + parkingLotDataVO.getIntoCount().add(count1); + parkingLotDataVO.getIntoCount().add(count2); + parkingLotDataVO.getIntoCount().add(count3); + parkingLotDataVO.getIntoCount().add(count4); + parkingLotDataVO.getIntoCount().add(count5); + parkingLotDataVO.getIntoCount().add(count6); + count1 = 0; + count2 = 0; + count3 = 0; + count4 = 0; + count5 = 0; + count6 = 0; + + + for (int i = 0; i < appearanceRecordList.size(); i++) { + AppearanceRecord appearanceRecord = appearanceRecordList.get(i); + + if (appearanceRecord.getCreateTime().isAfter(startTime1) && appearanceRecord.getCreateTime().isBefore(endTime1)){ + count1++; + continue; + } + if (appearanceRecord.getCreateTime().isAfter(startTime2) && appearanceRecord.getCreateTime().isBefore(endTime2)){ + count2++; + continue; + } + if (appearanceRecord.getCreateTime().isAfter(startTime3) && appearanceRecord.getCreateTime().isBefore(endTime3)){ + count3++; + continue; + } + if (appearanceRecord.getCreateTime().isAfter(startTime4) && appearanceRecord.getCreateTime().isBefore(endTime4)){ + count4++; + continue; + } + if (appearanceRecord.getCreateTime().isAfter(startTime5) && appearanceRecord.getCreateTime().isBefore(endTime5)){ + count5++; + continue; + } + if (appearanceRecord.getCreateTime().isAfter(startTime6) && appearanceRecord.getCreateTime().isBefore(endTime6)){ + count6++; + } + } + parkingLotDataVO.getOutCount().add(count); + parkingLotDataVO.getOutCount().add(count1); + parkingLotDataVO.getOutCount().add(count2); + parkingLotDataVO.getOutCount().add(count3); + parkingLotDataVO.getOutCount().add(count4); + parkingLotDataVO.getOutCount().add(count5); + parkingLotDataVO.getOutCount().add(count6); + + return ResponseVO.success(200,"",parkingLotDataVO,0); + } + + + //车辆出入实时记录图 + @GetMapping("/recordOfAccess") + public ResponseVO recordOfAccess(int page){ + + // 获取今天的日期 + LocalDate today = LocalDate.now(); + LocalDateTime startOfDay = LocalDateTime.of(today, LocalTime.MIN); + LocalDateTime endOfDay = LocalDateTime.of(today, LocalTime.MAX); + + long total = vehicleRecordRepository.countByCreateTimeBetween(startOfDay, endOfDay); + + // 创建分页请求 + Pageable pageable = PageRequest.of(page, 4); + Page recordOfAccessList = vehicleRecordRepository.findByCreateTimeBetweenOrderByCreateTimeAsc(startOfDay, endOfDay, pageable); + + return ResponseVO.success(200,"",recordOfAccessList,total); + } + + + //车辆营收统计 + @GetMapping("/revenue") + public ResponseVO revenue(String date,String areaName){ + + List revenueList; + + LocalDateTime startOfDay = null; + LocalDateTime endOfDay = null; + + + if (date.equals("今日")){ + // 获取今天的日期 + LocalDate today = LocalDate.now(); + startOfDay = LocalDateTime.of(today, LocalTime.MIN); + endOfDay = LocalDateTime.of(today, LocalTime.MAX); + } + if (date.equals("近一周")){ + endOfDay = LocalDateTime.now(); // 结束时间为当前时间 + startOfDay = endOfDay.minusDays(7); // 开始时间为当前时间的前7天 + + } + if (date.equals("近一月")){ + endOfDay = LocalDateTime.now(); // 结束时间为当前时间 + startOfDay = endOfDay.minusMonths(1); // 开始时间为当前时间的前一个月 + } + + if (areaName.equals("全部")){ + revenueList = revenueRepository.findByCreateTimeBetween(startOfDay, endOfDay); + }else { + revenueList = revenueRepository.findByCreateTimeAndAreaName(startOfDay, endOfDay, areaName); + } + + // 声明 BigDecimal 对象来保存金额 + BigDecimal sum = BigDecimal.ZERO; + BigDecimal zfb = BigDecimal.ZERO; + BigDecimal wx = BigDecimal.ZERO; + BigDecimal yl = BigDecimal.ZERO; + BigDecimal xj = BigDecimal.ZERO; + BigDecimal gjk = BigDecimal.ZERO; + + // 循环计算金额 + for (int i = 0; i < revenueList.size(); i++) { + Revenue revenue = revenueList.get(i); + BigDecimal charge = new BigDecimal(revenue.getPayCharge()); + if (revenue.getPayKind().equals("现金")){ + xj = xj.add(charge); + } else if (revenue.getPayKind().equals("微信")){ + wx = wx.add(charge); + } else if (revenue.getPayKind().equals("支付宝")){ + zfb = zfb.add(charge); + } else if (revenue.getPayKind().equals("银联")){ + yl = yl.add(charge); + } else if (revenue.getPayKind().equals("公交卡")){ + gjk = gjk.add(charge); + } + } + + // 计算总和 + sum = sum.add(xj).add(wx).add(zfb).add(yl).add(gjk); + + RevenueVO revenueVO = new RevenueVO(); + revenueVO.setSum(sum); + revenueVO.setGjk(gjk); + revenueVO.setWx(wx); + revenueVO.setXj(xj); + revenueVO.setYl(yl); + revenueVO.setZfb(zfb); + + + + return ResponseVO.success(200,"",revenueVO ,0); + } + + + //预警信息栏 + @GetMapping("/warning_information_bar") + public ResponseVO warningInformation(){ + return ResponseVO.success(200,"今日实时客流人数125,同比上月实时人数提升12%。今日车辆数量135,同比上月实时人数提升13%。今日沿海阵风3级.....",null ,0); + } + + + + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordCarInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordCarInfoVo.java new file mode 100644 index 000000000..d01551da0 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordCarInfoVo.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordCarInfoVo { + private String plate; + private String plateColor; + private String ticketCode; + private String carType; + private Integer confidence; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeListVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeListVo.java new file mode 100644 index 000000000..a451afb26 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeListVo.java @@ -0,0 +1,13 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordChargeListVo { + private String payNo; + private String getTime; + private String payCharge; + private String payKind; + private String payChannel; + private String memo; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeStatisticsVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeStatisticsVo.java new file mode 100644 index 000000000..e752e6391 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeStatisticsVo.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordChargeStatisticsVo { + private String charge; + private String onLineCharge; + private String offLineCharge; + private String profitChargeTotal; + private String onLineProfitChargeNum; + private String onLineProfitChargeValue; + private String offLineProfitChargeNum; + private String offLineProfitChargeValue; + private String onLineProfitTimeNum; + private String onLineProfitTimeValue; + private String offLineProfitTimeNum; + private String offLineProfitTimeValue; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPassInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPassInfoVo.java new file mode 100644 index 000000000..e22d1c7a8 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPassInfoVo.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordPassInfoVo { + private String inTime; + private String outTime;//出场时间 + private String inImage; + private String outImage; + private String inChannel; + private String outChannel; + private String openGateMode; + private String matchMode; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPlaceInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPlaceInfoVo.java new file mode 100644 index 000000000..66b21c3ec --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPlaceInfoVo.java @@ -0,0 +1,11 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordPlaceInfoVo { + private String areaId; + private String areaName; + private String placeNumber; + private String memo; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordProfitListVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordProfitListVo.java new file mode 100644 index 000000000..cccc43e47 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordProfitListVo.java @@ -0,0 +1,13 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordProfitListVo { + private String profitCode; + private String getTime; + private String profitTime; + private String profitCharge; + private String profitChargeValue; + private String memo; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordUserInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordUserInfoVo.java new file mode 100644 index 000000000..52018478d --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordUserInfoVo.java @@ -0,0 +1,8 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordUserInfoVo { + private String idCard; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordVo.java new file mode 100644 index 000000000..7297bafcb --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordVo.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +import java.util.ArrayList; + +@Data +public class AppearanceRecordVo { + private String orderId; + private String operatorId; + private String operatorName; + private String invoiceNo; + private AppearanceRecordCarInfoVo carInfo; + private AppearanceRecordUserInfoVo userInfo; + private AppearanceRecordPassInfoVo passInfo; + private AppearanceRecordChargeStatisticsVo chargeStatistics; + private ArrayList chargeList; + private ArrayList profitList; + private ArrayList placeInfo; + private String costTime; + private String plate; + private String plateColor; + private String ticketCode; + private String carType; + private Integer confidence; +} + diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AreaDataVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AreaDataVO.java new file mode 100644 index 000000000..ccc93005a --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AreaDataVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AreaDataVO { + + //区域停车场名称 + private String areaName; + + //区域停车总数 + private int parkingCount; + + //区域余位总数 + private int lastSpaceCount; + + //区域利用率 + private int useRatio; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/BlueCardHeartbeatVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/BlueCardHeartbeatVo.java new file mode 100644 index 000000000..09fb9594b --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/BlueCardHeartbeatVo.java @@ -0,0 +1,13 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class BlueCardHeartbeatVo { + private String areaName; + private Integer spaceCount; + private Integer lastSpaceCount; + private Integer bookSpaceCount; + private Integer bookInParkCount; + private Integer areaId; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordPlaceInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordPlaceInfoVo.java new file mode 100644 index 000000000..b9a8f7121 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordPlaceInfoVo.java @@ -0,0 +1,11 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class EntryRecordPlaceInfoVo { + private String areaId; + private String areaName; + private String placeNumber; + private String memo; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordUserInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordUserInfoVo.java new file mode 100644 index 000000000..ee5e13e8a --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordUserInfoVo.java @@ -0,0 +1,11 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class EntryRecordUserInfoVo { + private String idCard; + private String userName; + private String phone; + private String address; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordVo.java new file mode 100644 index 000000000..3125e0531 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordVo.java @@ -0,0 +1,26 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +import java.util.ArrayList; + +@Data +public class EntryRecordVo { + private String plate; + private String ticketCode; + private String plateColor; + private String inTime;//入场时间 + private String inChannel; + private String inImage; + private String orderId; + private String visitReason; + private String openGateMode; + private String matchMode; + private String idCard; + private Integer confidence; + private String carType; + private EntryRecordUserInfoVo userInfo; + private ArrayList placeInfo; + private String barriorOpen; + private String costTime; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/ParkingLotDataVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/ParkingLotDataVO.java new file mode 100644 index 000000000..39765355a --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/ParkingLotDataVO.java @@ -0,0 +1,47 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +/** + * 停车场数据 + */ +public class ParkingLotDataVO { + + //实时停车数 + private int parkingNum; + + //剩余停车位 + private int residualStopNum; + + //车辆进入数 + private int intoNum; + + //车辆出入数 + private int outNum; + + //车位总数 + private int totalParkingSpace; + + //余位总数 + private int residualTotal; + + //总利用率 + private int useRatio; + + //区域停车场数据集合 + private List areaDataVOList = new ArrayList<>(); + + //车辆进出趋势时间 + private String[] timeList; + + //车辆进出趋势进入车辆数量集合 + private List intoCount = new ArrayList<>(); + + //车辆进出趋势出入车辆数量集合 + private List outCount = new ArrayList<>(); + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/RevenueVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/RevenueVO.java new file mode 100644 index 000000000..ebf414630 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/RevenueVO.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 车辆营收统计数据 + */ +@Data +public class RevenueVO { + + //支付宝 + private BigDecimal zfb; + + //微信 + private BigDecimal wx; + + //银联 + private BigDecimal yl; + + //现金 + private BigDecimal xj; + + //公交卡 + private BigDecimal gjk; + + //总金额 + private BigDecimal sum; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/weather/WeatherApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/weather/WeatherApi.java index 56a70e176..4ab12caab 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/weather/WeatherApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/weather/WeatherApi.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.datacenter.controller.admin.weather; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.datacenter.controller.admin.weather.vo.WeatherInfoVO; import cn.iocoder.yudao.module.datacenter.utlis.GoodWeatherUtil; +import cn.iocoder.yudao.module.datacenter.utlis.ResponseVO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; @@ -15,14 +16,14 @@ import org.springframework.web.bind.annotation.RestController; */ @Tag(name = "大屏服务 - 天气接口") @RestController -@RequestMapping("/h5/weather") +@RequestMapping("/datacenter/h5/weather") @Validated public class WeatherApi { @GetMapping(value = "/getWeather") @Operation(summary = "获得输入城市的天气") - public CommonResult getWeather(String cityCode) { + public ResponseVO getWeather(String cityCode) { String weatherData = GoodWeatherUtil.getWeatherData(cityCode); WeatherInfoVO weatherInfo = GoodWeatherUtil.GetWeather(weatherData); - return CommonResult.success(weatherInfo); + return new ResponseVO(200,"",weatherInfo,0); } } diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AccessRecordPicture.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AccessRecordPicture.java new file mode 100644 index 000000000..18f7d160e --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AccessRecordPicture.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import lombok.Data; +import org.springframework.data.mongodb.core.mapping.Document; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@Document("access_record_picture") +@Data +@XmlRootElement(name = "root") +@XmlAccessorType(XmlAccessType.FIELD) +public class AccessRecordPicture { + @XmlElement + private String id; + @XmlElement + private String parkNumber; + @XmlElement + private String imageName; + @XmlElement + private String image; + @XmlElement + private String imgAddress; + @XmlElement + private byte[] resource; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AppearanceRecord.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AppearanceRecord.java new file mode 100644 index 000000000..dae5ddc93 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AppearanceRecord.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.AppearanceRecordVo; +import lombok.Data; +import org.springframework.data.mongodb.core.index.Indexed; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.time.LocalDateTime; +import java.util.ArrayList; + +@Document("appearance_record") +@Data +public class AppearanceRecord { + private String id; + private String parkNumber; + private Integer size; + @Indexed + private LocalDateTime createTime; + private ArrayList datas; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/BlueCardHeartbeat.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/BlueCardHeartbeat.java new file mode 100644 index 000000000..04524ead7 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/BlueCardHeartbeat.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.BlueCardHeartbeatVo; +import lombok.Data; +import org.springframework.data.mongodb.core.index.Indexed; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.time.LocalDateTime; +import java.util.ArrayList; + +@Document("blue_card_heartbeat") +@Data +public class BlueCardHeartbeat { + private String id; + private String parkNumber; + private String parkName; + private Integer spaceCount;//场库总车位数 + private Integer freeSpaceCount;//场库空车位数 + private Integer bookSpaceCount; + private Integer bookInParkCount; + @Indexed + private LocalDateTime createTime; + private ArrayList areaList; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/EntryRecord.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/EntryRecord.java new file mode 100644 index 000000000..12b4463d5 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/EntryRecord.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.EntryRecordVo; +import lombok.Data; +import org.springframework.data.mongodb.core.index.Indexed; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.time.LocalDateTime; +import java.util.ArrayList; + +@Document("entry_record") +@Data +public class EntryRecord { + private String id; + private String parkNumber; + private Integer size; + @Indexed + private LocalDateTime createTime; + private ArrayList datas; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/Revenue.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/Revenue.java new file mode 100644 index 000000000..985469171 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/Revenue.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import lombok.Data; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.time.LocalDateTime; + +/** + * 车辆营收数据 + */ +@Data +@Document("revenue") +public class Revenue { + private String id; + private String plate;//车牌 + private String getTime;//结算时间 + private String payCharge;//支付金额 + private String PayKind;//支付类型 + private String areaName;//停车所在区域 + private String memo;//备注 + private LocalDateTime createTime; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/VehicleRecord.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/VehicleRecord.java new file mode 100644 index 000000000..99f8f14b7 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/VehicleRecord.java @@ -0,0 +1,31 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import lombok.Data; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.time.LocalDateTime; + +/** + *车辆进出记录数据 + */ +@Data +@Document("vehicle_record") +public class VehicleRecord { + + private String id; + + //进出 + private String intoOrOut; + + //车牌号 + private String licenseNumber; + + //时间 + private String time; + + //图片 + private String picture; + + private LocalDateTime createTime; + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AccessRecordPictureRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AccessRecordPictureRepository.java new file mode 100644 index 000000000..cf84cd04a --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AccessRecordPictureRepository.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.AccessRecordPicture; +import org.springframework.data.mongodb.repository.MongoRepository; + +import java.util.List; + +public interface AccessRecordPictureRepository extends MongoRepository { + + // 根据给定的 imageName 数组查询记录 + List findByImageNameIn(List imageNames); + + AccessRecordPicture findByImageName(String imageName); + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AppearanceRecordRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AppearanceRecordRepository.java new file mode 100644 index 000000000..eabb3af6f --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AppearanceRecordRepository.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.AppearanceRecord; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.data.mongodb.repository.Query; + +import java.time.LocalDateTime; +import java.util.List; + +public interface AppearanceRecordRepository extends MongoRepository { + + @Query("{'createTime': {$gte: ?0, $lte: ?1}}") + List findByCreateTimeBetween (LocalDateTime startOfDay, LocalDateTime endOfDay); + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/BlueCardHeartbeatRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/BlueCardHeartbeatRepository.java new file mode 100644 index 000000000..7a93b3fa5 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/BlueCardHeartbeatRepository.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.BlueCardHeartbeat; +import org.springframework.data.mongodb.repository.MongoRepository; + +import java.util.Optional; + +public interface BlueCardHeartbeatRepository extends MongoRepository { + + + Optional findTopByOrderByCreateTimeDesc(); + + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/EntryRecordRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/EntryRecordRepository.java new file mode 100644 index 000000000..f6fb5d538 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/EntryRecordRepository.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.EntryRecord; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.data.mongodb.repository.Query; + +import java.time.LocalDateTime; +import java.util.List; + +public interface EntryRecordRepository extends MongoRepository { + + @Query("{ 'createTime' : { $gte: ?0, $lt: ?1 } }") + List findByCreateTimeBetween(LocalDateTime startDate, LocalDateTime endDate); + + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/RevenueRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/RevenueRepository.java new file mode 100644 index 000000000..3f55b1d81 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/RevenueRepository.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.Revenue; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.data.mongodb.repository.Query; + +import java.time.LocalDateTime; +import java.util.List; + +public interface RevenueRepository extends MongoRepository { + @Query("{'createTime': {$gte: ?0, $lte: ?1}}") + List findByCreateTimeBetween (LocalDateTime startOfDay, LocalDateTime endOfDay); + + @Query(value = "{ 'areaName': { $regex: ?2, $options: 'i' }, 'createTime': { $gte: ?0, $lte: ?1 } }") + List findByCreateTimeAndAreaName(LocalDateTime startTime, LocalDateTime endTime, String areaName); +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/VehicleRecordRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/VehicleRecordRepository.java new file mode 100644 index 000000000..2bb78e84c --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/VehicleRecordRepository.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.VehicleRecord; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.data.mongodb.repository.Query; + +import java.time.LocalDateTime; +import java.util.List; + +public interface VehicleRecordRepository extends MongoRepository { + + @Query("{ 'createTime' : { $gte: ?0, $lt: ?1 } }") + List findByCreateTimeBetween(LocalDateTime startDate, LocalDateTime endDate); + + // 根据时间字段查询今天的数据,并根据时间排序并分页 + Page findByCreateTimeBetweenOrderByCreateTimeAsc(LocalDateTime startOfDay, LocalDateTime endOfDay, Pageable pageable); + + // 根据 createTime 字段查询今天的数据条数 + long countByCreateTimeBetween(LocalDateTime startOfDay, LocalDateTime endOfDay); +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/ResponseVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/ResponseVO.java new file mode 100644 index 000000000..57b9edda3 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/ResponseVO.java @@ -0,0 +1,68 @@ +package cn.iocoder.yudao.module.datacenter.utlis; + +import lombok.Data; + +@Data +public class ResponseVO { + + int code;// 返回编码 + String msg;// 返回消息 + Object data;// 返回数据 + long total; + + + public ResponseVO(int code, String msg, Object data, long total) { + this.code = code; + this.msg = msg; + this.data = data; + this.total = total; + } + + public ResponseVO(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public static ResponseVO success(int code,String msg, Object data,long total) { + + return new ResponseVO(code,msg,data,total); + } + + public static ResponseVO error(int code,String msg) { + ResponseVO serverRsp = new ResponseVO(code,msg); + serverRsp.setMsg(msg); + return serverRsp; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } + + public long getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } +} -- 2.45.2 From 6b9fe3874b8fc45e91fad7471eeee038648ba2f5 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Fri, 16 Aug 2024 13:51:34 +0800 Subject: [PATCH 5/9] =?UTF-8?q?nacos=E8=BF=98=E5=8E=9F=E4=B8=BA=E7=BA=BF?= =?UTF-8?q?=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap-local.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml index 2de0efbf7..12c520cd9 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml @@ -3,7 +3,7 @@ spring: cloud: nacos: - server-addr: 127.0.0.1:8848 + server-addr: crm.fjptzykj.com:8849 discovery: namespace: dev # 命名空间。这里使用 dev 开发环境 metadata: @@ -16,7 +16,7 @@ spring: nacos: # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 config: - server-addr: 127.0.0.1:8848 # Nacos 服务器地址 + server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址 namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name -- 2.45.2 From 90ecdcfffe16471147e5e38b22cbce70c2b2fb76 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Fri, 16 Aug 2024 14:25:35 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E7=A5=A8=E5=8A=A1mongodb=E6=8A=BD=E6=95=B0?= =?UTF-8?q?=E4=B8=8A=E4=B8=AA=E6=9C=88=E5=88=B0=E4=BB=8A=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job/ticketing/TicketDataMigration.java | 119 +++++++++++++++++- 1 file changed, 117 insertions(+), 2 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/job/ticketing/TicketDataMigration.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/job/ticketing/TicketDataMigration.java index 22f6143f4..b9b08b472 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/job/ticketing/TicketDataMigration.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/job/ticketing/TicketDataMigration.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.infra.job.ticketing; +import cn.hutool.core.date.DatePattern; import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONUtil; import cn.iocoder.yudao.framework.common.util.date.TickingDateUtils; @@ -26,6 +27,9 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; import java.util.List; import java.util.Map; @@ -190,6 +194,114 @@ public class TicketDataMigration { XxlJobHelper.log("抽数服务:检票数据抽数正常结束!总共:{}条数据,{}条数据重复,{}条数据插入成功!", totalRows, duplicatesCount, successCount); } + @XxlJob("getCheckTicketByMongoDBLastMonthToNow") + public void getCheckTicketByMongoDBLastMonthToNow() throws Exception { + XxlJobHelper.log("抽数服务:mongodb检票数据开始抽数..."); + + int successCount; + int duplicatesCount; + int pageNumber; + // 获取当前日期 + Calendar startDate = Calendar.getInstance(); + // 设置开始日期为上一个月的第一天 + startDate.set(Calendar.DAY_OF_MONTH, 1); // 先将日期设置为当前月的第一天 + startDate.add(Calendar.MONTH, -1); // 然后减去一个月 + + // 设置结束日期为今天 + Calendar endDate = Calendar.getInstance(); + + // 循环从开始日期到结束日期 + while (!startDate.after(endDate)) { + successCount = 0; + duplicatesCount = 0; + String dateString = TickingDateUtils.format(startDate.getTime()); + pageNumber = 1; + TicketingSamplingRespVO ticketingSamplingRespVO = this.getUrlResponseData(CHECK_TICKET_SERVICE, CHECK_TICKET_METHOD, dateString, pageNumber); + if (ticketingSamplingRespVO == null) { + startDate.add(Calendar.DAY_OF_MONTH, 1); + continue; + } + int totalRows = ticketingSamplingRespVO.getTotalRows(); + List> mapList; + + // 获得总页数 + int totalPages = ticketingSamplingRespVO.getTotalPages(); + + // 处理剩余页的数据 + for (; pageNumber <= totalPages; pageNumber++) { + ticketingSamplingRespVO = this.getUrlResponseData(CHECK_TICKET_SERVICE, CHECK_TICKET_METHOD, dateString, pageNumber); + mapList = ticketingSamplingRespVO.getDataMapList(); + List resultNum = checkTicketService.insertByMongoDB(BeanUtils.toBean(mapList, CheckTicket.class)); + + if (resultNum == null) { + XxlJobHelper.log("数据批量插入异常!", pageNumber); + } else { + successCount += resultNum.get(0); + duplicatesCount += resultNum.get(1); + } + } + int currentMonth = startDate.get(Calendar.MONTH) + 1; // 加1以得到1-12的月份 + int currentDay = startDate.get(Calendar.DAY_OF_MONTH); + XxlJobHelper.log("抽数服务:{}月{}日:检票数据抽数正常结束!总共:{}条数据,{}条数据重复,{}条数据插入成功!",currentMonth,currentDay ,totalRows, duplicatesCount, successCount); + // 日期递增一天 + startDate.add(Calendar.DAY_OF_MONTH, 1); + } + XxlJobHelper.log("抽数结束!!!"); + } + @XxlJob("getSaleDataByMongoDBLastMonthToNow") + public void getSaleDataByMongoDBLastMonthToNow() throws Exception { + XxlJobHelper.log("抽数服务:mongodb售票数据开始抽数..."); + + int successCount; + int duplicatesCount; + int pageNumber; + // 获取当前日期 + Calendar startDate = Calendar.getInstance(); + // 设置开始日期为上一个月的第一天 + startDate.set(Calendar.DAY_OF_MONTH, 1); // 先将日期设置为当前月的第一天 + startDate.add(Calendar.MONTH, -1); // 然后减去一个月 + + // 设置结束日期为今天 + Calendar endDate = Calendar.getInstance(); + + // 循环从开始日期到结束日期 + while (!startDate.after(endDate)) { + successCount = 0; + duplicatesCount = 0; + String dateString = TickingDateUtils.format(startDate.getTime()); + pageNumber = 1; + TicketingSamplingRespVO ticketingSamplingRespVO = this.getUrlResponseData(SALE_DATA_SERVICE, SALE_DATA_METHOD, dateString, pageNumber); + if (ticketingSamplingRespVO == null) { + startDate.add(Calendar.DAY_OF_MONTH, 1); + continue; + } + int totalRows = ticketingSamplingRespVO.getTotalRows(); + List> mapList; + + // 获得总页数 + int totalPages = ticketingSamplingRespVO.getTotalPages(); + + // 处理剩余页的数据 + for (; pageNumber <= totalPages; pageNumber++) { + ticketingSamplingRespVO = this.getUrlResponseData(SALE_DATA_SERVICE, SALE_DATA_METHOD, dateString, pageNumber); + mapList = ticketingSamplingRespVO.getDataMapList(); + List resultNum = saleDataService.insertByMongoDB(BeanUtils.toBean(mapList, SaleData.class)); + + if (resultNum == null) { + XxlJobHelper.log("数据批量插入异常!", pageNumber); + } else { + successCount += resultNum.get(0); + duplicatesCount += resultNum.get(1); + } + } + int currentMonth = startDate.get(Calendar.MONTH) + 1; // 加1以得到1-12的月份 + int currentDay = startDate.get(Calendar.DAY_OF_MONTH); + XxlJobHelper.log("抽数服务:{}月{}日:售票数据抽数正常结束!总共:{}条数据,{}条数据重复,{}条数据插入成功!",currentMonth,currentDay ,totalRows, duplicatesCount, successCount); + // 日期递增一天 + startDate.add(Calendar.DAY_OF_MONTH, 1); + } + XxlJobHelper.log("抽数结束!!!"); + } /** * 插入销售数据的方法(mysql) * @@ -262,9 +374,12 @@ public class TicketDataMigration { // TODO 需要再优化 if (ticketingSamplingRespVO != null && !ticketingSamplingRespVO.isPassflag()) { // 让调度中心重新调用 - XxlJobHelper.log("抽数服务:检票数据抽数失败,返回消息:" + ticketingSamplingRespVO.getRtnMsg()); - XxlJobHelper.handleFail("销售数据抽数失败,请重试"); + XxlJobHelper.log("数据抽数失败,返回消息:" + ticketingSamplingRespVO.getRtnMsg()); + XxlJobHelper.handleFail("数据抽数失败,请重试"); throw new RuntimeException(); + }else if (ticketingSamplingRespVO.getPageNumber() == null || ticketingSamplingRespVO.getPageSize() == null || ticketingSamplingRespVO.getTotalPages() == null || ticketingSamplingRespVO.getTotalRows() == null || ticketingSamplingRespVO.getDataMapList().isEmpty()){ + XxlJobHelper.log("{},请求抽数成功,但返回参数值存在问题:{}", date, ticketingSamplingRespVO); + return null; } return ticketingSamplingRespVO; } -- 2.45.2 From 088fd9df0f07ac10c06ea87a97c16734d91d188c Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Fri, 16 Aug 2024 17:42:40 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E5=81=9C=E8=BD=A6=E5=9C=BA=E5=90=8E?= =?UTF-8?q?=E5=8F=B0-=E5=BF=83=E8=B7=B3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/area/AreaController.java | 4 ++-- .../admin/area/vo/AreaPageReqVO.java | 3 +++ .../parking/dal/mysql/area/AreaMapper.java | 8 ++++++-- .../parking/service/area/AreaService.java | 9 +++++---- .../parking/service/area/AreaServiceImpl.java | 20 +++++++++++++------ .../heartbeat/HeartbeatServiceImpl.java | 7 +++---- 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/AreaController.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/AreaController.java index 0b2f3fada..fefcd1da6 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/AreaController.java +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/AreaController.java @@ -57,7 +57,7 @@ public class AreaController { @Operation(summary = "删除区域列表") @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('parking:area:delete')") - public CommonResult deleteArea(@RequestParam("id") Integer id) { + public CommonResult deleteArea(@RequestParam("id") Long id) { areaService.deleteArea(id); return success(true); } @@ -66,7 +66,7 @@ public class AreaController { @Operation(summary = "获得区域列表") @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('parking:area:query')") - public CommonResult getArea(@RequestParam("id") Integer id) { + public CommonResult getArea(@RequestParam("id") Long id) { AreaDO area = areaService.getArea(id); return success(BeanUtils.toBean(area, AreaRespVO.class)); } diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaPageReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaPageReqVO.java index a789186d3..e0d031666 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaPageReqVO.java +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/area/vo/AreaPageReqVO.java @@ -15,6 +15,9 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @ToString(callSuper = true) public class AreaPageReqVO extends PageParam { + @Schema(description = "区域Id", example = "27272") + private Integer areaId; + @Schema(description = "场库编号") private String parkNumber; diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/area/AreaMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/area/AreaMapper.java index ef506e92a..c7fe27ea2 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/area/AreaMapper.java +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/area/AreaMapper.java @@ -6,8 +6,10 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.module.parking.dal.dataobject.area.AreaDO; +import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import cn.iocoder.yudao.module.parking.controller.admin.area.vo.*; +import org.apache.ibatis.annotations.Param; /** * 区域列表 Mapper @@ -26,7 +28,9 @@ public interface AreaMapper extends BaseMapperX { .eqIfPresent(AreaDO::getBookSpaceCount, reqVO.getBookSpaceCount()) .eqIfPresent(AreaDO::getBookInParkCount, reqVO.getBookInParkCount()) .betweenIfPresent(AreaDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(AreaDO::getAreaId)); + .eqIfPresent(AreaDO::getAreaId, reqVO.getAreaId()) + .orderByDesc(AreaDO::getId)); } - + @Delete("DELETE FROM `area` WHERE `park_number` = #{parkNumber}") + int physicalDeleteByParkNumber(@Param("parkNumber") String parkNumber); } \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaService.java index 355dc4239..f8cb49e08 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaService.java +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaService.java @@ -41,7 +41,7 @@ public interface AreaService { * * @param id 编号 */ - void deleteArea(Integer id); + void deleteArea(Long id); /** * 获得区域列表 @@ -49,7 +49,7 @@ public interface AreaService { * @param id 编号 * @return 区域列表 */ - AreaDO getArea(Integer id); + AreaDO getArea(Long id); /** * 获得区域列表分页 @@ -59,10 +59,11 @@ public interface AreaService { */ PageResult getAreaPage(AreaPageReqVO pageReqVO); + /** - * 创建或更新区域(批量) + * 根据场库编号创建或更新区域(批量) * @param areaList * @return java.lang.Boolean */ - Boolean createOrUpdateAreaBatch(ArrayList areaList); + Boolean updateAreaBatchByParkNumber(ArrayList areaList); } \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaServiceImpl.java index fd93f4aa3..f6d30dcfd 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaServiceImpl.java +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/area/AreaServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.parking.service.area; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import org.springframework.stereotype.Service; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -48,28 +49,28 @@ public class AreaServiceImpl implements AreaService { @Override public void updateArea(AreaSaveReqVO updateReqVO) { // 校验存在 - validateAreaExists(updateReqVO.getAreaId()); + validateAreaExists(updateReqVO.getId()); // 更新 AreaDO updateObj = BeanUtils.toBean(updateReqVO, AreaDO.class); areaMapper.updateById(updateObj); } @Override - public void deleteArea(Integer id) { + public void deleteArea(Long id) { // 校验存在 validateAreaExists(id); // 删除 areaMapper.deleteById(id); } - private void validateAreaExists(Integer id) { + private void validateAreaExists(Long id) { if (areaMapper.selectById(id) == null) { throw exception(AREA_NOT_EXISTS); } } @Override - public AreaDO getArea(Integer id) { + public AreaDO getArea(Long id) { return areaMapper.selectById(id); } @@ -79,8 +80,15 @@ public class AreaServiceImpl implements AreaService { } @Override - public Boolean createOrUpdateAreaBatch(ArrayList areaList) { - return areaMapper.insertOrUpdateBatch(BeanUtils.toBean(areaList, AreaDO.class)); + @Transactional(rollbackFor = Exception.class) + public Boolean updateAreaBatchByParkNumber(ArrayList areaList) { + if (areaList == null || areaList.isEmpty()){ + return false; + } + areaMapper.physicalDeleteByParkNumber(areaList.get(0).getParkNumber()); + areaMapper.insertBatch(BeanUtils.toBean(areaList, AreaDO.class)); + return true; } + } \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatServiceImpl.java index de337778d..23b136b41 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatServiceImpl.java +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/heartbeat/HeartbeatServiceImpl.java @@ -85,7 +85,7 @@ public class HeartbeatServiceImpl implements HeartbeatService { } @Override - @Transactional + @Transactional(rollbackFor = Exception.class) public BlueCardResult doHeartbeat(HeartbeatReqDataVO blueCardHeartbeat) { try { ArrayList areaList = blueCardHeartbeat.getAreaList(); @@ -104,9 +104,8 @@ public class HeartbeatServiceImpl implements HeartbeatService { if (!areaList.isEmpty()){ // 对区域都添加停车场库编号 areaList.forEach(item -> item.setParkNumber(blueCardHeartbeat.getParkNumber())); - // 写入区域信息 - // TODO 判断重复及处理方式 - areaService.createOrUpdateAreaBatch(areaList); + // 更新区域信息 + areaService.updateAreaBatchByParkNumber(areaList); } } catch (Exception e) { // 手动设置回滚 -- 2.45.2 From e1a3b531cd5d3d829ab141e3d7f6793ffdd62d87 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Mon, 19 Aug 2024 09:40:31 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E8=BF=9B=E5=87=BA?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=9A=82=E6=97=B6=E6=9F=A5=E5=85=A8=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/vehicleaccess/VehicleAccessApi.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java index 6e90e292f..7737a2b30 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java @@ -247,8 +247,8 @@ public class VehicleAccessApi { // 创建分页请求 Pageable pageable = PageRequest.of(page, 4); - Page recordOfAccessList = vehicleRecordRepository.findByCreateTimeBetweenOrderByCreateTimeAsc(startOfDay, endOfDay, pageable); - +// Page recordOfAccessList = vehicleRecordRepository.findByCreateTimeBetweenOrderByCreateTimeAsc(startOfDay, endOfDay, pageable); + Page recordOfAccessList = vehicleRecordRepository.findAll(pageable); // TODO 暂时获取全部数据分页 return ResponseVO.success(200,"",recordOfAccessList,total); } -- 2.45.2 From fb048363362bb4f25510042ca88399fa57b2f4c5 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Mon, 19 Aug 2024 09:44:08 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E5=BC=80=E5=8F=91=E6=97=B6nacos=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=BD=BF=E7=94=A8=E6=9C=AC=E5=9C=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap-local.yaml | 4 ++-- .../src/main/resources/bootstrap-local.yaml | 4 ++-- .../src/main/resources/bootstrap-local.yaml | 4 ++-- .../src/main/resources/bootstrap-local.yaml | 4 ++-- yudao-gateway/src/main/resources/bootstrap-local.yaml | 4 ++-- .../src/main/resources/bootstrap-local.yaml | 4 ++-- .../src/main/resources/bootstrap-local.yaml | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml index 12c520cd9..2de0efbf7 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml @@ -3,7 +3,7 @@ spring: cloud: nacos: - server-addr: crm.fjptzykj.com:8849 + server-addr: 127.0.0.1:8848 discovery: namespace: dev # 命名空间。这里使用 dev 开发环境 metadata: @@ -16,7 +16,7 @@ spring: nacos: # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 config: - server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址 + server-addr: 127.0.0.1:8848 # Nacos 服务器地址 namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/resources/bootstrap-local.yaml b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/resources/bootstrap-local.yaml index 12c520cd9..2de0efbf7 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/resources/bootstrap-local.yaml +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/resources/bootstrap-local.yaml @@ -3,7 +3,7 @@ spring: cloud: nacos: - server-addr: crm.fjptzykj.com:8849 + server-addr: 127.0.0.1:8848 discovery: namespace: dev # 命名空间。这里使用 dev 开发环境 metadata: @@ -16,7 +16,7 @@ spring: nacos: # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 config: - server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址 + server-addr: 127.0.0.1:8848 # Nacos 服务器地址 namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/resources/bootstrap-local.yaml b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/bootstrap-local.yaml index 12c520cd9..2de0efbf7 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/resources/bootstrap-local.yaml +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/bootstrap-local.yaml @@ -3,7 +3,7 @@ spring: cloud: nacos: - server-addr: crm.fjptzykj.com:8849 + server-addr: 127.0.0.1:8848 discovery: namespace: dev # 命名空间。这里使用 dev 开发环境 metadata: @@ -16,7 +16,7 @@ spring: nacos: # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 config: - server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址 + server-addr: 127.0.0.1:8848 # Nacos 服务器地址 namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name diff --git a/ludu-module-ticketing/ludu-module-ticketing-biz/src/main/resources/bootstrap-local.yaml b/ludu-module-ticketing/ludu-module-ticketing-biz/src/main/resources/bootstrap-local.yaml index 12c520cd9..2de0efbf7 100644 --- a/ludu-module-ticketing/ludu-module-ticketing-biz/src/main/resources/bootstrap-local.yaml +++ b/ludu-module-ticketing/ludu-module-ticketing-biz/src/main/resources/bootstrap-local.yaml @@ -3,7 +3,7 @@ spring: cloud: nacos: - server-addr: crm.fjptzykj.com:8849 + server-addr: 127.0.0.1:8848 discovery: namespace: dev # 命名空间。这里使用 dev 开发环境 metadata: @@ -16,7 +16,7 @@ spring: nacos: # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 config: - server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址 + server-addr: 127.0.0.1:8848 # Nacos 服务器地址 namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name diff --git a/yudao-gateway/src/main/resources/bootstrap-local.yaml b/yudao-gateway/src/main/resources/bootstrap-local.yaml index cb38c776a..fbbd4942c 100644 --- a/yudao-gateway/src/main/resources/bootstrap-local.yaml +++ b/yudao-gateway/src/main/resources/bootstrap-local.yaml @@ -3,7 +3,7 @@ spring: cloud: nacos: - server-addr: crm.fjptzykj.com:8849 + server-addr: 127.0.0.1:8848 discovery: namespace: dev @@ -14,7 +14,7 @@ spring: nacos: # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 config: - server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址 + server-addr: 127.0.0.1:8848 # Nacos 服务器地址 namespace: dev group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP name: # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/bootstrap-local.yaml b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/bootstrap-local.yaml index 12c520cd9..2de0efbf7 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/bootstrap-local.yaml +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/bootstrap-local.yaml @@ -3,7 +3,7 @@ spring: cloud: nacos: - server-addr: crm.fjptzykj.com:8849 + server-addr: 127.0.0.1:8848 discovery: namespace: dev # 命名空间。这里使用 dev 开发环境 metadata: @@ -16,7 +16,7 @@ spring: nacos: # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 config: - server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址 + server-addr: 127.0.0.1:8848 # Nacos 服务器地址 namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/bootstrap-local.yaml b/yudao-module-system/yudao-module-system-biz/src/main/resources/bootstrap-local.yaml index 12c520cd9..2de0efbf7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/bootstrap-local.yaml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/bootstrap-local.yaml @@ -3,7 +3,7 @@ spring: cloud: nacos: - server-addr: crm.fjptzykj.com:8849 + server-addr: 127.0.0.1:8848 discovery: namespace: dev # 命名空间。这里使用 dev 开发环境 metadata: @@ -16,7 +16,7 @@ spring: nacos: # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 config: - server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址 + server-addr: 127.0.0.1:8848 # Nacos 服务器地址 namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name -- 2.45.2