新增黑名单,进出场记录

This commit is contained in:
sonjinyon 2024-08-23 09:44:44 +08:00
parent 91efcd403a
commit c0d0640e7d
48 changed files with 2627 additions and 3 deletions

View File

@ -19,8 +19,11 @@ public interface ErrorCodeConstants {
ErrorCode VEHICLE_RENEWAL_RECORD_NOT_EXISTS = new ErrorCode(22222, "固定车续费记录不存在"); ErrorCode VEHICLE_RENEWAL_RECORD_NOT_EXISTS = new ErrorCode(22222, "固定车续费记录不存在");
ErrorCode WARNING_NOT_EXISTS = new ErrorCode(33333, "告警记录不存在"); ErrorCode WARNING_NOT_EXISTS = new ErrorCode(33333, "告警记录不存在");
ErrorCode WHITE_NOT_EXISTS = new ErrorCode(444444, "白名单管理不存在"); ErrorCode WHITE_NOT_EXISTS = new ErrorCode(444444, "白名单管理不存在");
ErrorCode BLACK_NOT_EXISTS = new ErrorCode(55555, "黑名单管理不存在");
// ========== 收费信息 1_005_001_029 ========== // ========== 收费信息 1_005_001_029 ==========
ErrorCode CHARGE_INFO_NOT_EXISTS = new ErrorCode(1_005_001_029, "收费信息不存在"); ErrorCode CHARGE_INFO_NOT_EXISTS = new ErrorCode(1_005_001_029, "收费信息不存在");
// ========== 远程抬杠日志 1_005_001_030 ========== // ========== 远程抬杠日志 1_005_001_030 ==========
ErrorCode LIFTING_ROD_NOT_EXISTS = new ErrorCode(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, "出场记录不存在");
} }

View File

@ -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<Long> createAppearanceRecord(@Valid @RequestBody AppearanceRecordSaveReqVO createReqVO) {
return success(appearanceRecordService.createAppearanceRecord(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新出场记录")
@PreAuthorize("@ss.hasPermission('parking:appearance-record:update')")
public CommonResult<Boolean> 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<Boolean> 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<AppearanceRecordRespVO> 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<PageResult<AppearanceRecordRespVO>> getAppearanceRecordPage(@Valid AppearanceRecordPageReqVO pageReqVO) {
PageResult<AppearanceRecordDO> 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<AppearanceRecordDO> list = appearanceRecordService.getAppearanceRecordPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "出场记录.xls", "数据", AppearanceRecordRespVO.class,
BeanUtils.toBean(list, AppearanceRecordRespVO.class));
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<Boolean> deleteBlack(BlackDO blackDO) {
//设置请求参数
BlackVO blackVO = new BlackVO();
blackVO.setParkNumber(blackDO.getParkNumber());
blackVO.setSource(blackDO.getSource());
List<Datas> 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<Boolean> queryBlack(BlackDO blackDO) {
//设置请求参数
BlackVO blackVO = new BlackVO();
blackVO.setParkNumber(blackDO.getParkNumber());
List<Datas> 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<Boolean> synBlack(BlackDO blackDO) {
//设置请求参数
BlackVO blackVO = new BlackVO();
blackVO.setParkNumber(blackDO.getParkNumber());
blackVO.setSource(blackDO.getSource());
List<Datas> 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<Long> createBlack(@Valid @RequestBody BlackSaveReqVO createReqVO) {
return success(blackService.createBlack(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新黑名单")
@PreAuthorize("@ss.hasPermission('parking:black:update')")
public CommonResult<Boolean> 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<Boolean> 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<BlackRespVO> 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<PageResult<BlackRespVO>> getBlackPage(@Valid BlackPageReqVO pageReqVO) {
PageResult<BlackDO> 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<BlackDO> list = blackService.getBlackPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "黑名单.xls", "数据", BlackRespVO.class,
BeanUtils.toBean(list, BlackRespVO.class));
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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> datas;
}

View File

@ -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;
}

View File

@ -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<Long> createEntryRecord(@Valid @RequestBody EntryRecordSaveReqVO createReqVO) {
return success(entryRecordService.createEntryRecord(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新入场记录")
@PreAuthorize("@ss.hasPermission('parking:entry-record:update')")
public CommonResult<Boolean> updateEntryRecord(@Valid @RequestBody EntryRecordSaveReqVO updateReqVO) {
entryRecordService.updateEntryRecord(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除入场记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('parking:entry-record:delete')")
public CommonResult<Boolean> deleteEntryRecord(@RequestParam("id") Long id) {
entryRecordService.deleteEntryRecord(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得入场记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('parking:entry-record:query')")
public CommonResult<EntryRecordRespVO> getEntryRecord(@RequestParam("id") Long id) {
EntryRecordDO entryRecord = entryRecordService.getEntryRecord(id);
return success(BeanUtils.toBean(entryRecord, EntryRecordRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得入场记录分页")
@PreAuthorize("@ss.hasPermission('parking:entry-record:query')")
public CommonResult<PageResult<EntryRecordRespVO>> getEntryRecordPage(@Valid EntryRecordPageReqVO pageReqVO) {
PageResult<EntryRecordDO> pageResult = entryRecordService.getEntryRecordPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, EntryRecordRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出入场记录 Excel")
@PreAuthorize("@ss.hasPermission('parking:entry-record:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportEntryRecordExcel(@Valid EntryRecordPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<EntryRecordDO> list = entryRecordService.getEntryRecordPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "入场记录.xls", "数据", EntryRecordRespVO.class,
BeanUtils.toBean(list, EntryRecordRespVO.class));
}
}

View File

@ -0,0 +1,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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<AreasAndValidityDO> areasAndValidity;
}

View File

@ -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") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 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;
}

View File

@ -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<DataList> datas = new ArrayList<>();
}

View File

@ -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;
}

View File

@ -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<ChargeDO> chargeList = new ArrayList<>();
private List<ProfitDO> profitList = new ArrayList<>();
private List<PlaceInfoDO> placeInfo = new ArrayList<>();
private String costTime;
}

View File

@ -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;
}

View File

@ -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") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 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;
}

View File

@ -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") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 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;
}

View File

@ -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<PlaceInfoDO> placeInfo = new ArrayList<>();
private String barriorOpen;
private String costTime;
}

View File

@ -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") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 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;
}

View File

@ -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> datas = new ArrayList<>();
}

View File

@ -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") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 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;
}

View File

@ -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") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 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;
}

View File

@ -25,7 +25,7 @@ public class UserInfoDO extends BaseDO {
/** /**
* 证件号码 * 证件号码
*/ */
// @TableId(type = IdType.INPUT) @TableId
private String idCard; private String idCard;
/** /**
* 车主姓名 * 车主姓名

View File

@ -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<AppearanceRecordDO> {
default PageResult<AppearanceRecordDO> selectPage(AppearanceRecordPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<AppearanceRecordDO>()
.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));
}
}

View File

@ -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<BlackDO> {
default PageResult<BlackDO> selectPage(BlackPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<BlackDO>()
.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));
}
}

View File

@ -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<ChargeDO> {
}

View File

@ -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<EntryRecordDO> {
default PageResult<EntryRecordDO> selectPage(EntryRecordPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<EntryRecordDO>()
.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));
}
}

View File

@ -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<PlaceInfoDO> {
}

View File

@ -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<ProfitDO> {
}

View File

@ -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<AppearanceRecordDO> getAppearanceRecordPage(AppearanceRecordPageReqVO pageReqVO);
BlueCardResult upAppearanceRecord(AppearanceRecordVO appearanceRecordVO);
}

View File

@ -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<AppearanceRecordMapper,AppearanceRecordDO> 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<AppearanceRecordDO> 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; // 或抛出异常
}
}

View File

@ -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<BlackDO> getBlackPage(BlackPageReqVO pageReqVO);
}

View File

@ -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<BlackDO> getBlackPage(BlackPageReqVO pageReqVO) {
return blackMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,12 @@
package cn.iocoder.yudao.module.parking.service.charge;
/**
* 收费明细 Service 接口
*
* @author 管理员
*/
public interface ChargeService {
}

View File

@ -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;
}

View File

@ -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<EntryRecordDO> getEntryRecordPage(EntryRecordPageReqVO pageReqVO);
/**
* 上传入场记录
*/
BlueCardResult upEntryRecord(EntryRecordVO entryRecordVO);
}

View File

@ -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<EntryRecordMapper,EntryRecordDO> 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<EntryRecordDO> 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; // 或抛出异常
}
}

View File

@ -0,0 +1,12 @@
package cn.iocoder.yudao.module.parking.service.placeinfo;
/**
* 车位信息 Service 接口
*
* @author 管理员
*/
public interface PlaceInfoService {
}

View File

@ -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 {
}

View File

@ -0,0 +1,11 @@
package cn.iocoder.yudao.module.parking.service.profit;
/**
* 优惠明细 Service 接口
*
* @author 管理员
*/
public interface ProfitService {
}

View File

@ -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;
}

View File

@ -12,6 +12,10 @@ import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional; 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 java.util.*;
import cn.iocoder.yudao.module.parking.controller.admin.white.vo.*; import cn.iocoder.yudao.module.parking.controller.admin.white.vo.*;
import cn.iocoder.yudao.module.parking.dal.dataobject.white.WhiteDO; import cn.iocoder.yudao.module.parking.dal.dataobject.white.WhiteDO;
@ -69,6 +73,40 @@ public class WhiteServiceImpl implements WhiteService {
validateWhiteExists(id); validateWhiteExists(id);
// 删除 // 删除
whiteMapper.deleteById(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<AreasAndValidityDO> 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) { private void validateWhiteExists(Integer id) {
@ -119,7 +157,12 @@ public class WhiteServiceImpl implements WhiteService {
userInfoDO.setUserName(whiteDatasDO.getName()); userInfoDO.setUserName(whiteDatasDO.getName());
userInfoDO.setPhone(whiteDatasDO.getPhone()); userInfoDO.setPhone(whiteDatasDO.getPhone());
userInfoDO.setAddress(whiteDatasDO.getAddress()); userInfoDO.setAddress(whiteDatasDO.getAddress());
UserInfoDO userInfoDOOne = userInfoMapper.selectOne("id_card", whiteDatasDO.getCertificate());
if (userInfoDOOne == null){
userInfoMapper.insert(userInfoDO); userInfoMapper.insert(userInfoDO);
}else {
userInfoMapper.updateById(userInfoDO);
}
CarInfoDO carInfoDO = new CarInfoDO(); CarInfoDO carInfoDO = new CarInfoDO();
carInfoDO.setPlate(whiteDatasDO.getPlate()); carInfoDO.setPlate(whiteDatasDO.getPlate());
@ -127,7 +170,13 @@ public class WhiteServiceImpl implements WhiteService {
// carInfoDO.setTicketCode(whiteDatasDO.get) // carInfoDO.setTicketCode(whiteDatasDO.get)
carInfoDO.setCarType(whiteDatasDO.getCarType()); carInfoDO.setCarType(whiteDatasDO.getCarType());
// carInfoDO.setConfidence(whiteDatasDO.ge) // carInfoDO.setConfidence(whiteDatasDO.ge)
CarInfoDO carInfoDO1 = carInfoMapper.selectOne("plate", whiteDatasDO.getPlate());
if (carInfoDO1 == null){
carInfoMapper.insert(carInfoDO); carInfoMapper.insert(carInfoDO);
}else {
carInfoDO.setId(carInfoDO1.getId());
carInfoMapper.updateById(carInfoDO);
}
AreasAndValidityDO areasAndValidityDO = whiteDatasDO.getAreasAndValidity().get(0); AreasAndValidityDO areasAndValidityDO = whiteDatasDO.getAreasAndValidity().get(0);
AreasAndValidityDO areasAndValidityDOs = new AreasAndValidityDO(); AreasAndValidityDO areasAndValidityDOs = new AreasAndValidityDO();