| | |
| | | @Autowired |
| | | private SiteMapper siteMapper; |
| | | |
| | | @Autowired |
| | | private TBackRecordService backRecordService; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | Store store = storeService.getById(site.getStoreId()); |
| | | QuerySiteInfoVo querySiteInfoVo = new QuerySiteInfoVo(); |
| | | querySiteInfoVo.setId(site.getId()); |
| | | querySiteInfoVo.setTypeName(site.getTypeName()); |
| | | querySiteInfoVo.setName(site.getName()); |
| | | querySiteInfoVo.setSiteTypeName(siteType.getName()); |
| | | querySiteInfoVo.setStoreName(store.getName()); |
| | |
| | | querySiteInfoVo.setStorePhone(store.getPhone()); |
| | | querySiteInfoVo.setImgs(site.getImgs()); |
| | | querySiteInfoVo.setDistance(0D); |
| | | querySiteInfoVo.setCashPriceOne(site.getCashPriceOne()); |
| | | if(site.getPlayPaiCoinOne()!=null){ |
| | | querySiteInfoVo.setPlayPaiCoinOne(site.getPlayPaiCoinOne().intValue()); |
| | | } |
| | | |
| | | querySiteInfoVo.setIntroduce(site.getIntroduce()); |
| | | ArrayList<String> nextName = new ArrayList<>(); |
| | | ArrayList<String> halfName = new ArrayList<>(); |
| | | String nextName1 = site.getNextName(); |
| | | String halfName1 = site.getHalfName(); |
| | | |
| | | querySiteInfoVo.setIshalf(site.getIshalf()); |
| | | String[] split = nextName1.split(","); |
| | | for (String s : split) { |
| | | nextName.add(s); |
| | |
| | | e.setTime(sdf.parse(day + " " + site.getAppointmentEndTime())); |
| | | |
| | | int hour = e.get(Calendar.HOUR_OF_DAY); |
| | | |
| | | int minute = e.get(Calendar.MINUTE); |
| | | |
| | | List<QuerySiteTimes> list = new ArrayList<>(); |
| | | |
| | | SimpleDateFormat sdfs = new SimpleDateFormat("HH:mm"); |
| | | |
| | | while (true){ |
| | | |
| | | String start = sdfs.format(s.getTime()); |
| | | |
| | | s.set(Calendar.MINUTE, s.get(Calendar.MINUTE) + 30); |
| | | |
| | | int e_hour = s.get(Calendar.HOUR_OF_DAY); |
| | | |
| | | int e_minute = s.get(Calendar.MINUTE); |
| | | |
| | | String end = sdfs.format(s.getTime()); |
| | | |
| | | QuerySiteTimes querySiteTimes = new QuerySiteTimes(); |
| | | |
| | | querySiteTimes.setTime(start + "-" + end); |
| | | |
| | | querySiteTimes.setSelectable(1); |
| | | |
| | | SiteBooking siteBooking = siteBookingService.getOne(new QueryWrapper<SiteBooking>().eq("siteId", id).eq("state", 1) |
| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | Double payMoney = 0D; |
| | | if(reservationSite.getPayType() == 3){ |
| | | payMoney = new BigDecimal(site.getCashPrice()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | if(reservationSite.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(); |
| | | } |
| | | if(appUser.getPlayPaiCoins().compareTo(payMoney.intValue()) < 0){ |
| | | return ResultUtil.error("玩湃币不足"); |
| | | } |
| | |
| | | |
| | | //校验优惠券 |
| | | Long couponId = reservationSite.getCouponId(); |
| | | if (couponId!=null && couponId != 0){ |
| | | |
| | | if(null != couponId && reservationSite.getPayType() != 3){ |
| | | UserCoupon userCoupon = userCouponClient.queryUserCouponById(new QueryUserCouponByIdAndUserId(reservationSite.getCouponId(),uid)); |
| | | |
| | | |
| | | if(userCoupon.getStatus() == 2){ |
| | | return ResultUtil.error("优惠券已被核销"); |
| | | } |
| | |
| | | } |
| | | userCoupon.setStatus(2); |
| | | userCouponClient.updateUserCoupon(userCoupon); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | return aliPaymentSite(payMoney, siteBooking); |
| | | } |
| | | if(reservationSite.getPayType() == 3){//玩湃币支付 |
| | | return playPaiCoinPaymentSite(appUser, payMoney, siteBooking); |
| | | if(reservationSite.getIsHalf()==2){ |
| | | return playPaiCoinPaymentSite(appUser, Double.valueOf(site.getPlayPaiCoin()), siteBooking); |
| | | }else { |
| | | return playPaiCoinPaymentSite(appUser, site.getPlayPaiCoinOne(), siteBooking); |
| | | } |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | SiteBooking siteBooking = siteBookingService.getById(queryMySiteVo.getId()); |
| | | Site site = this.getById(siteBooking.getSiteId()); |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | queryMySiteVo.setPlayPaiCoin(site.getPlayPaiCoin() * split.length); |
| | | if(site!=null){ |
| | | |
| | | queryMySiteVo.setPlayPaiCoin(site.getPlayPaiCoin() * split.length); |
| | | } |
| | | } |
| | | return queryMySiteVos; |
| | | } |
| | |
| | | } |
| | | siteBooking.setCancelUserId(uid); |
| | | siteBookingService.updateById(siteBooking); |
| | | |
| | | TBackRecord tBackRecord = new TBackRecord(); |
| | | tBackRecord.setMoney(siteBooking.getPayMoney()); |
| | | tBackRecord.setUserId(siteBooking.getAppUserId()); |
| | | tBackRecord.setTime(new Date()); |
| | | backRecordService.save(tBackRecord); |
| | | |
| | | } |
| | | if(siteBooking.getPayType() == 2){//支付宝 |
| | | Map<String, String> map = payMoneyUtil.aliRefund(siteBooking.getPayOrderNo(), siteBooking.getPayMoney().toString()); |
| | |
| | | userCoupon.setStatus(1); |
| | | userCouponClient.updateUserCoupon(userCoupon); |
| | | } |
| | | |
| | | |
| | | TBackRecord tBackRecord = new TBackRecord(); |
| | | tBackRecord.setMoney(siteBooking.getPayMoney()); |
| | | tBackRecord.setUserId(siteBooking.getAppUserId()); |
| | | tBackRecord.setTime(new Date()); |
| | | backRecordService.save(tBackRecord); |
| | | } |
| | | |
| | | if(siteBooking.getPayType() == 3){//玩湃币 |