| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalTime; |
| | | import java.util.*; |
| | |
| | | List<String> strings = new ArrayList<>(); |
| | | |
| | | // List<SiteBooking> siteBookings = siteClient.listBooks(id); |
| | | List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", id).eq("nextName",siteName).like("times",day)); |
| | | List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", id).ne("status",5).eq("nextName",siteName).like("times",day)); |
| | | |
| | | |
| | | if (siteName==null|| siteName.equals("")){ |
| | |
| | | if(stringDateBetween){ |
| | | orderDto.setSelectable(0); |
| | | } |
| | | if (DateComparisonExample.isStringWithinTimeRange(stime, siteLock.getStartTime(), siteLock.getEndTime())){ |
| | | orderDto.setSelectable(0); |
| | | } |
| | | if (DateComparisonExample.isStringWithinTimeRange(etime, siteLock.getStartTime(), siteLock.getEndTime())){ |
| | | orderDto.setSelectable(0); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static String getNextTime(String currentTime) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 课程支付宝支付 |
| | | * @param paymentPrice |
| | |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); |
| | | Date startTime = siteBooking.getStartTime(); |
| | | if(format.format(new Date()).equals(format.format(startTime))){ |
| | | if(format.format(new Date()).equals(format.format(startTime))&&siteBooking.getStatus() != 0){ |
| | | return ResultUtil.error("预约当天,不能取消"); |
| | | } |
| | | |
| | | if(siteBooking.getStatus() == 0){ |
| | | return ResultUtil.error("请先进行支付"); |
| | | // return ResultUtil.error("请先进行支付"); |
| | | siteBooking.setStatus(5); |
| | | siteBookingService.updateById(siteBooking); |
| | | return ResultUtil.success(); |
| | | } |
| | | if(siteBooking.getStatus() != 1 && siteBooking.getStatus() != 2){ |
| | | return ResultUtil.error("不能进行取消操作"); |
| | |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | Double payMoney = 0D; |
| | | if(payType == 3){ |
| | | payMoney = new BigDecimal(site.getPlayPaiCoin()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | // payMoney = new BigDecimal(site.getPlayPaiCoin()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | if(appUser.getPlayPaiCoins().compareTo(payMoney.intValue()) < 0){ |
| | | return ResultUtil.error("玩湃币不足"); |
| | | } |
| | | |
| | | if(siteBooking.getIsHalf()==2){ |
| | | payMoney = new BigDecimal(site.getPlayPaiCoin()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | }else { |
| | | payMoney = new BigDecimal(site.getPlayPaiCoinOne()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | } |
| | | }else{ |
| | | if(siteBooking.getIsHalf()==2){ |
| | |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | Map<String, Double> map = new HashMap<>(); |
| | | Double payMoney = new BigDecimal(site.getPlayPaiCoin()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | |
| | | |
| | | if(siteBooking.getIsHalf()==2){ |
| | | payMoney = new BigDecimal(site.getPlayPaiCoin()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | }else { |
| | | payMoney = new BigDecimal(site.getPlayPaiCoinOne()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | } |
| | | |
| | | map.put("playPaiCoin", payMoney); |
| | | payMoney = new BigDecimal(site.getCashPrice()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | |
| | | if(siteBooking.getIsHalf()==2){ |
| | | payMoney = new BigDecimal(site.getCashPrice()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | }else { |
| | | payMoney = new BigDecimal(site.getCashPriceOne()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | } |
| | | |
| | | //校验优惠券 |
| | | Long couponId = siteBooking.getUserCouponId(); |
| | | if(null != couponId){ |