From 399b57fe136311a089491c91000cf04bce0c4b98 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 05 十一月 2025 17:39:11 +0800
Subject: [PATCH] bug修改
---
cloud-server-other/src/main/java/com/dsh/other/controller/CodeCallBackController.java | 37 +++++++++++++++++++++++++++++--------
1 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/cloud-server-other/src/main/java/com/dsh/other/controller/CodeCallBackController.java b/cloud-server-other/src/main/java/com/dsh/other/controller/CodeCallBackController.java
index 4487ef8..81604b3 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/controller/CodeCallBackController.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/controller/CodeCallBackController.java
@@ -1,6 +1,7 @@
package com.dsh.other.controller;
import com.dsh.other.entity.SiteBooking;
+import com.dsh.other.feignclient.activity.UserCouponClient;
import com.dsh.other.model.QuerySiteTimes;
import com.dsh.other.service.ISiteBookingService;
import com.dsh.other.service.ISiteService;
@@ -33,12 +34,14 @@
private ISiteBookingService siteBookingService;
@Autowired
private ISiteService siteService;
+ @Autowired
+ private UserCouponClient userCouponClient;
// 进场二维码新增参数codeType 1=订场 2=散客,3=门票,玩湃惠民卡codeType=4
/**
* 硬件开门后回调 是否可进场检查接口 sid门店id rid场地id
*/
@GetMapping("/verify")
- public ResultUtil verify(Integer codeType,Integer dataId, Integer rid, Integer sid) throws Exception {
+ public ResultUtil verify(Integer codeType,String dataId, Integer rid, Integer sid) throws Exception {
System.err.println("硬件开门后回调 校验是否可入场");
System.err.println("codeType:"+codeType);
System.err.println("dataId:"+dataId);
@@ -49,7 +52,7 @@
// codeType二维码类型1=订场 2=散客,3=门票,玩湃惠民卡codeType=4 234需要校验能否进场
if (codeType==1 || codeType==2){
// 将订单设置为已核销
- SiteBooking siteBooking = siteBookingService.getById(dataId);
+ SiteBooking siteBooking = siteBookingService.getById(Integer.valueOf(dataId));
if (siteBooking==null){
System.err.println("未查询到订场记录"+dataId);
System.err.println("codeType"+codeType);
@@ -65,15 +68,36 @@
LocalDate now = LocalDate.now();
Date date1 = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
- SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String day = simpleDateFormat.format(now);
- String nowDate = simpleDateFormat.format(date1);
List<QuerySiteTimes> querySiteTimes = siteService.querySiteTimes(rid, day, null, null, 2);
Integer flag =0;
for (QuerySiteTimes querySiteTime : querySiteTimes) {
if (querySiteTime.getSelectable()==1){
- //
+ flag = 1;
+ break;
+ }
+ }
+ if (flag==0){
+ return ResultUtil.error("该时间段已无空位");
+ }else{
+ // 远程调用 将门票设置为已使用
+ userCouponClient.changeTicketStatus(dataId);
+ return ResultUtil.success();
+ }
+ }
+ if (codeType==4){
+ // 判断是否能入场 远程调用将门票设置为已使用
+ LocalDate now = LocalDate.now();
+ Date date1 = new Date();
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+ String day = simpleDateFormat.format(now);
+ List<QuerySiteTimes> querySiteTimes = siteService.querySiteTimes(rid, day, null, null, 2);
+ Integer flag =0;
+ for (QuerySiteTimes querySiteTime : querySiteTimes) {
+ if (querySiteTime.getSelectable()==1){
+ flag = 1;
+ break;
}
}
if (flag==0){
@@ -81,9 +105,6 @@
}else{
return ResultUtil.success();
}
- }
- if (codeType==4){
- // 判断能否入场
}
return ResultUtil.success();
--
Gitblit v1.7.1