From db7f0be6a4f8d3e76ddd726fd2f3648d0e0a2e6e Mon Sep 17 00:00:00 2001
From: huliguo <2023611923@qq.com>
Date: 星期一, 28 七月 2025 20:06:43 +0800
Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/HongRuiTang into 2.0
---
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java | 8 ++++++--
ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml | 2 +-
ruoyi-modules/ruoyi-member/src/main/resources/mapper/birthday/BirthdayCardMapper.xml | 2 +-
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java | 4 ++++
ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java | 12 +++++++++++-
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppLotteryEventController.java | 11 +++++++++--
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java | 2 +-
7 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java
index d6fc5dc..7da8395 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java
+++ b/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());
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppLotteryEventController.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppLotteryEventController.java
index 06010bc..21fc9f1 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppLotteryEventController.java
+++ b/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);
}
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
index 65e76ea..eeda868 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
+++ b/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);
}
diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java
index f263cf8..ecff163 100644
--- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java
+++ b/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;
}
diff --git a/ruoyi-modules/ruoyi-member/src/main/resources/mapper/birthday/BirthdayCardMapper.xml b/ruoyi-modules/ruoyi-member/src/main/resources/mapper/birthday/BirthdayCardMapper.xml
index 5f11326..864f529 100644
--- a/ruoyi-modules/ruoyi-member/src/main/resources/mapper/birthday/BirthdayCardMapper.xml
+++ b/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>
diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
index 0e0d98d..35256f3 100644
--- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
+++ b/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);
diff --git a/ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml b/ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
index f91399e..394e93a 100644
--- a/ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
+++ b/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,
--
Gitblit v1.7.1