From 25f06fbe76e8bfc351cf83785ea9d36a198e726a Mon Sep 17 00:00:00 2001
From: cun-nan <19819293608@163.com>
Date: Tue, 27 Aug 2024 16:54:55 +0800
Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/dataSources.xml | 12 ++
.idea/easyCodeTableSetting.xml | 145 ++++++++++++++++++
.../src/api/EventMarketing/openCardGift.js | 43 ++++++
.../src/views/EventMarketing/center/index.vue | 13 ++
.../EventMarketing/openCardGift/index.vue | 127 +++++++++++++++
.../controller/OpenCardGiftController.java | 73 +++++++++
.../openCardGift/entity/OpenCardGift.java | 98 ++++++++++++
.../mapper/OpenCardGiftMapper.java | 7 +
.../service/OpenCardGiftService.java | 50 ++++++
.../service/impl/OpenCardGiftServiceImpl.java | 74 +++++++++
10 files changed, 642 insertions(+)
create mode 100644 .idea/dataSources.xml
create mode 100644 .idea/easyCodeTableSetting.xml
create mode 100644 fuintAdmin/src/api/EventMarketing/openCardGift.js
create mode 100644 fuintAdmin/src/views/EventMarketing/openCardGift/index.vue
create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/controller/OpenCardGiftController.java
create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/entity/OpenCardGift.java
create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/mapper/OpenCardGiftMapper.java
create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/service/OpenCardGiftService.java
create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/service/impl/OpenCardGiftServiceImpl.java
diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml
new file mode 100644
index 000000000..9bded928e
--- /dev/null
+++ b/.idea/dataSources.xml
@@ -0,0 +1,12 @@
+
+
+
+
+ mysql.8
+ true
+ com.mysql.cj.jdbc.Driver
+ jdbc:mysql://47.94.122.58:3306
+ $ProjectFileDir$
+
+
+
\ No newline at end of file
diff --git a/.idea/easyCodeTableSetting.xml b/.idea/easyCodeTableSetting.xml
new file mode 100644
index 000000000..4c91bab52
--- /dev/null
+++ b/.idea/easyCodeTableSetting.xml
@@ -0,0 +1,145 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fuintAdmin/src/api/EventMarketing/openCardGift.js b/fuintAdmin/src/api/EventMarketing/openCardGift.js
new file mode 100644
index 000000000..91cbaab00
--- /dev/null
+++ b/fuintAdmin/src/api/EventMarketing/openCardGift.js
@@ -0,0 +1,43 @@
+import request from '@/utils/request'
+
+// 查询开卡有礼信息
+export function getOpenCardInfo() {
+ return request({
+ url: 'openCardGift',
+ method: 'get',
+ })
+}
+
+// 根据id查询开卡有礼信息
+export function getOpenCardById(id) {
+ return request({
+ url: 'openCardGift/'+id,
+ method: 'get',
+ })
+}
+
+// 添加开卡有礼信息
+export function addOpenCardBy(data) {
+ return request({
+ url: 'openCardGift',
+ method: 'post',
+ data:data
+ })
+}
+
+// 添加开卡有礼信息
+export function editOpenCardBy(data) {
+ return request({
+ url: 'openCardGift',
+ method: 'put',
+ data:data
+ })
+}
+
+// 根据id删除开卡有礼信息
+export function deleteOpenCard(id) {
+ return request({
+ url: 'openCardGift/'+id,
+ method: 'delete',
+ })
+}
diff --git a/fuintAdmin/src/views/EventMarketing/center/index.vue b/fuintAdmin/src/views/EventMarketing/center/index.vue
index a85bd715a..779d1cc7b 100644
--- a/fuintAdmin/src/views/EventMarketing/center/index.vue
+++ b/fuintAdmin/src/views/EventMarketing/center/index.vue
@@ -71,6 +71,16 @@
一键发券
+
+

+
+
发卡有礼
+
Card issuing gift
+
+
+
@@ -125,6 +135,9 @@ export default {
if(id == 6){
this.$router.push('/EventMarketing/yijiancoupon/index')
}
+ if(id == 7){
+ this.$router.push('/EventMarketing/openCardGift/index')
+ }
},
}
diff --git a/fuintAdmin/src/views/EventMarketing/openCardGift/index.vue b/fuintAdmin/src/views/EventMarketing/openCardGift/index.vue
new file mode 100644
index 000000000..6b7ccef1b
--- /dev/null
+++ b/fuintAdmin/src/views/EventMarketing/openCardGift/index.vue
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 保存
+
+
+
+
+
+
+
+
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/controller/OpenCardGiftController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/controller/OpenCardGiftController.java
new file mode 100644
index 000000000..dee6456e2
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/controller/OpenCardGiftController.java
@@ -0,0 +1,73 @@
+package com.fuint.business.marketingActivity.openCardGift.controller;
+
+import com.fuint.business.marketingActivity.openCardGift.entity.OpenCardGift;
+import com.fuint.business.marketingActivity.openCardGift.service.OpenCardGiftService;
+import com.fuint.framework.web.BaseController;
+import com.fuint.framework.web.ResponseObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 开卡有礼Controller层
+ */
+@RestController
+@RequestMapping("openCardGift")
+public class OpenCardGiftController extends BaseController {
+ @Autowired
+ private OpenCardGiftService openCardGiftService;
+
+ /**
+ * 通过店铺id查询单条数据
+ *
+ * @return 单条数据
+ */
+ @GetMapping
+ public ResponseObject getInfo() {
+ return getSuccessResult(openCardGiftService.queryByStoreId());
+ }
+
+ /**
+ * 通过主键查询单条数据
+ *
+ * @param id 主键
+ * @return 单条数据
+ */
+ @GetMapping("{id}")
+ public ResponseObject queryById(@PathVariable("id") Integer id) {
+ return getSuccessResult(openCardGiftService.queryById(id));
+ }
+
+ /**
+ * 新增数据
+ *
+ * @param openCardGift 实体
+ * @return 新增结果
+ */
+ @PostMapping
+ public ResponseObject add(@RequestBody OpenCardGift openCardGift) {
+ return getSuccessResult(openCardGiftService.insert(openCardGift));
+ }
+
+ /**
+ * 编辑数据
+ *
+ * @param openCardGift 实体
+ * @return 编辑结果
+ */
+ @PutMapping
+ public ResponseObject edit(@RequestBody OpenCardGift openCardGift) {
+ return getSuccessResult(openCardGiftService.update(openCardGift));
+ }
+
+ /**
+ * 删除数据
+ *
+ * @param id 主键
+ * @return 删除是否成功
+ */
+ @DeleteMapping("{id}")
+ public ResponseObject deleteById(@PathVariable Integer id) {
+ return getSuccessResult(openCardGiftService.deleteById(id));
+ }
+
+}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/entity/OpenCardGift.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/entity/OpenCardGift.java
new file mode 100644
index 000000000..109f1459a
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/entity/OpenCardGift.java
@@ -0,0 +1,98 @@
+package com.fuint.business.marketingActivity.openCardGift.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fuint.framework.entity.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * 营销中心-开卡有礼(OpenCardGift)实体类
+ *
+ * @author makejava
+ * @since 2024-08-27 15:41:16
+ */
+@Data
+@TableName("open_card_gift")
+@ApiModel(value = "OpenCardGift对象", description = "营销中心-开卡有礼")
+public class OpenCardGift extends BaseEntity implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ /**
+ * 主键
+ */
+ @ApiModelProperty("ID")
+ @TableId(value = "ID", type = IdType.AUTO)
+ private Integer id;
+ /**
+ * 连锁店id
+ */
+ private Integer chainStoreId;
+ /**
+ * 油站id
+ */
+ private Integer storeId;
+ /**
+ * 活动名称
+ */
+ private String name;
+ /**
+ * 活动时间类型:0永久有效;1自定义
+ */
+ private String activityTimeType;
+ /**
+ * 活动时间前
+ */
+ private Date activityTimeFront;
+ /**
+ * 活动时间后
+ */
+ private Date activityTimeAfter;
+ /**
+ * 通知内容
+ */
+ private String noticeContent;
+ /**
+ * 活动详情
+ */
+ private String activityDetails;
+ /**
+ * 活动奖品(多选):赠送积分、赠送成长值、赠送优惠券
+ */
+ private String activityPrize;
+ /**
+ * 赠送积分数量
+ */
+ private Integer givePoints;
+ /**
+ * 赠送成长值
+ */
+ private Integer giveGrowthValue;
+ /**
+ * 赠送优惠信息
+ */
+ private String giveCoupon;
+ /**
+ * 创建时间
+ */
+ private Date createTime;
+ /**
+ * 创建人
+ */
+ private String createBy;
+ /**
+ * 更新时间
+ */
+ private Date updateTime;
+ /**
+ * 更新人
+ */
+ private String updateBy;
+
+}
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/mapper/OpenCardGiftMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/mapper/OpenCardGiftMapper.java
new file mode 100644
index 000000000..6d457c9e2
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/mapper/OpenCardGiftMapper.java
@@ -0,0 +1,7 @@
+package com.fuint.business.marketingActivity.openCardGift.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fuint.business.marketingActivity.openCardGift.entity.OpenCardGift;
+
+public interface OpenCardGiftMapper extends BaseMapper {
+}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/service/OpenCardGiftService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/service/OpenCardGiftService.java
new file mode 100644
index 000000000..24a627ddb
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/service/OpenCardGiftService.java
@@ -0,0 +1,50 @@
+package com.fuint.business.marketingActivity.openCardGift.service;
+
+import com.fuint.business.marketingActivity.openCardGift.entity.OpenCardGift;
+
+/**
+ * 营销中心-开卡有礼(OpenCardGift)表服务接口
+ *
+ * @author makejava
+ * @since 2024-08-27 15:41:20
+ */
+public interface OpenCardGiftService {
+ /**
+ * 根据店铺id查询开卡有礼配置信息
+ * @return
+ */
+ OpenCardGift queryByStoreId();
+
+ /**
+ * 通过ID查询单条数据
+ *
+ * @param id 主键
+ * @return 实例对象
+ */
+ OpenCardGift queryById(Integer id);
+
+ /**
+ * 新增数据
+ *
+ * @param openCardGift 实例对象
+ * @return 实例对象
+ */
+ int insert(OpenCardGift openCardGift);
+
+ /**
+ * 修改数据
+ *
+ * @param openCardGift 实例对象
+ * @return 实例对象
+ */
+ int update(OpenCardGift openCardGift);
+
+ /**
+ * 通过主键删除数据
+ *
+ * @param id 主键
+ * @return 是否成功
+ */
+ int deleteById(Integer id);
+
+}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/service/impl/OpenCardGiftServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/service/impl/OpenCardGiftServiceImpl.java
new file mode 100644
index 000000000..3b379071f
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/openCardGift/service/impl/OpenCardGiftServiceImpl.java
@@ -0,0 +1,74 @@
+package com.fuint.business.marketingActivity.openCardGift.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fuint.business.marketingActivity.openCardGift.entity.OpenCardGift;
+import com.fuint.business.marketingActivity.openCardGift.mapper.OpenCardGiftMapper;
+import com.fuint.business.marketingActivity.openCardGift.service.OpenCardGiftService;
+import com.fuint.common.dto.AccountInfo;
+import com.fuint.common.util.TokenUtil;
+import org.springframework.stereotype.Service;
+
+/**
+ * 营销中心-开卡有礼(OpenCardGift)表服务实现类
+ *
+ * @author makejava
+ * @since 2024-08-27 15:41:23
+ */
+@Service("openCardGiftService")
+public class OpenCardGiftServiceImpl extends ServiceImpl implements OpenCardGiftService {
+
+ @Override
+ public OpenCardGift queryByStoreId() {
+ AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
+ return baseMapper.selectOne(queryWrapper);
+ }
+
+ /**
+ * 通过ID查询单条数据
+ * @param id 主键
+ * @return 实例对象
+ */
+ @Override
+ public OpenCardGift queryById(Integer id) {
+ return baseMapper.selectById(id);
+ }
+
+ /**
+ * 新增数据
+ *
+ * @param openCardGift 实例对象
+ * @return 实例对象
+ */
+ @Override
+ public int insert(OpenCardGift openCardGift) {
+ AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+ openCardGift.setChainStoreId(nowAccountInfo.getChainStoreId());
+ openCardGift.setStoreId(nowAccountInfo.getStoreId());
+ return baseMapper.insert(openCardGift);
+ }
+
+ /**
+ * 修改数据
+ *
+ * @param openCardGift 实例对象
+ * @return 实例对象
+ */
+ @Override
+ public int update(OpenCardGift openCardGift) {
+ return baseMapper.updateById(openCardGift);
+ }
+
+ /**
+ * 通过主键删除数据
+ *
+ * @param id 主键
+ * @return 是否成功
+ */
+ @Override
+ public int deleteById(Integer id) {
+ return baseMapper.deleteById(id);
+ }
+}