From 50acf879a162e32c382d4de10772cfe4842e4867 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com>
Date: Fri, 23 Feb 2024 17:37:20 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E6=9C=89=E7=A4=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../activeConsumption/index.vue | 9 +-
.../ActiveConsumptionController.java | 23 ++
.../entity/ActiveConsumption.java | 2 +
.../mapper/xml/ActiveConsumptionMapper.xml | 2 +-
.../ActiveConsumptionChildService.java | 6 +
.../ActiveConsumptionChildServiceImpl.java | 43 +++
.../impl/ActiveConsumptionServiceImpl.java | 41 +++
.../vo/ActiveConsumptionVO.java | 277 +-----------------
.../vo/ActiveConsumptionVO.java | 2 +
.../activeExchange/dto/PaymentActiveDTO.java | 2 +
.../impl/ActiveExchangeServiceImpl.java | 22 +-
.../ActiveNewlywedsRecordsServiceImpl.java | 6 +-
.../ActiveRecommendRecordsServiceImpl.java | 6 +-
.../entity/CardExchangeRecord.java | 2 +
.../entity/CardFavorableRecord.java | 2 +
.../vo/CardFavorableCountVO.java | 16 +
.../controller/CardGiftController.java | 9 +-
.../cardGift/service/CardGiftService.java | 2 +-
.../service/impl/CardGiftServiceImpl.java | 6 +-
.../order/mapper/xml/OilOrderMapper.xml | 1 +
20 files changed, 185 insertions(+), 294 deletions(-)
create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CardFavorableCountVO.java
diff --git a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue
index 01fdeac4e..b05405ac8 100644
--- a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue
+++ b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue
@@ -47,10 +47,9 @@
-
@@ -126,7 +125,7 @@
- 全部用户
+
全部会员
等级会员
@@ -340,12 +339,12 @@
-
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java
index 6aa945cde..a16b63cec 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java
@@ -120,5 +120,28 @@ public class ActiveConsumptionController extends BaseController {
public ResponseObject del(@RequestParam("ids") List ids) {
return getSuccessResult(activeConsumptionChildService.removeByIds(ids));
}
+
+ /**
+ * 优惠券、兑换券使用详情
+ *
+ * @param id 主键
+ * @return 单条数据
+ */
+ @GetMapping("/detailRecord/{id}")
+ public ResponseObject detail(@PathVariable Serializable id) {
+ return getSuccessResult(this.activeConsumptionChildService.detailRecord(id));
+ }
+
+ /**
+ * 统计
+ *
+ * @param id 主键
+ * @return 单条数据
+ */
+ @GetMapping("/detailCount/{id}")
+ public ResponseObject detailCount(@PathVariable Serializable id) {
+ return getSuccessResult(this.activeConsumptionChildService.detailCount(id));
+ }
+
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java
index 3b4c111ba..46a74a597 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java
@@ -30,6 +30,8 @@ public class ActiveConsumption extends Model {
private Integer storeId;
//活动名称
private String name;
+ //满足金额类型 1:订单金额 2:实付金额
+ private String moneyType;
//满足金额
private Double participationConditionMoney;
//活动开始时间
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/xml/ActiveConsumptionMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/xml/ActiveConsumptionMapper.xml
index 9a4a82667..be791a021 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/xml/ActiveConsumptionMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/xml/ActiveConsumptionMapper.xml
@@ -53,4 +53,4 @@
order by create_time desc
-
\ No newline at end of file
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionChildService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionChildService.java
index 1702d4ed0..212edb163 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionChildService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionChildService.java
@@ -2,6 +2,8 @@ package com.fuint.business.marketingActivity.activeConsumption.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
+import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
+import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableCountVO;
import java.io.Serializable;
import java.util.List;
@@ -16,4 +18,8 @@ public interface ActiveConsumptionChildService extends IService selectList(Serializable id);
+
+ List detailRecord(Serializable id);
+
+ CardFavorableCountVO detailCount(Serializable id);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java
index 8ae507408..3963b8f9d 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java
@@ -1,9 +1,15 @@
package com.fuint.business.marketingActivity.activeConsumption.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
import com.fuint.business.marketingActivity.activeConsumption.mapper.ActiveConsumptionChildMapper;
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionChildService;
+import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
+import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
+import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableCountVO;
+import com.fuint.common.dto.AccountInfo;
+import com.fuint.common.util.TokenUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -21,8 +27,45 @@ public class ActiveConsumptionChildServiceImpl extends ServiceImpl selectList(Serializable id) {
return activeConsumptionChildMapper.selectConsumptionChilds(id);
}
+
+ @Override
+ public List detailRecord(Serializable id) {
+ // 查询优惠券领取记录
+ AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+ LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(CardFavorableRecord::getActiveId, id);
+ queryWrapper.eq(CardFavorableRecord::getStoreId, nowAccountInfo.getStoreId());
+ List favorableRecords = cardFavorableRecordService.list(queryWrapper);
+ return favorableRecords;
+ }
+
+ @Override
+ public CardFavorableCountVO detailCount(Serializable id) {
+ // 查询优惠券领取记录
+ int a = 0;
+ int b = 0;
+ AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+ CardFavorableCountVO cardFavorableCountVO = new CardFavorableCountVO();
+ LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(CardFavorableRecord::getActiveId, id);
+ queryWrapper.eq(CardFavorableRecord::getStoreId, nowAccountInfo.getStoreId());
+ List favorableRecords = cardFavorableRecordService.list(queryWrapper);
+ for (CardFavorableRecord favorableRecord : favorableRecords) {
+ if (favorableRecord.getStatus().equals("0")){
+ a+=1;
+ }else {
+ b+=1;
+ }
+ }
+ cardFavorableCountVO.setCount(favorableRecords.size());
+ cardFavorableCountVO.setCountEd(b);
+ cardFavorableCountVO.setCountLd(a);
+ return cardFavorableCountVO;
+ }
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java
index a65f9fd58..1e25ae77c 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java
@@ -14,6 +14,10 @@ import com.fuint.business.marketingActivity.activeConsumption.service.ActiveCons
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionAppletVO;
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO;
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVOS;
+import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
+import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
+import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
+import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.entity.LJUserGrade;
@@ -53,6 +57,10 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl activeConsumptionChildList = activeConsumptionChildService.selectList(s.getId());
+ int youhuiTed = 0;
+ int duihuanTed = 0;
+ for (ActiveConsumptionChild activeConsumptionChild : activeConsumptionChildList) {
+ //优惠券
+ if (activeConsumptionChild.getActiveGift().equals("1")){
+ LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(CardFavorableRecord::getActiveId,activeConsumptionChild.getActiveConsumptionId());
+ queryWrapper.eq(CardFavorableRecord::getCardFavorableId,activeConsumptionChild.getVouchersId());
+ List list = cardFavorableRecordService.list(queryWrapper);
+ activeConsumptionVO.setYouhuiTotal(list.size());
+ for (CardFavorableRecord cardFavorableRecord : list) {
+ if (cardFavorableRecord.getStatus().equals("1")){
+ youhuiTed+=1;
+ }
+ }
+ }
+ //兑换券
+ if (activeConsumptionChild.getActiveGift().equals("2")){
+ LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(CardExchangeRecord::getActiveId,activeConsumptionChild.getActiveConsumptionId());
+ queryWrapper.eq(CardExchangeRecord::getCardExchangeId,activeConsumptionChild.getVouchersId());
+ List list = cardExchangeRecordService.list(queryWrapper);
+ activeConsumptionVO.setDuihuanTotal(list.size());
+ for (CardExchangeRecord cardExchangeRecord : list) {
+ if (cardExchangeRecord.getStatus().equals("1")){
+ duihuanTed+=1;
+ }
+ }
+ }
+ }
+ activeConsumptionVO.setDuihuanTotaled(youhuiTed);
+ activeConsumptionVO.setDuihuanTotaled(duihuanTed);
return activeConsumptionVO;
}).collect(Collectors.toList());
activeConsumptionVOSIPage.setRecords(activeConsumptionVOList);
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/vo/ActiveConsumptionVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/vo/ActiveConsumptionVO.java
index d17147d7b..f5eb4898d 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/vo/ActiveConsumptionVO.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/vo/ActiveConsumptionVO.java
@@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeConsumption.vo;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
+import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@@ -15,6 +16,7 @@ import java.util.List;
* @since 2023-11-10 10:44:58
*/
@SuppressWarnings("serial")
+@Data
public class ActiveConsumptionVO extends Model {
//主键id
private Integer id;
@@ -79,6 +81,10 @@ public class ActiveConsumptionVO extends Model {
private String status;
//是否在线 0:在线 1: 下线
private String isonline;
+ private Integer youhuiTotal;
+ private Integer duihuanTotal;
+ private Integer youhuiTotaled;
+ private Integer duihuanTotaled;
private List activeConsumptionChildList;
//创建者
@@ -108,277 +114,6 @@ public class ActiveConsumptionVO extends Model {
this.activeConsumptionChildList = activeConsumptionChildList;
}
- public Integer getId() {
- return id;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- public Integer getChainStoreId() {
- return chainStoreId;
- }
-
- public void setChainStoreId(Integer chainStoreId) {
- this.chainStoreId = chainStoreId;
- }
-
- public Integer getStoreId() {
- return storeId;
- }
-
- public void setStoreId(Integer storeId) {
- this.storeId = storeId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Date getActiveStartTime() {
- return activeStartTime;
- }
-
- public void setActiveStartTime(Date activeStartTime) {
- this.activeStartTime = activeStartTime;
- }
-
- public Date getActiveEndTime() {
- return activeEndTime;
- }
-
- public void setActiveEndTime(Date activeEndTime) {
- this.activeEndTime = activeEndTime;
- }
-
- public String[] getAdaptOils() {
- return adaptOils;
- }
-
- public void setAdaptOils(String[] adaptOils) {
- this.adaptOils = adaptOils;
- }
-
- public Integer[] getAdaptOil() {
- return adaptOil;
- }
-
- public void setAdaptOil(Integer[] adaptOil) {
- this.adaptOil = adaptOil;
- }
-
- public String getAdaptUserType() {
- return adaptUserType;
- }
-
- public void setAdaptUserType(String adaptUserType) {
- this.adaptUserType = adaptUserType;
- }
-
- public String getMember_type() {
- return member_type;
- }
-
- public void setMember_type(String member_type) {
- this.member_type = member_type;
- }
-
- public String[] getDieselUserLevel() {
- return dieselUserLevel;
- }
-
- public void setDieselUserLevel(String[] dieselUserLevel) {
- this.dieselUserLevel = dieselUserLevel;
- }
-
- public String[] getGasolineUserLevel() {
- return gasolineUserLevel;
- }
-
- public void setGasolineUserLevel(String[] gasolineUserLevel) {
- this.gasolineUserLevel = gasolineUserLevel;
- }
-
- public String[] getNaturalUserLevel() {
- return naturalUserLevel;
- }
-
- public void setNaturalUserLevel(String[] naturalUserLevel) {
- this.naturalUserLevel = naturalUserLevel;
- }
-
- public String getPaymentType() {
- return paymentType;
- }
-
- public void setPaymentType(String paymentType) {
- this.paymentType = paymentType;
- }
-
- public String getParticipationCondition() {
- return participationCondition;
- }
-
- public void setParticipationCondition(String participationCondition) {
- this.participationCondition = participationCondition;
- }
-
- public String getParticipationAcount() {
- return participationAcount;
- }
-
- public void setParticipationAcount(String participationAcount) {
- this.participationAcount = participationAcount;
- }
-
- public Integer getLimitAcount() {
- return limitAcount;
- }
-
- public void setLimitAcount(Integer limitAcount) {
- this.limitAcount = limitAcount;
- }
-
- public String[] getActiveGift() {
- return activeGift;
- }
-
- public void setActiveGift(String[] activeGift) {
- this.activeGift = activeGift;
- }
-
- public Integer getVouchersId() {
- return vouchersId;
- }
-
- public void setVouchersId(Integer vouchersId) {
- this.vouchersId = vouchersId;
- }
-
- public String getGiftCardName() {
- return giftCardName;
- }
-
- public void setGiftCardName(String giftCardName) {
- this.giftCardName = giftCardName;
- }
-
- public String getGiftCardType() {
- return giftCardType;
- }
-
- public void setGiftCardType(String giftCardType) {
- this.giftCardType = giftCardType;
- }
-
- public String getGiftCardDetail() {
- return giftCardDetail;
- }
-
- public void setGiftCardDetail(String giftCardDetail) {
- this.giftCardDetail = giftCardDetail;
- }
-
- public Integer getGiftCardTime() {
- return giftCardTime;
- }
-
- public void setGiftCardTime(Integer giftCardTime) {
- this.giftCardTime = giftCardTime;
- }
-
- public Integer getGiftCardTotal() {
- return giftCardTotal;
- }
-
- public void setGiftCardTotal(Integer giftCardTotal) {
- this.giftCardTotal = giftCardTotal;
- }
-
- public Integer getPoints() {
- return points;
- }
-
- public void setPoints(Integer points) {
- this.points = points;
- }
-
- public Integer getGoodsId() {
- return goodsId;
- }
-
- public void setGoodsId(Integer goodsId) {
- this.goodsId = goodsId;
- }
-
- public String getGoodsName() {
- return goodsName;
- }
-
- public void setGoodsName(String goodsName) {
- this.goodsName = goodsName;
- }
-
- public Integer getGoodsTotal() {
- return goodsTotal;
- }
-
- public void setGoodsTotal(Integer goodsTotal) {
- this.goodsTotal = goodsTotal;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getIsonline() {
- return isonline;
- }
-
- public void setIsonline(String isonline) {
- this.isonline = isonline;
- }
-
- public String getCreateBy() {
- return createBy;
- }
-
- public void setCreateBy(String createBy) {
- this.createBy = createBy;
- }
-
- public Date getCreateTime() {
- return createTime;
- }
-
- public void setCreateTime(Date createTime) {
- this.createTime = createTime;
- }
-
- public String getUpdateBy() {
- return updateBy;
- }
-
- public void setUpdateBy(String updateBy) {
- this.updateBy = updateBy;
- }
-
- public Date getUpdateTime() {
- return updateTime;
- }
-
- public void setUpdateTime(Date updateTime) {
- this.updateTime = updateTime;
- }
/**
* 获取主键值
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/vo/ActiveConsumptionVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/vo/ActiveConsumptionVO.java
index 2a1f4d437..6edae8ca8 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/vo/ActiveConsumptionVO.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/vo/ActiveConsumptionVO.java
@@ -11,6 +11,8 @@ public class ActiveConsumptionVO implements Serializable {
private Integer activeId;
//活动名称
private String activeName;
+ //满足金额类型 1:订单金额 2:实付金额
+ private String moneyType;
//适用会员类型 0:全部用户 1:全部会员 2:等级会员
private String adaptUserType;
//适用会员
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/dto/PaymentActiveDTO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/dto/PaymentActiveDTO.java
index 86d93828c..4de68f71b 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/dto/PaymentActiveDTO.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/dto/PaymentActiveDTO.java
@@ -11,6 +11,8 @@ public class PaymentActiveDTO implements Serializable {
private String type;
//支付金额
private BigDecimal amount;
+ //订单金额
+ private Double orderAmount;
//可用油品Id
private Integer oilId;
//店铺id
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java
index 9f9957f46..9c79b982f 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java
@@ -833,7 +833,19 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
@Override
public void activeConsumption(PaymentActiveDTO paymentActiveDTO) {
//消费有礼
+ ArrayList activeConsumptionVOS1 = new ArrayList<>();
List activeConsumptionVOS = oilOrderMapper.selectActiveConsumption(paymentActiveDTO.getStoreId(), paymentActiveDTO.getAmount());
+ if (CollectionUtils.isNotEmpty(activeConsumptionVOS)){
+ for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS) {
+ BigDecimal amount = new BigDecimal(activeConsumptionVO.getAmount());
+ if (activeConsumptionVO.getMoneyType().equals("1") && paymentActiveDTO.getOrderAmount()>=activeConsumptionVO.getAmount()){
+ activeConsumptionVOS1.add(activeConsumptionVO);
+ }
+ if (activeConsumptionVO.getMoneyType().equals("2") && paymentActiveDTO.getAmount().compareTo(amount)>0){
+ activeConsumptionVOS1.add(activeConsumptionVO);
+ }
+ }
+ }
//连锁店信息
// if (paymentActiveDTO.getUserId()==null){
// paymentActiveDTO.setUserId(TokenUtil.getNowAccountInfo().getId());
@@ -844,8 +856,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
//用户余额
UserBalance userBalance = userBalanceService.selectUserBalance(paymentActiveDTO.getUserId(),chainStoreId);
UserBalance userBalance1 = new UserBalance();
- if (CollectionUtils.isNotEmpty(activeConsumptionVOS)){
- for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS) {
+ if (CollectionUtils.isNotEmpty(activeConsumptionVOS1)){
+ for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS1) {
if (activeConsumptionVO.getAdaptUserType().equals("2") && activeConsumptionVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) &&
StringUtils.isNotEmpty(activeConsumptionVO.getAdaptUser()) && activeConsumptionVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString()) || activeConsumptionVO.getAdaptUserType().equals("0") && activeConsumptionVO.getOilId().contains(paymentActiveDTO.getOilId().toString())
|| activeConsumptionVO.getAdaptUserType().equals("1") && activeConsumptionVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) && StringUtils.isNotEmpty(paymentActiveDTO.getMtUserLevel().toString())){
@@ -881,7 +893,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
cardFavorableRecord.setName(ljUserVo.getName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setStatus("0");
- cardFavorableRecord.setExchangeFrom("充值送券");
+ cardFavorableRecord.setExchangeFrom("消费有礼");
+ cardFavorableRecord.setActiveId(activeConsumptionChild.getActiveConsumptionId());
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
//兑换券
}else if (ObjectUtils.isNotEmpty(activeConsumptionChild) && activeConsumptionChild.getActiveGift().equals("2")){
@@ -893,7 +906,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
cardExchangeRecord.setStatus("0");
- cardExchangeRecord.setExchangeFrom("充值送券");
+ cardExchangeRecord.setExchangeFrom("消费有礼");
+ cardExchangeRecord.setActiveId(activeConsumptionChild.getActiveConsumptionId());
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
}
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java
index 10b295a73..dda56a102 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java
@@ -80,7 +80,8 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl {
private Integer id;
//兑换券id
private Integer cardExchangeId;
+ //优惠券id
+ private Integer activeId;
//所属连锁店id
private Integer chainStorId;
//所属店铺id
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/entity/CardFavorableRecord.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/entity/CardFavorableRecord.java
index 7bc6dc049..bd08b9934 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/entity/CardFavorableRecord.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/entity/CardFavorableRecord.java
@@ -28,6 +28,8 @@ public class CardFavorableRecord extends Model {
private Integer chainStorId;
//优惠券id
private Integer cardFavorableId;
+ //活动id
+ private Integer activeId;
//所属店铺id
private Integer storeId;
//会员名字
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CardFavorableCountVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CardFavorableCountVO.java
new file mode 100644
index 000000000..fd31b433a
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CardFavorableCountVO.java
@@ -0,0 +1,16 @@
+package com.fuint.business.marketingActivity.cardFavorable.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class CardFavorableCountVO implements Serializable {
+
+ /**
+ * 优惠券数量
+ */
+ private Integer count;
+ private Integer countEd;
+ private Integer countLd;
+}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/controller/CardGiftController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/controller/CardGiftController.java
index 09cd93e08..8b4e43621 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/controller/CardGiftController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/controller/CardGiftController.java
@@ -5,7 +5,6 @@ import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardGift.entity.CardGift;
import com.fuint.business.marketingActivity.cardGift.service.CardGiftService;
-import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
@@ -166,12 +165,12 @@ public class CardGiftController extends BaseController {
/**
* 礼品卡模板导入
*
- * @param multipartFile excel文件
+ * @param file excel文件
* @return 修改结果
*/
- @RequestMapping("exchangeImport")
- public ResponseObject exchangeImport(MultipartFile multipartFile) throws IOException {
- return getSuccessResult(this.cardGiftService.exchangeImport(multipartFile));
+ @RequestMapping("/exchangeImport")
+ public ResponseObject exchangeImport(MultipartFile file) throws IOException {
+ return getSuccessResult(this.cardGiftService.exchangeImport(file));
}
/**
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/CardGiftService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/CardGiftService.java
index 5a4e488b5..e24d3b999 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/CardGiftService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/CardGiftService.java
@@ -61,7 +61,7 @@ public interface CardGiftService extends IService {
* @param multipartFile
* @return
*/
- Map exchangeImport(MultipartFile multipartFile) throws IOException;
+ Map exchangeImport(MultipartFile file) throws IOException;
List selectGiftValue(CardGift cardGift);
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java
index 5e28f6843..b1ab74696 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java
@@ -227,11 +227,11 @@ public class CardGiftServiceImpl extends ServiceImpl i
/**
* 礼品卡模板导入
- * @param multipartFile
+ * @param file
* @return
*/
@Override
- public Map exchangeImport(MultipartFile multipartFile) throws IOException {
+ public Map exchangeImport(MultipartFile file) throws IOException {
Map map = new HashMap<>();
int success = 0;
int error = 0;
@@ -240,7 +240,7 @@ public class CardGiftServiceImpl extends ServiceImpl i
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
//获取文件流
- InputStream inputStream = multipartFile.getInputStream();
+ InputStream inputStream = file.getInputStream();
//实例化实现了AnalysisEventListener接口的类
EasyExcelListener listener = new EasyExcelListener();
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml
index f8987be2f..e49aa3591 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml
@@ -463,6 +463,7 @@
ac.points points,
ac.participation_condition_money amount,
ac.adapt_user_type adaptUserType,
+ ac.money_type moneyType,
acc.active_gift activeGift,
acc.vouchers_id vouchersId
FROM