From 5964d51ab83e4c633d421a6868ab0620dab6f09f Mon Sep 17 00:00:00 2001
From: cun-nan <19819293608@163.com>
Date: Mon, 2 Sep 2024 11:48:31 +0800
Subject: [PATCH] =?UTF-8?q?=E8=90=A5=E9=94=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/api/EventMarketing/activeRecommend.js | 26 +
.../EventMarketing/openCardGift/index.vue | 17 +-
.../EventMarketing/openCardGift/popUp.vue | 785 ++++++++++++++++++
.../openCardGift/userConsume.vue | 763 +++++++++++++++++
.../openCardGift/userRecharge.vue | 741 +++++++++++++++++
.../controller/ActiveRecommendController.java | 29 +
.../entity/ActiveRecommend.java | 28 +-
.../service/ActiveRecommendChildService.java | 14 +
.../service/ActiveRecommendService.java | 10 +
.../impl/ActiveRecommendChildServiceImpl.java | 17 +
.../impl/ActiveRecommendServiceImpl.java | 59 ++
11 files changed, 2483 insertions(+), 6 deletions(-)
create mode 100644 fuintAdmin/src/views/EventMarketing/openCardGift/popUp.vue
create mode 100644 fuintAdmin/src/views/EventMarketing/openCardGift/userConsume.vue
create mode 100644 fuintAdmin/src/views/EventMarketing/openCardGift/userRecharge.vue
diff --git a/fuintAdmin/src/api/EventMarketing/activeRecommend.js b/fuintAdmin/src/api/EventMarketing/activeRecommend.js
index e735877c5..4b2e40fda 100644
--- a/fuintAdmin/src/api/EventMarketing/activeRecommend.js
+++ b/fuintAdmin/src/api/EventMarketing/activeRecommend.js
@@ -73,3 +73,29 @@ export function delActiveRecommend(id) {
method: 'delete'
})
}
+
+//
+export function getActiveRecommendInfo() {
+ return request({
+ url: '/business/marketingActivity/activeRecommend/getInfo' ,
+ method: 'get'
+ })
+}
+
+//
+export function insertActiveRecommend(data) {
+ return request({
+ url: '/business/marketingActivity/activeRecommend/add',
+ method: 'post',
+ data:data
+ })
+}
+
+//
+export function updateActiveRecommend1(data) {
+ return request({
+ url: '/business/marketingActivity/activeRecommend/update',
+ method: 'put',
+ data:data
+ })
+}
diff --git a/fuintAdmin/src/views/EventMarketing/openCardGift/index.vue b/fuintAdmin/src/views/EventMarketing/openCardGift/index.vue
index 15f98bc0a..4ba77fde8 100644
--- a/fuintAdmin/src/views/EventMarketing/openCardGift/index.vue
+++ b/fuintAdmin/src/views/EventMarketing/openCardGift/index.vue
@@ -8,6 +8,9 @@
+
+
+
@@ -26,6 +29,12 @@ import liJianMarketing from "@/views/EventMarketing/liJianMarketing/index.vue";
import invite from "./invite.vue";
// 生日有礼
import birthday from "./birthday.vue"
+// 推荐会员充值有礼
+import userRecharge from "@/views/EventMarketing/openCardGift/userRecharge.vue";
+// 推荐会员消费有礼
+import userConsume from "@/views/EventMarketing/openCardGift/userConsume.vue";
+// 弹窗营销
+import popUp from "@/views/EventMarketing/openCardGift/popUp.vue";
export default {
data() {
return {
@@ -51,7 +60,13 @@ export default {
// 邀请有礼
invite,
//生日有礼
- birthday
+ birthday,
+ // 推荐会员充值有礼
+ userRecharge,
+ // 推荐会员消费有礼
+ userConsume,
+ // 弹窗营销
+ popUp,
},
methods: {
diff --git a/fuintAdmin/src/views/EventMarketing/openCardGift/popUp.vue b/fuintAdmin/src/views/EventMarketing/openCardGift/popUp.vue
new file mode 100644
index 000000000..0fdc6732c
--- /dev/null
+++ b/fuintAdmin/src/views/EventMarketing/openCardGift/popUp.vue
@@ -0,0 +1,785 @@
+
+
+
+
+
+
+
+
+
+
+
+

+

+ {{ item }}
+
+
+
+
至
+
+
+
+
+
+
+
+
+

+

+ {{ item }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 至
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
赠送优惠券
+

+
+
+
+
+
+
+
赠送
+
+
+
+
+ 张
+
+

+
+
+
+
+
+
+
+

+

+ {{ item }}
+
+
+
+
+
+ 每个每日可参与次数:默认为1
+
+
+
+ 每个总参与次数:默认为0,不限制
+
+
+ 取消
+ 保存
+
+
+
+
+
+
+
+
+
diff --git a/fuintAdmin/src/views/EventMarketing/openCardGift/userConsume.vue b/fuintAdmin/src/views/EventMarketing/openCardGift/userConsume.vue
new file mode 100644
index 000000000..faacca0be
--- /dev/null
+++ b/fuintAdmin/src/views/EventMarketing/openCardGift/userConsume.vue
@@ -0,0 +1,763 @@
+
+
+
+
+
+
+
+
+
+
+
+

+

+ {{ item }}
+
+
+
+
至
+
+
+
+
+
+
+ 每个推荐人最多可获赠的次数限制。0表示每次都可以赠送,不限制次数
+
+
+
+
+

+

+ {{ item }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 赠送积分
+
+
+ 赠送成长值
+
+
+
赠送优惠券
+

+
+
+
+
+
+
+
+
+
+
赠送
+
+
+
+
+ 张
+
+

+
+
+
+
+
+ 取消
+ 保存
+
+
+
+
+
+
+
+
+
diff --git a/fuintAdmin/src/views/EventMarketing/openCardGift/userRecharge.vue b/fuintAdmin/src/views/EventMarketing/openCardGift/userRecharge.vue
new file mode 100644
index 000000000..a645eb7b6
--- /dev/null
+++ b/fuintAdmin/src/views/EventMarketing/openCardGift/userRecharge.vue
@@ -0,0 +1,741 @@
+
+
+
+
+
+
+
+
+
+
+
+

+

+ {{ item }}
+
+
+
+
至
+
+
+
+
+
+
+ 每个推荐人最多可获赠的次数限制。0表示每次都可以赠送,不限制次数
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 赠送积分
+
+
+ 赠送成长值
+
+
+
赠送优惠券
+

+
+
+
+
+
+
+
+
+
+
赠送
+
+
+
+
+ 张
+
+

+
+
+
+
+
+ 取消
+ 保存
+
+
+
+
+
+
+
+
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/controller/ActiveRecommendController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/controller/ActiveRecommendController.java
index 22a2f75ff..0fd0e133f 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/controller/ActiveRecommendController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/controller/ActiveRecommendController.java
@@ -196,5 +196,34 @@ public class ActiveRecommendController extends BaseController {
}catch (Exception ignored){}
return getSuccessResult(activeRecommendChildService.removeByIds(idList));
}
+
+ /**
+ * 根据storeId查询邀请有礼信息
+ * @return
+ */
+ @GetMapping("getInfo")
+ public ResponseObject getInfo() {
+ return getSuccessResult(activeRecommendService.selectByStoreId());
+ }
+
+ /**
+ * 添加邀请有礼信息
+ * @param activeRecommend
+ * @return
+ */
+ @PostMapping("add")
+ public ResponseObject add(@RequestBody ActiveRecommend activeRecommend) {
+ return getSuccessResult(activeRecommendService.insertActiveRecommend(activeRecommend));
+ }
+
+ /**
+ * 修改邀请有礼信息
+ * @param activeRecommend
+ * @return
+ */
+ @PutMapping("update")
+ public ResponseObject edit(@RequestBody ActiveRecommend activeRecommend) {
+ return getSuccessResult(activeRecommendService.updateActiveRecommend(activeRecommend));
+ }
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/entity/ActiveRecommend.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/entity/ActiveRecommend.java
index 088586264..c3694ebce 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/entity/ActiveRecommend.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/entity/ActiveRecommend.java
@@ -3,12 +3,15 @@ package com.fuint.business.marketingActivity.activeRecommend.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
+import java.util.List;
/**
* 推荐有礼表(ActiveRecommend)表实体类
@@ -18,6 +21,7 @@ import java.io.Serializable;
*/
@SuppressWarnings("serial")
@Data
+@TableName("active_recommend")
public class ActiveRecommend extends Model {
//主键id
@TableId(type = IdType.AUTO)
@@ -57,16 +61,30 @@ public class ActiveRecommend extends Model {
//创建者
private String createBy;
//创建时间
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
+ // 活动时间类型:0永久有效;1自定义
+ private String activeTimeType;
+// 活动开始时间
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date activeStartTime;
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
+// 活动结束时间
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date activeEndTime;
//更新者
private String updateBy;
//更新时间
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
- }
+// 通知内容
+ private String noticeContent;
+// 活动详情
+ private String activityDetails;
+
+ /**
+ * 优惠券列表
+ */
+ @TableField(exist = false)
+ private List couponList;
+}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/ActiveRecommendChildService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/ActiveRecommendChildService.java
index 0ae7570c3..e9df1d275 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/ActiveRecommendChildService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/ActiveRecommendChildService.java
@@ -3,6 +3,8 @@ package com.fuint.business.marketingActivity.activeRecommend.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
+import java.util.List;
+
/**
* 推荐有礼子表(优惠券兑换券)(ActiveRecommendChild)表服务接口
*
@@ -10,6 +12,18 @@ import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecomme
* @since 2023-11-13 15:10:17
*/
public interface ActiveRecommendChildService extends IService {
+ /**
+ * 根据推荐有礼id查询子表信息
+ * @param activeRecommendId
+ * @return
+ */
+ List selectList(Integer activeRecommendId);
+ /**
+ * 根据推荐有礼id删除子表信息
+ * @param activeRecommendId
+ * @return
+ */
+ int deleteByRecommendId(Integer activeRecommendId);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/ActiveRecommendService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/ActiveRecommendService.java
index 2b35423b5..8e46323f0 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/ActiveRecommendService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/ActiveRecommendService.java
@@ -56,5 +56,15 @@ public interface ActiveRecommendService extends IService {
List selectApplet(ActiveConsumption activeConsumption);
IPage select(Page page, ActiveRecommend activeRecommend);
+
+ /**
+ * 根据店铺id查询邀请有礼信息
+ * @return
+ */
+ ActiveRecommend selectByStoreId();
+
+ int insertActiveRecommend(ActiveRecommend activeRecommend);
+
+ int updateActiveRecommend(ActiveRecommend activeRecommend);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendChildServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendChildServiceImpl.java
index b2c202f32..54ca9d88c 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendChildServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendChildServiceImpl.java
@@ -1,11 +1,15 @@
package com.fuint.business.marketingActivity.activeRecommend.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendChildMapper;
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendChildService;
import org.springframework.stereotype.Service;
+import java.util.Collections;
+import java.util.List;
+
/**
* 推荐有礼子表(优惠券兑换券)(ActiveRecommendChild)表服务实现类
*
@@ -15,5 +19,18 @@ import org.springframework.stereotype.Service;
@Service("activeRecommendChildService")
public class ActiveRecommendChildServiceImpl extends ServiceImpl implements ActiveRecommendChildService {
+ @Override
+ public List selectList(Integer activeRecommendId) {
+ QueryWrapper queryWrapper = new QueryWrapper();
+ queryWrapper.eq("active_recommend_id", activeRecommendId);
+ return baseMapper.selectList(queryWrapper);
+ }
+
+ @Override
+ public int deleteByRecommendId(Integer activeRecommendId) {
+ QueryWrapper queryWrapper = new QueryWrapper();
+ queryWrapper.eq("active_recommend_id", activeRecommendId);
+ return baseMapper.delete(queryWrapper);
+ }
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendServiceImpl.java
index e924677c1..767c3882a 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendServiceImpl.java
@@ -2,6 +2,7 @@ package com.fuint.business.marketingActivity.activeRecommend.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -29,6 +30,7 @@ import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableMa
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.store.service.StoreService;
+import com.fuint.common.dto.AccountInfo;
import com.fuint.common.service.AccountService;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.model.TAccount;
@@ -41,6 +43,7 @@ import javax.annotation.Resource;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@@ -80,6 +83,11 @@ public class ActiveRecommendServiceImpl extends ServiceImpl list = baseMapper.selectList(queryWrapper);
+ ActiveRecommend activeRecommend = null;
+ for (ActiveRecommend activeRecommend1 : list) {
+ if (activeRecommend1.getActiveTimeType().equals("0")){
+ activeRecommend = activeRecommend1;
+ }else {
+ Date date = new Date();
+ if (activeRecommend1.getActiveStartTime().before(date) && activeRecommend1.getActiveEndTime().after(date)){
+ activeRecommend = activeRecommend1;
+ }
+ }
+ }
+ if (ObjectUtil.isNotEmpty(activeRecommend)){
+ List activeRecommendChildren = activeRecommendChildService.selectList(activeRecommend.getId());
+ activeRecommend.setCouponList(activeRecommendChildren);
+ }
+ return activeRecommend;
+ }
+
+ @Override
+ public int insertActiveRecommend(ActiveRecommend activeRecommend) {
+ ActiveRecommend activeRecommend1 = this.selectByStoreId();
+ if (ObjectUtil.isNotEmpty(activeRecommend1)){
+ return 0;
+ }
+ int row = baseMapper.insert(activeRecommend);
+ if (ObjectUtil.isNotEmpty(activeRecommend.getCouponList())){
+ for (ActiveRecommendChild activeRecommendChild : activeRecommend.getCouponList()) {
+ activeRecommendChildService.save(activeRecommendChild);
+ }
+ }
+ return row;
+ }
+
+ @Override
+ public int updateActiveRecommend(ActiveRecommend activeRecommend) {
+ int row = baseMapper.updateById(activeRecommend);
+ activeRecommendChildService.deleteByRecommendId(activeRecommend.getId());
+ if (ObjectUtil.isNotEmpty(activeRecommend.getCouponList())){
+ for (ActiveRecommendChild activeRecommendChild : activeRecommend.getCouponList()) {
+ activeRecommendChildService.save(activeRecommendChild);
+ }
+ }
+ return row;
+ }
+
/**
* 数组转字符串
* @param array