mitao
2025-11-05 faaf4ce0e117cd3f841fd06003e3dfdb2d0f7ebb
cloud-server-other/src/main/java/com/dsh/other/controller/CodeCallBackController.java
@@ -1,7 +1,12 @@
package com.dsh.other.controller;
import com.dsh.other.entity.SiteBooking;
import com.dsh.other.model.QuerySiteTimes;
import com.dsh.other.service.ISiteBookingService;
import com.dsh.other.service.ISiteService;
import com.dsh.other.util.ResultUtil;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -10,6 +15,7 @@
import javax.annotation.Resource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@@ -23,12 +29,16 @@
@Api(tags = "硬件方调用 存储玩湃惠民卡使用记录")
@RequestMapping("/base/code")
public class CodeCallBackController {
    @Autowired
    private ISiteBookingService siteBookingService;
    @Autowired
    private ISiteService siteService;
    // 进场二维码新增参数codeType 1=订场 2=散客,3=门票,玩湃惠民卡codeType=4
    /**
     * 硬件开门后回调 是否可进场检查接口 sid门店id rid场地id
     */
    @GetMapping("/verify")
    public ResultUtil verify(Integer codeType,Integer dataId, Integer rid, Integer sid) {
    public ResultUtil verify(Integer codeType,Integer dataId, Integer rid, Integer sid) throws Exception {
        System.err.println("硬件开门后回调 校验是否可入场");
        System.err.println("codeType:"+codeType);
        System.err.println("dataId:"+dataId);
@@ -37,9 +47,29 @@
        Date date = new Date();
        // codeType二维码类型1=订场 2=散客,3=门票,玩湃惠民卡codeType=4 234需要校验能否进场
        if (codeType==1){
        if (codeType==1 || codeType==2){
            // 将订单设置为已核销
            SiteBooking siteBooking = siteBookingService.getById(dataId);
            if (siteBooking==null){
                System.err.println("未查询到订场记录"+dataId);
                System.err.println("codeType"+codeType);
                return ResultUtil.error("未查询到订场记录");
            }else{
                siteBooking.setStatus(3);
                siteBookingService.updateById(siteBooking);
            }
            return ResultUtil.success();
        }
        if (codeType==3){
            // 远程调用将门票设置为已使用 然后判断是否能入场
            LocalDate now = LocalDate.now();
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
            String day = simpleDateFormat.format(now);
            List<QuerySiteTimes> querySiteTimes = siteService.querySiteTimes(rid, day, null, null, 2);
        }
        if (codeType==4){
            // 判断能否入场
        }
        return ResultUtil.success();
    }