From f49ed6f705319c17c41b5fcec767fca7448a8958 Mon Sep 17 00:00:00 2001
From: Hentua <wangdoubleone@gmail.com>
Date: Wed, 17 Jan 2024 00:56:04 +0800
Subject: [PATCH] 会员系统
---
src/main/java/cc/mrbird/febs/vip/mapper/MallVipBenefitsDetailsMapper.java | 7
src/main/resources/mapper/modules/MallVipBenefitsMapper.xml | 40 +++
src/main/java/cc/mrbird/febs/vip/entity/MallVipConfigBenefits.java | 20 +
src/main/java/cc/mrbird/febs/vip/mapper/MallVipBenefitsMapper.java | 14 +
src/main/java/cc/mrbird/febs/vip/service/IMallVipBenefitsService.java | 13 +
src/main/resources/templates/febs/views/modules/vip/vipBenefits-list.html | 172 +++++++++++++++
src/main/java/cc/mrbird/febs/vip/service/impl/MallVipConfigBenefitsServiceImpl.java | 15 +
src/main/java/cc/mrbird/febs/vip/mapper/MallVipConfigBenefitsMapper.java | 7
src/main/java/cc/mrbird/febs/vip/controller/AdminMallVipConfigController.java | 18 +
src/main/java/cc/mrbird/febs/vip/entity/MallVipBenefitsDetails.java | 40 +++
src/main/java/cc/mrbird/febs/vip/service/impl/MallVipBenefitsDetailsServiceImpl.java | 15 +
src/main/java/cc/mrbird/febs/vip/service/impl/MallVipConfigServiceImpl.java | 15 +
src/main/java/cc/mrbird/febs/vip/controller/ApiMallVipConfigController.java | 18 +
src/main/java/cc/mrbird/febs/vip/entity/MallVipConfig.java | 55 +++++
src/main/java/cc/mrbird/febs/vip/service/IMallVipConfigService.java | 7
src/main/java/cc/mrbird/febs/vip/controller/AdminMallVipBenefitsController.java | 40 +++
src/main/java/cc/mrbird/febs/vip/service/IMallVipBenefitsDetailsService.java | 7
src/main/java/cc/mrbird/febs/vip/service/IMallVipConfigBenefitsService.java | 7
src/main/java/cc/mrbird/febs/vip/service/impl/MallVipBenefitsServiceImpl.java | 31 ++
src/main/java/cc/mrbird/febs/vip/mapper/MallVipConfigMapper.java | 7
src/main/java/cc/mrbird/febs/vip/entity/MallVipBenefits.java | 41 +++
src/main/java/cc/mrbird/febs/vip/controller/ViewVipConfigController.java | 20 +
src/main/java/cc/mrbird/febs/vip/controller/ApiMallVipBenefitsController.java | 16 +
23 files changed, 625 insertions(+), 0 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/vip/controller/AdminMallVipBenefitsController.java b/src/main/java/cc/mrbird/febs/vip/controller/AdminMallVipBenefitsController.java
new file mode 100644
index 0000000..fbc0eb5
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/controller/AdminMallVipBenefitsController.java
@@ -0,0 +1,40 @@
+package cc.mrbird.febs.vip.controller;
+
+
+import cc.mrbird.febs.common.controller.BaseController;
+import cc.mrbird.febs.common.entity.FebsResponse;
+import cc.mrbird.febs.common.entity.QueryRequest;
+import cc.mrbird.febs.vip.service.IMallVipBenefitsService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+/**
+ * 会员权益接口类
+ */
+@Slf4j
+@Validated
+@RestController
+@RequiredArgsConstructor
+@RequestMapping(value = "/admin/vip/benefits")
+public class AdminMallVipBenefitsController extends BaseController {
+
+ private final IMallVipBenefitsService mallVipBenefitsService;
+
+ @GetMapping("/list")
+ public FebsResponse list(QueryRequest request) {
+ Map<String, Object> data = getDataTable(mallVipBenefitsService.vipBenefitsListInPage(request));
+ return new FebsResponse().success().data(data);
+ }
+
+ @GetMapping("/getById/{id}")
+ public FebsResponse getById(@PathVariable("id") Long id) {
+ return new FebsResponse().success().data(mallVipBenefitsService.findVipBenefitsById(id));
+ }
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/controller/AdminMallVipConfigController.java b/src/main/java/cc/mrbird/febs/vip/controller/AdminMallVipConfigController.java
new file mode 100644
index 0000000..88a0e99
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/controller/AdminMallVipConfigController.java
@@ -0,0 +1,18 @@
+package cc.mrbird.febs.vip.controller;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 会员配置接口类
+ */
+@Slf4j
+@Validated
+@RestController
+@RequiredArgsConstructor
+@RequestMapping(value = "/admin/vip/config")
+public class AdminMallVipConfigController {
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/controller/ApiMallVipBenefitsController.java b/src/main/java/cc/mrbird/febs/vip/controller/ApiMallVipBenefitsController.java
new file mode 100644
index 0000000..1b1f87b
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/controller/ApiMallVipBenefitsController.java
@@ -0,0 +1,16 @@
+package cc.mrbird.febs.vip.controller;
+
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Slf4j
+@Validated
+@RestController
+@RequiredArgsConstructor
+@RequestMapping(value = "/api/vip/benefits")
+public class ApiMallVipBenefitsController {
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/controller/ApiMallVipConfigController.java b/src/main/java/cc/mrbird/febs/vip/controller/ApiMallVipConfigController.java
new file mode 100644
index 0000000..8771bd2
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/controller/ApiMallVipConfigController.java
@@ -0,0 +1,18 @@
+package cc.mrbird.febs.vip.controller;
+
+
+import cc.mrbird.febs.common.controller.BaseController;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@Slf4j
+@Validated
+@RestController
+@RequiredArgsConstructor
+@RequestMapping(value = "/api/vip/config")
+public class ApiMallVipConfigController extends BaseController {
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/controller/ViewVipConfigController.java b/src/main/java/cc/mrbird/febs/vip/controller/ViewVipConfigController.java
new file mode 100644
index 0000000..be63da8
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/controller/ViewVipConfigController.java
@@ -0,0 +1,20 @@
+package cc.mrbird.febs.vip.controller;
+
+import cc.mrbird.febs.common.entity.FebsConstant;
+import cc.mrbird.febs.common.utils.FebsUtil;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller("mallVipConfig")
+@RequestMapping(FebsConstant.VIEW_PREFIX + "modules/vip/config")
+@RequiredArgsConstructor
+public class ViewVipConfigController {
+
+
+ @GetMapping(value = "/benefitsList")
+ public String benefitsList() {
+ return FebsUtil.view("modules/vip/vipBenefits-list");
+ }
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/entity/MallVipBenefits.java b/src/main/java/cc/mrbird/febs/vip/entity/MallVipBenefits.java
new file mode 100644
index 0000000..b3ec2c7
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/entity/MallVipBenefits.java
@@ -0,0 +1,41 @@
+package cc.mrbird.febs.vip.entity;
+
+import cc.mrbird.febs.common.entity.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@TableName("mall_vip_benefits")
+public class MallVipBenefits extends BaseEntity {
+
+ /**
+ * 权益名称
+ */
+ private String name;
+
+ /**
+ * 权益类型;1-积分 2-指定商品 3-暂无
+ */
+ private Integer type;
+
+ /**
+ * 权益图标
+ */
+ private String icon;
+
+ /**
+ * 积分倍数
+ */
+ private String multiple;
+
+ /**
+ * 权益备注
+ */
+ private String remark;
+
+ @TableField(exist = false)
+ private List<MallVipBenefitsDetails> details;
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/entity/MallVipBenefitsDetails.java b/src/main/java/cc/mrbird/febs/vip/entity/MallVipBenefitsDetails.java
new file mode 100644
index 0000000..ee933ee
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/entity/MallVipBenefitsDetails.java
@@ -0,0 +1,40 @@
+package cc.mrbird.febs.vip.entity;
+
+import cc.mrbird.febs.common.entity.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("mall_vip_benefits_details")
+public class MallVipBenefitsDetails extends BaseEntity {
+
+ /**
+ * 图片链接
+ */
+ private String image;
+
+ /**
+ * 是否可点击;1-是 2-否
+ */
+ private Integer isClick;
+
+ /**
+ * 链接类型;1-链接 2-领取商品 3-优惠券
+ */
+ private Integer linkType;
+
+ /**
+ * 内容;根据linkType来的
+ */
+ private String content;
+
+ /**
+ * 排序
+ */
+ private String seq;
+
+ /**
+ * 权益ID
+ */
+ private Long benefitsId;
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/entity/MallVipConfig.java b/src/main/java/cc/mrbird/febs/vip/entity/MallVipConfig.java
new file mode 100644
index 0000000..dd665f1
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/entity/MallVipConfig.java
@@ -0,0 +1,55 @@
+package cc.mrbird.febs.vip.entity;
+
+import cc.mrbird.febs.common.entity.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("mall_vip_config")
+public class MallVipConfig extends BaseEntity {
+
+ /**
+ * 会员名称
+ */
+ private String name;
+
+ /**
+ * 主图
+ */
+ private String thumb;
+
+ /**
+ * 等级
+ */
+ private Integer level;
+
+ /**
+ * 有效期
+ */
+ private Integer validTime;
+
+ /**
+ * 有效期类型;day/month/year
+ */
+ private String validType;
+
+ /**
+ * 成为会员条件类型;1-指定商品 2-时间区间内消费金额
+ */
+ private Integer type;
+
+ /**
+ * 消费金额
+ */
+ private Double amount;
+
+ /**
+ * 指定月数
+ */
+ private Integer times;
+
+ /**
+ * 指定商品ID
+ */
+ private Long targetId;
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/entity/MallVipConfigBenefits.java b/src/main/java/cc/mrbird/febs/vip/entity/MallVipConfigBenefits.java
new file mode 100644
index 0000000..8cfd973
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/entity/MallVipConfigBenefits.java
@@ -0,0 +1,20 @@
+package cc.mrbird.febs.vip.entity;
+
+import cc.mrbird.febs.common.entity.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("mall_vip_config_benefits")
+public class MallVipConfigBenefits extends BaseEntity {
+
+ /**
+ * 会员配置ID
+ */
+ private Long configId;
+
+ /**
+ * 会员权益ID
+ */
+ private Long benefitsId;
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/mapper/MallVipBenefitsDetailsMapper.java b/src/main/java/cc/mrbird/febs/vip/mapper/MallVipBenefitsDetailsMapper.java
new file mode 100644
index 0000000..8d37907
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/mapper/MallVipBenefitsDetailsMapper.java
@@ -0,0 +1,7 @@
+package cc.mrbird.febs.vip.mapper;
+
+import cc.mrbird.febs.vip.entity.MallVipBenefitsDetails;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface MallVipBenefitsDetailsMapper extends BaseMapper<MallVipBenefitsDetails> {
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/mapper/MallVipBenefitsMapper.java b/src/main/java/cc/mrbird/febs/vip/mapper/MallVipBenefitsMapper.java
new file mode 100644
index 0000000..d71df4b
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/mapper/MallVipBenefitsMapper.java
@@ -0,0 +1,14 @@
+package cc.mrbird.febs.vip.mapper;
+
+import cc.mrbird.febs.vip.entity.MallVipBenefits;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.ibatis.annotations.Param;
+
+public interface MallVipBenefitsMapper extends BaseMapper<MallVipBenefits> {
+
+ IPage<MallVipBenefits> selectVipBenefitsListInPage(Page<MallVipBenefits> page);
+
+ MallVipBenefits selectVipBenefitsById(@Param("id") Long id);
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/mapper/MallVipConfigBenefitsMapper.java b/src/main/java/cc/mrbird/febs/vip/mapper/MallVipConfigBenefitsMapper.java
new file mode 100644
index 0000000..dc72f52
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/mapper/MallVipConfigBenefitsMapper.java
@@ -0,0 +1,7 @@
+package cc.mrbird.febs.vip.mapper;
+
+import cc.mrbird.febs.vip.entity.MallVipConfigBenefits;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface MallVipConfigBenefitsMapper extends BaseMapper<MallVipConfigBenefits> {
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/mapper/MallVipConfigMapper.java b/src/main/java/cc/mrbird/febs/vip/mapper/MallVipConfigMapper.java
new file mode 100644
index 0000000..4d7d9d6
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/mapper/MallVipConfigMapper.java
@@ -0,0 +1,7 @@
+package cc.mrbird.febs.vip.mapper;
+
+import cc.mrbird.febs.vip.entity.MallVipConfig;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface MallVipConfigMapper extends BaseMapper<MallVipConfig> {
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/service/IMallVipBenefitsDetailsService.java b/src/main/java/cc/mrbird/febs/vip/service/IMallVipBenefitsDetailsService.java
new file mode 100644
index 0000000..60c5624
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/service/IMallVipBenefitsDetailsService.java
@@ -0,0 +1,7 @@
+package cc.mrbird.febs.vip.service;
+
+import cc.mrbird.febs.vip.entity.MallVipBenefitsDetails;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface IMallVipBenefitsDetailsService extends IService<MallVipBenefitsDetails> {
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/service/IMallVipBenefitsService.java b/src/main/java/cc/mrbird/febs/vip/service/IMallVipBenefitsService.java
new file mode 100644
index 0000000..1129b68
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/service/IMallVipBenefitsService.java
@@ -0,0 +1,13 @@
+package cc.mrbird.febs.vip.service;
+
+import cc.mrbird.febs.common.entity.QueryRequest;
+import cc.mrbird.febs.vip.entity.MallVipBenefits;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface IMallVipBenefitsService extends IService<MallVipBenefits> {
+
+ IPage<MallVipBenefits> vipBenefitsListInPage(QueryRequest request);
+
+ MallVipBenefits findVipBenefitsById(Long id);
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/service/IMallVipConfigBenefitsService.java b/src/main/java/cc/mrbird/febs/vip/service/IMallVipConfigBenefitsService.java
new file mode 100644
index 0000000..98634de
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/service/IMallVipConfigBenefitsService.java
@@ -0,0 +1,7 @@
+package cc.mrbird.febs.vip.service;
+
+import cc.mrbird.febs.vip.entity.MallVipConfigBenefits;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface IMallVipConfigBenefitsService extends IService<MallVipConfigBenefits> {
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/service/IMallVipConfigService.java b/src/main/java/cc/mrbird/febs/vip/service/IMallVipConfigService.java
new file mode 100644
index 0000000..5b795c1
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/service/IMallVipConfigService.java
@@ -0,0 +1,7 @@
+package cc.mrbird.febs.vip.service;
+
+import cc.mrbird.febs.vip.entity.MallVipConfig;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface IMallVipConfigService extends IService<MallVipConfig> {
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipBenefitsDetailsServiceImpl.java b/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipBenefitsDetailsServiceImpl.java
new file mode 100644
index 0000000..1be3f3d
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipBenefitsDetailsServiceImpl.java
@@ -0,0 +1,15 @@
+package cc.mrbird.febs.vip.service.impl;
+
+import cc.mrbird.febs.vip.entity.MallVipBenefitsDetails;
+import cc.mrbird.febs.vip.mapper.MallVipBenefitsDetailsMapper;
+import cc.mrbird.febs.vip.service.IMallVipBenefitsDetailsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class MallVipBenefitsDetailsServiceImpl extends ServiceImpl<MallVipBenefitsDetailsMapper, MallVipBenefitsDetails> implements IMallVipBenefitsDetailsService {
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipBenefitsServiceImpl.java b/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipBenefitsServiceImpl.java
new file mode 100644
index 0000000..343c1b7
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipBenefitsServiceImpl.java
@@ -0,0 +1,31 @@
+package cc.mrbird.febs.vip.service.impl;
+
+import cc.mrbird.febs.common.entity.QueryRequest;
+import cc.mrbird.febs.mall.entity.MallNewsInfo;
+import cc.mrbird.febs.mall.vo.AdminMallNewsInfoVo;
+import cc.mrbird.febs.vip.entity.MallVipBenefits;
+import cc.mrbird.febs.vip.mapper.MallVipBenefitsMapper;
+import cc.mrbird.febs.vip.service.IMallVipBenefitsService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class MallVipBenefitsServiceImpl extends ServiceImpl<MallVipBenefitsMapper, MallVipBenefits> implements IMallVipBenefitsService {
+
+ @Override
+ public IPage<MallVipBenefits> vipBenefitsListInPage(QueryRequest request) {
+ Page<MallVipBenefits> page = new Page<>(request.getPageNum(), request.getPageSize());
+ return this.baseMapper.selectVipBenefitsListInPage(page);
+ }
+
+ @Override
+ public MallVipBenefits findVipBenefitsById(Long id) {
+ return this.baseMapper.selectVipBenefitsById(id);
+ }
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipConfigBenefitsServiceImpl.java b/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipConfigBenefitsServiceImpl.java
new file mode 100644
index 0000000..b992145
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipConfigBenefitsServiceImpl.java
@@ -0,0 +1,15 @@
+package cc.mrbird.febs.vip.service.impl;
+
+import cc.mrbird.febs.vip.entity.MallVipConfigBenefits;
+import cc.mrbird.febs.vip.mapper.MallVipConfigBenefitsMapper;
+import cc.mrbird.febs.vip.service.IMallVipConfigBenefitsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class MallVipConfigBenefitsServiceImpl extends ServiceImpl<MallVipConfigBenefitsMapper, MallVipConfigBenefits> implements IMallVipConfigBenefitsService {
+}
diff --git a/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipConfigServiceImpl.java b/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipConfigServiceImpl.java
new file mode 100644
index 0000000..93374fc
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/vip/service/impl/MallVipConfigServiceImpl.java
@@ -0,0 +1,15 @@
+package cc.mrbird.febs.vip.service.impl;
+
+import cc.mrbird.febs.vip.entity.MallVipConfig;
+import cc.mrbird.febs.vip.mapper.MallVipConfigMapper;
+import cc.mrbird.febs.vip.service.IMallVipConfigService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class MallVipConfigServiceImpl extends ServiceImpl<MallVipConfigMapper, MallVipConfig> implements IMallVipConfigService {
+}
diff --git a/src/main/resources/mapper/modules/MallVipBenefitsMapper.xml b/src/main/resources/mapper/modules/MallVipBenefitsMapper.xml
new file mode 100644
index 0000000..a2e5d7d
--- /dev/null
+++ b/src/main/resources/mapper/modules/MallVipBenefitsMapper.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cc.mrbird.febs.vip.mapper.MallVipBenefitsMapper">
+
+ <resultMap id="VipBenefitsMap" type="cc.mrbird.febs.vip.entity.MallVipBenefits">
+ <id property="id" column="id" />
+ <result property="name" column="name" />
+ <result property="type" column="type" />
+ <result property="icon" column="icon" />
+ <result property="multiple" column="multiple" />
+ <result property="remark" column="remark" />
+
+ <collection property="details" ofType="cc.mrbird.febs.vip.entity.MallVipBenefitsDetails">
+ <id property="id" column="c_id" />
+ <result property="image" column="image" />
+ <result property="isClick" column="is_click" />
+ <result property="linkType" column="link_type" />
+ <result property="content" column="content" />
+ <result property="seq" column="seq" />
+ </collection>
+ </resultMap>
+
+ <select id="selectVipBenefitsListInPage" resultType="cc.mrbird.febs.vip.entity.MallVipBenefits">
+ select * from mall_vip_benefits
+ </select>
+
+ <select id="selectVipBenefitsById" resultMap="VipBenefitsMap">
+ select
+ benefits.*,
+ benefitsDetail.id c_id
+ ,benefitsDetail.image
+ ,benefitsDetail.is_click
+ ,benefitsDetail.link_type
+ ,benefitsDetail.content
+ ,benefitsDetail.seq
+ from mall_vip_benefits benefits
+ inner join mall_vip_benefits_details benefitsDetail on benefits.id=benefitsDetail.benefitsId
+ where benefits.id=#{id}
+ </select>
+</mapper>
\ No newline at end of file
diff --git a/src/main/resources/templates/febs/views/modules/vip/vipBenefits-list.html b/src/main/resources/templates/febs/views/modules/vip/vipBenefits-list.html
new file mode 100644
index 0000000..b6be61c
--- /dev/null
+++ b/src/main/resources/templates/febs/views/modules/vip/vipBenefits-list.html
@@ -0,0 +1,172 @@
+<div class="layui-fluid layui-anim febs-anim" id="febs-vip-benefits" lay-title="会员权益">
+ <div class="layui-row febs-container">
+ <div class="layui-col-md12">
+ <div class="layui-card">
+ <div class="layui-card-body febs-table-full">
+ <form class="layui-form layui-table-form" lay-filter="vip-benefits-table-form">
+ <div class="layui-row">
+ <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
+ <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="add">
+ 新增
+ </div>
+ <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query">
+ <i class="layui-icon"></i>
+ </div>
+ <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset">
+ <i class="layui-icon"></i>
+ </div>
+ </div>
+ </div>
+ </form>
+ <table lay-filter="vipBenefitsTable" lay-data="{id: 'vipBenefitsTable'}"></table>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<style>
+ .layui-table-cell {
+ height: auto;
+ }
+ .layui-form-onswitch {
+ background-color: #5FB878 !important;
+ }
+</style>
+<script type="text/html" id="isTopSwitch">
+ {{# if(d.isTop === 1) { }}
+ <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="isTopSwitch">
+ {{# } else { }}
+ <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="isTopSwitch">
+ {{# } }}
+</script>
+<!-- 表格操作栏 start -->
+<script type="text/html" id="user-option">
+ <span shiro:lacksPermission="vipBenefits:view,vipBenefits:update,vipBenefits:delete">
+ <span class="layui-badge-dot febs-bg-orange"></span> 无权限
+ </span>
+ <a lay-event="edit" shiro:hasPermission="vipBenefits:update"><i
+ class="layui-icon febs-edit-area febs-blue"></i></a>
+</script>
+<!-- 表格操作栏 end -->
+<script data-th-inline="none" type="text/javascript">
+ // 引入组件并初始化
+ layui.use([ 'jquery', 'form', 'table', 'febs'], function () {
+ var $ = layui.jquery,
+ febs = layui.febs,
+ form = layui.form,
+ table = layui.table,
+ $view = $('#febs-vip-benefits'),
+ $query = $view.find('#query'),
+ $add = $view.find('#add'),
+ $reset = $view.find('#reset'),
+ $searchForm = $view.find('form'),
+ sortObject = {field: 'phone', type: null},
+ tableIns;
+
+ form.render();
+
+ // 表格初始化
+ initTable();
+
+ // 初始化表格操作栏各个按钮功能
+ table.on('tool(vipBenefitsTable)', function (obj) {
+ var data = obj.data,
+ layEvent = obj.event;
+ if (layEvent === 'newsInfoUpdate') {
+ febs.modal.open('编辑', 'modules/news/newsInfoUpdate/' + data.id, {
+ btn: ['提交', '取消'],
+ yes: function (index, layero) {
+ $('#newsInfo-update').find('#submit').trigger('click');
+ },
+ btn2: function () {
+ layer.closeAll();
+ }
+ });
+ }
+ if (layEvent === 'delNewsInfo') {
+ febs.modal.confirm('删除', '确认删除?', function () {
+ delNewsInfo(data.id);
+ });
+ }
+ });
+
+ function delNewsInfo(id) {
+ febs.get(ctx + 'admin/news/delNewsInfo/' + id, null, function () {
+ febs.alert.success('操作成功');
+ $query.click();
+ });
+ }
+
+ // 查询按钮
+ $query.on('click', function () {
+ var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type});
+ tableIns.reload({where: params, page: {curr: 1}});
+ });
+
+ // 刷新按钮
+ $reset.on('click', function () {
+ $searchForm[0].reset();
+ sortObject.type = 'null';
+ tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
+ });
+
+ $add.on('click', function () {
+ febs.modal.open('新增', 'modules/news/newsInfoAdd/', {
+ btn: ['提交', '取消'],
+ yes: function (index, layero) {
+ $('#newsInfo-add').find('#submit').trigger('click');
+ },
+ btn2: function () {
+ layer.closeAll();
+ }
+ });
+ });
+
+ function initTable() {
+ tableIns = febs.table.init({
+ elem: $view.find('table'),
+ id: 'vipBenefitsTable',
+ url: ctx + 'admin/vip/benefits/list',
+ cols: [[
+ {field: 'name', title: '权益名称', minWidth: 120, align: 'center'},
+ {
+ field: 'icon', title: 'ICON',
+ templet: function (d) {
+ return '';
+ }, minWidth: 150, align: 'center'
+ },
+ {field: 'remark', title: '备注', minWidth: 120, align: 'center'},
+ {field: 'createdTime', title: '创建时间', minWidth: 120, align: 'center'},
+ {
+ title: '操作',
+ templet: function (d) {
+ return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="newsInfoUpdate" shiro:hasPermission="user:update">编辑</button>'
+ + '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delNewsInfo" shiro:hasPermission="user:update">删除</button>'
+ }, minWidth: 300, align: 'center'
+ }
+ ]]
+ });
+ }
+
+ // 获取查询参数
+ function getQueryParams() {
+ return {
+ };
+ }
+
+ form.on('switch(isTopSwitch)', function (data) {
+ console.log(data.value);
+ if (data.elem.checked) {
+ febs.post(ctx + 'admin/news/topNews/' + data.value, null, function () {
+ febs.alert.success('设置成功');
+ $query.click();
+ });
+ } else {
+ febs.post(ctx + 'admin/news/unTopNews/' + data.value, null, function () {
+ febs.alert.success('设置成功');
+ $query.click();
+ });
+ }
+ })
+ })
+</script>
\ No newline at end of file
--
Gitblit v1.9.1