ruoyi-api/ruoyi-api-goods/src/main/java/com/ruoyi/goods/api/domain/TUserLotteryEvent.java
@@ -64,5 +64,10 @@ */ @TableField(value = "create_time") private LocalDateTime createTime; /** * 订单id */ @TableField(value = "orderId") private String orderId; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/service/RemoteShopService.java
@@ -250,6 +250,6 @@ * @param shopId * @return */ @PostMapping("/getMemberIngTotal") @PostMapping("/shop/getMemberIngTotal") R<List<Integer>> getMemberIngTotal(@RequestParam("shopId") Long shopId); } ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerGoodsController.java
@@ -57,12 +57,10 @@ page.setOptimizeCountSql(false); List<MerGoodsPageVo> merGoodsPageVoList = goodsService.pageMerShopGoods(page, merGoodsPageDto); Shop shop = remoteShopService.getShop(merGoodsPageDto.getShopId()).getData(); if (null != shop.getBelongShopId()){ Shop belongShop = remoteShopService.getShop(shop.getBelongShopId()).getData(); merGoodsPageVoList.forEach(merGoodsPageVo -> { ShopGoods shopGoods = shopGoodsService.getByShopIdAndGoodsId(merGoodsPageDto.getShopId(), merGoodsPageVo.getGoodsId()); //后台开启经销商统一售价,且经销商设置了统一售价,加盟商不能修改价格 if (1 == belongShop.getModifyPricePermission() && null != shopGoods) { if (1 == shop.getModifyPricePermission() && null != shopGoods) { merGoodsPageVo.setModifyPricePermission(0); merGoodsPageVo.setIsUnifiedPrice(1); merGoodsPageVo.setUnifiedPrice(shopGoods.getSalesPrice()); @@ -72,8 +70,6 @@ merGoodsPageVo.setIsUnifiedPrice(0); } }); } return R.ok(page.setRecords(merGoodsPageVoList)); } ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppLotteryEventController.java
@@ -69,7 +69,7 @@ @ApiImplicitParam(name = "id", value = "抽奖活动id", required = true, dataType = "String", paramType = "path") }) public R<LotteryEventVo> getLotteryEvent(@PathVariable("id") String id, @PathVariable("orderId") String orderId) { LotteryEventVo lotteryEvent = lotteryEventService.getLotteryEvent(id); LotteryEventVo lotteryEvent = lotteryEventService.getLotteryEvent(id, orderId); TLotteryEvent event = lotteryEventService.getById(id); if (LocalDateTime.now().isBefore(event.getStartTime())) { lotteryEvent.setStatus(1); @@ -91,7 +91,7 @@ @ApiImplicitParam(name = "id", value = "抽奖活动id", required = true, dataType = "String", paramType = "path") }) public R<TLotteryEventPrize> lotteryDraw(@PathVariable("id") String id, @PathVariable("orderId") String orderId) { return lotteryEventService.lotteryDraw(id); return lotteryEventService.lotteryDraw(id, orderId); } @@ -122,12 +122,12 @@ @ResponseBody @PostMapping("/getLotteryEventInfo/{id}/{orderId}") @PostMapping("/getLotteryEventInfo/{id}") @ApiOperation(value = "获取抽奖活动详情【2.0】", tags = "抽奖活动") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "抽奖活动id", required = true, dataType = "String", paramType = "path") }) public R<LotteryEventInfoVo> getLotteryEventInfo(@PathVariable("id") String id, @PathVariable("orderId") String orderId){ public R<LotteryEventInfoVo> getLotteryEventInfo(@PathVariable("id") String id){ Long userId = SecurityUtils.getUserId(); TLotteryEvent lotteryEvent = lotteryEventService.getById(id); LotteryEventInfoVo vo = new LotteryEventInfoVo(); ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
@@ -79,7 +79,7 @@ * @return */ @Override public LotteryEventVo getLotteryEvent(String id) { public LotteryEventVo getLotteryEvent(String id, String orderId) { Long userId = SecurityUtils.getUserId(); TLotteryEvent lotteryEvent = this.getById(id); //构建返回结果 @@ -87,7 +87,12 @@ vo.setId(lotteryEvent.getId()); vo.setName(lotteryEvent.getName()); vo.setActivityProfile(lotteryEvent.getActivityProfile()); List<TUserLotteryEvent> userLotteryEvents = userLotteryEventService.list(new QueryWrapper<TUserLotteryEvent>().eq("lottery_event_id", id).eq("user_id", userId)); QueryWrapper<TUserLotteryEvent> wrapper = new QueryWrapper<TUserLotteryEvent>().eq("lottery_event_id", id).eq("user_id", userId); //下单抽奖 if(2 == lotteryEvent.getActivityType()){ wrapper.eq("orderId", orderId); } List<TUserLotteryEvent> userLotteryEvents = userLotteryEventService.list(wrapper); vo.setLaveTimes(lotteryEvent.getTimes() - userLotteryEvents.size()); //构建我的奖品明细 @@ -134,7 +139,7 @@ * @return */ @Override public R<TLotteryEventPrize> lotteryDraw(String id) { public R<TLotteryEventPrize> lotteryDraw(String id, String orderId) { Long userId = SecurityUtils.getUserId(); Member member = remoteMemberService.getMember(userId).getData(); TLotteryEvent lotteryEvent = this.getById(id); @@ -152,11 +157,9 @@ boolean tryLock = lock.tryLock(30, TimeUnit.SECONDS); if (tryLock) { //判断抽奖次数是否用完 if(2 != lotteryEvent.getActivityType()){ int count = userLotteryEventService.count(new QueryWrapper<TUserLotteryEvent>().eq("lottery_event_id", id).eq("user_id", userId)); int count = userLotteryEventService.count(new QueryWrapper<TUserLotteryEvent>().eq("lottery_event_id", id).eq("user_id", userId).eq("order_id", orderId)); if (lotteryEvent.getTimes() <= count) { return R.fail("抽奖次数已用完"); } } List<TLotteryEventPrize> lotteryEventPrizeList = lotteryEventPrizeService.list(new QueryWrapper<TLotteryEventPrize>().eq("lottery_event_id", id)); //开始抽奖,根据中奖概率来抽奖 @@ -184,6 +187,7 @@ userLotteryEvent.setObjectId(lotteryEventPrize.getObjectId()); userLotteryEvent.setObjectName(lotteryEventPrize.getObjectName()); userLotteryEvent.setNumber(lotteryEventPrize.getNumber()); userLotteryEvent.setOrderId(orderId); //中奖优惠券 if (1 == lotteryEventPrize.getPrizeType()) { AddMemberCoupon addMemberCoupon = new AddMemberCoupon(); ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/lottery/ILotteryEventService.java
@@ -24,7 +24,7 @@ * @param id * @return */ LotteryEventVo getLotteryEvent(String id); LotteryEventVo getLotteryEvent(String id, String orderId); /** @@ -33,7 +33,7 @@ * @param id * @return */ R<TLotteryEventPrize> lotteryDraw(String id); R<TLotteryEventPrize> lotteryDraw(String id, String orderId); /** ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/business/MerShopController.java
@@ -283,7 +283,7 @@ @RequestMapping(value = "/cancelReservation", method = RequestMethod.POST) @ApiOperation(value = "商户取消预约【2.0】") public R cancelReservation(@RequestBody CancelReservationDto dto) { TShopAppointableTime shopAppointableTime = shopAppointableTimeService.getById(dto.getId()); TShopAppointableTime shopAppointableTime = shopAppointableTimeService.getById(dto.getAppointmentId()); if (null == shopAppointableTime) { return R.fail("预约不存在"); } @@ -291,7 +291,7 @@ return R.fail("不能重复操作"); } shopAppointableTime.setStatus(0); shopAppointableTime.setReason(dto.getReason()); shopAppointableTime.setReason(dto.getCancelReason()); shopAppointableTimeService.updateById(shopAppointableTime); return R.ok(); } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/CancelReservationDto.java
@@ -10,7 +10,7 @@ @ApiModel public class CancelReservationDto { @ApiModelProperty(value = "预约id") private String id; private String appointmentId; @ApiModelProperty(value = "取消原因") private String reason; private String cancelReason; }