cloud-server-activity/src/main/java/com/dsh/activity/controller/UserCouponController.java
@@ -169,6 +169,13 @@ if (null == uid) { return ResultUtil.tokenErr(); } if(!StringUtils.hasLength(lon)){ return ResultUtil.success(new ArrayList<>()); } if (lon.equals("0.0")){ return ResultUtil.success(new ArrayList<>()); } List<CouponListVo> listVos = userCouponService.querySiteCouponList(uid, siteId, price, lon, lat); return ResultUtil.success(listVos); } catch (Exception e) { cloud-server-other/src/main/java/com/dsh/other/controller/CodeCallBackController.java
@@ -1,6 +1,7 @@ package com.dsh.other.controller; import com.dsh.other.util.ResultUtil; import io.swagger.annotations.Api; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -19,6 +20,7 @@ * @date 2023/6/24 11:27 */ @RestController @Api(tags = "硬件方调用 存储玩湃惠民卡使用记录") @RequestMapping("/base/code") public class CodeCallBackController { // 进场二维码新增参数codeType 1=订场 2=散客,3=门票,玩湃惠民卡codeType=4 @@ -36,9 +38,9 @@ // codeType二维码类型1=订场 2=散客,3=门票,玩湃惠民卡codeType=4 234需要校验能否进场 if (codeType==1){ return ResultUtil.success(true); return ResultUtil.success(); } return ResultUtil.success(true); return ResultUtil.success(); } } cloud-server-other/src/main/java/com/dsh/other/controller/SiteController.java
@@ -363,12 +363,11 @@ }) public ResultUtil reservationSite(ReservationSite reservationSite) { try { // Integer uid = tokenUtil.getUserIdFormRedis(); // if (null == uid) { // return ResultUtil.tokenErr(); // } Integer uid = 201; Integer uid = tokenUtil.getUserIdFormRedis(); if (null == uid) { return ResultUtil.tokenErr(); } // Integer uid = 201; return siteService.reservationSite(uid, reservationSite); } catch (Exception e) { e.printStackTrace(); cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java
@@ -91,6 +91,7 @@ /** * 获取场地列表 * @@ -101,12 +102,28 @@ @Override public List<QuerySiteListVo> querySiteList(QuerySiteList querySiteList) throws Exception { querySiteList.setPageNum((querySiteList.getPageNum() - 1) * querySiteList.getPageSize()); DayOfWeek dayOfWeek = LocalDate.now().getDayOfWeek(); Map<Integer, List<TSitePrice>> priceMap = sitePriceService.lambdaQuery().eq(TSitePrice::getDayOfWeek, dayOfWeek.getValue()) .eq(TSitePrice::getTargetAudience,1).list() .stream().collect(Collectors.groupingBy(TSitePrice::getSiteId)); List<QuerySiteListVo> querySiteListVos = this.baseMapper.querySiteList(querySiteList); for (QuerySiteListVo querySiteListVo : querySiteListVos) { if (ToolUtil.isEmpty(querySiteList.getLon())) { querySiteListVo.setDistance(0D); continue; } List<TSitePrice> tSitePrices = priceMap.get(querySiteListVo.getId()); if (tSitePrices!=null&& !tSitePrices.isEmpty()){ BigDecimal bigDecimal = tSitePrices.get(0).getCashPrice(); // 遍历 查询最小的价格 for (TSitePrice tSitePrice : tSitePrices) { if (bigDecimal.compareTo(tSitePrice.getCashPrice()) > 0) { bigDecimal = tSitePrice.getCashPrice(); } } querySiteListVo.setPrice(bigDecimal.doubleValue()); querySiteListVo.setTimes(tSitePrices.get(0).getStartTime() + "-" + tSitePrices.get(tSitePrices.size()-1).getEndTime()); } Map<String, Double> distance = GeodesyUtil.getDistance(querySiteList.getLon() + "," + querySiteList.getLat(), querySiteListVo.getStoreLon() + "," + querySiteListVo.getStoreLat()); double wgs84 = new BigDecimal(distance.get("WGS84")).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); querySiteListVo.setDistance(wgs84);