44323
2023-12-08 2fa137fdda93862d79ef09a75603faef4f4769cd
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java
@@ -1026,7 +1026,7 @@
        System.out.println("=====stie====="+site);
        System.out.println("=====type====="+type);
        if (type == 0 ){
        if (type == 1 ){
            doubles.add(site.getCashPrice());
            doubles.add(Double.valueOf(site.getPlayPaiCoin()));
            return  doubles;
@@ -1048,7 +1048,7 @@
    @RequestMapping("/yuyuetimes/{id}")
    @ResponseBody
    public List<OrderDto> yuyuetimes(@PathVariable("id") Integer id,String date,String siteName,String halfName) {
    public List<OrderDto> yuyuetimes(@PathVariable("id") Integer id,String date,String siteName,String halfName) throws ParseException {
//        System.out.println("=======date======"+date);
//
//        List<String> strings = new ArrayList<>();
@@ -1108,7 +1108,8 @@
//        return timeRanges;
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        Date now = new Date();
        System.out.println("=======date======" + date);
        List<String> strings = new ArrayList<>();
@@ -1187,6 +1188,10 @@
                String stime = date + " " + currentTime;
                String etime = date + " " + nextTime;
                Date isPass = format.parse(etime);
                orderDto.setState(1);
                // 查出lock
                List<SiteLock> list = siteLockService.list(new LambdaQueryWrapper<SiteLock>().eq(SiteLock::getSiteId, id));
@@ -1203,7 +1208,9 @@
                    }
                }
                if (isPass.before(now)){
                    orderDto.setState(0);
                }
            }
@@ -1270,6 +1277,17 @@
        return split;
    }
    @RequestMapping("/nextName/{id}")
    @ResponseBody
    public String[] nextName(@PathVariable("id") Integer id) {
        TSite byId =   siteService.getById(id);
        String[] split = byId.getNextName().split(",");
        System.out.println("=-============"+split);
        return split;
    }
    @RequestMapping("/yuyue_add")
    public String yuyueadd(Model model) {
        Integer objectType = UserExt.getUser().getObjectType();
@@ -1324,6 +1342,48 @@
        siteBooking.setState(1);
        siteBooking.setStatus(0);
        siteBooking.setAddType(1);
        //存开始和结束时间
        String times = siteBooking.getTimes();
        String[] dates = times.split(";");
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        Date minDate = null;
        Date maxDate = null;
        for (String dateStr : dates) {
            String[] dateRange = dateStr.split("-");
            String startDateStr = dateRange[0].trim();
            String endDateStr = dateRange[1].trim();
            try {
                Date startDate = format.parse(startDateStr);
                Date endDate = format.parse(endDateStr);
                if (minDate == null || startDate.before(minDate)) {
                    minDate = startDate;
                }
                if (maxDate == null || endDate.after(maxDate)) {
                    maxDate = endDate;
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        System.out.println("最小日期:" + minDate);
        System.out.println("最大日期:" + maxDate);
        siteBooking.setStartTime(minDate);
        siteBooking.setEndTime(maxDate);
        siteBooking.setPayType(2);
        //存多少钱
        String money = siteBooking.getMoney();
        String[] moneys = money.split(",");
        siteBooking.setPayMoney(Double.valueOf(moneys[0]));
        // 查询当前预约人是否是会员
        String phone = siteBooking.getPhone();
        String booker = siteBooking.getBooker();