Просмотр исходного кода

添加事件框架 - 添加基于事件框架的积分兑换限时预定活动功能

xianwait 2 лет назад
Родитель
Сommit
2c5982a2c2
21 измененных файлов с 1722 добавлено и 6 удалено
  1. 100 0
      willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsEventBusinessRelationController.java
  2. 104 0
      willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsEventController.java
  3. 1 2
      willalp-admin/src/main/resources/application-dev.yml
  4. 1 2
      willalp-admin/src/main/resources/application-prod.yml
  5. 174 0
      willalp-clocking-in/src/main/java/com/willalp/event/domain/HsEvent.java
  6. 84 0
      willalp-clocking-in/src/main/java/com/willalp/event/domain/HsEventBusinessRelation.java
  7. 23 0
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventBusinessRelationMapper.java
  8. 23 0
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventMapper.java
  9. 33 0
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventBusinessRelationMapper.xml
  10. 76 0
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventMapper.xml
  11. 31 0
      willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventBusinessRelationService.java
  12. 23 0
      willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventService.java
  13. 79 0
      willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventBusinessRelationServiceImpl.java
  14. 35 0
      willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventServiceImpl.java
  15. 4 0
      willalp-generator/src/main/resources/vm/java/controller.java.vm
  16. 1 1
      willalp-generator/src/main/resources/vm/java/serviceImpl.java.vm
  17. 53 0
      willalp-ui/src/api/eventConfig/event.js
  18. 62 0
      willalp-ui/src/api/eventConfig/relation.js
  19. 89 1
      willalp-ui/src/views/canteen/gift/index.vue
  20. 431 0
      willalp-ui/src/views/eventConfig/event/index.vue
  21. 295 0
      willalp-ui/src/views/eventConfig/relation/index.vue

+ 100 - 0
willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsEventBusinessRelationController.java

@@ -0,0 +1,100 @@
+package com.willalp.web.controller.clockingin;
+
+import com.willalp.common.annotation.Log;
+import com.willalp.common.core.controller.BaseController;
+import com.willalp.common.core.domain.AjaxResult;
+import com.willalp.common.core.page.TableDataInfo;
+import com.willalp.common.enums.BusinessType;
+import com.willalp.common.utils.poi.ExcelUtil;
+import com.willalp.event.domain.HsEventBusinessRelation;
+import com.willalp.event.service.IHsEventBusinessRelationService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 事件相关业务关系Controller
+ *
+ * @author willalp
+ * @date 2023-01-29
+ */
+@RestController
+@RequestMapping("/eventConfig/relation")
+public class HsEventBusinessRelationController extends BaseController {
+    @Resource
+    private IHsEventBusinessRelationService hsEventBusinessRelationService;
+
+    /**
+     * 查询事件相关业务关系列表
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:relation:list')")
+    @PostMapping("/submit/binding")
+    public AjaxResult submitBinding(@RequestBody HsEventBusinessRelation hsEventBusinessRelation) {
+        return toAjax(hsEventBusinessRelationService.doBindingRelation(hsEventBusinessRelation));
+    }
+
+    /**
+     * 查询事件相关业务关系列表
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:relation:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(HsEventBusinessRelation hsEventBusinessRelation) {
+        startPage();
+        List<HsEventBusinessRelation> list = hsEventBusinessRelationService.selectHsEventBusinessRelationList(hsEventBusinessRelation);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出事件相关业务关系列表
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:relation:export')")
+    @Log(title = "事件相关业务关系", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(HsEventBusinessRelation hsEventBusinessRelation) {
+        List<HsEventBusinessRelation> list = hsEventBusinessRelationService.selectHsEventBusinessRelationList(hsEventBusinessRelation);
+        ExcelUtil<HsEventBusinessRelation> util = new ExcelUtil<HsEventBusinessRelation>(HsEventBusinessRelation.class);
+        return util.exportExcel(list, "事件相关业务关系数据");
+    }
+
+    /**
+     * 获取事件相关业务关系详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:relation:query')")
+    @GetMapping(value = "/{eventId}")
+    public AjaxResult getInfo(@PathVariable("eventId") String eventId) {
+        return AjaxResult.success(hsEventBusinessRelationService.getById(eventId));
+    }
+
+    /**
+     * 新增事件相关业务关系
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:relation:add')")
+    @Log(title = "事件相关业务关系", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody HsEventBusinessRelation hsEventBusinessRelation) {
+        return toAjax(hsEventBusinessRelationService.save(hsEventBusinessRelation));
+    }
+
+    /**
+     * 修改事件相关业务关系
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:relation:edit')")
+    @Log(title = "事件相关业务关系", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody HsEventBusinessRelation hsEventBusinessRelation) {
+        return toAjax(hsEventBusinessRelationService.updateById(hsEventBusinessRelation));
+    }
+
+    /**
+     * 删除事件相关业务关系
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:relation:remove')")
+    @Log(title = "事件相关业务关系", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{eventIds}")
+    public AjaxResult remove(@PathVariable String[] eventIds) {
+        return toAjax(hsEventBusinessRelationService.removeByIds(Arrays.asList(eventIds)));
+    }
+}

+ 104 - 0
willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsEventController.java

@@ -0,0 +1,104 @@
+package com.willalp.web.controller.clockingin;
+
+import com.willalp.common.annotation.Log;
+import com.willalp.common.core.controller.BaseController;
+import com.willalp.common.core.domain.AjaxResult;
+import com.willalp.common.core.page.TableDataInfo;
+import com.willalp.common.enums.BusinessType;
+import com.willalp.common.utils.DateUtils;
+import com.willalp.common.utils.SecurityUtils;
+import com.willalp.common.utils.poi.ExcelUtil;
+import com.willalp.event.domain.HsEvent;
+import com.willalp.event.service.IHsEventService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 活动配置Controller
+ *
+ * @author willalp
+ * @date 2023-01-29
+ */
+@RestController
+@RequestMapping("/eventConfig/event")
+public class HsEventController extends BaseController
+{
+    @Resource
+    private IHsEventService hsEventService;
+
+    /**
+     * 查询活动配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:event:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(HsEvent hsEvent)
+    {
+        startPage();
+        List<HsEvent> list = hsEventService.selectHsEventList(hsEvent);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出活动配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:event:export')")
+    @Log(title = "活动配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(HsEvent hsEvent)
+    {
+        List<HsEvent> list = hsEventService.selectHsEventList(hsEvent);
+        ExcelUtil<HsEvent> util = new ExcelUtil<HsEvent>(HsEvent.class);
+        return util.exportExcel(list, "活动配置数据");
+    }
+
+    /**
+     * 获取活动配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:event:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return AjaxResult.success(hsEventService.getById(id));
+    }
+
+    /**
+     * 新增活动配置
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:event:add')")
+    @Log(title = "活动配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody HsEvent hsEvent)
+    {
+        hsEvent.setCreateBy(SecurityUtils.getUsername());
+        hsEvent.setCreateTime(DateUtils.getNowDate());
+        return toAjax(hsEventService.save(hsEvent));
+    }
+
+    /**
+     * 修改活动配置
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:event:edit')")
+    @Log(title = "活动配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody HsEvent hsEvent)
+    {
+        hsEvent.setUpdateBy(SecurityUtils.getUsername());
+        hsEvent.setUpdateTime(DateUtils.getNowDate());
+        return toAjax(hsEventService.updateById(hsEvent));
+    }
+
+    /**
+     * 删除活动配置
+     */
+    @PreAuthorize("@ss.hasPermi('eventConfig:event:remove')")
+    @Log(title = "活动配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(hsEventService.removeByIds(Arrays.asList(ids)));
+    }
+}

+ 1 - 2
willalp-admin/src/main/resources/application-dev.yml

@@ -38,8 +38,7 @@ spring:
     druid:
       # 主库数据源
       master:
-        #url: jdbc:mysql://47.103.86.55:3306/willalp_pns_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-        url: jdbc:mysql://123.60.93.230:3306/willalp_pns_ml_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://123.60.93.230:3306/willalp_pns_ml_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
         #url: jdbc:mysql://114.115.142.166:3306/willalp_pns_prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         #url: jdbc:mysql://localhost:3306/willalp-pns-ml-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         username: root

+ 1 - 2
willalp-admin/src/main/resources/application-prod.yml

@@ -37,8 +37,7 @@ spring:
     druid:
       # 主库数据源
       master:
-        url: jdbc:mysql://114.115.142.166:3306/willalp_pns_prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-        #url: jdbc:mysql://47.103.86.55:3306/willalp_frame?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://114.115.142.166:3306/willalp_pns_prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
         username: root
         #password: annaru_mysql
         password: willalp_mysql

+ 174 - 0
willalp-clocking-in/src/main/java/com/willalp/event/domain/HsEvent.java

@@ -0,0 +1,174 @@
+package com.willalp.event.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.willalp.common.annotation.Excel;
+import com.willalp.common.core.domain.BaseEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 活动配置对象 hs_event
+ *
+ * @author willalp
+ * @date 2023-01-29
+ */
+
+@TableName("hs_event")
+public class HsEvent extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    @TableId
+    private String id;
+
+    /** 事件编号 */
+    @Excel(name = "事件编号")
+    private String eventNo;
+
+    /** 事件名称 */
+    @Excel(name = "事件名称")
+    private String eventName;
+
+    /** 开始时间 */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /** 事件时间 */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @Excel(name = "事件时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date eventTime;
+
+    /** 结束时间 */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date endTime;
+
+    /** 事件类型 */
+    @Excel(name = "事件类型")
+    private String eventType;
+
+    /** 事件地点 */
+    @Excel(name = "事件地点")
+    private String eventPlace;
+
+    /** 事件描述 */
+    @Excel(name = "事件描述")
+    private String eventDescribe;
+
+    /** 事件状态 */
+    @Excel(name = "事件状态")
+    private String eventStatus;
+
+    /** 是否删除(0.未删除;1.已删除) */
+    @Excel(name = "是否删除", readConverterExp = "0=.未删除;1.已删除")
+    @TableLogic
+    private Integer isDelete;
+
+    public void setId(String id)
+    {
+        this.id = id;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+    public void setEventNo(String eventNo)
+    {
+        this.eventNo = eventNo;
+    }
+
+    public String getEventNo()
+    {
+        return eventNo;
+    }
+    public void setEventName(String eventName)
+    {
+        this.eventName = eventName;
+    }
+
+    public String getEventName()
+    {
+        return eventName;
+    }
+    public void setEventTime(Date eventTime)
+    {
+        this.eventTime = eventTime;
+    }
+
+    public Date getEventTime()
+    {
+        return eventTime;
+    }
+    public void setEventType(String eventType)
+    {
+        this.eventType = eventType;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getEventType()
+    {
+        return eventType;
+    }
+    public void setEventPlace(String eventPlace)
+    {
+        this.eventPlace = eventPlace;
+    }
+
+    public String getEventPlace()
+    {
+        return eventPlace;
+    }
+    public void setEventDescribe(String eventDescribe)
+    {
+        this.eventDescribe = eventDescribe;
+    }
+
+    public String getEventDescribe()
+    {
+        return eventDescribe;
+    }
+    public void setEventStatus(String eventStatus)
+    {
+        this.eventStatus = eventStatus;
+    }
+
+    public String getEventStatus()
+    {
+        return eventStatus;
+    }
+    public void setIsDelete(Integer isDelete)
+    {
+        this.isDelete = isDelete;
+    }
+
+    public Integer getIsDelete()
+    {
+        return isDelete;
+    }
+
+}

+ 84 - 0
willalp-clocking-in/src/main/java/com/willalp/event/domain/HsEventBusinessRelation.java

@@ -0,0 +1,84 @@
+package com.willalp.event.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.willalp.common.annotation.Excel;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.List;
+
+/**
+ * 事件相关业务关系对象 hs_event_business_relation
+ *
+ * @author willalp
+ * @date 2023-01-29
+ */
+
+@TableName("hs_event_business_relation")
+public class HsEventBusinessRelation
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 事件ID */
+    @TableId
+    @Excel(name = "事件ID")
+    private String eventId;
+
+    /** 业务ID */
+    @Excel(name = "业务ID")
+    private String businessId;
+
+    /** 业务类型 */
+    @Excel(name = "业务类型")
+    private String businessType;
+
+    @TableField(exist = false)
+    private List<String> eventBusinessIds;
+
+    public List<String> getEventBusinessIds() {
+        return eventBusinessIds;
+    }
+
+    public void setEventBusinessIds(List<String> eventBusinessIds) {
+        this.eventBusinessIds = eventBusinessIds;
+    }
+
+    public void setEventId(String eventId)
+    {
+        this.eventId = eventId;
+    }
+
+    public String getEventId()
+    {
+        return eventId;
+    }
+    public void setBusinessId(String businessId)
+    {
+        this.businessId = businessId;
+    }
+
+    public String getBusinessId()
+    {
+        return businessId;
+    }
+    public void setBusinessType(String businessType)
+    {
+        this.businessType = businessType;
+    }
+
+    public String getBusinessType()
+    {
+        return businessType;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("eventId", getEventId())
+            .append("businessId", getBusinessId())
+            .append("businessType", getBusinessType())
+            .toString();
+    }
+}

+ 23 - 0
willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventBusinessRelationMapper.java

@@ -0,0 +1,23 @@
+package com.willalp.event.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.willalp.event.domain.HsEventBusinessRelation;
+
+import java.util.List;
+
+/**
+ * 事件相关业务关系Mapper接口
+ *
+ * @author willalp
+ * @date 2023-01-29
+ */
+public interface HsEventBusinessRelationMapper extends BaseMapper<HsEventBusinessRelation>
+{
+    /**
+     * 查询事件相关业务关系列表
+     *
+     * @param hsEventBusinessRelation 事件相关业务关系
+     * @return 事件相关业务关系集合
+     */
+    List<HsEventBusinessRelation> selectHsEventBusinessRelationList(HsEventBusinessRelation hsEventBusinessRelation);
+}

+ 23 - 0
willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventMapper.java

@@ -0,0 +1,23 @@
+package com.willalp.event.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.willalp.event.domain.HsEvent;
+
+import java.util.List;
+
+/**
+ * 活动配置Mapper接口
+ *
+ * @author willalp
+ * @date 2023-01-29
+ */
+public interface HsEventMapper extends BaseMapper<HsEvent>
+{
+    /**
+     * 查询活动配置列表
+     *
+     * @param hsEvent 活动配置
+     * @return 活动配置集合
+     */
+    List<HsEvent> selectHsEventList(HsEvent hsEvent);
+}

+ 33 - 0
willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventBusinessRelationMapper.xml

@@ -0,0 +1,33 @@
+<?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="com.willalp.event.mapper.HsEventBusinessRelationMapper">
+
+    <resultMap type="com.willalp.event.domain.HsEventBusinessRelation" id="HsEventBusinessRelationResult">
+        <result property="eventId" column="event_id"/>
+        <result property="businessId" column="business_id"/>
+        <result property="businessType" column="business_type"/>
+    </resultMap>
+
+    <sql id="selectHsEventBusinessRelationVo">
+        select event_id, business_id, business_type
+        from hs_event_business_relation
+    </sql>
+
+    <select id="selectHsEventBusinessRelationList" parameterType="HsEventBusinessRelation"
+            resultMap="HsEventBusinessRelationResult">
+        <include refid="selectHsEventBusinessRelationVo"/>
+        <where>
+            <if test="eventId != null  and eventId != ''">
+                and event_id = #{eventId}
+            </if>
+            <if test="businessId != null  and businessId != ''">
+                and business_id = #{businessId}
+            </if>
+            <if test="businessType != null  and businessType != ''">
+                and business_type = #{businessType}
+            </if>
+        </where>
+    </select>
+</mapper>

+ 76 - 0
willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventMapper.xml

@@ -0,0 +1,76 @@
+<?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="com.willalp.event.mapper.HsEventMapper">
+
+    <resultMap type="com.willalp.event.domain.HsEvent" id="HsEventResult">
+        <result property="id" column="id"/>
+        <result property="eventNo" column="event_no"/>
+        <result property="eventName" column="event_name"/>
+        <result property="startTime" column="start_time"/>
+        <result property="eventTime" column="event_time"/>
+        <result property="eventType" column="event_type"/>
+        <result property="eventPlace" column="event_place"/>
+        <result property="endTime" column="end_time"/>
+        <result property="eventDescribe" column="event_describe"/>
+        <result property="eventStatus" column="event_status"/>
+        <result property="isDelete" column="is_delete"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectHsEventVo">
+        select id,
+               event_no,
+               event_name,
+               start_time,
+               event_time,
+               event_type,
+               event_place,
+               end_time,
+               event_describe,
+               event_status,
+               is_delete,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from hs_event
+    </sql>
+
+    <select id="selectHsEventList" parameterType="HsEvent" resultMap="HsEventResult">
+        <include refid="selectHsEventVo"/>
+        <where>
+            is_delete = 0
+            <if test="eventNo != null  and eventNo != ''">
+                and event_no like concat('%', #{eventNo}, '%')
+            </if>
+            <if test="eventName != null  and eventName != ''">
+                and event_name like concat('%', #{eventName}, '%')
+            </if>
+            <if test="eventTime != null ">
+                and event_time like concat('%', #{eventTime}, '%')
+            </if>
+            <if test="eventType != null  and eventType != ''">
+                and event_type = #{eventType}
+            </if>
+            <if test="eventPlace != null  and eventPlace != ''">
+                and event_place = #{eventPlace}
+            </if>
+            <if test="eventDescribe != null  and eventDescribe != ''">
+                and event_describe = #{eventDescribe}
+            </if>
+            <if test="eventStatus != null  and eventStatus != ''">
+                and event_status = #{eventStatus}
+            </if>
+            <if test="isDelete != null ">
+                and is_delete = #{isDelete}
+            </if>
+        </where>
+    </select>
+</mapper>

+ 31 - 0
willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventBusinessRelationService.java

@@ -0,0 +1,31 @@
+package com.willalp.event.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.willalp.event.domain.HsEventBusinessRelation;
+
+import java.util.List;
+
+/**
+ * 事件相关业务关系Service接口
+ *
+ * @author willalp
+ * @date 2023-01-29
+ */
+public interface IHsEventBusinessRelationService extends IService<HsEventBusinessRelation>
+{
+    /**
+     * 查询事件相关业务关系列表
+     *
+     * @param hsEventBusinessRelation 事件相关业务关系
+     * @return 事件相关业务关系集合
+     */
+    public List<HsEventBusinessRelation> selectHsEventBusinessRelationList(HsEventBusinessRelation hsEventBusinessRelation);
+
+    /**
+     * 操作绑定事件与业务关系
+     *
+     * @param hsEventBusinessRelation
+     * @return
+     */
+    boolean doBindingRelation(HsEventBusinessRelation hsEventBusinessRelation);
+}

+ 23 - 0
willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventService.java

@@ -0,0 +1,23 @@
+package com.willalp.event.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.willalp.event.domain.HsEvent;
+
+import java.util.List;
+
+/**
+ * 活动配置Service接口
+ *
+ * @author willalp
+ * @date 2023-01-29
+ */
+public interface IHsEventService extends IService<HsEvent>
+{
+    /**
+     * 查询活动配置列表
+     *
+     * @param hsEvent 活动配置
+     * @return 活动配置集合
+     */
+    public List<HsEvent> selectHsEventList(HsEvent hsEvent);
+}

+ 79 - 0
willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventBusinessRelationServiceImpl.java

@@ -0,0 +1,79 @@
+package com.willalp.event.service.impl;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.willalp.common.exception.base.BaseException;
+import com.willalp.common.utils.StringUtils;
+import com.willalp.event.domain.HsEventBusinessRelation;
+import com.willalp.event.mapper.HsEventBusinessRelationMapper;
+import com.willalp.event.service.IHsEventBusinessRelationService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 事件相关业务关系Service业务层处理
+ *
+ * @author willalp
+ * @date 2023-01-29
+ */
+@Service
+public class HsEventBusinessRelationServiceImpl extends ServiceImpl<HsEventBusinessRelationMapper, HsEventBusinessRelation> implements IHsEventBusinessRelationService {
+    @Resource
+    private HsEventBusinessRelationMapper hsEventBusinessRelationMapper;
+
+    /**
+     * 查询事件相关业务关系列表
+     *
+     * @param hsEventBusinessRelation 事件相关业务关系
+     * @return 事件相关业务关系
+     */
+    @Override
+    public List<HsEventBusinessRelation> selectHsEventBusinessRelationList(HsEventBusinessRelation hsEventBusinessRelation) {
+        return hsEventBusinessRelationMapper.selectHsEventBusinessRelationList(hsEventBusinessRelation);
+    }
+
+    @Override
+    public boolean doBindingRelation(HsEventBusinessRelation hsEventBusinessRelation) {
+        String eventId = hsEventBusinessRelation.getEventId();
+        if (StringUtils.isBlank(eventId)) {
+            throw new BaseException("事件ID不能为空");
+        }
+        String businessType = hsEventBusinessRelation.getBusinessType();
+        if (StringUtils.isBlank(businessType)) {
+            throw new BaseException("事件绑定类型不能为空");
+        }
+        List<String> eventBusinessIds = hsEventBusinessRelation.getEventBusinessIds();
+        if (CollectionUtil.isEmpty(eventBusinessIds)) {
+            throw new BaseException("业务IDs不能为空");
+        }
+        List<HsEventBusinessRelation> relationList = getBaseMapper().selectList(new QueryWrapper<HsEventBusinessRelation>()
+                .eq("event_id", eventId));
+        List<HsEventBusinessRelation> list = new ArrayList<>();
+        for (String id : eventBusinessIds) {
+            int count = 0;
+            //去重
+            for (HsEventBusinessRelation eventBusinessRelation : relationList) {
+                String businessId = eventBusinessRelation.getBusinessId();
+                if (StringUtils.isNotBlank(businessId) &&
+                        StringUtils.equals(businessId, id)) {
+                    count++;
+                }
+            }
+            if (count == 0) {
+                HsEventBusinessRelation businessRelation = new HsEventBusinessRelation();
+                businessRelation.setEventId(eventId);
+                businessRelation.setBusinessType(businessType);
+                businessRelation.setBusinessId(id);
+                list.add(businessRelation);
+            }
+        }
+        if (list.size() == 0) {
+            throw new BaseException("已有绑定数据");
+        }
+        return saveBatch(list);
+    }
+}

+ 35 - 0
willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventServiceImpl.java

@@ -0,0 +1,35 @@
+package com.willalp.event.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.willalp.event.domain.HsEvent;
+import com.willalp.event.mapper.HsEventMapper;
+import com.willalp.event.service.IHsEventService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 活动配置Service业务层处理
+ *
+ * @author willalp
+ * @date 2023-01-29
+ */
+@Service
+public class HsEventServiceImpl extends ServiceImpl<HsEventMapper, HsEvent>  implements IHsEventService
+{
+    @Resource
+    private HsEventMapper hsEventMapper;
+
+    /**
+     * 查询活动配置列表
+     *
+     * @param hsEvent 活动配置
+     * @return 活动配置
+     */
+    @Override
+    public List<HsEvent> selectHsEventList(HsEvent hsEvent)
+    {
+        return hsEventMapper.selectHsEventList(hsEvent);
+    }
+}

+ 4 - 0
willalp-generator/src/main/resources/vm/java/controller.java.vm

@@ -15,6 +15,10 @@ import com.willalp.common.annotation.Log;
 import com.willalp.common.core.controller.BaseController;
 import com.willalp.common.core.domain.AjaxResult;
 import com.willalp.common.enums.BusinessType;
+import com.willalp.common.utils.DateUtils;
+import com.willalp.common.utils.SecurityUtils;
+import javax.annotation.Resource;
+import java.util.Arrays;
 import ${packageName}.domain.${ClassName};
 import ${packageName}.service.I${ClassName}Service;
 import com.willalp.common.utils.poi.ExcelUtil;

+ 1 - 1
willalp-generator/src/main/resources/vm/java/serviceImpl.java.vm

@@ -8,7 +8,7 @@ import com.willalp.common.utils.DateUtils;
 #break
 #end
 #end
-import org.springframework.beans.factory.annotation.Autowired;
+import javax.annotation.Resource;
 import org.springframework.stereotype.Service;
 #if($table.sub)
 import java.util.ArrayList;

+ 53 - 0
willalp-ui/src/api/eventConfig/event.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询活动配置列表
+export function listEvent(query) {
+  return request({
+    url: '/eventConfig/event/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询活动配置详细
+export function getEvent(id) {
+  return request({
+    url: '/eventConfig/event/' + id,
+    method: 'get'
+  })
+}
+
+// 新增活动配置
+export function addEvent(data) {
+  return request({
+    url: '/eventConfig/event',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改活动配置
+export function updateEvent(data) {
+  return request({
+    url: '/eventConfig/event',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除活动配置
+export function delEvent(id) {
+  return request({
+    url: '/eventConfig/event/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出活动配置
+export function exportEvent(query) {
+  return request({
+    url: '/eventConfig/event/export',
+    method: 'get',
+    params: query
+  })
+}

+ 62 - 0
willalp-ui/src/api/eventConfig/relation.js

@@ -0,0 +1,62 @@
+import request from '@/utils/request'
+
+// 查询事件相关业务关系列表
+export function listRelation(query) {
+  return request({
+    url: '/eventConfig/relation/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询事件相关业务关系详细
+export function getRelation(eventId) {
+  return request({
+    url: '/eventConfig/relation/' + eventId,
+    method: 'get'
+  })
+}
+
+// 新增事件相关业务关系
+export function submitBindingRelation(data) {
+  return request({
+    url: '/eventConfig/relation/submit/binding',
+    method: 'post',
+    data: data
+  })
+}
+
+// 新增事件相关业务关系
+export function addRelation(data) {
+  return request({
+    url: '/eventConfig/relation',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改事件相关业务关系
+export function updateRelation(data) {
+  return request({
+    url: '/eventConfig/relation',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除事件相关业务关系
+export function delRelation(eventId) {
+  return request({
+    url: '/eventConfig/relation/' + eventId,
+    method: 'delete'
+  })
+}
+
+// 导出事件相关业务关系
+export function exportRelation(query) {
+  return request({
+    url: '/eventConfig/relation/export',
+    method: 'get',
+    params: query
+  })
+}

+ 89 - 1
willalp-ui/src/views/canteen/gift/index.vue

@@ -95,6 +95,17 @@
           </el-switch>
         </div>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-time"
+          size="mini"
+          :loading="exportLoading"
+          @click="eventShow"
+        >领取时间配置
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -212,6 +223,42 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    <!-- 添加或修改礼品登记对话框 -->
+    <el-dialog title="领取时间配置" :visible.sync="eventForm.open" width="1600px" append-to-body>
+      <eventConfig ref="event" :id="eventGiftForm.eventId"></eventConfig>
+    </el-dialog>
+
+    <!-- 绑定活动礼品话框 -->
+    <el-dialog title="领取时间配置" :visible.sync="eventGiftForm.open" width="1600px" append-to-body>
+      <el-table v-loading="loading" :data="giftList" @selection-change="handleSelectionChange2">
+        <el-table-column type="selection" width="55" align="center"/>
+        <el-table-column label="礼品id" align="center" prop="giftId" v-if="false"/>
+        <el-table-column label="礼品编号" align="center" prop="giftNumber"/>
+        <el-table-column label="礼品名称" align="center" prop="giftName"/>
+        <el-table-column label="礼品图片" align="center" prop="giftPictrue">
+          <template slot-scope="scope">
+            <img style="width:80px;height:80px;border:none;" :src="baseUrl + scope.row.giftPictrue">
+          </template>
+        </el-table-column>
+        <el-table-column label="礼品价格" align="center" prop="giftPrice"/>
+        <el-table-column label="启用标志" align="center" prop="qybz">
+          <template slot-scope="scope">
+            <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.qybz"/>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitBindingEventGifts()" v-prevent-re-click>确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -230,14 +277,16 @@ import {
 } from "@/api/canteen/gift";
 import {getMasterOrgInfos} from "@/api/master-api";
 import {listGiftType} from "@/api/canteen/giftType";
+import eventConfig from "@/views/eventConfig/event";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {submitBindingRelation} from "@/api/eventConfig/relation";
 
 export default {
   name: "Gift",
   dicts: ['sys_normal_disable'],
   components: {
-    Treeselect
+    Treeselect, eventConfig
   },
   data() {
     return {
@@ -268,6 +317,19 @@ export default {
         text: "",
         openStatus: false
       },
+      eventForm: {
+        open: false,
+        text: "",
+        openStatus: false
+      },
+      eventGiftForm: {
+        eventId: "",
+        eventBusinessIds: [],
+        businessType: '1',
+        open: false,
+        text: "",
+        openStatus: false,
+      },
       // 礼品类型树选项
       giftTypeOptions: [],
       // 查询参数
@@ -296,6 +358,20 @@ export default {
     this.getNoticeStatus();
   },
   methods: {
+    bindingGift() {
+      this.eventGiftForm.open = true
+      setTimeout(() => {
+        this.eventGiftForm.eventId = this.$refs.event.getEventId()
+      }, 100)
+    },
+    submitBindingEventGifts() {
+      submitBindingRelation(this.eventGiftForm).then(re => {
+        if (re.code === 200) {
+          this.$modal.msgSuccess("绑定成功");
+          this.eventGiftForm.open = false
+        }
+      })
+    },
     setNoticeStatus() {
       let data = {
         'openStatus': this.noticeForm.openStatus ? 'true' : 'false'
@@ -364,6 +440,7 @@ export default {
     cancel() {
       this.open = false;
       this.noticeForm.open = false;
+      this.eventGiftForm.open = false;
       this.noticeForm.text = '';
       this.reset();
     },
@@ -403,6 +480,10 @@ export default {
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
+    // 多选框选中数据
+    handleSelectionChange2(selection) {
+      this.eventGiftForm.eventBusinessIds = selection.map(item => item.giftId)
+    },
     /** 新增按钮操作 */
     handleAdd() {
       this.getTreeselect();
@@ -413,6 +494,13 @@ export default {
     noticeShow() {
       this.noticeForm.open = true;
     },
+    eventShow() {
+      this.eventForm.open = true;
+      setTimeout(() => {
+        this.$refs.event.queryParams.eventType = '1'
+        this.$refs.event.getList()
+      }, 100)
+    },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.getTreeselect();

+ 431 - 0
willalp-ui/src/views/eventConfig/event/index.vue

@@ -0,0 +1,431 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+      <el-form-item label="事件类型" prop="eventType">
+        <el-select disabled v-model="queryParams.eventType" placeholder="请选择事件类型" clearable size="small">
+          <el-option
+            v-for="dict in dict.type.event_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="事件编号" prop="eventNo">
+        <el-input
+          v-model="queryParams.eventNo"
+          placeholder="请输入事件编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="事件名称" prop="eventName">
+        <el-input
+          v-model="queryParams.eventName"
+          placeholder="请输入事件名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="事件时间" prop="eventTime">
+        <el-date-picker
+          clearable size="small"
+          v-model="queryParams.eventTime"
+          type="datetime"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          placeholder="选择事件时间">
+        </el-date-picker>
+      </el-form-item>
+      <!--      <el-form-item label="事件地点" prop="eventPlace">-->
+      <!--        <el-select v-model="queryParams.eventPlace" placeholder="请选择事件地点" clearable size="small">-->
+      <!--          <el-option label="请选择字典生成" value="" />-->
+      <!--        </el-select>-->
+      <!--      </el-form-item>-->
+      <el-form-item label="事件状态" prop="eventStatus">
+        <el-select v-model="queryParams.eventStatus" placeholder="请选择事件状态" clearable size="small">
+          <el-option
+            v-for="dict in dict.type.event_status"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <!--        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['eventConfig:event:add']"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['eventConfig:event:edit']"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['eventConfig:event:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['eventConfig:event:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="eventList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <!--      <el-table-column label="主键" align="center" prop="id" />-->
+      <el-table-column label="事件编号" align="center" prop="eventNo"/>
+      <el-table-column label="事件名称" align="center" prop="eventName"/>
+      <el-table-column label="开始时间" align="center" prop="startTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="事件时间" align="center" prop="eventTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.eventTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="结束时间" align="center" prop="endTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="事件类型" align="center" prop="eventType">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.event_type" :value="scope.row.eventType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="事件地点" align="center" prop="eventPlace" v-if="queryParams.eventStatus !== '1'"/>
+      <el-table-column label="事件描述" align="center" prop="eventDescribe" v-if="queryParams.eventStatus !== '1'"/>
+      <el-table-column label="事件状态" align="center" prop="eventStatus">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.event_status" :value="scope.row.eventStatus"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remark" v-if="queryParams.eventStatus !== '1'"/>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-connection"
+            @click="bindingGiftChild(scope.row)"
+          >绑定商品
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['eventConfig:event:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['eventConfig:event:remove']"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改活动配置对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules">
+        <el-form-item label="事件编号" prop="eventNo">
+          <el-input v-model="form.eventNo" placeholder="请输入事件编号"/>
+        </el-form-item>
+        <el-form-item label="事件名称" prop="eventName">
+          <el-input v-model="form.eventName" placeholder="请输入事件名称"/>
+        </el-form-item>
+        <el-form-item label="开始时间" prop="startTime">
+          <el-date-picker
+            clearable size="small"
+            v-model="form.startTime"
+            type="datetime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            placeholder="选择开始时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="事件时间" prop="eventTime">
+          <el-date-picker
+            clearable size="small"
+            v-model="form.eventTime"
+            type="datetime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            placeholder="选择事件时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="结束时间" prop="endTime">
+          <el-date-picker
+            clearable size="small"
+            v-model="form.endTime"
+            type="datetime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            placeholder="选择结束时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="事件类型" prop="eventType">
+          <el-select v-model="form.eventType" placeholder="请选择事件类型">
+            <el-option
+              v-for="dict in dict.type.event_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="事件地点" prop="eventPlace" v-if="queryParams.eventStatus !== '1'">
+          <el-select v-model="form.eventPlace" placeholder="请选择事件地点">
+            <el-option label="请选择字典生成" value=""/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="事件描述" v-if="queryParams.eventStatus !== '1'">
+          <editor v-model="form.eventDescribe" :min-height="192"/>
+        </el-form-item>
+        <el-form-item label="事件状态" prop="eventStatus">
+          <el-select v-model="form.eventStatus" placeholder="请选择事件状态">
+            <el-option
+              v-for="dict in dict.type.event_status"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark" v-if="queryParams.eventStatus !== '1'">
+          <el-input v-model="form.remark" placeholder="请输入备注"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {listEvent, getEvent, delEvent, addEvent, updateEvent, exportEvent} from "@/api/eventConfig/event";
+
+export default {
+  name: "Event",
+  dicts: ['event_type', 'event_status'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 活动配置表格数据
+      eventList: [],
+      id: '',
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        eventNo: null,
+        eventName: null,
+        startTime: null,
+        eventTime: null,
+        endTime: null,
+        eventType: null,
+        eventPlace: null,
+        eventDescribe: null,
+        eventStatus: null,
+        isDelete: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    // this.getList();
+  },
+  methods: {
+    /** 查询活动配置列表 */
+    getList() {
+      this.loading = true;
+      listEvent(this.queryParams).then(response => {
+        this.eventList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    getEventId() {
+      return this.id;
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        eventNo: null,
+        eventName: null,
+        eventTime: null,
+        eventType: null,
+        eventPlace: null,
+        eventDescribe: null,
+        eventStatus: null,
+        isDelete: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    bindingGiftChild(row) {
+      this.id = row.id;
+      this.$parent.$parent.bindingGift();
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加活动配置";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getEvent(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改活动配置";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateEvent(this.form).then(() => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addEvent(this.form).then(() => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除活动配置编号为"' + ids + '"的数据项?').then(function () {
+        return delEvent(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$modal.confirm('是否确认导出所有活动配置数据项?').then(() => {
+        this.exportLoading = true;
+        return exportEvent(queryParams);
+      }).then(response => {
+        this.$download.name(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {
+      });
+    }
+  }
+};
+</script>

+ 295 - 0
willalp-ui/src/views/eventConfig/relation/index.vue

@@ -0,0 +1,295 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+      <el-form-item label="事件ID" prop="eventId">
+        <el-input
+          v-model="queryParams.eventId"
+          placeholder="请输入事件ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="业务ID" prop="businessId">
+        <el-input
+          v-model="queryParams.businessId"
+          placeholder="请输入业务ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="业务类型" prop="businessType">
+        <el-select v-model="queryParams.businessType" placeholder="请选择业务类型" clearable size="small">
+          <el-option
+            v-for="dict in dict.type.event_business_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['eventConfig:relation:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['eventConfig:relation:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['eventConfig:relation:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['eventConfig:relation:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="relationList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="事件ID" align="center" prop="eventId" />
+      <el-table-column label="业务ID" align="center" prop="businessId" />
+      <el-table-column label="业务类型" align="center" prop="businessType">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.event_business_type" :value="scope.row.businessType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['eventConfig:relation:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['eventConfig:relation:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改事件相关业务关系对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" >
+        <el-form-item label="事件ID" prop="eventId">
+          <el-input v-model="form.eventId" placeholder="请输入事件ID" />
+        </el-form-item>
+        <el-form-item label="业务ID" prop="businessId">
+          <el-input v-model="form.businessId" placeholder="请输入业务ID" />
+        </el-form-item>
+        <el-form-item label="业务类型" prop="businessType">
+          <el-select v-model="form.businessType" placeholder="请选择业务类型">
+            <el-option
+              v-for="dict in dict.type.event_business_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listRelation, getRelation, delRelation, addRelation, updateRelation, exportRelation } from "@/api/eventConfig/relation";
+
+export default {
+  name: "Relation",
+  dicts: ['event_business_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 事件相关业务关系表格数据
+      relationList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        eventId: null,
+        businessId: null,
+        businessType: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询事件相关业务关系列表 */
+    getList() {
+      this.loading = true;
+      listRelation(this.queryParams).then(response => {
+        this.relationList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        eventId: null,
+        businessId: null,
+        businessType: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.eventId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加事件相关业务关系";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const eventId = row.eventId || this.ids
+      getRelation(eventId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改事件相关业务关系";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.eventId != null) {
+            updateRelation(this.form).then(() => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addRelation(this.form).then(() => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const eventIds = row.eventId || this.ids;
+      this.$modal.confirm('是否确认删除事件相关业务关系编号为"' + eventIds + '"的数据项?').then(function() {
+        return delRelation(eventIds);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$modal.confirm('是否确认导出所有事件相关业务关系数据项?').then(() => {
+        this.exportLoading = true;
+        return exportRelation(queryParams);
+      }).then(response => {
+        this.$download.name(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
+    }
+  }
+};
+</script>