停车场

This commit is contained in:
zsq 2024-07-19 23:52:11 +08:00
parent bab03cb461
commit c5942eb785
57 changed files with 3682 additions and 11 deletions

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ludu-module-parking</artifactId>
<groupId>cn.iocoder.cloud</groupId>
<version>2.1.0-jdk8-snapshot</version> <!-- 1. 修改 version 为 ${revision} -->
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ludu-module-parking-api</artifactId>
<packaging>jar</packaging> <!-- 2. 新增 packaging 为 jar -->
<name>${project.artifactId}</name> <!-- 3. 新增 name 为 ${project.artifactId} -->
<description> <!-- 4. 新增 description 为该模块的描述 -->
demo 模块 API暴露给其它模块调用
</description>
<dependencies> <!-- 5. 新增 yudao-common 依赖 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-common</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-common</artifactId>
</dependency>
<!-- Web 相关 -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<scope>provided</scope>
</dependency>
<!-- 参数校验 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<optional>true</optional>
</dependency>
<!-- RPC 远程调用相关 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,23 @@
package cn.iocoder.yudao.module.parking.enums;
import cn.iocoder.yudao.framework.common.enums.RpcConstants;
/**
* API 相关的枚举
*
* @author 芋道源码
*/
public class ApiConstants {
/**
* 服务名
*
* 注意需要保证和 spring.application.name 保持一致
*/
public static final String NAME = "parking-server";
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/parking";
public static final String VERSION = "1.0.0";
}

View File

@ -0,0 +1,17 @@
package cn.iocoder.yudao.module.parking.enums;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
/**
* @Description TODO
*/
public interface ErrorCodeConstants {
ErrorCode INFORMATION_NOT_EXISTS = new ErrorCode(1_005_001_005, "通道信息不存在");
// ========== 出场记录 1_005_001_006 ==========
ErrorCode RECORD_NOT_EXISTS = new ErrorCode(1_005_001_006, "出场记录不存在");
// ========== 收费信息 1_005_001_007 ==========
ErrorCode CHARGE_INFORMATION_NOT_EXISTS = new ErrorCode(1_005_001_007, "收费信息不存在");
// ========== 入场记录 1_005_001_008 ==========
ErrorCode ENTRY_RECORD_NOT_EXISTS = new ErrorCode(1_005_001_008, "入场记录不存在");
}

View File

@ -0,0 +1,171 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ludu-module-parking</artifactId>
<groupId>cn.iocoder.cloud</groupId>
<version>2.1.0-jdk8-snapshot</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging> <!-- 2. 新增 packaging 为 jar -->
<artifactId>ludu-module-parking-biz</artifactId>
<name>${project.artifactId}</name> <!-- 3. 新增 name 为 ${project.artifactId} -->
<description> <!-- 4. 新增 description 为该模块的描述 -->
demo 模块,主要实现 XXX、YYY、ZZZ 等功能。
</description>
<dependencies> <!-- 5. 新增依赖,这里引入的都是比较常用的业务组件、技术组件 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>ludu-module-parking-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- Spring Cloud 基础 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-env</artifactId>
</dependency>
<!-- 依赖服务 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-module-system-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-module-infra-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- 业务组件 -->
<!-- <dependency>-->
<!-- <groupId>cn.iocoder.cloud</groupId>-->
<!-- <artifactId>yudao-spring-boot-starter-banner</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>cn.iocoder.cloud</groupId>-->
<!-- <artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>cn.iocoder.cloud</groupId>-->
<!-- <artifactId>yudao-spring-boot-starter-biz-dict</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-data-permission</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>cn.iocoder.cloud</groupId>-->
<!-- <artifactId>yudao-spring-boot-starter-biz-error-code</artifactId>-->
<!-- </dependency>-->
<!-- Web 相关 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-security</artifactId>
</dependency>
<!-- DB 相关 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-redis</artifactId>
</dependency>
<!-- RPC 远程调用相关 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-rpc</artifactId>
</dependency>
<!-- Registry 注册中心相关 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- Config 配置中心相关 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- Job 定时任务相关 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-job</artifactId>
</dependency>
<!-- 消息队列相关 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-mq</artifactId>
</dependency>
<!-- Test 测试相关 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-test</artifactId>
</dependency>
<!-- 工具类相关 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency>
<!-- 监控相关 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
</dependency>
</dependencies>
<build>
<!-- 设置构建的 jar 包名 -->
<finalName>${project.artifactId}</finalName>
<plugins>
<!-- 打包 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<fork>true</fork>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,17 @@
package cn.iocoder.yudao.module.parking;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @Description TODO
*/
@SpringBootApplication
//@MapperScan("cn.iocoder.yudao.module.parking.dal.mysql.channelinformation.ChannelInformationMapper")
public class ParkingServerApplication {
public static void main(String[] args) {
SpringApplication.run(ParkingServerApplication.class, args);
}
}

View File

@ -0,0 +1,94 @@
package cn.iocoder.yudao.module.parking.controller.admin.appearancerecord;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.parking.controller.admin.appearancerecord.vo.AppearanceRecordPageReqVO;
import cn.iocoder.yudao.module.parking.controller.admin.appearancerecord.vo.AppearanceRecordRespVO;
import cn.iocoder.yudao.module.parking.controller.admin.appearancerecord.vo.AppearanceRecordSaveReqVO;
import cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord.AppearanceRecordDO;
import cn.iocoder.yudao.module.parking.service.appearancerecord.AppearanceRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 出场记录")
@RestController
@RequestMapping("/parking/appearancerecord")
@Validated
public class AppearanceRecordController {
@Autowired
private AppearanceRecordService recordService;
@PostMapping("/create")
@Operation(summary = "创建出场记录")
@PreAuthorize("@ss.hasPermission('appearance:record:create')")
public CommonResult<Long> createRecord(@Valid @RequestBody AppearanceRecordSaveReqVO createReqVO) {
return success(recordService.createRecord(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新出场记录")
@PreAuthorize("@ss.hasPermission('appearance:record:update')")
public CommonResult<Boolean> updateRecord(@Valid @RequestBody AppearanceRecordSaveReqVO updateReqVO) {
recordService.updateRecord(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除出场记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('appearance:record:delete')")
public CommonResult<Boolean> deleteRecord(@RequestParam("id") Long id) {
recordService.deleteRecord(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得出场记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('appearance:record:query')")
public CommonResult<AppearanceRecordRespVO> getRecord(@RequestParam("id") Long id) {
AppearanceRecordDO record = recordService.getRecord(id);
return success(BeanUtils.toBean(record, AppearanceRecordRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得出场记录分页")
@PreAuthorize("@ss.hasPermission('appearance:record:query')")
public CommonResult<PageResult<AppearanceRecordRespVO>> getRecordPage(@Valid AppearanceRecordPageReqVO pageReqVO) {
PageResult<AppearanceRecordDO> pageResult = recordService.getRecordPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, AppearanceRecordRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出出场记录 Excel")
@PreAuthorize("@ss.hasPermission('appearance:record:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportRecordExcel(@Valid AppearanceRecordPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<AppearanceRecordDO> list = recordService.getRecordPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "出场记录.xls", "数据", AppearanceRecordRespVO.class,
BeanUtils.toBean(list, AppearanceRecordRespVO.class));
}
}

View File

@ -0,0 +1,172 @@
package cn.iocoder.yudao.module.parking.controller.admin.appearancerecord.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 AppearanceRecordPageReqVO extends PageParam {
@Schema(description = "停车场编号")
private String parkNumber;
@Schema(description = "数据条数")
private Integer size;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "入场记录编号", example = "21192")
private String orderId;
@Schema(description = "操作员 Id", example = "17507")
private String operatorId;
@Schema(description = "操作员姓名", example = "芋艿")
private String operatorName;
@Schema(description = "车牌")
private String plate;
@Schema(description = "车牌颜色")
private String plateColor;
@Schema(description = "无牌车票号")
private String ticketCode;
@Schema(description = "车类型", example = "1")
private String carType;
@Schema(description = "车牌识别可信度")
private Integer confidence;
@Schema(description = "证件号码")
private String idCard;
@Schema(description = "入场时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] inTime;
@Schema(description = "出场时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] outTime;
@Schema(description = "入场图片名")
private String inImage;
@Schema(description = "出场图片名")
private String outImage;
@Schema(description = "入口通道名称")
private String inChannel;
@Schema(description = "出口通道名称")
private String outChannel;
@Schema(description = "抬杆模式")
private String openGateMode;
@Schema(description = "匹配模式")
private String matchMode;
@Schema(description = "总停车费")
private String charge;
@Schema(description = "线上总收费")
private String onLineCharge;
@Schema(description = "线下总收费")
private String offLineCharge;
@Schema(description = "线上线下金额和时间优惠累计抵扣值")
private String profitChargeTotal;
@Schema(description = "线上累计优惠金额总面值")
private String onLineProfitChargeNum;
@Schema(description = "线上累计优惠金额总抵扣值")
private String onLineProfitChargeValue;
@Schema(description = "线下累计优惠金额总面值")
private String offLineProfitChargeNum;
@Schema(description = "线下累计优惠金额总抵扣值")
private String offLineProfitChargeValue;
@Schema(description = "线上累计优惠时间")
private String onLineProfitTimeNum;
@Schema(description = "线上累计优惠时间总抵扣值")
private String onLineProfitTimeValue;
@Schema(description = "线下累计优惠时间")
private String offLineProfitTimeNum;
@Schema(description = "线下累计优惠时间总抵扣值")
private String offLineProfitTimeValue;
@Schema(description = "支付订单号")
private String payNo;
@Schema(description = "结算时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] getTime;
@Schema(description = "支付金额")
private String payCharge;
@Schema(description = "支付类型")
private String payKind;
@Schema(description = "支付渠道")
private String payChannel;
@Schema(description = "备注", example = "你猜")
private String memo;
@Schema(description = "优惠码")
private String profitCode;
@Schema(description = "优惠下发时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] getproTime;
@Schema(description = "优惠时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] profitTime;
@Schema(description = "优惠金额面值")
private String profitCharge;
@Schema(description = "生效金额")
private String profitChargeValue;
@Schema(description = "备注", example = "你猜")
private String profitmemo;
@Schema(description = "区域 id", example = "19318")
private String areaId;
@Schema(description = "区域名称", example = "李四")
private String areaName;
@Schema(description = "车位编号")
private String placeNumber;
@Schema(description = "备注信息", example = "你猜")
private String placememo;
@Schema(description = "时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] costTime;
}

View File

@ -0,0 +1,220 @@
package cn.iocoder.yudao.module.parking.controller.admin.appearancerecord.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 AppearanceRecordRespVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28157")
@ExcelProperty("id")
private Long id;
@Schema(description = "停车场编号")
@ExcelProperty("停车场编号")
private String parkNumber;
@Schema(description = "数据条数")
@ExcelProperty("数据条数")
private Integer size;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "入场记录编号", example = "21192")
@ExcelProperty("入场记录编号")
private String orderId;
@Schema(description = "操作员 Id", example = "17507")
@ExcelProperty("操作员 Id")
private String operatorId;
@Schema(description = "操作员姓名", example = "芋艿")
@ExcelProperty("操作员姓名")
private String operatorName;
@Schema(description = "发票号码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("发票号码")
private String invoiceNo;
@Schema(description = "车牌")
@ExcelProperty("车牌")
private String plate;
@Schema(description = "车牌颜色")
@ExcelProperty("车牌颜色")
private String plateColor;
@Schema(description = "无牌车票号")
@ExcelProperty("无牌车票号")
private String ticketCode;
@Schema(description = "车类型", example = "1")
@ExcelProperty("车类型")
private String carType;
@Schema(description = "车牌识别可信度")
@ExcelProperty("车牌识别可信度")
private Integer confidence;
@Schema(description = "证件号码")
@ExcelProperty("证件号码")
private String idCard;
@Schema(description = "入场时间")
@ExcelProperty("入场时间")
private String inTime;
@Schema(description = "出场时间")
@ExcelProperty("出场时间")
private String outTime;
@Schema(description = "入场图片名")
@ExcelProperty("入场图片名")
private String inImage;
@Schema(description = "出场图片名")
@ExcelProperty("出场图片名")
private String outImage;
@Schema(description = "入口通道名称")
@ExcelProperty("入口通道名称")
private String inChannel;
@Schema(description = "出口通道名称")
@ExcelProperty("出口通道名称")
private String outChannel;
@Schema(description = "抬杆模式")
@ExcelProperty("抬杆模式")
private String openGateMode;
@Schema(description = "匹配模式")
@ExcelProperty("匹配模式")
private String matchMode;
@Schema(description = "总停车费")
@ExcelProperty("总停车费")
private String charge;
@Schema(description = "线上总收费")
@ExcelProperty("线上总收费")
private String onLineCharge;
@Schema(description = "线下总收费")
@ExcelProperty("线下总收费")
private String offLineCharge;
@Schema(description = "线上线下金额和时间优惠累计抵扣值")
@ExcelProperty("线上线下金额和时间优惠累计抵扣值")
private String profitChargeTotal;
@Schema(description = "线上累计优惠金额总面值")
@ExcelProperty("线上累计优惠金额总面值")
private String onLineProfitChargeNum;
@Schema(description = "线上累计优惠金额总抵扣值")
@ExcelProperty("线上累计优惠金额总抵扣值")
private String onLineProfitChargeValue;
@Schema(description = "线下累计优惠金额总面值")
@ExcelProperty("线下累计优惠金额总面值")
private String offLineProfitChargeNum;
@Schema(description = "线下累计优惠金额总抵扣值")
@ExcelProperty("线下累计优惠金额总抵扣值")
private String offLineProfitChargeValue;
@Schema(description = "线上累计优惠时间")
@ExcelProperty("线上累计优惠时间")
private String onLineProfitTimeNum;
@Schema(description = "线上累计优惠时间总抵扣值")
@ExcelProperty("线上累计优惠时间总抵扣值")
private String onLineProfitTimeValue;
@Schema(description = "线下累计优惠时间")
@ExcelProperty("线下累计优惠时间")
private String offLineProfitTimeNum;
@Schema(description = "线下累计优惠时间总抵扣值")
@ExcelProperty("线下累计优惠时间总抵扣值")
private String offLineProfitTimeValue;
@Schema(description = "支付订单号")
@ExcelProperty("支付订单号")
private String payNo;
@Schema(description = "结算时间")
@ExcelProperty("结算时间")
private String getTime;
@Schema(description = "支付金额")
@ExcelProperty("支付金额")
private String payCharge;
@Schema(description = "支付类型")
@ExcelProperty("支付类型")
private String payKind;
@Schema(description = "支付渠道")
@ExcelProperty("支付渠道")
private String payChannel;
@Schema(description = "备注", example = "你猜")
@ExcelProperty("备注")
private String memo;
@Schema(description = "优惠码")
@ExcelProperty("优惠码")
private String profitCode;
@Schema(description = "优惠下发时间")
@ExcelProperty("优惠下发时间")
private String getproTime;
@Schema(description = "优惠时间")
@ExcelProperty("优惠时间")
private String profitTime;
@Schema(description = "优惠金额面值")
@ExcelProperty("优惠金额面值")
private String profitCharge;
@Schema(description = "生效金额")
@ExcelProperty("生效金额")
private String profitChargeValue;
@Schema(description = "备注", example = "你猜")
@ExcelProperty("备注")
private String profitmemo;
@Schema(description = "区域 id", example = "19318")
@ExcelProperty("区域 id")
private String areaId;
@Schema(description = "区域名称", example = "李四")
@ExcelProperty("区域名称")
private String areaName;
@Schema(description = "车位编号")
@ExcelProperty("车位编号")
private String placeNumber;
@Schema(description = "备注信息", example = "你猜")
@ExcelProperty("备注信息")
private String placememo;
@Schema(description = "时间")
@ExcelProperty("时间")
private String costTime;
}

View File

@ -0,0 +1,162 @@
package cn.iocoder.yudao.module.parking.controller.admin.appearancerecord.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 AppearanceRecordSaveReqVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28157")
private Long id;
@Schema(description = "停车场编号")
private String parkNumber;
@Schema(description = "数据条数")
private Integer size;
@Schema(description = "入场记录编号", example = "21192")
private String orderId;
@Schema(description = "操作员 Id", example = "17507")
private String operatorId;
@Schema(description = "操作员姓名", example = "芋艿")
private String operatorName;
@Schema(description = "发票号码", requiredMode = Schema.RequiredMode.REQUIRED)
private String invoiceNo;
@Schema(description = "车牌")
private String plate;
@Schema(description = "车牌颜色")
private String plateColor;
@Schema(description = "无牌车票号")
private String ticketCode;
@Schema(description = "车类型", example = "1")
private String carType;
@Schema(description = "车牌识别可信度")
private Integer confidence;
@Schema(description = "证件号码")
private String idCard;
@Schema(description = "入场时间")
private String inTime;
@Schema(description = "出场时间")
private String outTime;
@Schema(description = "入场图片名")
private String inImage;
@Schema(description = "出场图片名")
private String outImage;
@Schema(description = "入口通道名称")
private String inChannel;
@Schema(description = "出口通道名称")
private String outChannel;
@Schema(description = "抬杆模式")
private String openGateMode;
@Schema(description = "匹配模式")
private String matchMode;
@Schema(description = "总停车费")
private String charge;
@Schema(description = "线上总收费")
private String onLineCharge;
@Schema(description = "线下总收费")
private String offLineCharge;
@Schema(description = "线上线下金额和时间优惠累计抵扣值")
private String profitChargeTotal;
@Schema(description = "线上累计优惠金额总面值")
private String onLineProfitChargeNum;
@Schema(description = "线上累计优惠金额总抵扣值")
private String onLineProfitChargeValue;
@Schema(description = "线下累计优惠金额总面值")
private String offLineProfitChargeNum;
@Schema(description = "线下累计优惠金额总抵扣值")
private String offLineProfitChargeValue;
@Schema(description = "线上累计优惠时间")
private String onLineProfitTimeNum;
@Schema(description = "线上累计优惠时间总抵扣值")
private String onLineProfitTimeValue;
@Schema(description = "线下累计优惠时间")
private String offLineProfitTimeNum;
@Schema(description = "线下累计优惠时间总抵扣值")
private String offLineProfitTimeValue;
@Schema(description = "支付订单号")
private String payNo;
@Schema(description = "结算时间")
private String getTime;
@Schema(description = "支付金额")
private String payCharge;
@Schema(description = "支付类型")
private String payKind;
@Schema(description = "支付渠道")
private String payChannel;
@Schema(description = "备注", example = "你猜")
private String memo;
@Schema(description = "优惠码")
private String profitCode;
@Schema(description = "优惠下发时间")
private String getproTime;
@Schema(description = "优惠时间")
private String profitTime;
@Schema(description = "优惠金额面值")
private String profitCharge;
@Schema(description = "生效金额")
private String profitChargeValue;
@Schema(description = "备注", example = "你猜")
private String profitmemo;
@Schema(description = "区域 id", example = "19318")
private String areaId;
@Schema(description = "区域名称", example = "李四")
private String areaName;
@Schema(description = "车位编号")
private String placeNumber;
@Schema(description = "备注信息", example = "你猜")
private String placememo;
@Schema(description = "时间")
private String costTime;
}

View File

@ -0,0 +1,104 @@
package cn.iocoder.yudao.module.parking.controller.admin.channelinformation;
import cn.iocoder.yudao.module.parking.controller.admin.channelinformation.vo.ChannelInformationPageReqVO;
import cn.iocoder.yudao.module.parking.controller.admin.channelinformation.vo.ChannelInformationRespVO;
import cn.iocoder.yudao.module.parking.controller.admin.channelinformation.vo.ChannelInformationSaveReqVO;
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.annotation.security.PermitAll;
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.channelinformation.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.channelinformation.ChannelInformationDO;
import cn.iocoder.yudao.module.parking.service.channelinformation.ChannelInformationService;
@Tag(name = "管理后台 - 通道信息")
@RestController
@RequestMapping("/parking/channel")
@Validated
public class ChannelInformationController {
@Resource
private ChannelInformationService informationService;
@PostMapping("/create")
@Operation(summary = "创建通道信息")
@PreAuthorize("@ss.hasPermission('channel:information:create')")
public CommonResult<Long> createInformation(@Valid @RequestBody ChannelInformationSaveReqVO createReqVO) {
return success(informationService.createInformation(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新通道信息")
@PreAuthorize("@ss.hasPermission('channel:information:update')")
public CommonResult<Boolean> updateInformation(@Valid @RequestBody ChannelInformationSaveReqVO updateReqVO) {
informationService.updateInformation(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除通道信息")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('channel:information:delete')")
public CommonResult<Boolean> deleteInformation(@RequestParam("id") Long id) {
informationService.deleteInformation(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得通道信息")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('channel:information:query')")
public CommonResult<ChannelInformationRespVO> getInformation(@RequestParam("id") Long id) {
ChannelInformationDO information = informationService.getInformation(id);
return success(BeanUtils.toBean(information, ChannelInformationRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得通道信息分页")
@PreAuthorize("@ss.hasPermission('channel:information:query')")
// @PermitAll
public CommonResult<PageResult<ChannelInformationRespVO>> getInformationPage(@Valid ChannelInformationPageReqVO pageReqVO,HttpServletRequest res) {
System.out.println("--------------------------------");
System.out.println(res.getHeader("Authorization"));
System.out.println(res.getHeader("Tenant-Id"));
System.out.println("--------------------------------");
PageResult<ChannelInformationDO> pageResult = informationService.getInformationPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ChannelInformationRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出通道信息 Excel")
@PreAuthorize("@ss.hasPermission('channel:information:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportInformationExcel(@Valid ChannelInformationPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ChannelInformationDO> list = informationService.getInformationPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "通道信息.xls", "数据", ChannelInformationRespVO.class,
BeanUtils.toBean(list, ChannelInformationRespVO.class));
}
}

View File

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.parking.controller.admin.channelinformation.vo;
import lombok.*;
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 ChannelInformationPageReqVO extends PageParam {
@Schema(description = "场库编号")
private String parkNumber;
@Schema(description = "数据条数")
private Integer size;
@Schema(description = "通道 Id", example = "17706")
private String passagewayId;
@Schema(description = "通道名称", example = "李四")
private String passagewayName;
@Schema(description = "源区域 Id", example = "14542")
private String sourceAreaId;
@Schema(description = "目标区域 Id", example = "3382")
private String targetAreaId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,46 @@
package cn.iocoder.yudao.module.parking.controller.admin.channelinformation.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 通道信息 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ChannelInformationRespVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25403")
@ExcelProperty("id")
private Long id;
@Schema(description = "场库编号")
@ExcelProperty("场库编号")
private String parkNumber;
@Schema(description = "数据条数")
@ExcelProperty("数据条数")
private Integer size;
@Schema(description = "通道 Id", example = "17706")
@ExcelProperty("通道 Id")
private String passagewayId;
@Schema(description = "通道名称", example = "李四")
@ExcelProperty("通道名称")
private String passagewayName;
@Schema(description = "源区域 Id", example = "14542")
@ExcelProperty("源区域 Id")
private String sourceAreaId;
@Schema(description = "目标区域 Id", example = "3382")
@ExcelProperty("目标区域 Id")
private String targetAreaId;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,31 @@
package cn.iocoder.yudao.module.parking.controller.admin.channelinformation.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@Schema(description = "管理后台 - 通道信息新增/修改 Request VO")
@Data
public class ChannelInformationSaveReqVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25403")
private Long id;
@Schema(description = "场库编号")
private String parkNumber;
@Schema(description = "数据条数")
private Integer size;
@Schema(description = "通道 Id", example = "17706")
private String passagewayId;
@Schema(description = "通道名称", example = "李四")
private String passagewayName;
@Schema(description = "源区域 Id", example = "14542")
private String sourceAreaId;
@Schema(description = "目标区域 Id", example = "3382")
private String targetAreaId;
}

View File

@ -0,0 +1,95 @@
package cn.iocoder.yudao.module.parking.controller.admin.chargeinformation;
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.chargeinformation.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.chargeinformation.ChargeInformationDO;
import cn.iocoder.yudao.module.parking.service.chargeinformation.ChargeInformationService;
@Tag(name = "管理后台 - 收费信息")
@RestController
@RequestMapping("/parking/chargeinformation")
@Validated
public class ChargeInformationController {
@Resource
private ChargeInformationService informationService;
@PostMapping("/create")
@Operation(summary = "创建收费信息")
@PreAuthorize("@ss.hasPermission('charge:information:create')")
public CommonResult<Long> createInformation(@Valid @RequestBody ChargeInformationSaveReqVO createReqVO) {
return success(informationService.createInformation(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新收费信息")
@PreAuthorize("@ss.hasPermission('charge:information:update')")
public CommonResult<Boolean> updateInformation(@Valid @RequestBody ChargeInformationSaveReqVO updateReqVO) {
informationService.updateInformation(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除收费信息")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('charge:information:delete')")
public CommonResult<Boolean> deleteInformation(@RequestParam("id") Long id) {
informationService.deleteInformation(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得收费信息")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('charge:information:query')")
public CommonResult<ChargeInformationRespVO> getInformation(@RequestParam("id") Long id) {
ChargeInformationDO information = informationService.getInformation(id);
return success(BeanUtils.toBean(information, ChargeInformationRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得收费信息分页")
@PreAuthorize("@ss.hasPermission('charge:information:query')")
public CommonResult<PageResult<ChargeInformationRespVO>> getInformationPage(@Valid ChargeInformationPageReqVO pageReqVO) {
PageResult<ChargeInformationDO> pageResult = informationService.getInformationPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ChargeInformationRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出收费信息 Excel")
@PreAuthorize("@ss.hasPermission('charge:information:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportInformationExcel(@Valid ChargeInformationPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ChargeInformationDO> list = informationService.getInformationPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "收费信息.xls", "数据", ChargeInformationRespVO.class,
BeanUtils.toBean(list, ChargeInformationRespVO.class));
}
}

View File

@ -0,0 +1,87 @@
package cn.iocoder.yudao.module.parking.controller.admin.chargeinformation.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 ChargeInformationPageReqVO extends PageParam {
@Schema(description = "场库编号")
private String parkNumber;
@Schema(description = "收费信息数量")
private Integer size;
@Schema(description = "车牌号")
private String plate;
@Schema(description = "入场时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] inTime;
@Schema(description = "结算时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] outTime;
@Schema(description = "入场通道")
private String inChannel;
@Schema(description = "出场通道")
private String outChannel;
@Schema(description = "支付类型")
private String payKind;
@Schema(description = "支付渠道")
private String payChannel;
@Schema(description = "入场订单号", example = "12321")
private String orderId;
@Schema(description = "车辆类型", example = "1")
private String carType;
@Schema(description = "支付订单号")
private String payNo;
@Schema(description = "备注", example = "随便")
private String memo;
@Schema(description = "应缴金额")
private String charge;
@Schema(description = "实收金额")
private String realCharge;
@Schema(description = "优惠金额")
private String couponCharge;
@Schema(description = "区域 ID", example = "12265")
private String areaId;
@Schema(description = "操作员名称", example = "赵六")
private String operatorName;
@Schema(description = "操作员联系电话")
private String operatorTelphone;
@Schema(description = "支付订单号")
private String outTradeNo;
@Schema(description = "车牌颜色")
private String plateColor;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,108 @@
package cn.iocoder.yudao.module.parking.controller.admin.chargeinformation.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 ChargeInformationRespVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5441")
@ExcelProperty("id")
private Long id;
@Schema(description = "场库编号")
@ExcelProperty("场库编号")
private String parkNumber;
@Schema(description = "收费信息数量")
@ExcelProperty("收费信息数量")
private Integer size;
@Schema(description = "车牌号")
@ExcelProperty("车牌号")
private String plate;
@Schema(description = "入场时间")
@ExcelProperty("入场时间")
private String inTime;
@Schema(description = "结算时间")
@ExcelProperty("结算时间")
private String outTime;
@Schema(description = "入场通道")
@ExcelProperty("入场通道")
private String inChannel;
@Schema(description = "出场通道")
@ExcelProperty("出场通道")
private String outChannel;
@Schema(description = "支付类型")
@ExcelProperty("支付类型")
private String payKind;
@Schema(description = "支付渠道")
@ExcelProperty("支付渠道")
private String payChannel;
@Schema(description = "入场订单号", example = "12321")
@ExcelProperty("入场订单号")
private String orderId;
@Schema(description = "车辆类型", example = "1")
@ExcelProperty("车辆类型")
private String carType;
@Schema(description = "支付订单号")
@ExcelProperty("支付订单号")
private String payNo;
@Schema(description = "备注", example = "随便")
@ExcelProperty("备注")
private String memo;
@Schema(description = "应缴金额")
@ExcelProperty("应缴金额")
private String charge;
@Schema(description = "实收金额")
@ExcelProperty("实收金额")
private String realCharge;
@Schema(description = "优惠金额")
@ExcelProperty("优惠金额")
private String couponCharge;
@Schema(description = "区域 ID", example = "12265")
@ExcelProperty("区域 ID")
private String areaId;
@Schema(description = "操作员名称", example = "赵六")
@ExcelProperty("操作员名称")
private String operatorName;
@Schema(description = "操作员联系电话")
@ExcelProperty("操作员联系电话")
private String operatorTelphone;
@Schema(description = "支付订单号")
@ExcelProperty("支付订单号")
private String outTradeNo;
@Schema(description = "车牌颜色")
@ExcelProperty("车牌颜色")
private String plateColor;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,78 @@
package cn.iocoder.yudao.module.parking.controller.admin.chargeinformation.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 ChargeInformationSaveReqVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5441")
private Long id;
@Schema(description = "场库编号")
private String parkNumber;
@Schema(description = "收费信息数量")
private Integer size;
@Schema(description = "车牌号")
private String plate;
@Schema(description = "入场时间")
private String inTime;
@Schema(description = "结算时间")
private String outTime;
@Schema(description = "入场通道")
private String inChannel;
@Schema(description = "出场通道")
private String outChannel;
@Schema(description = "支付类型")
private String payKind;
@Schema(description = "支付渠道")
private String payChannel;
@Schema(description = "入场订单号", example = "12321")
private String orderId;
@Schema(description = "车辆类型", example = "1")
private String carType;
@Schema(description = "支付订单号")
private String payNo;
@Schema(description = "备注", example = "随便")
private String memo;
@Schema(description = "应缴金额")
private String charge;
@Schema(description = "实收金额")
private String realCharge;
@Schema(description = "优惠金额")
private String couponCharge;
@Schema(description = "区域 ID", example = "12265")
private String areaId;
@Schema(description = "操作员名称", example = "赵六")
private String operatorName;
@Schema(description = "操作员联系电话")
private String operatorTelphone;
@Schema(description = "支付订单号")
private String outTradeNo;
@Schema(description = "车牌颜色")
private String plateColor;
}

View File

@ -0,0 +1,95 @@
package cn.iocoder.yudao.module.parking.controller.admin.entryrecord;
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.entryrecord.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.entryrecord.EntryRecordDO;
import cn.iocoder.yudao.module.parking.service.entryrecord.EntryRecordService;
@Tag(name = "管理后台 - 入场记录")
@RestController
@RequestMapping("/parking/entry-record")
@Validated
public class EntryRecordController {
@Resource
private EntryRecordService entryRecordService;
@PostMapping("/create")
@Operation(summary = "创建入场记录")
@PreAuthorize("@ss.hasPermission('parking:entry-record:create')")
public CommonResult<Long> createEntryRecord(@Valid @RequestBody EntryRecordSaveReqVO createReqVO) {
return success(entryRecordService.createEntryRecord(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新入场记录")
@PreAuthorize("@ss.hasPermission('parking:entry-record:update')")
public CommonResult<Boolean> updateEntryRecord(@Valid @RequestBody EntryRecordSaveReqVO updateReqVO) {
entryRecordService.updateEntryRecord(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除入场记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('parking:entry-record:delete')")
public CommonResult<Boolean> deleteEntryRecord(@RequestParam("id") Long id) {
entryRecordService.deleteEntryRecord(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得入场记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('parking:entry-record:query')")
public CommonResult<EntryRecordRespVO> getEntryRecord(@RequestParam("id") Long id) {
EntryRecordDO entryRecord = entryRecordService.getEntryRecord(id);
return success(BeanUtils.toBean(entryRecord, EntryRecordRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得入场记录分页")
@PreAuthorize("@ss.hasPermission('parking:entry-record:query')")
public CommonResult<PageResult<EntryRecordRespVO>> getEntryRecordPage(@Valid EntryRecordPageReqVO pageReqVO) {
PageResult<EntryRecordDO> pageResult = entryRecordService.getEntryRecordPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, EntryRecordRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出入场记录 Excel")
@PreAuthorize("@ss.hasPermission('parking:entry-record:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportEntryRecordExcel(@Valid EntryRecordPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<EntryRecordDO> list = entryRecordService.getEntryRecordPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "入场记录.xls", "数据", EntryRecordRespVO.class,
BeanUtils.toBean(list, EntryRecordRespVO.class));
}
}

View File

@ -0,0 +1,99 @@
package cn.iocoder.yudao.module.parking.controller.admin.entryrecord.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 EntryRecordPageReqVO extends PageParam {
@Schema(description = "停车场编号")
private String parkNumber;
@Schema(description = "数据条数")
private Integer size;
@Schema(description = "车牌")
private String plate;
@Schema(description = "无牌车票号")
private String ticketCode;
@Schema(description = "车牌颜色")
private String plateColor;
@Schema(description = "入场时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] inTime;
@Schema(description = "入场通道名称")
private String inChannel;
@Schema(description = "入场图片名")
private String inImage;
@Schema(description = "入场记录编号", example = "28860")
private String orderId;
@Schema(description = "访问事由", example = "不香")
private String visitReason;
@Schema(description = "放行类型")
private String openGateMode;
@Schema(description = "匹配模式")
private String matchMode;
@Schema(description = "证件号码")
private String idCard;
@Schema(description = "车牌识别可信度")
private Integer confidence;
@Schema(description = "车类型", example = "2")
private String carType;
@Schema(description = "证件号码")
private String userIdCard;
@Schema(description = "车主姓名", example = "王五")
private String userName;
@Schema(description = "联系电话")
private String phone;
@Schema(description = "地址")
private String address;
@Schema(description = "区域 id", example = "4615")
private String areaId;
@Schema(description = "区域名称", example = "张三")
private String areaName;
@Schema(description = "车位编号")
private String placeNumber;
@Schema(description = "备注信息", example = "你说的对")
private String memo;
@Schema(description = "是否开闸")
private String barriorOpen;
@Schema(description = "开闸耗时")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] costTime;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,124 @@
package cn.iocoder.yudao.module.parking.controller.admin.entryrecord.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 EntryRecordRespVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25926")
@ExcelProperty("id")
private Long id;
@Schema(description = "停车场编号")
@ExcelProperty("停车场编号")
private String parkNumber;
@Schema(description = "数据条数")
@ExcelProperty("数据条数")
private Integer size;
@Schema(description = "车牌")
@ExcelProperty("车牌")
private String plate;
@Schema(description = "无牌车票号")
@ExcelProperty("无牌车票号")
private String ticketCode;
@Schema(description = "车牌颜色")
@ExcelProperty("车牌颜色")
private String plateColor;
@Schema(description = "入场时间")
@ExcelProperty("入场时间")
private String inTime;
@Schema(description = "入场通道名称")
@ExcelProperty("入场通道名称")
private String inChannel;
@Schema(description = "入场图片名")
@ExcelProperty("入场图片名")
private String inImage;
@Schema(description = "入场记录编号", example = "28860")
@ExcelProperty("入场记录编号")
private String orderId;
@Schema(description = "访问事由", example = "不香")
@ExcelProperty("访问事由")
private String visitReason;
@Schema(description = "放行类型")
@ExcelProperty("放行类型")
private String openGateMode;
@Schema(description = "匹配模式")
@ExcelProperty("匹配模式")
private String matchMode;
@Schema(description = "证件号码")
@ExcelProperty("证件号码")
private String idCard;
@Schema(description = "车牌识别可信度")
@ExcelProperty("车牌识别可信度")
private Integer confidence;
@Schema(description = "车类型", example = "2")
@ExcelProperty("车类型")
private String carType;
@Schema(description = "证件号码")
@ExcelProperty("证件号码")
private String userIdCard;
@Schema(description = "车主姓名", example = "王五")
@ExcelProperty("车主姓名")
private String userName;
@Schema(description = "联系电话", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("联系电话")
private String phone;
@Schema(description = "地址")
@ExcelProperty("地址")
private String address;
@Schema(description = "区域 id", example = "4615")
@ExcelProperty("区域 id")
private String areaId;
@Schema(description = "区域名称", example = "张三")
@ExcelProperty("区域名称")
private String areaName;
@Schema(description = "车位编号")
@ExcelProperty("车位编号")
private String placeNumber;
@Schema(description = "备注信息", example = "你说的对")
@ExcelProperty("备注信息")
private String memo;
@Schema(description = "是否开闸")
@ExcelProperty("是否开闸")
private String barriorOpen;
@Schema(description = "开闸耗时")
@ExcelProperty("开闸耗时")
private String costTime;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,91 @@
package cn.iocoder.yudao.module.parking.controller.admin.entryrecord.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 EntryRecordSaveReqVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25926")
private Long id;
@Schema(description = "停车场编号")
private String parkNumber;
@Schema(description = "数据条数")
private Integer size;
@Schema(description = "车牌")
private String plate;
@Schema(description = "无牌车票号")
private String ticketCode;
@Schema(description = "车牌颜色")
private String plateColor;
@Schema(description = "入场时间")
private String inTime;
@Schema(description = "入场通道名称")
private String inChannel;
@Schema(description = "入场图片名")
private String inImage;
@Schema(description = "入场记录编号", example = "28860")
private String orderId;
@Schema(description = "访问事由", example = "不香")
private String visitReason;
@Schema(description = "放行类型")
private String openGateMode;
@Schema(description = "匹配模式")
private String matchMode;
@Schema(description = "证件号码")
private String idCard;
@Schema(description = "车牌识别可信度")
private Integer confidence;
@Schema(description = "车类型", example = "2")
private String carType;
@Schema(description = "证件号码")
private String userIdCard;
@Schema(description = "车主姓名", example = "王五")
private String userName;
@Schema(description = "联系电话", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "联系电话不能为空")
private String phone;
@Schema(description = "地址")
private String address;
@Schema(description = "区域 id", example = "4615")
private String areaId;
@Schema(description = "区域名称", example = "张三")
private String areaName;
@Schema(description = "车位编号")
private String placeNumber;
@Schema(description = "备注信息", example = "你说的对")
private String memo;
@Schema(description = "是否开闸")
private String barriorOpen;
@Schema(description = "开闸耗时")
private String costTime;
}

View File

@ -0,0 +1,228 @@
package cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord;
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("appearance_record_do")
@KeySequence("appearance_record_do_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AppearanceRecordDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* 停车场编号
*/
private String parkNumber;
/**
* 数据条数
*/
private Integer size;
/**
* 入场记录编号
*/
private String orderId;
/**
* 操作员 Id
*/
private String operatorId;
/**
* 操作员姓名
*/
private String operatorName;
/**
* 发票号码
*/
private String invoiceNo;
/**
* 车牌
*/
private String plate;
/**
* 车牌颜色
*/
private String plateColor;
/**
* 无牌车票号
*/
private String ticketCode;
/**
* 车类型
*/
private String carType;
/**
* 车牌识别可信度
*/
private Integer confidence;
/**
* 证件号码
*/
private String idCard;
/**
* 入场时间
*/
private String inTime;
/**
* 出场时间
*/
private String outTime;
/**
* 入场图片名
*/
private String inImage;
/**
* 出场图片名
*/
private String outImage;
/**
* 入口通道名称
*/
private String inChannel;
/**
* 出口通道名称
*/
private String outChannel;
/**
* 抬杆模式
*/
private String openGateMode;
/**
* 匹配模式
*/
private String matchMode;
/**
* 总停车费
*/
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;
/**
* 支付订单号
*/
private String payNo;
/**
* 结算时间
*/
private String getTime;
/**
* 支付金额
*/
private String payCharge;
/**
* 支付类型
*/
private String payKind;
/**
* 支付渠道
*/
private String payChannel;
/**
* 备注
*/
private String memo;
/**
* 优惠码
*/
private String profitCode;
/**
* 优惠下发时间
*/
private String getproTime;
/**
* 优惠时间
*/
private String profitTime;
/**
* 优惠金额面值
*/
private String profitCharge;
/**
* 生效金额
*/
private String profitChargeValue;
/**
* 备注
*/
private String profitmemo;
/**
* 区域 id
*/
private String areaId;
/**
* 区域名称
*/
private String areaName;
/**
* 车位编号
*/
private String placeNumber;
/**
* 备注信息
*/
private String placememo;
/**
* 时间
*/
private String costTime;
}

View File

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.parking.dal.dataobject.channelinformation;
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 ss
*/
@TableName("channel_information_do")
@KeySequence("channel_information_do_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ChannelInformationDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* 场库编号
*/
private String parkNumber;
/**
* 数据条数
*/
private Integer size;
/**
* 通道 Id
*/
private String passagewayId;
/**
* 通道名称
*/
private String passagewayName;
/**
* 源区域 Id
*/
private String sourceAreaId;
/**
* 目标区域 Id
*/
private String targetAreaId;
}

View File

@ -0,0 +1,116 @@
package cn.iocoder.yudao.module.parking.dal.dataobject.chargeinformation;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
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("charge_information_do")
@KeySequence("charge_information_do_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ChargeInformationDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* 场库编号
*/
private String parkNumber;
/**
* 收费信息数量
*/
private Integer size;
/**
* 车牌号
*/
private String plate;
/**
* 入场时间
*/
private String inTime;
/**
* 结算时间
*/
private String outTime;
/**
* 入场通道
*/
private String inChannel;
/**
* 出场通道
*/
private String outChannel;
/**
* 支付类型
*/
private String payKind;
/**
* 支付渠道
*/
private String payChannel;
/**
* 入场订单号
*/
private String orderId;
/**
* 车辆类型
*/
private String carType;
/**
* 支付订单号
*/
private String payNo;
/**
* 备注
*/
private String memo;
/**
* 应缴金额
*/
private String charge;
/**
* 实收金额
*/
private String realCharge;
/**
* 优惠金额
*/
private String couponCharge;
/**
* 区域 ID
*/
private String areaId;
/**
* 操作员名称
*/
private String operatorName;
/**
* 操作员联系电话
*/
private String operatorTelphone;
/**
* 支付订单号
*/
private String outTradeNo;
/**
* 车牌颜色
*/
private String plateColor;
}

View File

@ -0,0 +1,132 @@
package cn.iocoder.yudao.module.parking.dal.dataobject.entryrecord;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
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("entry_record_do")
@KeySequence("entry_record_do_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EntryRecordDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* 停车场编号
*/
private String parkNumber;
/**
* 数据条数
*/
private Integer size;
/**
* 车牌
*/
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 String userIdCard;
/**
* 车主姓名
*/
private String userName;
/**
* 联系电话
*/
private String phone;
/**
* 地址
*/
private String address;
/**
* 区域 id
*/
private String areaId;
/**
* 区域名称
*/
private String areaName;
/**
* 车位编号
*/
private String placeNumber;
/**
* 备注信息
*/
private String memo;
/**
* 是否开闸
*/
private String barriorOpen;
/**
* 开闸耗时
*/
private String costTime;
}

View File

@ -0,0 +1,75 @@
package cn.iocoder.yudao.module.parking.dal.mysql.appearancerecord;
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.controller.admin.appearancerecord.vo.AppearanceRecordPageReqVO;
import cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord.AppearanceRecordDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 出场记录 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface AppearanceRecordMapper extends BaseMapperX<AppearanceRecordDO> {
default PageResult<AppearanceRecordDO> selectPage(AppearanceRecordPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<AppearanceRecordDO>()
.eqIfPresent(AppearanceRecordDO::getParkNumber, reqVO.getParkNumber())
.eqIfPresent(AppearanceRecordDO::getSize, reqVO.getSize())
.betweenIfPresent(AppearanceRecordDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(AppearanceRecordDO::getOrderId, reqVO.getOrderId())
.eqIfPresent(AppearanceRecordDO::getOperatorId, reqVO.getOperatorId())
.likeIfPresent(AppearanceRecordDO::getOperatorName, reqVO.getOperatorName())
.eqIfPresent(AppearanceRecordDO::getPlate, reqVO.getPlate())
.eqIfPresent(AppearanceRecordDO::getPlateColor, reqVO.getPlateColor())
.eqIfPresent(AppearanceRecordDO::getTicketCode, reqVO.getTicketCode())
.eqIfPresent(AppearanceRecordDO::getCarType, reqVO.getCarType())
.eqIfPresent(AppearanceRecordDO::getConfidence, reqVO.getConfidence())
.eqIfPresent(AppearanceRecordDO::getIdCard, reqVO.getIdCard())
.betweenIfPresent(AppearanceRecordDO::getInTime, reqVO.getInTime())
.betweenIfPresent(AppearanceRecordDO::getOutTime, reqVO.getOutTime())
.eqIfPresent(AppearanceRecordDO::getInImage, reqVO.getInImage())
.eqIfPresent(AppearanceRecordDO::getOutImage, reqVO.getOutImage())
.eqIfPresent(AppearanceRecordDO::getInChannel, reqVO.getInChannel())
.eqIfPresent(AppearanceRecordDO::getOutChannel, reqVO.getOutChannel())
.eqIfPresent(AppearanceRecordDO::getOpenGateMode, reqVO.getOpenGateMode())
.eqIfPresent(AppearanceRecordDO::getMatchMode, reqVO.getMatchMode())
.eqIfPresent(AppearanceRecordDO::getCharge, reqVO.getCharge())
.eqIfPresent(AppearanceRecordDO::getOnLineCharge, reqVO.getOnLineCharge())
.eqIfPresent(AppearanceRecordDO::getOffLineCharge, reqVO.getOffLineCharge())
.eqIfPresent(AppearanceRecordDO::getProfitChargeTotal, reqVO.getProfitChargeTotal())
.eqIfPresent(AppearanceRecordDO::getOnLineProfitChargeNum, reqVO.getOnLineProfitChargeNum())
.eqIfPresent(AppearanceRecordDO::getOnLineProfitChargeValue, reqVO.getOnLineProfitChargeValue())
.eqIfPresent(AppearanceRecordDO::getOffLineProfitChargeNum, reqVO.getOffLineProfitChargeNum())
.eqIfPresent(AppearanceRecordDO::getOffLineProfitChargeValue, reqVO.getOffLineProfitChargeValue())
.eqIfPresent(AppearanceRecordDO::getOnLineProfitTimeNum, reqVO.getOnLineProfitTimeNum())
.eqIfPresent(AppearanceRecordDO::getOnLineProfitTimeValue, reqVO.getOnLineProfitTimeValue())
.eqIfPresent(AppearanceRecordDO::getOffLineProfitTimeNum, reqVO.getOffLineProfitTimeNum())
.eqIfPresent(AppearanceRecordDO::getOffLineProfitTimeValue, reqVO.getOffLineProfitTimeValue())
.eqIfPresent(AppearanceRecordDO::getPayNo, reqVO.getPayNo())
.betweenIfPresent(AppearanceRecordDO::getGetTime, reqVO.getGetTime())
.eqIfPresent(AppearanceRecordDO::getPayCharge, reqVO.getPayCharge())
.eqIfPresent(AppearanceRecordDO::getPayKind, reqVO.getPayKind())
.eqIfPresent(AppearanceRecordDO::getPayChannel, reqVO.getPayChannel())
.eqIfPresent(AppearanceRecordDO::getMemo, reqVO.getMemo())
.eqIfPresent(AppearanceRecordDO::getProfitCode, reqVO.getProfitCode())
.betweenIfPresent(AppearanceRecordDO::getGetproTime, reqVO.getGetproTime())
.betweenIfPresent(AppearanceRecordDO::getProfitTime, reqVO.getProfitTime())
.eqIfPresent(AppearanceRecordDO::getProfitCharge, reqVO.getProfitCharge())
.eqIfPresent(AppearanceRecordDO::getProfitChargeValue, reqVO.getProfitChargeValue())
.eqIfPresent(AppearanceRecordDO::getProfitmemo, reqVO.getProfitmemo())
.eqIfPresent(AppearanceRecordDO::getAreaId, reqVO.getAreaId())
.likeIfPresent(AppearanceRecordDO::getAreaName, reqVO.getAreaName())
.eqIfPresent(AppearanceRecordDO::getPlaceNumber, reqVO.getPlaceNumber())
.eqIfPresent(AppearanceRecordDO::getPlacememo, reqVO.getPlacememo())
.betweenIfPresent(AppearanceRecordDO::getCostTime, reqVO.getCostTime())
.orderByDesc(AppearanceRecordDO::getId));
}
}

View File

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.parking.dal.mysql.channelinformation;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.parking.controller.admin.channelinformation.vo.ChannelInformationPageReqVO;
import cn.iocoder.yudao.module.parking.dal.dataobject.channelinformation.ChannelInformationDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 通道信息 Mapper
*
* @author ss
*/
@Mapper
public interface ChannelInformationMapper extends BaseMapperX<ChannelInformationDO> {
default PageResult<ChannelInformationDO> selectPage(ChannelInformationPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ChannelInformationDO>()
.eqIfPresent(ChannelInformationDO::getParkNumber, reqVO.getParkNumber())
.eqIfPresent(ChannelInformationDO::getSize, reqVO.getSize())
.eqIfPresent(ChannelInformationDO::getPassagewayId, reqVO.getPassagewayId())
.likeIfPresent(ChannelInformationDO::getPassagewayName, reqVO.getPassagewayName())
.eqIfPresent(ChannelInformationDO::getSourceAreaId, reqVO.getSourceAreaId())
.eqIfPresent(ChannelInformationDO::getTargetAreaId, reqVO.getTargetAreaId())
.betweenIfPresent(ChannelInformationDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ChannelInformationDO::getId));
}
}

View File

@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.parking.dal.mysql.chargeinformation;
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.chargeinformation.ChargeInformationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.parking.controller.admin.chargeinformation.vo.*;
/**
* 收费信息 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface ChargeInformationMapper extends BaseMapperX<ChargeInformationDO> {
default PageResult<ChargeInformationDO> selectPage(ChargeInformationPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ChargeInformationDO>()
.eqIfPresent(ChargeInformationDO::getParkNumber, reqVO.getParkNumber())
.eqIfPresent(ChargeInformationDO::getSize, reqVO.getSize())
.eqIfPresent(ChargeInformationDO::getPlate, reqVO.getPlate())
.betweenIfPresent(ChargeInformationDO::getInTime, reqVO.getInTime())
.betweenIfPresent(ChargeInformationDO::getOutTime, reqVO.getOutTime())
.eqIfPresent(ChargeInformationDO::getInChannel, reqVO.getInChannel())
.eqIfPresent(ChargeInformationDO::getOutChannel, reqVO.getOutChannel())
.eqIfPresent(ChargeInformationDO::getPayKind, reqVO.getPayKind())
.eqIfPresent(ChargeInformationDO::getPayChannel, reqVO.getPayChannel())
.eqIfPresent(ChargeInformationDO::getOrderId, reqVO.getOrderId())
.eqIfPresent(ChargeInformationDO::getCarType, reqVO.getCarType())
.eqIfPresent(ChargeInformationDO::getPayNo, reqVO.getPayNo())
.eqIfPresent(ChargeInformationDO::getMemo, reqVO.getMemo())
.eqIfPresent(ChargeInformationDO::getCharge, reqVO.getCharge())
.eqIfPresent(ChargeInformationDO::getRealCharge, reqVO.getRealCharge())
.eqIfPresent(ChargeInformationDO::getCouponCharge, reqVO.getCouponCharge())
.eqIfPresent(ChargeInformationDO::getAreaId, reqVO.getAreaId())
.likeIfPresent(ChargeInformationDO::getOperatorName, reqVO.getOperatorName())
.eqIfPresent(ChargeInformationDO::getOperatorTelphone, reqVO.getOperatorTelphone())
.eqIfPresent(ChargeInformationDO::getOutTradeNo, reqVO.getOutTradeNo())
.eqIfPresent(ChargeInformationDO::getPlateColor, reqVO.getPlateColor())
.betweenIfPresent(ChargeInformationDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ChargeInformationDO::getId));
}
}

View File

@ -0,0 +1,51 @@
package cn.iocoder.yudao.module.parking.dal.mysql.entryrecord;
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.entryrecord.EntryRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.parking.controller.admin.entryrecord.vo.*;
/**
* 入场记录 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface EntryRecordMapper extends BaseMapperX<EntryRecordDO> {
default PageResult<EntryRecordDO> selectPage(EntryRecordPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<EntryRecordDO>()
.eqIfPresent(EntryRecordDO::getParkNumber, reqVO.getParkNumber())
.eqIfPresent(EntryRecordDO::getSize, reqVO.getSize())
.eqIfPresent(EntryRecordDO::getPlate, reqVO.getPlate())
.eqIfPresent(EntryRecordDO::getTicketCode, reqVO.getTicketCode())
.eqIfPresent(EntryRecordDO::getPlateColor, reqVO.getPlateColor())
.betweenIfPresent(EntryRecordDO::getInTime, reqVO.getInTime())
.eqIfPresent(EntryRecordDO::getInChannel, reqVO.getInChannel())
.eqIfPresent(EntryRecordDO::getInImage, reqVO.getInImage())
.eqIfPresent(EntryRecordDO::getOrderId, reqVO.getOrderId())
.eqIfPresent(EntryRecordDO::getVisitReason, reqVO.getVisitReason())
.eqIfPresent(EntryRecordDO::getOpenGateMode, reqVO.getOpenGateMode())
.eqIfPresent(EntryRecordDO::getMatchMode, reqVO.getMatchMode())
.eqIfPresent(EntryRecordDO::getIdCard, reqVO.getIdCard())
.eqIfPresent(EntryRecordDO::getConfidence, reqVO.getConfidence())
.eqIfPresent(EntryRecordDO::getCarType, reqVO.getCarType())
.eqIfPresent(EntryRecordDO::getUserIdCard, reqVO.getUserIdCard())
.likeIfPresent(EntryRecordDO::getUserName, reqVO.getUserName())
.eqIfPresent(EntryRecordDO::getPhone, reqVO.getPhone())
.eqIfPresent(EntryRecordDO::getAddress, reqVO.getAddress())
.eqIfPresent(EntryRecordDO::getAreaId, reqVO.getAreaId())
.likeIfPresent(EntryRecordDO::getAreaName, reqVO.getAreaName())
.eqIfPresent(EntryRecordDO::getPlaceNumber, reqVO.getPlaceNumber())
.eqIfPresent(EntryRecordDO::getMemo, reqVO.getMemo())
.eqIfPresent(EntryRecordDO::getBarriorOpen, reqVO.getBarriorOpen())
.betweenIfPresent(EntryRecordDO::getCostTime, reqVO.getCostTime())
.betweenIfPresent(EntryRecordDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(EntryRecordDO::getId));
}
}

View File

@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.parking.framework.security.config;
import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer;
import cn.iocoder.yudao.module.parking.enums.ApiConstants;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
/**
* Demo 模块的 Security 配置
*/
@Configuration(proxyBeanMethods = false)
public class SecurityConfiguration {
@Bean
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
return new AuthorizeRequestsCustomizer() {
@Override
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
// Swagger 接口文档
registry.antMatchers("/v3/api-docs/**").permitAll() // 元数据
.antMatchers("/swagger-ui.html").permitAll(); // Swagger UI
// Druid 监控
registry.antMatchers("/druid/**").anonymous();
// Spring Boot Actuator 的安全配置
registry.antMatchers("/actuator").anonymous()
.antMatchers("/actuator/**").anonymous();
// RPC 服务的安全配置
registry.antMatchers(ApiConstants.PREFIX + "/**").permitAll();
}
};
}
}

View File

@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.parking.service.appearancerecord;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.parking.controller.admin.appearancerecord.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord.AppearanceRecordDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.parking.controller.admin.appearancerecord.vo.AppearanceRecordPageReqVO;
import cn.iocoder.yudao.module.parking.controller.admin.appearancerecord.vo.AppearanceRecordSaveReqVO;
/**
* 出场记录 Service 接口
*
* @author 芋道源码
*/
public interface AppearanceRecordService {
/**
* 创建出场记录
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createRecord(@Valid AppearanceRecordSaveReqVO createReqVO);
/**
* 更新出场记录
*
* @param updateReqVO 更新信息
*/
void updateRecord(@Valid AppearanceRecordSaveReqVO updateReqVO);
/**
* 删除出场记录
*
* @param id 编号
*/
void deleteRecord(Long id);
/**
* 获得出场记录
*
* @param id 编号
* @return 出场记录
*/
AppearanceRecordDO getRecord(Long id);
/**
* 获得出场记录分页
*
* @param pageReqVO 分页查询
* @return 出场记录分页
*/
PageResult<AppearanceRecordDO> getRecordPage(AppearanceRecordPageReqVO pageReqVO);
}

View File

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.parking.service.appearancerecord;
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.appearancerecord.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord.AppearanceRecordDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.parking.dal.mysql.appearancerecord.AppearanceRecordMapper;
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 AppearanceRecordServiceImpl implements AppearanceRecordService {
@Resource
private AppearanceRecordMapper recordMapper;
@Override
public Long createRecord(AppearanceRecordSaveReqVO createReqVO) {
// 插入
AppearanceRecordDO record = BeanUtils.toBean(createReqVO, AppearanceRecordDO.class);
recordMapper.insert(record);
// 返回
return record.getId();
}
@Override
public void updateRecord(AppearanceRecordSaveReqVO updateReqVO) {
// 校验存在
validateRecordExists(updateReqVO.getId());
// 更新
AppearanceRecordDO updateObj = BeanUtils.toBean(updateReqVO, AppearanceRecordDO.class);
recordMapper.updateById(updateObj);
}
@Override
public void deleteRecord(Long id) {
// 校验存在
validateRecordExists(id);
// 删除
recordMapper.deleteById(id);
}
private void validateRecordExists(Long id) {
if (recordMapper.selectById(id) == null) {
throw exception(RECORD_NOT_EXISTS);
}
}
@Override
public AppearanceRecordDO getRecord(Long id) {
return recordMapper.selectById(id);
}
@Override
public PageResult<AppearanceRecordDO> getRecordPage(AppearanceRecordPageReqVO pageReqVO) {
return recordMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.parking.service.channelinformation;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.parking.controller.admin.channelinformation.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.channelinformation.ChannelInformationDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.parking.controller.admin.channelinformation.vo.ChannelInformationPageReqVO;
import cn.iocoder.yudao.module.parking.controller.admin.channelinformation.vo.ChannelInformationSaveReqVO;
/**
* 通道信息 Service 接口
*
* @author ss
*/
public interface ChannelInformationService {
/**
* 创建通道信息
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createInformation(@Valid ChannelInformationSaveReqVO createReqVO);
/**
* 更新通道信息
*
* @param updateReqVO 更新信息
*/
void updateInformation(@Valid ChannelInformationSaveReqVO updateReqVO);
/**
* 删除通道信息
*
* @param id 编号
*/
void deleteInformation(Long id);
/**
* 获得通道信息
*
* @param id 编号
* @return 通道信息
*/
ChannelInformationDO getInformation(Long id);
/**
* 获得通道信息分页
*
* @param pageReqVO 分页查询
* @return 通道信息分页
*/
PageResult<ChannelInformationDO> getInformationPage(ChannelInformationPageReqVO pageReqVO);
}

View File

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.parking.service.channelinformation;
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.channelinformation.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.channelinformation.ChannelInformationDO;
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.channelinformation.ChannelInformationMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.parking.enums.ErrorCodeConstants.*;
/**
* 通道信息 Service 实现类
*
* @author ss
*/
@Service
@Validated
public class ChannelInformationServiceImpl implements ChannelInformationService {
@Resource
private ChannelInformationMapper informationMapper;
@Override
public Long createInformation(ChannelInformationSaveReqVO createReqVO) {
// 插入
ChannelInformationDO information = BeanUtils.toBean(createReqVO, ChannelInformationDO.class);
informationMapper.insert(information);
// 返回
return information.getId();
}
@Override
public void updateInformation(ChannelInformationSaveReqVO updateReqVO) {
// 校验存在
validateInformationExists(updateReqVO.getId());
// 更新
ChannelInformationDO updateObj = BeanUtils.toBean(updateReqVO, ChannelInformationDO.class);
informationMapper.updateById(updateObj);
}
@Override
public void deleteInformation(Long id) {
// 校验存在
validateInformationExists(id);
// 删除
informationMapper.deleteById(id);
}
private void validateInformationExists(Long id) {
if (informationMapper.selectById(id) == null) {
throw exception(INFORMATION_NOT_EXISTS);
}
}
@Override
public ChannelInformationDO getInformation(Long id) {
return informationMapper.selectById(id);
}
@Override
public PageResult<ChannelInformationDO> getInformationPage(ChannelInformationPageReqVO pageReqVO) {
return informationMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.parking.service.chargeinformation;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.parking.controller.admin.chargeinformation.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.chargeinformation.ChargeInformationDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* 收费信息 Service 接口
*
* @author 芋道源码
*/
public interface ChargeInformationService {
/**
* 创建收费信息
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createInformation(@Valid ChargeInformationSaveReqVO createReqVO);
/**
* 更新收费信息
*
* @param updateReqVO 更新信息
*/
void updateInformation(@Valid ChargeInformationSaveReqVO updateReqVO);
/**
* 删除收费信息
*
* @param id 编号
*/
void deleteInformation(Long id);
/**
* 获得收费信息
*
* @param id 编号
* @return 收费信息
*/
ChargeInformationDO getInformation(Long id);
/**
* 获得收费信息分页
*
* @param pageReqVO 分页查询
* @return 收费信息分页
*/
PageResult<ChargeInformationDO> getInformationPage(ChargeInformationPageReqVO pageReqVO);
}

View File

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.parking.service.chargeinformation;
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.chargeinformation.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.chargeinformation.ChargeInformationDO;
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.chargeinformation.ChargeInformationMapper;
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 ChargeInformationServiceImpl implements ChargeInformationService {
@Resource
private ChargeInformationMapper informationMapper;
@Override
public Long createInformation(ChargeInformationSaveReqVO createReqVO) {
// 插入
ChargeInformationDO information = BeanUtils.toBean(createReqVO, ChargeInformationDO.class);
informationMapper.insert(information);
// 返回
return information.getId();
}
@Override
public void updateInformation(ChargeInformationSaveReqVO updateReqVO) {
// 校验存在
validateInformationExists(updateReqVO.getId());
// 更新
ChargeInformationDO updateObj = BeanUtils.toBean(updateReqVO, ChargeInformationDO.class);
informationMapper.updateById(updateObj);
}
@Override
public void deleteInformation(Long id) {
// 校验存在
validateInformationExists(id);
// 删除
informationMapper.deleteById(id);
}
private void validateInformationExists(Long id) {
if (informationMapper.selectById(id) == null) {
throw exception(CHARGE_INFORMATION_NOT_EXISTS);
}
}
@Override
public ChargeInformationDO getInformation(Long id) {
return informationMapper.selectById(id);
}
@Override
public PageResult<ChargeInformationDO> getInformationPage(ChargeInformationPageReqVO pageReqVO) {
return informationMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.parking.service.entryrecord;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.parking.controller.admin.entryrecord.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.entryrecord.EntryRecordDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* 入场记录 Service 接口
*
* @author 芋道源码
*/
public interface EntryRecordService {
/**
* 创建入场记录
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createEntryRecord(@Valid EntryRecordSaveReqVO createReqVO);
/**
* 更新入场记录
*
* @param updateReqVO 更新信息
*/
void updateEntryRecord(@Valid EntryRecordSaveReqVO updateReqVO);
/**
* 删除入场记录
*
* @param id 编号
*/
void deleteEntryRecord(Long id);
/**
* 获得入场记录
*
* @param id 编号
* @return 入场记录
*/
EntryRecordDO getEntryRecord(Long id);
/**
* 获得入场记录分页
*
* @param pageReqVO 分页查询
* @return 入场记录分页
*/
PageResult<EntryRecordDO> getEntryRecordPage(EntryRecordPageReqVO pageReqVO);
}

View File

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.parking.service.entryrecord;
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.entryrecord.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.entryrecord.EntryRecordDO;
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.entryrecord.EntryRecordMapper;
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 EntryRecordServiceImpl implements EntryRecordService {
@Resource
private EntryRecordMapper entryRecordMapper;
@Override
public Long createEntryRecord(EntryRecordSaveReqVO createReqVO) {
// 插入
EntryRecordDO entryRecord = BeanUtils.toBean(createReqVO, EntryRecordDO.class);
entryRecordMapper.insert(entryRecord);
// 返回
return entryRecord.getId();
}
@Override
public void updateEntryRecord(EntryRecordSaveReqVO updateReqVO) {
// 校验存在
validateEntryRecordExists(updateReqVO.getId());
// 更新
EntryRecordDO updateObj = BeanUtils.toBean(updateReqVO, EntryRecordDO.class);
entryRecordMapper.updateById(updateObj);
}
@Override
public void deleteEntryRecord(Long id) {
// 校验存在
validateEntryRecordExists(id);
// 删除
entryRecordMapper.deleteById(id);
}
private void validateEntryRecordExists(Long id) {
if (entryRecordMapper.selectById(id) == null) {
throw exception(ENTRY_RECORD_NOT_EXISTS);
}
}
@Override
public EntryRecordDO getEntryRecord(Long id) {
return entryRecordMapper.selectById(id);
}
@Override
public PageResult<EntryRecordDO> getEntryRecordPage(EntryRecordPageReqVO pageReqVO) {
return entryRecordMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,103 @@
--- #################### 数据库相关配置 ####################
spring:
# 数据源配置项
autoconfigure:
exclude:
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
datasource:
druid: # Druid 【监控】相关的全局配置
web-stat-filter:
enabled: true
stat-view-servlet:
enabled: true
allow: # 设置白名单,不填则允许所有访问
url-pattern: /druid/*
login-username: # 控制台管理用户名和密码
login-password:
filter:
stat:
enabled: true
log-slow-sql: true # 慢 SQL 记录
slow-sql-millis: 100
merge-sql: true
wall:
config:
multi-statement-allow: true
dynamic: # 多数据源配置
druid: # Druid 【连接池】相关的全局配置
initial-size: 5 # 初始连接数
min-idle: 10 # 最小连接池数量
max-active: 20 # 最大连接池数量
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
test-while-idle: true
test-on-borrow: false
test-on-return: false
primary: master
datasource:
master:
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
username: root
password: 123456
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
lazy: true # 开启懒加载,保证启动速度
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
username: root
password: 123456
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis:
host: 400-infra.server.iocoder.cn # 地址
port: 6379 # 端口
database: 1 # 数据库索引
# password: 123456 # 密码,建议生产环境开启
--- #################### MQ 消息队列相关配置 ####################
--- #################### 定时任务相关配置 ####################
xxl:
job:
admin:
addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
--- #################### 服务保障相关配置 ####################
# Lock4j 配置项
lock4j:
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
--- #################### 监控相关配置 ####################
# Actuator 监控端点的配置项
management:
endpoints:
web:
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
exposure:
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
# Spring Boot Admin 配置项
spring:
boot:
admin:
# Spring Boot Admin Client 客户端的相关配置
client:
instance:
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
# Spring Boot Admin Server 服务端的相关配置
context-path: /admin # 配置 Spring
--- #################### 芋道相关配置 ####################
# 芋道配置项,设置当前项目所有自定义的配置
yudao:
xss:
enable: false
web:
admin-ui:
url: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址
demo: true # 开启演示模式

View File

@ -0,0 +1,126 @@
--- #################### 数据库相关配置 ####################
spring:
# 数据源配置项
autoconfigure:
exclude:
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
- de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置
datasource:
druid: # Druid 【监控】相关的全局配置
web-stat-filter:
enabled: true
stat-view-servlet:
enabled: true
allow: # 设置白名单,不填则允许所有访问
url-pattern: /druid/*
login-username: # 控制台管理用户名和密码
login-password:
filter:
stat:
enabled: true
log-slow-sql: true # 慢 SQL 记录
slow-sql-millis: 100
merge-sql: true
wall:
config:
multi-statement-allow: true
dynamic: # 多数据源配置
druid: # Druid 【连接池】相关的全局配置
initial-size: 1 # 初始连接数
min-idle: 1 # 最小连接池数量
max-active: 20 # 最大连接池数量
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
test-while-idle: true
test-on-borrow: false
test-on-return: false
primary: master
datasource:
master:
url: jdbc:mysql://120.46.37.243:3306/ludu_park?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro # SQLServer 连接的示例
# url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
username: root
password: xpower1234
# username: sa # SQL Server 连接的示例
# password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例
# username: SYSDBA # DM 连接的示例
# password: SYSDBA # DM 连接的示例
slave: # 模拟从库,可根据自己需要修改
lazy: true # 开启懒加载,保证启动速度
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root
password: 123456
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis:
host: 127.0.0.1 # 地址
port: 6379 # 端口
database: 0 # 数据库索引
# password: 123456 # 密码,建议生产环境开启
--- #################### MQ 消息队列相关配置 ####################
--- #################### 定时任务相关配置 ####################
xxl:
job:
enabled: false # 是否开启调度中心,默认为 true 开启
admin:
addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
--- #################### 服务保障相关配置 ####################
# Lock4j 配置项
lock4j:
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
--- #################### 监控相关配置 ####################
# Actuator 监控端点的配置项
management:
endpoints:
web:
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
exposure:
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
# Spring Boot Admin 配置项
spring:
boot:
admin:
# Spring Boot Admin Client 客户端的相关配置
client:
instance:
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
# 日志文件配置
logging:
level:
# 配置自己写的 MyBatis Mapper 打印日志
cn.iocoder.yudao.module.parking.dal.mysql: debug
# cn.iocoder.yudao.module.system.dal.mysql.sensitiveword.SensitiveWordMapper: INFO # 配置 SensitiveWordMapper 的日志级别为 info
# cn.iocoder.yudao.module.system.dal.mysql.sms.SmsChannelMapper: INFO # 配置 SmsChannelMapper 的日志级别为 info
--- #################### 芋道相关配置 ####################
# 芋道配置项,设置当前项目所有自定义的配置
yudao:
env: # 多环境的配置项
tag: ${HOSTNAME}
web:
admin-ui:
url: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址
security:
mock-enable: true
xss:
enable: false
access-log: # 访问日志的配置项
enable: false
demo: false # 关闭演示模式

View File

@ -0,0 +1,115 @@
spring:
main:
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
# Servlet 配置
servlet:
# 文件上传相关配置项
multipart:
max-file-size: 16MB # 单个文件大小
max-request-size: 32MB # 设置总上传的文件大小
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER # 解决 SpringFox 与 SpringBoot 2.6.x 不兼容的问题,参见 SpringFoxHandlerProviderBeanPostProcessor 类
# Jackson 配置项
jackson:
serialization:
write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
fail-on-empty-beans: false # 允许序列化无属性的 Bean
# Cache 配置项
cache:
type: REDIS
redis:
time-to-live: 1h # 设置过期时间为 1 小时
--- #################### 接口文档配置 ####################
springdoc:
api-docs:
enabled: true # 1. 是否开启 Swagger 接文档的元数据
path: /v3/api-docs
swagger-ui:
enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面
path: /swagger-ui.html
default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档
knife4j:
enable: true # 2.2 是否开启 Swagger 文档的 Knife4j UI 界面
setting:
language: zh_cn
# MyBatis Plus 的配置项
mybatis-plus:
configuration:
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
global-config:
db-config:
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
# id-type: AUTO # 自增 ID适合 MySQL 等直接自增的数据库
# id-type: INPUT # 用户输入 ID适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
# id-type: ASSIGN_ID # 分配 ID默认使用雪花算法。注意Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
banner: false # 关闭控制台的 Banner 打印
type-aliases-package: ${yudao.info.base-package}.dal.dataobject
encryptor:
password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成
mybatis-plus-join:
banner: false # 关闭控制台的 Banner 打印
# Spring Data Redis 配置
spring:
data:
redis:
repositories:
enabled: false # 项目未使用到 Spring Data Redis 的 Repository所以直接禁用保证启动速度
# VO 转换(数据翻译)相关
easy-trans:
is-enable-global: true # 启用全局翻译(拦截所有 SpringMVC ResponseBody 进行自动翻译 )。如果对于性能要求很高可关闭此配置,或通过 @IgnoreTrans 忽略某个接口
is-enable-cloud: false # 禁用 TransType.RPC 微服务模式
--- #################### RPC 远程调用相关配置 ####################
--- #################### MQ 消息队列相关配置 ####################
--- #################### 定时任务相关配置 ####################
xxl:
job:
admin:
addresses: http://127.0.0.1:9090/xxl-job-admin
executor:
appname: ${spring.application.name} # 执行器 AppName
address:
ip: # 执行器IP [选填]默认为空表示自动获取IP多网卡时可手动设置指定IP该IP不会绑定Host仅作为通讯实用地址信息用于 "执行器注册" 和 "调度中心请求并触发任务"
port: 0 # ### 执行器端口号 [选填]小于等于0则自动获取默认端口为9999单机部署多个执行器时注意要配置不同执行器端口
logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径
logretentiondays: 30 # 执行器日志文件保存天数 [选填] 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
accessToken: # 执行器通讯TOKEN
--- #################### 芋道相关配置 ####################
yudao:
info:
version: 1.0.0
base-package: cn.iocoder.yudao.module.parking
swagger:
title: 管理后台
description: 提供管理员管理的所有功能
version: ${yudao.info.version}
base-package: ${yudao.info.base-package}
captcha:
enable: true # 验证码的开关,默认为 true
tenant: # 多租户相关配置项
enable: false
ignore-urls:
ignore-tables:
debug: false

View File

@ -0,0 +1,23 @@
--- #################### 注册中心相关配置 ####################
spring:
cloud:
nacos:
server-addr: 127.0.0.1:8848
discovery:
namespace: dev # 命名空间。这里使用 dev 开发环境
metadata:
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
--- #################### 配置中心相关配置 ####################
spring:
cloud:
nacos:
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
config:
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
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties

View File

@ -0,0 +1,14 @@
spring:
application:
name: parking-server
profiles:
active: local
server:
port: 48090
# 日志文件配置。注意,如果 logging.file.name 不放在 bootstrap.yaml 配置文件,而是放在 application.yaml 中,会导致出现 LOG_FILE_IS_UNDEFINED 文件
logging:
file:
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>yudao</artifactId>
<groupId>cn.iocoder.cloud</groupId>
<version>${revision}</version> <!-- 1. 修改 version 为 ${revision} -->
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>ludu-module-parking</artifactId>
<packaging>pom</packaging> <!-- 2. 新增 packaging 为 pom -->
<name>${project.artifactId}</name>
<version>2.1.0-jdk8-snapshot</version> <!-- 3. 新增 name 为 ${project.artifactId} -->
<description> <!-- 4. 新增 description 为该模块的描述 -->
demo 模块,主要实现 XXX、YYY、ZZZ 等功能。
</description>
<modules>
<module>ludu-module-parking-api</module>
<module>ludu-module-parking-biz</module>
</modules>
</project>

View File

@ -9,4 +9,5 @@ public interface ErrorCodeConstants {
ErrorCode ASSET_NOT_EXISTS = new ErrorCode(1_005_001_000, "设备不存在");
ErrorCode CHECK_TICKET_NOT_EXISTS = new ErrorCode(1_005_001_001, "检票不存在");
ErrorCode SALE_DATA_NOT_EXISTS = new ErrorCode(1_005_001_002, "售票不存在");
}

View File

@ -44,3 +44,5 @@ public class AssetConvertImpl implements AssetConvert {
return list1;
}
}

View File

@ -17,10 +17,11 @@
<module>yudao-module-member</module>
<module>ludu-module-ticket-manager</module>
<module>ludu-module-sampling</module>
<module>ludu-module-sampling/ludu-module-sampling-api</module>
<module>ludu-module-sampling/ludu-module-sampling-biz</module>
<module>ludu-job-admin</module>
<module>ludu-job-admin/ludu-job-admin-biz</module>
<module>ludu-module-parking</module>
<module>ludu-module-parking/ludu-module-parking-api</module>
<!-- <module>yudao-module-bpm</module>-->
<!-- <module>yudao-module-pay</module>-->
<!-- <module>yudao-module-report</module>-->

View File

@ -58,3 +58,4 @@ public final class ServiceException extends RuntimeException {
}
}

View File

@ -69,6 +69,7 @@ public class CommonResult<T> implements Serializable {
}
public static boolean isSuccess(Integer code) {
System.out.println("--------------------------------code:"+code);
return Objects.equals(code, GlobalErrorCodeConstants.SUCCESS.getCode());
}
@ -110,3 +111,5 @@ public class CommonResult<T> implements Serializable {
}
}

View File

@ -36,11 +36,12 @@ public class TenantContextHolder {
* @return 租户编号
*/
public static Long getRequiredTenantId() {
Long tenantId = getTenantId();
if (tenantId == null) {
throw new NullPointerException("TenantContextHolder 不存在租户编号!可参考文档:"
+ DocumentEnum.TENANT.getUrl());
}
// Long tenantId = getTenantId();
Long tenantId = 1L;
// if (tenantId == null) {
// throw new NullPointerException("TenantContextHolder 不存在租户编号!可参考文档:"
// + DocumentEnum.TENANT.getUrl());
// }
return tenantId;
}

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.framework.excel.core.convert;
import cn.hutool.core.convert.Convert;
import cn.iocoder.yudao.framework.ip.core.Area;
import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
import com.alibaba.excel.converters.Converter;

View File

@ -70,6 +70,16 @@ public class SecurityFrameworkServiceImpl implements SecurityFrameworkService {
@Override
@SneakyThrows
public boolean hasAnyPermissions(String... permissions) {
// System.out.println("----------------------");
// System.out.println(Arrays.asList(permissions).toString());
// KeyValue<Long, List<String>> longListKeyValue = new KeyValue<>(getLoginUserId(), Arrays.asList(permissions));
// System.out.println(longListKeyValue);
// System.out.println("----------------------");
// if (Arrays.asList(permissions).toString().equals("[channel:information:query]")
// || Arrays.asList(permissions).toString().equals("[appearance:record:query]")
// ||Arrays.asList(permissions).toString().equals("[appearance:record:create]")){
// return true;
// }
return hasAnyPermissionsCache.get(new KeyValue<>(getLoginUserId(), Arrays.asList(permissions)));
}

View File

@ -118,6 +118,19 @@ spring:
- Path=/app-api/promotion/**
filters:
- RewritePath=/app-api/promotion/v3/api-docs, /v3/api-docs
# member-server 服务
- id: parking-admin-api # 路由的编号
uri: grayLb://parking-server
predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组
- Path=/admin-api/parking/**
filters:
- RewritePath=/admin-api/parking/v3/api-docs, /v3/api-docs
- id: parking-app-api # 路由的编号
uri: grayLb://parking-server
predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组
- Path=/app-api/parking/**
filters:
- RewritePath=/app-api/parking/v3/api-docs, /v3/api-docs
## trade-server 服务
- id: trade-admin-api # 路由的编号
uri: grayLb://trade-server
@ -160,6 +173,7 @@ spring:
filters:
- RewritePath=/admin-api/ticket/v3/api-docs, /v3/api-docs # 配置,保证转发到 /v3/api-docs
x-forwarded:
prefix-enabled: false # 避免 Swagger 重复带上额外的 /admin-api/system 前缀

View File

@ -55,4 +55,11 @@ public interface ErrorCodeConstants {
ErrorCode GROUP_NOT_EXISTS = new ErrorCode(1_004_012_000, "用户分组不存在");
ErrorCode GROUP_HAS_USER = new ErrorCode(1_004_012_001, "用户分组下存在用户,无法删除");
// ========== 通道信息 1_004_013_001 ==========
ErrorCode INFOR_NOT_EXISTS = new ErrorCode(1_004_013_001, "通道信息不存在");
// ========== 通道信息 1_004_014_001 ==========
ErrorCode INFORMATION_NOT_EXISTS = new ErrorCode(1_004_014_001, "通道信息不存在");
}

View File

@ -11,6 +11,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.security.PermitAll;
import java.util.Collection;
import java.util.Set;
@ -31,6 +32,7 @@ public interface PermissionApi {
@Parameter(name = "userId", description = "用户编号", example = "1", required = true),
@Parameter(name = "permissions", description = "权限", example = "read,write", required = true)
})
@PermitAll
CommonResult<Boolean> hasAnyPermissions(@RequestParam("userId") Long userId,
@RequestParam("permissions") String... permissions);

View File

@ -67,7 +67,9 @@ public class PermissionServiceImpl implements PermissionService {
}
// 获得当前登录的角色如果为空说明没有权限
System.out.println("----------------------roles:"+userId);
List<RoleDO> roles = getEnableUserRoleListByUserIdFromCache(userId);
System.out.println("---------------------------roles2:"+roles);
if (CollUtil.isEmpty(roles)) {
return false;
}

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.RandomUtil;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
import cn.iocoder.yudao.framework.test.core.util.AssertUtils;
import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2CodeDO;
import cn.iocoder.yudao.module.system.dal.mysql.oauth2.OAuth2CodeMapper;
import org.assertj.core.util.Lists;
@ -15,7 +16,6 @@ import java.time.LocalDateTime;
import java.util.List;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.OAUTH2_CODE_EXPIRE;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.OAUTH2_CODE_NOT_EXISTS;
@ -63,7 +63,7 @@ class OAuth2CodeServiceImplTest extends BaseDbUnitTest {
@Test
public void testConsumeAuthorizationCode_null() {
// 调用并断言
assertServiceException(() -> oauth2CodeService.consumeAuthorizationCode(randomString()),
AssertUtils.assertServiceException(() -> oauth2CodeService.consumeAuthorizationCode(randomString()),
OAUTH2_CODE_NOT_EXISTS);
}
@ -77,7 +77,7 @@ class OAuth2CodeServiceImplTest extends BaseDbUnitTest {
oauth2CodeMapper.insert(codeDO);
// 调用并断言
assertServiceException(() -> oauth2CodeService.consumeAuthorizationCode(code),
AssertUtils.assertServiceException(() -> oauth2CodeService.consumeAuthorizationCode(code),
OAUTH2_CODE_EXPIRE);
}