From c0d0640e7d3ca07aecc3ef4665c7c641f459af54 Mon Sep 17 00:00:00 2001 From: sonjinyon <2476687577@qq.com> Date: Fri, 23 Aug 2024 09:44:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=BB=91=E5=90=8D=E5=8D=95?= =?UTF-8?q?=EF=BC=8C=E8=BF=9B=E5=87=BA=E5=9C=BA=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parking/enums/ErrorCodeConstants.java | 3 + .../AppearanceRecordController.java | 106 +++++++++ .../vo/AppearanceRecordPageReqVO.java | 109 +++++++++ .../vo/AppearanceRecordRespVO.java | 136 +++++++++++ .../vo/AppearanceRecordSaveReqVO.java | 120 ++++++++++ .../admin/black/BlackController.java | 225 ++++++++++++++++++ .../admin/black/vo/BlackPageReqVO.java | 34 +++ .../admin/black/vo/BlackRespVO.java | 43 ++++ .../admin/black/vo/BlackSaveReqVO.java | 27 +++ .../controller/admin/black/vo/BlackVO.java | 12 + .../controller/admin/black/vo/Datas.java | 9 + .../entryrecord/EntryRecordController.java | 105 ++++++++ .../entryrecord/vo/EntryRecordPageReqVO.java | 60 +++++ .../entryrecord/vo/EntryRecordRespVO.java | 72 ++++++ .../entryrecord/vo/EntryRecordSaveReqVO.java | 63 +++++ .../admin/white/vo/WhiteDeleteDO.java | 13 + .../appearancerecord/AppearanceRecordDO.java | 143 +++++++++++ .../appearancerecord/AppearanceRecordVO.java | 14 ++ .../appearancerecord/ChargeStatistics.java | 19 ++ .../dataobject/appearancerecord/DataList.java | 27 +++ .../dataobject/appearancerecord/PassInfo.java | 15 ++ .../parking/dal/dataobject/black/BlackDO.java | 49 ++++ .../dal/dataobject/charge/ChargeDO.java | 59 +++++ .../dal/dataobject/entryrecord/Datas.java | 29 +++ .../dataobject/entryrecord/EntryRecordDO.java | 79 ++++++ .../dataobject/entryrecord/EntryRecordVO.java | 14 ++ .../dal/dataobject/placeinfo/PlaceInfoDO.java | 51 ++++ .../dal/dataobject/profit/ProfitDO.java | 63 +++++ .../dal/dataobject/userinfo/UserInfoDO.java | 2 +- .../AppearanceRecordMapper.java | 54 +++++ .../parking/dal/mysql/black/BlackMapper.java | 30 +++ .../dal/mysql/charge/ChargeMapper.java | 18 ++ .../mysql/entryrecord/EntryRecordMapper.java | 38 +++ .../dal/mysql/placeinfo/PlaceInfoMapper.java | 18 ++ .../dal/mysql/profit/ProfitMapper.java | 16 ++ .../AppearanceRecordService.java | 59 +++++ .../AppearanceRecordServiceImpl.java | 196 +++++++++++++++ .../parking/service/black/BlackService.java | 55 +++++ .../service/black/BlackServiceImpl.java | 74 ++++++ .../parking/service/charge/ChargeService.java | 12 + .../service/charge/ChargeServiceImpl.java | 20 ++ .../entryrecord/EntryRecordService.java | 63 +++++ .../entryrecord/EntryRecordServiceImpl.java | 164 +++++++++++++ .../service/placeinfo/PlaceInfoService.java | 12 + .../placeinfo/PlaceInfoServiceImpl.java | 16 ++ .../parking/service/profit/ProfitService.java | 11 + .../service/profit/ProfitServiceImpl.java | 20 ++ .../service/white/WhiteServiceImpl.java | 53 ++++- 48 files changed, 2627 insertions(+), 3 deletions(-) create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/AppearanceRecordController.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordPageReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordRespVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordSaveReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/BlackController.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackPageReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackRespVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackSaveReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/Datas.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/EntryRecordController.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordPageReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordRespVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordSaveReqVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/white/vo/WhiteDeleteDO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/AppearanceRecordDO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/AppearanceRecordVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/ChargeStatistics.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/DataList.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/PassInfo.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/black/BlackDO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/charge/ChargeDO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/Datas.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/EntryRecordDO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/EntryRecordVO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/placeinfo/PlaceInfoDO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/profit/ProfitDO.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/appearancerecord/AppearanceRecordMapper.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/black/BlackMapper.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/charge/ChargeMapper.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/entryrecord/EntryRecordMapper.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/placeinfo/PlaceInfoMapper.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/profit/ProfitMapper.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/appearancerecord/AppearanceRecordService.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/appearancerecord/AppearanceRecordServiceImpl.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/black/BlackService.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/black/BlackServiceImpl.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/charge/ChargeService.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/charge/ChargeServiceImpl.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/entryrecord/EntryRecordService.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/entryrecord/EntryRecordServiceImpl.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/placeinfo/PlaceInfoService.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/placeinfo/PlaceInfoServiceImpl.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/profit/ProfitService.java create mode 100644 ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/profit/ProfitServiceImpl.java diff --git a/ludu-module-parking/ludu-module-parking-api/src/main/java/cn/iocoder/yudao/module/parking/enums/ErrorCodeConstants.java b/ludu-module-parking/ludu-module-parking-api/src/main/java/cn/iocoder/yudao/module/parking/enums/ErrorCodeConstants.java index c69023964..6cc17d496 100644 --- a/ludu-module-parking/ludu-module-parking-api/src/main/java/cn/iocoder/yudao/module/parking/enums/ErrorCodeConstants.java +++ b/ludu-module-parking/ludu-module-parking-api/src/main/java/cn/iocoder/yudao/module/parking/enums/ErrorCodeConstants.java @@ -19,8 +19,11 @@ public interface ErrorCodeConstants { ErrorCode VEHICLE_RENEWAL_RECORD_NOT_EXISTS = new ErrorCode(22222, "固定车续费记录不存在"); ErrorCode WARNING_NOT_EXISTS = new ErrorCode(33333, "告警记录不存在"); ErrorCode WHITE_NOT_EXISTS = new ErrorCode(444444, "白名单管理不存在"); + ErrorCode BLACK_NOT_EXISTS = new ErrorCode(55555, "黑名单管理不存在"); // ========== 收费信息 1_005_001_029 ========== ErrorCode CHARGE_INFO_NOT_EXISTS = new ErrorCode(1_005_001_029, "收费信息不存在"); // ========== 远程抬杠日志 1_005_001_030 ========== ErrorCode LIFTING_ROD_NOT_EXISTS = new ErrorCode(1_005_001_030, "远程抬杠日志不存在"); + ErrorCode ENTRY_RECORD_NOT_EXISTS = new ErrorCode(666666, "入场记录不存在"); + ErrorCode APPEARANCE_RECORD_NOT_EXISTS = new ErrorCode(77777, "出场记录不存在"); } diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/AppearanceRecordController.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/AppearanceRecordController.java new file mode 100644 index 000000000..f40c7b4b8 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/AppearanceRecordController.java @@ -0,0 +1,106 @@ +package cn.iocoder.yudao.module.parking.controller.admin.appearancerecord; + +import cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord.AppearanceRecordVO; +import cn.iocoder.yudao.module.parking.util.BlueCardResult; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.parking.controller.admin.appearancerecord.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord.AppearanceRecordDO; +import cn.iocoder.yudao.module.parking.service.appearancerecord.AppearanceRecordService; + +@Tag(name = "管理后台 - 出场记录") +@RestController +@RequestMapping("/parking/appearance-record") +@Validated +public class AppearanceRecordController { + + @Resource + private AppearanceRecordService appearanceRecordService; + + + @PostMapping("/upAppearanceRecord") + @Operation(summary = "实时发送出场记录") + public BlueCardResult upAppearanceRecord(@RequestBody AppearanceRecordVO appearanceRecordVO) { + return appearanceRecordService.upAppearanceRecord(appearanceRecordVO); + } + + + + @PostMapping("/create") + @Operation(summary = "创建出场记录") + @PreAuthorize("@ss.hasPermission('parking:appearance-record:create')") + public CommonResult createAppearanceRecord(@Valid @RequestBody AppearanceRecordSaveReqVO createReqVO) { + return success(appearanceRecordService.createAppearanceRecord(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新出场记录") + @PreAuthorize("@ss.hasPermission('parking:appearance-record:update')") + public CommonResult updateAppearanceRecord(@Valid @RequestBody AppearanceRecordSaveReqVO updateReqVO) { + appearanceRecordService.updateAppearanceRecord(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除出场记录") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('parking:appearance-record:delete')") + public CommonResult deleteAppearanceRecord(@RequestParam("id") Long id) { + appearanceRecordService.deleteAppearanceRecord(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得出场记录") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('parking:appearance-record:query')") + public CommonResult getAppearanceRecord(@RequestParam("id") Long id) { + AppearanceRecordDO appearanceRecord = appearanceRecordService.getAppearanceRecord(id); + return success(BeanUtils.toBean(appearanceRecord, AppearanceRecordRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得出场记录分页") + @PreAuthorize("@ss.hasPermission('parking:appearance-record:query')") + public CommonResult> getAppearanceRecordPage(@Valid AppearanceRecordPageReqVO pageReqVO) { + PageResult pageResult = appearanceRecordService.getAppearanceRecordPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, AppearanceRecordRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出出场记录 Excel") + @PreAuthorize("@ss.hasPermission('parking:appearance-record:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportAppearanceRecordExcel(@Valid AppearanceRecordPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = appearanceRecordService.getAppearanceRecordPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "出场记录.xls", "数据", AppearanceRecordRespVO.class, + BeanUtils.toBean(list, AppearanceRecordRespVO.class)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordPageReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordPageReqVO.java new file mode 100644 index 000000000..80fa555ef --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordPageReqVO.java @@ -0,0 +1,109 @@ +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 = "入场记录编号", example = "20322") + private String orderId; + + @Schema(description = "停车场编号") + private String parkNumber; + + @Schema(description = "操作员 Id", example = "1640") + private String operatorId; + + @Schema(description = "操作员姓名", example = "张三") + private String operatorName; + + @Schema(description = "发票号码") + private String invoiceNo; + + @Schema(description = "车牌") + private String plate; + + @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 = "时间") + @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; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordRespVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordRespVO.java new file mode 100644 index 000000000..39e23474c --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordRespVO.java @@ -0,0 +1,136 @@ +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 = "20113") + @ExcelProperty("id") + private Long id; + + @Schema(description = "入场记录编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20322") + @ExcelProperty("入场记录编号") + private String orderId; + + @Schema(description = "停车场编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("停车场编号") + private String parkNumber; + + @Schema(description = "操作员 Id", example = "1640") + @ExcelProperty("操作员 Id") + private String operatorId; + + @Schema(description = "操作员姓名", example = "张三") + @ExcelProperty("操作员姓名") + private String operatorName; + + @Schema(description = "发票号码") + @ExcelProperty("发票号码") + private String invoiceNo; + + @Schema(description = "车牌", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("车牌") + private String plate; + + @Schema(description = "证件号码") + @ExcelProperty("证件号码") + private String idCard; + + @Schema(description = "入场时间") + @ExcelProperty("入场时间") + private String inTime; + + @Schema(description = "出场时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("出场时间") + private String outTime; + + @Schema(description = "入场图片名") + @ExcelProperty("入场图片名") + private String inImage; + + @Schema(description = "出场图片名", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("出场图片名") + private String outImage; + + @Schema(description = "入口通道名称") + @ExcelProperty("入口通道名称") + private String inChannel; + + @Schema(description = "出口通道名称", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("出口通道名称") + private String outChannel; + + @Schema(description = "抬杆模式", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("抬杆模式") + private String openGateMode; + + @Schema(description = "匹配模式", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("匹配模式") + private String matchMode; + + @Schema(description = "总停车费", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("总停车费") + private String charge; + + @Schema(description = "线上总收费", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("线上总收费") + private String onLineCharge; + + @Schema(description = "线下总收费", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("线下总收费") + private String offLineCharge; + + @Schema(description = "线上线下金额和时间优惠累计抵扣值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("线上线下金额和时间优惠累计抵扣值") + private String profitChargeTotal; + + @Schema(description = "线上累计优惠金额总面值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("线上累计优惠金额总面值") + private String onLineProfitChargeNum; + + @Schema(description = "线上累计优惠金额总抵扣值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("线上累计优惠金额总抵扣值") + private String onLineProfitChargeValue; + + @Schema(description = "线下累计优惠金额总面值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("线下累计优惠金额总面值") + private String offLineProfitChargeNum; + + @Schema(description = "线下累计优惠金额总抵扣值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("线下累计优惠金额总抵扣值") + private String offLineProfitChargeValue; + + @Schema(description = "线上累计优惠时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("线上累计优惠时间") + private String onLineProfitTimeNum; + + @Schema(description = "线上累计优惠时间总抵扣值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("线上累计优惠时间总抵扣值") + private String onLineProfitTimeValue; + + @Schema(description = "线下累计优惠时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("线下累计优惠时间") + private String offLineProfitTimeNum; + + @Schema(description = "线下累计优惠时间总抵扣值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("线下累计优惠时间总抵扣值") + private String offLineProfitTimeValue; + + @Schema(description = "时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("时间") + private String costTime; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordSaveReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordSaveReqVO.java new file mode 100644 index 000000000..8ebe6e639 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/appearancerecord/vo/AppearanceRecordSaveReqVO.java @@ -0,0 +1,120 @@ +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 = "20113") + private Long id; + + @Schema(description = "入场记录编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20322") + @NotEmpty(message = "入场记录编号不能为空") + private String orderId; + + @Schema(description = "停车场编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "停车场编号不能为空") + private String parkNumber; + + @Schema(description = "操作员 Id", example = "1640") + private String operatorId; + + @Schema(description = "操作员姓名", example = "张三") + private String operatorName; + + @Schema(description = "发票号码") + private String invoiceNo; + + @Schema(description = "车牌", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "车牌不能为空") + private String plate; + + @Schema(description = "证件号码") + private String idCard; + + @Schema(description = "入场时间") + private String inTime; + + @Schema(description = "出场时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "出场时间不能为空") + private String outTime; + + @Schema(description = "入场图片名") + private String inImage; + + @Schema(description = "出场图片名", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "出场图片名不能为空") + private String outImage; + + @Schema(description = "入口通道名称") + private String inChannel; + + @Schema(description = "出口通道名称", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "出口通道名称不能为空") + private String outChannel; + + @Schema(description = "抬杆模式", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "抬杆模式不能为空") + private String openGateMode; + + @Schema(description = "匹配模式", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "匹配模式不能为空") + private String matchMode; + + @Schema(description = "总停车费", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "总停车费不能为空") + private String charge; + + @Schema(description = "线上总收费", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "线上总收费不能为空") + private String onLineCharge; + + @Schema(description = "线下总收费", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "线下总收费不能为空") + private String offLineCharge; + + @Schema(description = "线上线下金额和时间优惠累计抵扣值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "线上线下金额和时间优惠累计抵扣值不能为空") + private String profitChargeTotal; + + @Schema(description = "线上累计优惠金额总面值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "线上累计优惠金额总面值不能为空") + private String onLineProfitChargeNum; + + @Schema(description = "线上累计优惠金额总抵扣值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "线上累计优惠金额总抵扣值不能为空") + private String onLineProfitChargeValue; + + @Schema(description = "线下累计优惠金额总面值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "线下累计优惠金额总面值不能为空") + private String offLineProfitChargeNum; + + @Schema(description = "线下累计优惠金额总抵扣值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "线下累计优惠金额总抵扣值不能为空") + private String offLineProfitChargeValue; + + @Schema(description = "线上累计优惠时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "线上累计优惠时间不能为空") + private String onLineProfitTimeNum; + + @Schema(description = "线上累计优惠时间总抵扣值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "线上累计优惠时间总抵扣值不能为空") + private String onLineProfitTimeValue; + + @Schema(description = "线下累计优惠时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "线下累计优惠时间不能为空") + private String offLineProfitTimeNum; + + @Schema(description = "线下累计优惠时间总抵扣值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "线下累计优惠时间总抵扣值不能为空") + private String offLineProfitTimeValue; + + @Schema(description = "时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "时间不能为空") + private String costTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/BlackController.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/BlackController.java new file mode 100644 index 000000000..2bda351df --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/BlackController.java @@ -0,0 +1,225 @@ +package cn.iocoder.yudao.module.parking.controller.admin.black; + +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.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; +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.black.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.black.BlackDO; +import cn.iocoder.yudao.module.parking.service.black.BlackService; + +@Tag(name = "管理后台 - 黑名单") +@RestController +@RequestMapping("/parking/black") +@Validated +public class BlackController { + + @Resource + private BlackService blackService; + + + /** + * 删除黑名单 + * @param + * @return + */ + @PostMapping("/delBlack") + public CommonResult deleteBlack(BlackDO blackDO) { + //设置请求参数 + BlackVO blackVO = new BlackVO(); + blackVO.setParkNumber(blackDO.getParkNumber()); + blackVO.setSource(blackDO.getSource()); + List datasList = new ArrayList<>(); + Datas datas = new Datas(); + datas.setPlate(blackDO.getPlate()); + datas.setMemo(blackDO.getMemo()); + datasList.add(datas); + blackVO.setDatas(datasList); + //调用蓝卡接口 + try { + String url = "http://蓝卡云 ip:端口/bcopenapi/out/delBlack"; + URL obj = new URL(url); + HttpURLConnection con = (HttpURLConnection) obj.openConnection(); + // 请求方式 + con.setRequestMethod("GET"); + // 获取响应 + int responseCode = con.getResponseCode(); + System.out.println("Response Code : " + responseCode); + BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); + String inputLine; + StringBuilder response = new StringBuilder(); + while ((inputLine = in.readLine()) != null) { + response.append(inputLine); + } + in.close(); + System.out.println(response.toString()); + } catch (Exception e) { + e.printStackTrace(); + } + return success(true); + } + + + /** + * 黑名单查询 + * @param + * @return + */ + @PostMapping("/queryBlack") + public CommonResult queryBlack(BlackDO blackDO) { + //设置请求参数 + BlackVO blackVO = new BlackVO(); + blackVO.setParkNumber(blackDO.getParkNumber()); + List datasList = new ArrayList<>(); + Datas datas = new Datas(); + datas.setPlate(blackDO.getPlate()); + datasList.add(datas); + blackVO.setDatas(datasList); + //调用蓝卡接口 + try { + String url = " http://蓝卡云 ip:端口/bcopenapi/out/queryBlack"; + URL obj = new URL(url); + HttpURLConnection con = (HttpURLConnection) obj.openConnection(); + // 请求方式 + con.setRequestMethod("GET"); + // 获取响应 + int responseCode = con.getResponseCode(); + System.out.println("Response Code : " + responseCode); + BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); + String inputLine; + StringBuilder response = new StringBuilder(); + while ((inputLine = in.readLine()) != null) { + response.append(inputLine); + } + in.close(); + System.out.println(response.toString()); + } catch (Exception e) { + e.printStackTrace(); + } + return success(true); + } + + + /** + * 新增黑名单 + * @param + * @return + */ + @PostMapping("/synBlack") + public CommonResult synBlack(BlackDO blackDO) { + //设置请求参数 + BlackVO blackVO = new BlackVO(); + blackVO.setParkNumber(blackDO.getParkNumber()); + blackVO.setSource(blackDO.getSource()); + List datasList = new ArrayList<>(); + Datas datas = new Datas(); + datas.setPlate(blackDO.getPlate()); + datas.setMemo(blackDO.getMemo()); + datasList.add(datas); + blackVO.setDatas(datasList); + //调用蓝卡接口 + try { + String url = "http://蓝卡云 ip:端口/bcopenapi/out/synBlack"; + URL obj = new URL(url); + HttpURLConnection con = (HttpURLConnection) obj.openConnection(); + // 请求方式 + con.setRequestMethod("GET"); + // 获取响应 + int responseCode = con.getResponseCode(); + System.out.println("Response Code : " + responseCode); + BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); + String inputLine; + StringBuilder response = new StringBuilder(); + while ((inputLine = in.readLine()) != null) { + response.append(inputLine); + } + in.close(); + System.out.println(response.toString()); + } catch (Exception e) { + e.printStackTrace(); + } + return success(true); + } + + + + @PostMapping("/create") + @Operation(summary = "创建黑名单") + @PreAuthorize("@ss.hasPermission('parking:black:create')") + public CommonResult createBlack(@Valid @RequestBody BlackSaveReqVO createReqVO) { + return success(blackService.createBlack(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新黑名单") + @PreAuthorize("@ss.hasPermission('parking:black:update')") + public CommonResult updateBlack(@Valid @RequestBody BlackSaveReqVO updateReqVO) { + blackService.updateBlack(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除黑名单") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('parking:black:delete')") + public CommonResult deleteBlack(@RequestParam("id") Long id) { + blackService.deleteBlack(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得黑名单") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('parking:black:query')") + public CommonResult getBlack(@RequestParam("id") Long id) { + BlackDO black = blackService.getBlack(id); + return success(BeanUtils.toBean(black, BlackRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得黑名单分页") + @PreAuthorize("@ss.hasPermission('parking:black:query')") + public CommonResult> getBlackPage(@Valid BlackPageReqVO pageReqVO) { + PageResult pageResult = blackService.getBlackPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BlackRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出黑名单 Excel") + @PreAuthorize("@ss.hasPermission('parking:black:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBlackExcel(@Valid BlackPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = blackService.getBlackPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "黑名单.xls", "数据", BlackRespVO.class, + BeanUtils.toBean(list, BlackRespVO.class)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackPageReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackPageReqVO.java new file mode 100644 index 000000000..a3a473e51 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackPageReqVO.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.parking.controller.admin.black.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 BlackPageReqVO extends PageParam { + + @Schema(description = "场库编号") + private String parkNumber; + + @Schema(description = "来源") + private String source; + + @Schema(description = "车牌号") + private String plate; + + @Schema(description = "备注", example = "你说的对") + private String memo; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackRespVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackRespVO.java new file mode 100644 index 000000000..ea0252eff --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackRespVO.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.module.parking.controller.admin.black.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.*; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; + +@Schema(description = "管理后台 - 黑名单 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BlackRespVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23847") + @ExcelProperty("id") + private Long id; + + @Schema(description = "场库编号") + @ExcelProperty("场库编号") + private String parkNumber; + + @Schema(description = "来源") + @ExcelProperty(value = "来源", converter = DictConvert.class) + @DictFormat("black_source") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private String source; + + @Schema(description = "车牌号") + @ExcelProperty("车牌号") + private String plate; + + @Schema(description = "备注", example = "你说的对") + @ExcelProperty("备注") + private String memo; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackSaveReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackSaveReqVO.java new file mode 100644 index 000000000..5527d856c --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackSaveReqVO.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.parking.controller.admin.black.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 BlackSaveReqVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23847") + private Long id; + + @Schema(description = "场库编号") + private String parkNumber; + + @Schema(description = "来源") + private String source; + + @Schema(description = "车牌号") + private String plate; + + @Schema(description = "备注", example = "你说的对") + private String memo; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackVO.java new file mode 100644 index 000000000..561e6aebe --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/BlackVO.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.parking.controller.admin.black.vo; + +import lombok.Data; + +import java.util.List; + +@Data +public class BlackVO { + private String parkNumber; + private String source; + private List datas; +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/Datas.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/Datas.java new file mode 100644 index 000000000..8af0a0b8c --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/black/vo/Datas.java @@ -0,0 +1,9 @@ +package cn.iocoder.yudao.module.parking.controller.admin.black.vo; + +import lombok.Data; + +@Data +public class Datas { + private String plate; + private String memo; +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/EntryRecordController.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/EntryRecordController.java new file mode 100644 index 000000000..14d91ebca --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/EntryRecordController.java @@ -0,0 +1,105 @@ +package cn.iocoder.yudao.module.parking.controller.admin.entryrecord; + +import cn.iocoder.yudao.module.parking.dal.dataobject.entryrecord.EntryRecordVO; +import cn.iocoder.yudao.module.parking.util.BlueCardResult; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.parking.controller.admin.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("/upEntryRecord") + @Operation(summary = "实时发送入场记录") + public BlueCardResult upEntryRecord(@RequestBody EntryRecordVO entryRecordVO) { + return entryRecordService.upEntryRecord(entryRecordVO); + } + + + @PostMapping("/create") + @Operation(summary = "创建入场记录") + @PreAuthorize("@ss.hasPermission('parking:entry-record:create')") + public CommonResult createEntryRecord(@Valid @RequestBody EntryRecordSaveReqVO createReqVO) { + return success(entryRecordService.createEntryRecord(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新入场记录") + @PreAuthorize("@ss.hasPermission('parking:entry-record:update')") + public CommonResult 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 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 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> getEntryRecordPage(@Valid EntryRecordPageReqVO pageReqVO) { + PageResult 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 list = entryRecordService.getEntryRecordPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "入场记录.xls", "数据", EntryRecordRespVO.class, + BeanUtils.toBean(list, EntryRecordRespVO.class)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordPageReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordPageReqVO.java new file mode 100644 index 000000000..7c9c2bad8 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordPageReqVO.java @@ -0,0 +1,60 @@ +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 = "入场记录编号", example = "4622") + private String orderId; + + @Schema(description = "场库编号") + private String parkNumber; + + @Schema(description = "车牌") + private String plate; + + @Schema(description = "证件号码") + private String idCard; + + @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 = "不对") + private String visitReason; + + @Schema(description = "放行类型") + private String openGateMode; + + @Schema(description = "匹配模式") + private String matchMode; + + @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; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordRespVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordRespVO.java new file mode 100644 index 000000000..3b282622d --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordRespVO.java @@ -0,0 +1,72 @@ +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 = "31287") + @ExcelProperty("入场id") + private Long id; + + @Schema(description = "入场记录编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4622") + @ExcelProperty("入场记录编号") + private String orderId; + + @Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("场库编号") + private String parkNumber; + + @Schema(description = "车牌", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("车牌") + private String plate; + + @Schema(description = "证件号码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("证件号码") + private String idCard; + + @Schema(description = "入场时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("入场时间") + private String inTime; + + @Schema(description = "入场通道名称", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("入场通道名称") + private String inChannel; + + @Schema(description = "入场图片名", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("入场图片名") + private String inImage; + + @Schema(description = "访问事由", requiredMode = Schema.RequiredMode.REQUIRED, example = "不对") + @ExcelProperty("访问事由") + private String visitReason; + + @Schema(description = "放行类型", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("放行类型") + private String openGateMode; + + @Schema(description = "匹配模式", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("匹配模式") + private String matchMode; + + @Schema(description = "是否开闸", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否开闸") + private String barriorOpen; + + @Schema(description = "开闸耗时", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("开闸耗时") + private String costTime; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordSaveReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordSaveReqVO.java new file mode 100644 index 000000000..59e8ecacf --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/entryrecord/vo/EntryRecordSaveReqVO.java @@ -0,0 +1,63 @@ +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 = "31287") + private Long id; + + @Schema(description = "入场记录编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4622") + @NotEmpty(message = "入场记录编号不能为空") + private String orderId; + + @Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "场库编号不能为空") + private String parkNumber; + + @Schema(description = "车牌", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "车牌不能为空") + private String plate; + + @Schema(description = "证件号码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "证件号码不能为空") + private String idCard; + + @Schema(description = "入场时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "入场时间不能为空") + private String inTime; + + @Schema(description = "入场通道名称", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "入场通道名称不能为空") + private String inChannel; + + @Schema(description = "入场图片名", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "入场图片名不能为空") + private String inImage; + + @Schema(description = "访问事由", requiredMode = Schema.RequiredMode.REQUIRED, example = "不对") + @NotEmpty(message = "访问事由不能为空") + private String visitReason; + + @Schema(description = "放行类型", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "放行类型不能为空") + private String openGateMode; + + @Schema(description = "匹配模式", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "匹配模式不能为空") + private String matchMode; + + @Schema(description = "是否开闸", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "是否开闸不能为空") + private String barriorOpen; + + @Schema(description = "开闸耗时", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "开闸耗时不能为空") + private String costTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/white/vo/WhiteDeleteDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/white/vo/WhiteDeleteDO.java new file mode 100644 index 000000000..f059c452f --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/white/vo/WhiteDeleteDO.java @@ -0,0 +1,13 @@ +package cn.iocoder.yudao.module.parking.controller.admin.white.vo; + +import cn.iocoder.yudao.module.parking.dal.dataobject.areasandvalidity.AreasAndValidityDO; +import lombok.Data; + +import java.util.List; + +@Data +public class WhiteDeleteDO { + private String parkNumber; + private String plate; + private List areasAndValidity; +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/AppearanceRecordDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/AppearanceRecordDO.java new file mode 100644 index 000000000..54d4d29eb --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/AppearanceRecordDO.java @@ -0,0 +1,143 @@ +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") +@KeySequence("appearance_record_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AppearanceRecordDO extends BaseDO { + + /** + * id + */ + @TableId + private Long id; + /** + * 入场记录编号 + */ + private String orderId; + /** + * 停车场编号 + */ + private String parkNumber; + /** + * 操作员 Id + */ + private String operatorId; + /** + * 操作员姓名 + */ + private String operatorName; + /** + * 发票号码 + */ + private String invoiceNo; + /** + * 车牌 + */ + private String plate; + /** + * 证件号码 + */ + 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 costTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/AppearanceRecordVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/AppearanceRecordVO.java new file mode 100644 index 000000000..64dcf2bc3 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/AppearanceRecordVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class AppearanceRecordVO { + private String parkNumber; + private Integer size; + private List datas = new ArrayList<>(); + +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/ChargeStatistics.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/ChargeStatistics.java new file mode 100644 index 000000000..60fe0e894 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/ChargeStatistics.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord; + +import lombok.Data; + +@Data +public class ChargeStatistics { + private String charge; + private String onLineCharge; + private String offLineCharge; + private String profitChargeTotal; + private String onLineProfitChargeNum; + private String onLineProfitChargeValue; + private String offLineProfitChargeNum; + private String offLineProfitChargeValue; + private String onLineProfitTimeNum; + private String onLineProfitTimeValue; + private String offLineProfitTimeNum; + private String offLineProfitTimeValue; +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/DataList.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/DataList.java new file mode 100644 index 000000000..948673f00 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/DataList.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord; + +import cn.iocoder.yudao.module.parking.dal.dataobject.carinfo.CarInfoDO; +import cn.iocoder.yudao.module.parking.dal.dataobject.charge.ChargeDO; +import cn.iocoder.yudao.module.parking.dal.dataobject.placeinfo.PlaceInfoDO; +import cn.iocoder.yudao.module.parking.dal.dataobject.profit.ProfitDO; +import cn.iocoder.yudao.module.parking.dal.dataobject.userinfo.UserInfoDO; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class DataList { + private String orderId; + private String operatorId; + private String operatorName; + private String invoiceNo; + private CarInfoDO carInfo; + private UserInfoDO userInfo; + private PassInfo passInfo; + private ChargeStatistics chargeStatistics; + private List chargeList = new ArrayList<>(); + private List profitList = new ArrayList<>(); + private List placeInfo = new ArrayList<>(); + private String costTime; +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/PassInfo.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/PassInfo.java new file mode 100644 index 000000000..14016cde7 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/appearancerecord/PassInfo.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord; + +import lombok.Data; + +@Data +public class PassInfo { + private String inTime; + private String outTime; + private String inImage; + private String outImage; + private String inChannel; + private String outChannel; + private String openCateMode; + private String matchMode; +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/black/BlackDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/black/BlackDO.java new file mode 100644 index 000000000..42147e105 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/black/BlackDO.java @@ -0,0 +1,49 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.black; + +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("black") +@KeySequence("black_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BlackDO extends BaseDO { + + /** + * id + */ + @TableId + private Long id; + /** + * 场库编号 + */ + private String parkNumber; + /** + * 来源 + * + * 枚举 {@link TODO black_source 对应的类} + */ + private String source; + /** + * 车牌号 + */ + private String plate; + /** + * 备注 + */ + private String memo; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/charge/ChargeDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/charge/ChargeDO.java new file mode 100644 index 000000000..254818c5c --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/charge/ChargeDO.java @@ -0,0 +1,59 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.charge; + +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("charge") +@KeySequence("charge_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ChargeDO extends BaseDO { + + /** + * id + */ + @TableId + private Long id; + /** + * 出场id + */ + private Long appearanceId; + /** + * 支付订单号 + */ + private String payNo; + /** + * 结算时间 + */ + private String getTime; + /** + * 支付金额 + */ + private String payCharge; + /** + * 支付类型 + */ + private String payKind; + /** + * 支付渠道 + */ + private String payChannel; + /** + * 备注 + */ + private String memo; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/Datas.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/Datas.java new file mode 100644 index 000000000..18ad353cf --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/Datas.java @@ -0,0 +1,29 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.entryrecord; + +import cn.iocoder.yudao.module.parking.dal.dataobject.placeinfo.PlaceInfoDO; +import cn.iocoder.yudao.module.parking.dal.dataobject.userinfo.UserInfoDO; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class Datas { + 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 UserInfoDO userInfoDO; + private List placeInfo = new ArrayList<>(); + private String barriorOpen; + private String costTime; +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/EntryRecordDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/EntryRecordDO.java new file mode 100644 index 000000000..a13fd9a00 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/EntryRecordDO.java @@ -0,0 +1,79 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.entryrecord; + +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("entry_record") +@KeySequence("entry_record_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class EntryRecordDO extends BaseDO { + + /** + * 入场id + */ + @TableId + private Long id; + /** + * 入场记录编号 + */ + private String orderId; + /** + * 场库编号 + */ + private String parkNumber; + /** + * 车牌 + */ + private String plate; + /** + * 证件号码 + */ + private String idCard; + /** + * 入场时间 + */ + private String inTime; + /** + * 入场通道名称 + */ + private String inChannel; + /** + * 入场图片名 + */ + private String inImage; + /** + * 访问事由 + */ + private String visitReason; + /** + * 放行类型 + */ + private String openGateMode; + /** + * 匹配模式 + */ + private String matchMode; + /** + * 是否开闸 + */ + private String barriorOpen; + /** + * 开闸耗时 + */ + private String costTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/EntryRecordVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/EntryRecordVO.java new file mode 100644 index 000000000..90ae0d0fe --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/entryrecord/EntryRecordVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.entryrecord; + +import io.swagger.v3.oas.models.security.SecurityScheme; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class EntryRecordVO { + private String parkNumber; + private Integer size; + private List datas = new ArrayList<>(); +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/placeinfo/PlaceInfoDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/placeinfo/PlaceInfoDO.java new file mode 100644 index 000000000..a43fae17e --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/placeinfo/PlaceInfoDO.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.placeinfo; + +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("place_info") +@KeySequence("place_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PlaceInfoDO extends BaseDO { + + /** + * id + */ + @TableId + private Long id; + /** + * 入场id + */ + private Long entryId; + /** + * 车位编号 + */ + private String placeNumber; + /** + * 区域id + */ + private String areaId; + /** + * 区域名称 + */ + private String areaName; + /** + * 备注信息 + */ + private String memo; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/profit/ProfitDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/profit/ProfitDO.java new file mode 100644 index 000000000..66737ad6d --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/profit/ProfitDO.java @@ -0,0 +1,63 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.profit; + +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("profit") +@KeySequence("profit_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ProfitDO extends BaseDO { + + /** + * id + */ + @TableId + private Long id; + /** + * 出场id + */ + private Long appearanceId; + /** + * 优惠码 + */ + private String profitCode; + /** + * 入场记录编号 + */ + private String orderId; + /** + * 优惠下发时间 + */ + private String getTime; + /** + * 优惠时间 + */ + private String profitTime; + /** + * 优惠金额面值 + */ + private String profitCharge; + /** + * 生效金额 + */ + private String profitChargeValue; + /** + * 备注 + */ + private String memo; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/userinfo/UserInfoDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/userinfo/UserInfoDO.java index bb5c86459..1289ec0e8 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/userinfo/UserInfoDO.java +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/userinfo/UserInfoDO.java @@ -25,7 +25,7 @@ public class UserInfoDO extends BaseDO { /** * 证件号码 */ -// @TableId(type = IdType.INPUT) + @TableId private String idCard; /** * 车主姓名 diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/appearancerecord/AppearanceRecordMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/appearancerecord/AppearanceRecordMapper.java new file mode 100644 index 000000000..d20e5a8a9 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/appearancerecord/AppearanceRecordMapper.java @@ -0,0 +1,54 @@ +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.dal.dataobject.appearancerecord.AppearanceRecordDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.parking.controller.admin.appearancerecord.vo.*; + +/** + * 出场记录 Mapper + * + * @author 管理员 + */ +@Mapper +public interface AppearanceRecordMapper extends BaseMapperX { + + default PageResult selectPage(AppearanceRecordPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(AppearanceRecordDO::getOrderId, reqVO.getOrderId()) + .eqIfPresent(AppearanceRecordDO::getParkNumber, reqVO.getParkNumber()) + .eqIfPresent(AppearanceRecordDO::getOperatorId, reqVO.getOperatorId()) + .likeIfPresent(AppearanceRecordDO::getOperatorName, reqVO.getOperatorName()) + .eqIfPresent(AppearanceRecordDO::getInvoiceNo, reqVO.getInvoiceNo()) + .eqIfPresent(AppearanceRecordDO::getPlate, reqVO.getPlate()) + .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()) + .betweenIfPresent(AppearanceRecordDO::getCostTime, reqVO.getCostTime()) + .betweenIfPresent(AppearanceRecordDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(AppearanceRecordDO::getId)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/black/BlackMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/black/BlackMapper.java new file mode 100644 index 000000000..f82c262dc --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/black/BlackMapper.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.parking.dal.mysql.black; + +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.black.BlackDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.parking.controller.admin.black.vo.*; + +/** + * 黑名单 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface BlackMapper extends BaseMapperX { + + default PageResult selectPage(BlackPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BlackDO::getParkNumber, reqVO.getParkNumber()) + .eqIfPresent(BlackDO::getSource, reqVO.getSource()) + .eqIfPresent(BlackDO::getPlate, reqVO.getPlate()) + .eqIfPresent(BlackDO::getMemo, reqVO.getMemo()) + .betweenIfPresent(BlackDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(BlackDO::getId)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/charge/ChargeMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/charge/ChargeMapper.java new file mode 100644 index 000000000..692a4587b --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/charge/ChargeMapper.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.parking.dal.mysql.charge; + +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.parking.dal.dataobject.charge.ChargeDO; +import org.apache.ibatis.annotations.Mapper; + + +/** + * 收费明细 Mapper + * + * @author 管理员 + */ +@Mapper +public interface ChargeMapper extends BaseMapperX { + + + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/entryrecord/EntryRecordMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/entryrecord/EntryRecordMapper.java new file mode 100644 index 000000000..8e364d667 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/entryrecord/EntryRecordMapper.java @@ -0,0 +1,38 @@ +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 { + + default PageResult selectPage(EntryRecordPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(EntryRecordDO::getOrderId, reqVO.getOrderId()) + .eqIfPresent(EntryRecordDO::getParkNumber, reqVO.getParkNumber()) + .eqIfPresent(EntryRecordDO::getPlate, reqVO.getPlate()) + .eqIfPresent(EntryRecordDO::getIdCard, reqVO.getIdCard()) + .betweenIfPresent(EntryRecordDO::getInTime, reqVO.getInTime()) + .eqIfPresent(EntryRecordDO::getInChannel, reqVO.getInChannel()) + .eqIfPresent(EntryRecordDO::getInImage, reqVO.getInImage()) + .eqIfPresent(EntryRecordDO::getVisitReason, reqVO.getVisitReason()) + .eqIfPresent(EntryRecordDO::getOpenGateMode, reqVO.getOpenGateMode()) + .eqIfPresent(EntryRecordDO::getMatchMode, reqVO.getMatchMode()) + .eqIfPresent(EntryRecordDO::getBarriorOpen, reqVO.getBarriorOpen()) + .betweenIfPresent(EntryRecordDO::getCostTime, reqVO.getCostTime()) + .betweenIfPresent(EntryRecordDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(EntryRecordDO::getId)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/placeinfo/PlaceInfoMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/placeinfo/PlaceInfoMapper.java new file mode 100644 index 000000000..7972f5bb4 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/placeinfo/PlaceInfoMapper.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.parking.dal.mysql.placeinfo; + +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.parking.dal.dataobject.placeinfo.PlaceInfoDO; +import org.apache.ibatis.annotations.Mapper; + + +/** + * 车位信息 Mapper + * + * @author 管理员 + */ +@Mapper +public interface PlaceInfoMapper extends BaseMapperX { + + + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/profit/ProfitMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/profit/ProfitMapper.java new file mode 100644 index 000000000..15d048370 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/profit/ProfitMapper.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.parking.dal.mysql.profit; + +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.parking.dal.dataobject.profit.ProfitDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 优惠明细 Mapper + * + * @author 管理员 + */ +@Mapper +public interface ProfitMapper extends BaseMapperX { + + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/appearancerecord/AppearanceRecordService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/appearancerecord/AppearanceRecordService.java new file mode 100644 index 000000000..f011a7629 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/appearancerecord/AppearanceRecordService.java @@ -0,0 +1,59 @@ +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.dal.dataobject.appearancerecord.AppearanceRecordVO; +import cn.iocoder.yudao.module.parking.util.BlueCardResult; + +/** + * 出场记录 Service 接口 + * + * @author 管理员 + */ +public interface AppearanceRecordService { + + /** + * 创建出场记录 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createAppearanceRecord(@Valid AppearanceRecordSaveReqVO createReqVO); + + /** + * 更新出场记录 + * + * @param updateReqVO 更新信息 + */ + void updateAppearanceRecord(@Valid AppearanceRecordSaveReqVO updateReqVO); + + /** + * 删除出场记录 + * + * @param id 编号 + */ + void deleteAppearanceRecord(Long id); + + /** + * 获得出场记录 + * + * @param id 编号 + * @return 出场记录 + */ + AppearanceRecordDO getAppearanceRecord(Long id); + + /** + * 获得出场记录分页 + * + * @param pageReqVO 分页查询 + * @return 出场记录分页 + */ + PageResult getAppearanceRecordPage(AppearanceRecordPageReqVO pageReqVO); + + BlueCardResult upAppearanceRecord(AppearanceRecordVO appearanceRecordVO); + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/appearancerecord/AppearanceRecordServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/appearancerecord/AppearanceRecordServiceImpl.java new file mode 100644 index 000000000..e3472d57f --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/appearancerecord/AppearanceRecordServiceImpl.java @@ -0,0 +1,196 @@ +package cn.iocoder.yudao.module.parking.service.appearancerecord; + +import cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord.AppearanceRecordVO; +import cn.iocoder.yudao.module.parking.dal.dataobject.appearancerecord.DataList; +import cn.iocoder.yudao.module.parking.dal.dataobject.carinfo.CarInfoDO; +import cn.iocoder.yudao.module.parking.dal.dataobject.charge.ChargeDO; +import cn.iocoder.yudao.module.parking.dal.dataobject.placeinfo.PlaceInfoDO; +import cn.iocoder.yudao.module.parking.dal.dataobject.profit.ProfitDO; +import cn.iocoder.yudao.module.parking.dal.mysql.carinfo.CarInfoMapper; +import cn.iocoder.yudao.module.parking.dal.mysql.charge.ChargeMapper; +import cn.iocoder.yudao.module.parking.dal.mysql.placeinfo.PlaceInfoMapper; +import cn.iocoder.yudao.module.parking.dal.mysql.profit.ProfitMapper; +import cn.iocoder.yudao.module.parking.dal.mysql.userinfo.UserInfoMapper; +import cn.iocoder.yudao.module.parking.util.BlueCardResult; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +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 extends ServiceImpl implements AppearanceRecordService { + + @Resource + private AppearanceRecordMapper appearanceRecordMapper; + + @Resource + private UserInfoMapper userInfoMapper; + + @Resource + private PlaceInfoMapper placeInfoMapper; + + @Resource + private CarInfoMapper carInfoMapper; + + @Resource + private ChargeMapper chargeMapper; + + @Resource + private ProfitMapper profitMapper; + + @Override + public Long createAppearanceRecord(AppearanceRecordSaveReqVO createReqVO) { + // 插入 + AppearanceRecordDO appearanceRecord = BeanUtils.toBean(createReqVO, AppearanceRecordDO.class); + appearanceRecordMapper.insert(appearanceRecord); + // 返回 + return appearanceRecord.getId(); + } + + @Override + public void updateAppearanceRecord(AppearanceRecordSaveReqVO updateReqVO) { + // 校验存在 + validateAppearanceRecordExists(updateReqVO.getId()); + // 更新 + AppearanceRecordDO updateObj = BeanUtils.toBean(updateReqVO, AppearanceRecordDO.class); + appearanceRecordMapper.updateById(updateObj); + } + + @Override + public void deleteAppearanceRecord(Long id) { + // 校验存在 + validateAppearanceRecordExists(id); + // 删除 + appearanceRecordMapper.deleteById(id); + } + + private void validateAppearanceRecordExists(Long id) { + if (appearanceRecordMapper.selectById(id) == null) { + throw exception(APPEARANCE_RECORD_NOT_EXISTS); + } + } + + @Override + public AppearanceRecordDO getAppearanceRecord(Long id) { + return appearanceRecordMapper.selectById(id); + } + + @Override + public PageResult getAppearanceRecordPage(AppearanceRecordPageReqVO pageReqVO) { + return appearanceRecordMapper.selectPage(pageReqVO); + } + + @Override + public BlueCardResult upAppearanceRecord(AppearanceRecordVO appearanceRecordVO) { + + for (int i = 0; i < appearanceRecordVO.getDatas().size(); i++) { + DataList datas = appearanceRecordVO.getDatas().get(i); + + AppearanceRecordDO appearanceRecordDO = new AppearanceRecordDO(); + appearanceRecordDO.setOrderId(datas.getOrderId()); + appearanceRecordDO.setParkNumber(appearanceRecordVO.getParkNumber()); + appearanceRecordDO.setOperatorId(datas.getOperatorId()); + appearanceRecordDO.setOperatorName(datas.getOperatorName()); + appearanceRecordDO.setInvoiceNo(datas.getInvoiceNo()); + appearanceRecordDO.setPlate(datas.getCarInfo().getPlate()); + appearanceRecordDO.setIdCard(datas.getUserInfo().getIdCard()); + appearanceRecordDO.setInTime(datas.getPassInfo().getInTime()); + appearanceRecordDO.setOutTime(datas.getPassInfo().getOutTime()); + appearanceRecordDO.setInImage(datas.getPassInfo().getInImage()); + appearanceRecordDO.setOutImage(datas.getPassInfo().getOutImage()); + appearanceRecordDO.setInChannel(datas.getPassInfo().getInChannel()); + appearanceRecordDO.setOutChannel(datas.getPassInfo().getOutChannel()); + appearanceRecordDO.setOpenGateMode(datas.getPassInfo().getOpenCateMode()); + appearanceRecordDO.setMatchMode(datas.getPassInfo().getMatchMode()); + appearanceRecordDO.setCharge(datas.getChargeStatistics().getCharge()); + appearanceRecordDO.setOnLineCharge(datas.getChargeStatistics().getOnLineCharge()); + appearanceRecordDO.setOffLineCharge(datas.getChargeStatistics().getOffLineCharge()); + appearanceRecordDO.setProfitChargeTotal(datas.getChargeStatistics().getProfitChargeTotal()); + appearanceRecordDO.setOnLineProfitChargeNum(datas.getChargeStatistics().getOnLineProfitChargeNum()); + appearanceRecordDO.setOnLineProfitChargeValue(datas.getChargeStatistics().getOnLineProfitChargeValue()); + appearanceRecordDO.setOffLineProfitChargeNum(datas.getChargeStatistics().getOffLineProfitChargeNum()); + appearanceRecordDO.setOffLineProfitChargeValue(datas.getChargeStatistics().getOffLineProfitChargeValue()); + appearanceRecordDO.setOnLineProfitTimeNum(datas.getChargeStatistics().getOnLineProfitTimeNum()); + appearanceRecordDO.setOnLineProfitTimeValue(datas.getChargeStatistics().getOnLineProfitTimeValue()); + appearanceRecordDO.setOffLineProfitTimeNum(datas.getChargeStatistics().getOffLineProfitTimeNum()); + appearanceRecordDO.setOffLineProfitTimeValue(datas.getChargeStatistics().getOffLineProfitTimeValue()); + appearanceRecordDO.setCostTime(datas.getCostTime()); + AppearanceRecordDO appearanceRecordDO1 = addAppearanceRecord(appearanceRecordDO); + + //添加车位信息 + PlaceInfoDO placeInfoDO = new PlaceInfoDO(); + placeInfoDO.setEntryId(appearanceRecordDO1.getId()); + placeInfoDO.setPlaceNumber(datas.getPlaceInfo().get(0).getPlaceNumber()); + placeInfoDO.setAreaId(datas.getPlaceInfo().get(0).getAreaId()); + placeInfoDO.setAreaName(datas.getPlaceInfo().get(0).getAreaName()); + placeInfoDO.setMemo(datas.getPlaceInfo().get(0).getMemo()); + placeInfoMapper.insert(placeInfoDO); + + //添加车辆信息 + CarInfoDO carInfoDO = new CarInfoDO(); + carInfoDO.setPlate(datas.getCarInfo().getPlate()); + carInfoDO.setPlateColor(datas.getCarInfo().getPlateColor()); + carInfoDO.setTicketCode(datas.getCarInfo().getTicketCode()); + carInfoDO.setCarType(datas.getCarInfo().getCarType()); + carInfoDO.setConfidence(datas.getCarInfo().getConfidence()); + CarInfoDO carInfoDO1 = carInfoMapper.selectOne("plate", datas.getCarInfo().getPlate()); + if (carInfoDO1 == null){ + carInfoMapper.insert(carInfoDO); + }else { + carInfoDO.setId(carInfoDO1.getId()); + carInfoMapper.updateById(carInfoDO); + } + + //添加收费明细 + ChargeDO chargeDO = new ChargeDO(); + chargeDO.setAppearanceId(appearanceRecordDO1.getId()); + chargeDO.setPayNo(datas.getChargeList().get(0).getPayNo()); + chargeDO.setGetTime(datas.getChargeList().get(0).getGetTime()); + chargeDO.setPayCharge(datas.getChargeList().get(0).getPayCharge()); + chargeDO.setPayKind(datas.getChargeList().get(0).getPayKind()); + chargeDO.setPayChannel(datas.getChargeList().get(0).getPayChannel()); + chargeDO.setMemo(datas.getChargeList().get(0).getMemo()); + chargeMapper.insert(chargeDO); + + //添加优惠明细 + ProfitDO profitDO = new ProfitDO(); + profitDO.setAppearanceId(appearanceRecordDO1.getId()); + profitDO.setProfitCode(datas.getProfitList().get(0).getProfitCode()); + profitDO.setOrderId(datas.getProfitList().get(0).getOrderId()); + profitDO.setGetTime(datas.getProfitList().get(0).getGetTime()); + profitDO.setProfitTime(datas.getProfitList().get(0).getProfitTime()); + profitDO.setProfitCharge(datas.getProfitList().get(0).getProfitCharge()); + profitDO.setProfitChargeValue(datas.getProfitList().get(0).getProfitChargeValue()); + profitDO.setMemo(datas.getProfitList().get(0).getMemo()); + profitMapper.insert(profitDO); + + + } + return BlueCardResult.success(); + } + + public AppearanceRecordDO addAppearanceRecord(AppearanceRecordDO appearanceRecordDO) { + boolean saved = this.save(appearanceRecordDO); + if (saved) { + return appearanceRecordDO; // 返回包含 ID 的对象 + } + return null; // 或抛出异常 + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/black/BlackService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/black/BlackService.java new file mode 100644 index 000000000..4d6807099 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/black/BlackService.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.parking.service.black; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.parking.controller.admin.black.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.black.BlackDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; + +/** + * 黑名单 Service 接口 + * + * @author 芋道源码 + */ +public interface BlackService { + + /** + * 创建黑名单 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createBlack(@Valid BlackSaveReqVO createReqVO); + + /** + * 更新黑名单 + * + * @param updateReqVO 更新信息 + */ + void updateBlack(@Valid BlackSaveReqVO updateReqVO); + + /** + * 删除黑名单 + * + * @param id 编号 + */ + void deleteBlack(Long id); + + /** + * 获得黑名单 + * + * @param id 编号 + * @return 黑名单 + */ + BlackDO getBlack(Long id); + + /** + * 获得黑名单分页 + * + * @param pageReqVO 分页查询 + * @return 黑名单分页 + */ + PageResult getBlackPage(BlackPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/black/BlackServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/black/BlackServiceImpl.java new file mode 100644 index 000000000..b26c00807 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/black/BlackServiceImpl.java @@ -0,0 +1,74 @@ +package cn.iocoder.yudao.module.parking.service.black; + +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.black.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.black.BlackDO; +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.black.BlackMapper; + +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 BlackServiceImpl implements BlackService { + + @Resource + private BlackMapper blackMapper; + + @Override + public Long createBlack(BlackSaveReqVO createReqVO) { + // 插入 + BlackDO black = BeanUtils.toBean(createReqVO, BlackDO.class); + blackMapper.insert(black); + // 返回 + return black.getId(); + } + + @Override + public void updateBlack(BlackSaveReqVO updateReqVO) { + // 校验存在 + validateBlackExists(updateReqVO.getId()); + // 更新 + BlackDO updateObj = BeanUtils.toBean(updateReqVO, BlackDO.class); + blackMapper.updateById(updateObj); + } + + @Override + public void deleteBlack(Long id) { + // 校验存在 + validateBlackExists(id); + // 删除 + blackMapper.deleteById(id); + } + + private void validateBlackExists(Long id) { + if (blackMapper.selectById(id) == null) { + throw exception(BLACK_NOT_EXISTS); + } + } + + @Override + public BlackDO getBlack(Long id) { + return blackMapper.selectById(id); + } + + @Override + public PageResult getBlackPage(BlackPageReqVO pageReqVO) { + return blackMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/charge/ChargeService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/charge/ChargeService.java new file mode 100644 index 000000000..912a291ec --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/charge/ChargeService.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.parking.service.charge; + +/** + * 收费明细 Service 接口 + * + * @author 管理员 + */ +public interface ChargeService { + + + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/charge/ChargeServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/charge/ChargeServiceImpl.java new file mode 100644 index 000000000..fb8c08ecb --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/charge/ChargeServiceImpl.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.parking.service.charge; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import cn.iocoder.yudao.module.parking.dal.mysql.charge.ChargeMapper; + +/** + * 收费明细 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class ChargeServiceImpl implements ChargeService { + + @Resource + private ChargeMapper chargeMapper; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/entryrecord/EntryRecordService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/entryrecord/EntryRecordService.java new file mode 100644 index 000000000..e763af783 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/entryrecord/EntryRecordService.java @@ -0,0 +1,63 @@ +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; +import cn.iocoder.yudao.module.parking.dal.dataobject.entryrecord.EntryRecordVO; +import cn.iocoder.yudao.module.parking.util.BlueCardResult; + +/** + * 入场记录 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 getEntryRecordPage(EntryRecordPageReqVO pageReqVO); + + + /** + * 上传入场记录 + */ + BlueCardResult upEntryRecord(EntryRecordVO entryRecordVO); + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/entryrecord/EntryRecordServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/entryrecord/EntryRecordServiceImpl.java new file mode 100644 index 000000000..2c83e1fce --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/entryrecord/EntryRecordServiceImpl.java @@ -0,0 +1,164 @@ +package cn.iocoder.yudao.module.parking.service.entryrecord; + +import cn.iocoder.yudao.module.parking.dal.dataobject.carinfo.CarInfoDO; +import cn.iocoder.yudao.module.parking.dal.dataobject.entryrecord.Datas; +import cn.iocoder.yudao.module.parking.dal.dataobject.entryrecord.EntryRecordVO; +import cn.iocoder.yudao.module.parking.dal.dataobject.placeinfo.PlaceInfoDO; +import cn.iocoder.yudao.module.parking.dal.dataobject.userinfo.UserInfoDO; +import cn.iocoder.yudao.module.parking.dal.mysql.carinfo.CarInfoMapper; +import cn.iocoder.yudao.module.parking.dal.mysql.placeinfo.PlaceInfoMapper; +import cn.iocoder.yudao.module.parking.dal.mysql.userinfo.UserInfoMapper; +import cn.iocoder.yudao.module.parking.util.BlueCardResult; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +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 extends ServiceImpl implements EntryRecordService { + + @Resource + private EntryRecordMapper entryRecordMapper; + + @Resource + private UserInfoMapper userInfoMapper; + + @Resource + private PlaceInfoMapper placeInfoMapper; + + @Resource + private CarInfoMapper carInfoMapper; + + @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 getEntryRecordPage(EntryRecordPageReqVO pageReqVO) { + return entryRecordMapper.selectPage(pageReqVO); + } + + @Override + public BlueCardResult upEntryRecord(EntryRecordVO entryRecordVO) { + + for (int i = 0; i < entryRecordVO.getDatas().size(); i++) { + EntryRecordDO entryRecordDO = new EntryRecordDO(); + entryRecordDO.setParkNumber(entryRecordVO.getParkNumber()); + Datas datas = entryRecordVO.getDatas().get(i); + entryRecordDO.setOrderId(datas.getOrderId()); + entryRecordDO.setPlate(datas.getPlate()); + entryRecordDO.setIdCard(datas.getIdCard()); + entryRecordDO.setInTime(datas.getInTime()); + entryRecordDO.setInChannel(datas.getInChannel()); + entryRecordDO.setInImage(datas.getInImage()); + entryRecordDO.setVisitReason(datas.getVisitReason()); + entryRecordDO.setOpenGateMode(datas.getOpenGateMode()); + entryRecordDO.setMatchMode(datas.getMatchMode()); + entryRecordDO.setBarriorOpen(datas.getBarriorOpen()); + entryRecordDO.setCostTime(datas.getCostTime()); + EntryRecordDO entryRecordDO1 = addEntryRecord(entryRecordDO); + + //添加用户 + UserInfoDO userInfoDOOne = userInfoMapper.selectOne("id_card", datas.getUserInfoDO().getIdCard()); + UserInfoDO userInfoDO = new UserInfoDO(); + userInfoDO.setIdCard(datas.getUserInfoDO().getIdCard()); + userInfoDO.setUserName(datas.getUserInfoDO().getUserName()); + userInfoDO.setPhone(datas.getUserInfoDO().getPhone()); + userInfoDO.setAddress(datas.getUserInfoDO().getAddress()); + if (userInfoDOOne == null){ + userInfoMapper.insert(userInfoDO); + }else { + userInfoMapper.updateById(userInfoDO); + } + + //添加车位信息 + PlaceInfoDO placeInfoDO = new PlaceInfoDO(); + placeInfoDO.setEntryId(entryRecordDO1.getId()); + placeInfoDO.setPlaceNumber(datas.getPlaceInfo().get(0).getPlaceNumber()); + placeInfoDO.setAreaId(datas.getPlaceInfo().get(0).getAreaId()); + placeInfoDO.setAreaName(datas.getPlaceInfo().get(0).getAreaName()); + placeInfoDO.setMemo(datas.getPlaceInfo().get(0).getMemo()); + placeInfoMapper.insert(placeInfoDO); + + //添加车辆信息 + CarInfoDO carInfoDO = new CarInfoDO(); + carInfoDO.setPlate(datas.getPlate()); + carInfoDO.setPlateColor(datas.getPlateColor()); + carInfoDO.setTicketCode(datas.getTicketCode()); + carInfoDO.setCarType(datas.getCarType()); + carInfoDO.setConfidence(datas.getConfidence()); + CarInfoDO carInfoDO1 = carInfoMapper.selectOne("plate", datas.getPlate()); + if (carInfoDO1 == null){ + carInfoMapper.insert(carInfoDO); + }else { + carInfoDO.setId(carInfoDO1.getId()); + carInfoMapper.updateById(carInfoDO); + } + } + + return BlueCardResult.success(); + } + + + public EntryRecordDO addEntryRecord(EntryRecordDO entryRecordDO) { + boolean saved = this.save(entryRecordDO); + if (saved) { + return entryRecordDO; // 返回包含 ID 的对象 + } + return null; // 或抛出异常 + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/placeinfo/PlaceInfoService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/placeinfo/PlaceInfoService.java new file mode 100644 index 000000000..9851a64ee --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/placeinfo/PlaceInfoService.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.parking.service.placeinfo; + + +/** + * 车位信息 Service 接口 + * + * @author 管理员 + */ +public interface PlaceInfoService { + + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/placeinfo/PlaceInfoServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/placeinfo/PlaceInfoServiceImpl.java new file mode 100644 index 000000000..f5f6e3995 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/placeinfo/PlaceInfoServiceImpl.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.parking.service.placeinfo; + +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +/** + * 车位信息 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class PlaceInfoServiceImpl implements PlaceInfoService { + + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/profit/ProfitService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/profit/ProfitService.java new file mode 100644 index 000000000..891b32a01 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/profit/ProfitService.java @@ -0,0 +1,11 @@ +package cn.iocoder.yudao.module.parking.service.profit; + + +/** + * 优惠明细 Service 接口 + * + * @author 管理员 + */ +public interface ProfitService { + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/profit/ProfitServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/profit/ProfitServiceImpl.java new file mode 100644 index 000000000..0209dcc0c --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/profit/ProfitServiceImpl.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.parking.service.profit; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import cn.iocoder.yudao.module.parking.dal.mysql.profit.ProfitMapper; + +/** + * 优惠明细 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class ProfitServiceImpl implements ProfitService { + + @Resource + private ProfitMapper profitMapper; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/white/WhiteServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/white/WhiteServiceImpl.java index 4e652bb60..a9cb0406d 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/white/WhiteServiceImpl.java +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/white/WhiteServiceImpl.java @@ -12,6 +12,10 @@ import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; import java.util.*; import cn.iocoder.yudao.module.parking.controller.admin.white.vo.*; import cn.iocoder.yudao.module.parking.dal.dataobject.white.WhiteDO; @@ -69,6 +73,40 @@ public class WhiteServiceImpl implements WhiteService { validateWhiteExists(id); // 删除 whiteMapper.deleteById(id); + WhiteDO whiteDO = whiteMapper.selectOne("fixed_id", id); + userInfoMapper.deleteById(whiteDO.getCertificate());//删除用户信息 + carInfoMapper.deleteById(whiteDO.getPlate());//删除车量信息 + AreasAndValidityDO areasAndValidityDO = areasAndValidityMapper.selectOne("fixed_id", id); + + //设置删除请求参数 + WhiteDeleteDO whiteDeleteDO = new WhiteDeleteDO(); + whiteDeleteDO.setParkNumber(whiteDO.getParkNumber()); + whiteDeleteDO.setPlate(whiteDO.getPlate()); + List areasAndValidityDOS = new ArrayList<>(); + areasAndValidityDOS.add(areasAndValidityDO); + whiteDeleteDO.setAreasAndValidity(areasAndValidityDOS); + //调用蓝卡接口白名单删除 + try { + String url = "http://蓝卡云 ip:端口/bcopenapi/out/delWhite"; + URL obj = new URL(url); + HttpURLConnection con = (HttpURLConnection) obj.openConnection(); + // 请求方式 + con.setRequestMethod("GET"); + // 获取响应 + int responseCode = con.getResponseCode(); + System.out.println("Response Code : " + responseCode); + BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); + String inputLine; + StringBuilder response = new StringBuilder(); + while ((inputLine = in.readLine()) != null) { + response.append(inputLine); + } + in.close(); + System.out.println(response.toString()); + } catch (Exception e) { + e.printStackTrace(); + } + } private void validateWhiteExists(Integer id) { @@ -119,7 +157,12 @@ public class WhiteServiceImpl implements WhiteService { userInfoDO.setUserName(whiteDatasDO.getName()); userInfoDO.setPhone(whiteDatasDO.getPhone()); userInfoDO.setAddress(whiteDatasDO.getAddress()); - userInfoMapper.insert(userInfoDO); + UserInfoDO userInfoDOOne = userInfoMapper.selectOne("id_card", whiteDatasDO.getCertificate()); + if (userInfoDOOne == null){ + userInfoMapper.insert(userInfoDO); + }else { + userInfoMapper.updateById(userInfoDO); + } CarInfoDO carInfoDO = new CarInfoDO(); carInfoDO.setPlate(whiteDatasDO.getPlate()); @@ -127,7 +170,13 @@ public class WhiteServiceImpl implements WhiteService { // carInfoDO.setTicketCode(whiteDatasDO.get) carInfoDO.setCarType(whiteDatasDO.getCarType()); // carInfoDO.setConfidence(whiteDatasDO.ge) - carInfoMapper.insert(carInfoDO); + CarInfoDO carInfoDO1 = carInfoMapper.selectOne("plate", whiteDatasDO.getPlate()); + if (carInfoDO1 == null){ + carInfoMapper.insert(carInfoDO); + }else { + carInfoDO.setId(carInfoDO1.getId()); + carInfoMapper.updateById(carInfoDO); + } AreasAndValidityDO areasAndValidityDO = whiteDatasDO.getAreasAndValidity().get(0); AreasAndValidityDO areasAndValidityDOs = new AreasAndValidityDO();