ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java
@@ -23,6 +23,7 @@ import com.ruoyi.system.api.service.RemoteShopService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -37,6 +38,7 @@ * @author zhibing.pu * @Date 2025/5/8 18:13 */ @Slf4j @Api(value = "商户端商户相关接口", tags = "商户端商户相关接口", description = "商户端商户相关接口") @RestController @RequestMapping("/mer/lotteryEvent") @@ -118,6 +120,8 @@ lotteryEvent.setId(IdUtils.simpleUUID()); String weiXinQrCode = remoteMemberService.getWeiXinQrCode("id=" + lotteryEvent.getId() + "&activityType=" + lotteryEvent.getActivityType(), "/pages/turntable/index"); lotteryEvent.setWxMiniProgramQrCode(weiXinQrCode); lotteryEvent.setCreateTime(LocalDateTime.now()); lotteryEvent.setCreateUserId(lotteryEvent.getCreateUserId()); } lotteryEvent.setUpdateTime(LocalDateTime.now()); lotteryEvent.setUpdateUserId(SecurityUtils.getUserId()); ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppLotteryEventController.java
@@ -249,6 +249,8 @@ one.setLotteryEventQuestionId(lotteryEventQuestions.getId()); one.setLotteryEventQuestionsAnswersId(lotteryEventQuestionsAnswers.getId()); one.setCreateTime(LocalDateTime.now()); }else{ one.setLotteryEventQuestionsAnswersId(lotteryEventQuestionsAnswers.getId()); } one.setIsCorrect(0); //答案正确 @@ -270,7 +272,12 @@ TLotteryEvent lotteryEvent = lotteryEventService.getById(id); TUserLotteryEventQuestions questionsServiceOne = userLotteryEventQuestionsService.getOne(new QueryWrapper<TUserLotteryEventQuestions>().eq("lottery_event_id", id).eq("user_id", userId)); if (null == questionsServiceOne) { return R.fail("请先进行答题操作"); questionsServiceOne = new TUserLotteryEventQuestions(); questionsServiceOne.setId(IdUtils.simpleUUID()); questionsServiceOne.setUserId(userId); questionsServiceOne.setLotteryEventId(id); questionsServiceOne.setStatus(1); questionsServiceOne.setCreateTime(LocalDateTime.now()); } questionsServiceOne.setStatus(2); questionsServiceOne.setEndTime(LocalDateTime.now()); @@ -280,7 +287,7 @@ int right = list.stream().filter(item -> 1 == item.getIsCorrect()).collect(Collectors.toList()).size(); BigDecimal multiply = new BigDecimal(right).divide(new BigDecimal(count), 4, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)); questionsServiceOne.setCorrectAnswerRate(multiply); userLotteryEventQuestionsService.updateById(questionsServiceOne); userLotteryEventQuestionsService.saveOrUpdate(questionsServiceOne); if (multiply.compareTo(lotteryEvent.getAccuracy()) >= 0) { return R.ok(true); } ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
@@ -16,6 +16,7 @@ import com.ruoyi.goods.domain.vo.*; import com.ruoyi.goods.mapper.lottery.LotteryEventMapper; import com.ruoyi.goods.service.lottery.*; import com.ruoyi.system.api.domain.dto.IntegralChangeDto; import com.ruoyi.system.api.domain.poji.member.Member; import com.ruoyi.system.api.domain.poji.member.MemberGiftRecord; import com.ruoyi.system.api.domain.poji.shop.Shop; @@ -194,17 +195,20 @@ memberGiftRecord.setGiftId(userLotteryEvent.getId()); memberGiftRecord.setGiftFrom(1); memberGiftRecord.setShopId(member.getRelationShopId()); memberGiftRecord.setVerifyStatus(1); switch (lotteryEventPrize.getPrizeType()) { case 1: memberGiftRecord.setGiftType(1); memberGiftRecord.setCouponId(userLotteryEvent.getObjectId()); memberGiftRecord.setCouponNumber(userLotteryEvent.getNumber()); memberGiftRecord.setCouponName(userLotteryEvent.getObjectName()); memberGiftRecord.setVerifyStatus(2); break; case 2: memberGiftRecord.setGiftType(2); memberGiftRecord.setGoodsId(userLotteryEvent.getObjectId()); memberGiftRecord.setGiftName(userLotteryEvent.getObjectName()); memberGiftRecord.setGoodsNumber(userLotteryEvent.getNumber()); memberGiftRecord.setGoodsName(userLotteryEvent.getObjectName()); break; case 3: memberGiftRecord.setGiftType(4); @@ -214,11 +218,11 @@ case 4: memberGiftRecord.setGiftType(5); memberGiftRecord.setIntegralNumber(userLotteryEvent.getNumber()); memberGiftRecord.setVerifyStatus(2); break; } memberGiftRecord.setPrizeFrom(2); memberGiftRecord.setCreateTime(new Date()); memberGiftRecord.setVerifyStatus(1); remoteMemberService.saveMemberGiftRecord(memberGiftRecord); return R.ok(lotteryEventPrize); } ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java
@@ -2182,7 +2182,7 @@ integralRecord.setUserId(integralChangeDto.getUserId()); integralRecord.setChangeType(integralType); integralRecord.setCreateTime(new Date()); //1分享获取2平台建议获取3门店建议获取4每日签到5消费得积分 //1分享获取2平台建议获取3门店建议获取4每日签到5消费得积分6抽奖获得积分 switch(integralType){ case 1: changeIntegral = appOtherConfigGetVo.getShareIntegral(); @@ -2230,6 +2230,16 @@ memberTotal.setUseableIntegral(memberTotal.getUseableIntegral()+changeIntegral); memberTotal.setBuyFlag(1); break; case 6: integralRecord.setChangeIntegral(changeIntegral); integralRecord.setSurpIntegral(memberTotal.getUseableIntegral()+changeIntegral); integralRecord.setChangeReason("抽奖获得积分"); integralRecord.setOrderId(integralChangeDto.getOrderId()); integralRecord.setOrderNo(integralChangeDto.getOrderNo()); memberTotal.setTotalIntegral(memberTotal.getTotalIntegral()+changeIntegral); memberTotal.setUseableIntegral(memberTotal.getUseableIntegral()+changeIntegral); memberTotal.setBuyFlag(1); break; default: break; } ruoyi-modules/ruoyi-member/src/main/resources/mapper/birthday/BirthdayCardMapper.xml
@@ -37,6 +37,6 @@ FROM t_member_gift_record WHERE del_flag = 0 AND user_id = #{userId} ORDER BY verify_status ASC ORDER BY verify_status ASC,create_time desc </select> </mapper> ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
@@ -3221,7 +3221,7 @@ order.setOrderFrom(4); order.setShopId(shopId); order.setUserId(userId); order.setOrderMoney(BigDecimal.ZERO); order.setOrderMoney(goods.getSalesPrice()); order.setCouponMoney(BigDecimal.ZERO); order.setDiscountMoney(BigDecimal.ZERO); order.setReceivableMoney(BigDecimal.ZERO); ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
@@ -1196,7 +1196,7 @@ COUNT(order_id) orderTotal, IFNULL(SUM(CASE WHEN order_from = 1 THEN 1 ELSE 0 END),0) onlineTotal, IFNULL(SUM(CASE WHEN order_from = 3 THEN 1 ELSE 0 END),0) offlineTotal, IFNULL(SUM(CASE WHEN order_from = 2 THEN 1 ELSE 0 END),0) activityTotal, IFNULL(SUM(CASE WHEN order_from = 2 THEN 1 ELSE 0 END),0) activityTotal, IFNULL(SUM(CASE WHEN order_from = 5 THEN 1 ELSE 0 END),0) meituan, IFNULL(SUM(CASE WHEN order_from = 5 THEN receivable_money ELSE 0 END),0) meituanAmount, IFNULL(SUM(CASE WHEN order_from = 6 THEN 1 ELSE 0 END),0) douyin,