| | |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "使用状态 (1已使用 2未使用)", name = "useType", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "商品类型 1实物 2课包 3门票 4优惠券", name = "goodType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "page", name = "页数", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "size", name = "size", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<List<ExchangeDetailsResponse>> exchangeRecordsDetails(Integer useType, Integer goodType,Integer page,Integer size){ |
| | | try { |
| | | if(page==null || size==null){ |
| | | page=1; |
| | | size=10; |
| | | } |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | |
| | | } |
| | | |
| | | int totalItems = detailsResponses.size(); |
| | | int totalPages = (int) Math.ceil((double) totalItems / size); |
| | | int startIndex = (page - 1) * size; |
| | | int endIndex = Math.min(startIndex + size, totalItems); |
| | | |
| | |
| | | |
| | | list = pmdsService.list(new QueryWrapper<PointsMerchandise>() |
| | | .eq("state", 1) |
| | | .eq("shelves",1)); |
| | | .eq("shelves",1).le("startTime",new Date()).ge("endTime",new Date())); |
| | | if (list.size() > 0 ){ |
| | | Iterator<PointsMerchandise> iterator = list.iterator(); |
| | | while (iterator.hasNext()) { |
| | | PointsMerchandise merchandise = iterator.next(); |
| | | if (merchandise.getUseScope() == 2 && (!Objects.equals(merchandise.getCityCode(), cityCode) && !Objects.equals(merchandise.getProvinceCode(), provinceCode))) { |
| | | if (merchandise.getUseScope() == 2 && (!cityCode.equals(merchandise.getCityCode()) || !provinceCode.equals(merchandise.getProvinceCode()))) { |
| | | iterator.remove(); // 移除符合条件的商品 |
| | | } |
| | | } |
| | |
| | | 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("玩湃币不足"); |
| | | } |
| | |
| | | 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(); |
| | | } |