Browse Source

【修改】增加赞和踩埋点记录

lichen 11 months ago
parent
commit
ee415bbea6

+ 125 - 0
suishenbang-admin/src/main/java/com/dgtly/web/controller/system/AlertUpvoteLogController.java

@@ -0,0 +1,125 @@
+package com.dgtly.web.controller.system;
+
+import java.util.List;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import com.dgtly.common.annotation.Log;
+import com.dgtly.common.enums.BusinessType;
+import com.dgtly.system.domain.AlertUpvoteLog;
+import com.dgtly.system.service.IAlertUpvoteLogService;
+import com.dgtly.common.core.controller.BaseController;
+import com.dgtly.common.core.domain.AjaxResult;
+import com.dgtly.common.utils.poi.ExcelUtil;
+import com.dgtly.common.core.page.TableDataInfo;
+
+/**
+ * 弹框点赞日志Controller
+ * 
+ * @author dgtlc
+ * @date 2024-12-24
+ */
+@Controller
+@RequestMapping("/system/upvoteLog")
+public class AlertUpvoteLogController extends BaseController
+{
+    private String prefix = "system/upvoteLog";
+
+    @Autowired
+    private IAlertUpvoteLogService alertUpvoteLogService;
+
+    @RequiresPermissions("system:upvoteLog:view")
+    @GetMapping()
+    public String log()
+    {
+        return prefix + "/upvoteLog";
+    }
+
+    /**
+     * 查询弹框点赞日志列表
+     */
+    @RequiresPermissions("system:upvoteLog:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(AlertUpvoteLog alertUpvoteLog)
+    {
+        startPage();
+        List<AlertUpvoteLog> list = alertUpvoteLogService.selectAlertUpvoteLogList(alertUpvoteLog);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出弹框点赞日志列表
+     */
+    @RequiresPermissions("system:upvoteLog:export")
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(AlertUpvoteLog alertUpvoteLog)
+    {
+        List<AlertUpvoteLog> list = alertUpvoteLogService.selectAlertUpvoteLogList(alertUpvoteLog);
+        ExcelUtil<AlertUpvoteLog> util = new ExcelUtil<AlertUpvoteLog>(AlertUpvoteLog.class);
+        return util.exportExcel(list, "log");
+    }
+
+    /**
+     * 新增弹框点赞日志
+     */
+    @GetMapping("/add")
+    public String add()
+    {
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存弹框点赞日志
+     */
+    @RequiresPermissions("system:upvoteLog:add")
+    @Log(title = "弹框点赞日志", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(AlertUpvoteLog alertUpvoteLog)
+    {
+        return toAjax(alertUpvoteLogService.insertAlertUpvoteLog(alertUpvoteLog));
+    }
+
+    /**
+     * 修改弹框点赞日志
+     */
+    @GetMapping("/edit/{alertUpvoteId}")
+    public String edit(@PathVariable("alertUpvoteId") Long alertUpvoteId, ModelMap mmap)
+    {
+        AlertUpvoteLog alertUpvoteLog = alertUpvoteLogService.selectAlertUpvoteLogById(alertUpvoteId);
+        mmap.put("alertUpvoteLog", alertUpvoteLog);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存弹框点赞日志
+     */
+    @RequiresPermissions("system:upvoteLog:edit")
+    @Log(title = "弹框点赞日志", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(AlertUpvoteLog alertUpvoteLog)
+    {
+        return toAjax(alertUpvoteLogService.updateAlertUpvoteLog(alertUpvoteLog));
+    }
+
+    /**
+     * 删除弹框点赞日志
+     */
+    @RequiresPermissions("system:upvoteLog:remove")
+    @Log(title = "弹框点赞日志", businessType = BusinessType.DELETE)
+    @PostMapping( "/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids)
+    {
+        return toAjax(alertUpvoteLogService.deleteAlertUpvoteLogByIds(ids));
+    }
+}

+ 3 - 0
suishenbang-admin/src/main/resources/templates/system/alertConfiguration/configuration.html

@@ -176,6 +176,9 @@
                         if (value.indexOf('0') != -1) {
                             return '立邦员工';
                         }
+                        if (value.indexOf('3') != -1) {
+                            return '其他';
+                        }
                     }
                 },
                     {

+ 47 - 0
suishenbang-admin/src/main/resources/templates/system/upvoteLog/add.html

@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新增弹框点赞日志')" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-log-add">
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">弹框配置id:</label>
+                <div class="col-sm-8">
+                    <input name="alertId" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">用户id:</label>
+                <div class="col-sm-8">
+                    <input name="userId" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">点赞状态。0: 无;1:赞;2:踩:</label>
+                <div class="col-sm-8">
+                    <div class="radio-box">
+                        <input type="radio" name="status" value="">
+                        <label th:for="status" th:text="未知"></label>
+                    </div>
+                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script type="text/javascript">
+        var prefix = ctx + "system/log"
+        $("#form-log-add").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/add", $('#form-log-add').serialize());
+            }
+        }
+    </script>
+</body>
+</html>

+ 48 - 0
suishenbang-admin/src/main/resources/templates/system/upvoteLog/edit.html

@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('修改弹框点赞日志')" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-log-edit" th:object="${alertUpvoteLog}">
+            <input name="alertUpvoteId" th:field="*{alertUpvoteId}" type="hidden">
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">弹框配置id:</label>
+                <div class="col-sm-8">
+                    <input name="alertId" th:field="*{alertId}" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">用户id:</label>
+                <div class="col-sm-8">
+                    <input name="userId" th:field="*{userId}" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">点赞状态。0: 无;1:赞;2:踩:</label>
+                <div class="col-sm-8">
+                    <div class="radio-box">
+                        <input type="radio" name="status" value="">
+                        <label th:for="status" th:text="未知"></label>
+                    </div>
+                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script type="text/javascript">
+        var prefix = ctx + "system/log";
+        $("#form-log-edit").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/edit", $('#form-log-edit').serialize());
+            }
+        }
+    </script>
+</body>
+</html>

+ 108 - 0
suishenbang-admin/src/main/resources/templates/system/upvoteLog/upvoteLog.html

@@ -0,0 +1,108 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('弹框点赞日志列表')" />
+</head>
+<body class="gray-bg">
+     <div class="container-div">
+        <div class="row">
+            <div class="col-sm-12 search-collapse">
+                <form id="formId">
+                    <div class="select-list">
+                        <ul>
+                            <li>
+                                <p>弹框配置id:</p>
+                                <input type="text" name="alertId"/>
+                            </li>
+                            <li>
+                                <p>用户id:</p>
+                                <input type="text" name="userId"/>
+                            </li>
+                            <li>
+                                <p>点赞状态。0: 无;1:赞;2:踩:</p>
+                                <select name="status">
+                                    <option value="">所有</option>
+                                </select>
+                            </li>
+                            <li>
+                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                            </li>
+                        </ul>
+                    </div>
+                </form>
+            </div>
+
+            <div class="btn-group-sm" id="toolbar" role="group">
+                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:log:add">
+                    <i class="fa fa-plus"></i> 添加
+                </a>
+                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:log:edit">
+                    <i class="fa fa-edit"></i> 修改
+                </a>
+                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:log:remove">
+                    <i class="fa fa-remove"></i> 删除
+                </a>
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:log:export">
+                    <i class="fa fa-download"></i> 导出
+                 </a>
+            </div>
+            <div class="col-sm-12 select-table table-striped">
+                <table id="bootstrap-table"></table>
+            </div>
+        </div>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var editFlag = [[${@permission.hasPermi('system:log:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('system:log:remove')}]];
+        var prefix = ctx + "system/upvoteLog";
+
+        $(function() {
+            var options = {
+                url: prefix + "/list",
+                createUrl: prefix + "/add",
+                updateUrl: prefix + "/edit/{id}",
+                removeUrl: prefix + "/remove",
+                exportUrl: prefix + "/export",
+                modalName: "弹框点赞日志",
+                columns: [{
+                    checkbox: true
+                },
+                {
+                    field : 'alertUpvoteId', 
+                    title : 'id',
+                    visible: false
+                },
+                {
+                    field : 'alertId', 
+                    title : '弹框配置id'
+                },
+                {
+                    field : 'isDelete', 
+                    title : '是否删除'
+                },
+                {
+                    field : 'userId', 
+                    title : '用户id'
+                },
+                {
+                    field : 'status', 
+                    title : '点赞状态。0: 无;1:赞;2:踩'
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        var actions = [];
+                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.alertUpvoteId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.alertUpvoteId + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        return actions.join('');
+                    }
+                }]
+            };
+            $.table.init(options);
+        });
+    </script>
+</body>
+</html>

+ 95 - 0
suishenbang-system/src/main/java/com/dgtly/system/domain/AlertUpvoteLog.java

@@ -0,0 +1,95 @@
+package com.dgtly.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.dgtly.common.annotation.Excel;
+import com.dgtly.common.core.domain.BaseEntity;
+
+/**
+ * 弹框点赞日志对象 alert_upvote_log
+ * 
+ * @author dgtly
+ * @date 2024-12-24
+ */
+public class AlertUpvoteLog extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long alertUpvoteId;
+
+    /** 弹框配置id */
+    @Excel(name = "弹框配置id")
+    private Long alertId;
+
+    /** 是否删除 */
+    @Excel(name = "是否删除")
+    private Long isDelete;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 点赞状态。0: 无;1:赞;2:踩 */
+    @Excel(name = "点赞状态。0: 无;1:赞;2:踩")
+    private Integer status;
+
+    public void setAlertUpvoteId(Long alertUpvoteId) 
+    {
+        this.alertUpvoteId = alertUpvoteId;
+    }
+
+    public Long getAlertUpvoteId() 
+    {
+        return alertUpvoteId;
+    }
+    public void setAlertId(Long alertId) 
+    {
+        this.alertId = alertId;
+    }
+
+    public Long getAlertId() {
+        return alertId;
+    }
+
+    public Long getIsDelete() {
+        return isDelete;
+    }
+
+    public void setIsDelete(Long isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getUserId()
+    {
+        return userId;
+    }
+    public void setStatus(Integer status) 
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus() 
+    {
+        return status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("alertUpvoteId", getAlertUpvoteId())
+            .append("alertId", getAlertId())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("isDelete", getIsDelete())
+            .append("userId", getUserId())
+            .append("status", getStatus())
+            .toString();
+    }
+}

+ 74 - 0
suishenbang-system/src/main/java/com/dgtly/system/mapper/AlertUpvoteLogMapper.java

@@ -0,0 +1,74 @@
+package com.dgtly.system.mapper;
+
+import com.dgtly.system.domain.AlertUpvoteLog;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 弹框点赞日志Mapper接口
+ * 
+ * @author dgtlc
+ * @date 2024-12-24
+ */
+public interface AlertUpvoteLogMapper 
+{
+    /**
+     * 查询弹框点赞日志
+     * 
+     * @param alertUpvoteId 弹框点赞日志ID
+     * @return 弹框点赞日志
+     */
+    public AlertUpvoteLog selectAlertUpvoteLogById(Long alertUpvoteId);
+
+    /**
+     * 查询弹框点赞日志列表
+     * 
+     * @param alertUpvoteLog 弹框点赞日志
+     * @return 弹框点赞日志集合
+     */
+    public List<AlertUpvoteLog> selectAlertUpvoteLogList(AlertUpvoteLog alertUpvoteLog);
+
+    /**
+     * 新增弹框点赞日志
+     * 
+     * @param alertUpvoteLog 弹框点赞日志
+     * @return 结果
+     */
+    public int insertAlertUpvoteLog(AlertUpvoteLog alertUpvoteLog);
+
+    /**
+     * 修改弹框点赞日志
+     * 
+     * @param alertUpvoteLog 弹框点赞日志
+     * @return 结果
+     */
+    public int updateAlertUpvoteLog(AlertUpvoteLog alertUpvoteLog);
+
+    /**
+     * 删除弹框点赞日志
+     * 
+     * @param alertUpvoteId 弹框点赞日志ID
+     * @return 结果
+     */
+    public int deleteAlertUpvoteLogById(Long alertUpvoteId);
+
+    /**
+     * 批量删除弹框点赞日志
+     * 
+     * @param alertUpvoteIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteAlertUpvoteLogByIds(String[] alertUpvoteIds);
+
+
+    /**
+     * @description: 根据用户ID、弹框ID查询是否有记录
+     * @param userId 用户ID
+     * @param alertId 弹框ID
+     * @return com.dgtly.system.domain.AlertUpvoteLog
+     * @author lc
+     * @date 2024-12-25 11:12
+     */
+    public AlertUpvoteLog selectUpvoteByUidAndAid(@Param("userId") Long userId, @Param("alertId")Long alertId);
+}

+ 71 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/IAlertUpvoteLogService.java

@@ -0,0 +1,71 @@
+package com.dgtly.system.service;
+
+import com.dgtly.system.domain.AlertUpvoteLog;
+import java.util.List;
+
+/**
+ * 弹框点赞日志Service接口
+ * 
+ * @author dgtlc
+ * @date 2024-12-24
+ */
+public interface IAlertUpvoteLogService 
+{
+    /**
+     * 查询弹框点赞日志
+     * 
+     * @param alertUpvoteId 弹框点赞日志ID
+     * @return 弹框点赞日志
+     */
+    public AlertUpvoteLog selectAlertUpvoteLogById(Long alertUpvoteId);
+
+    /**
+     * 查询弹框点赞日志列表
+     * 
+     * @param alertUpvoteLog 弹框点赞日志
+     * @return 弹框点赞日志集合
+     */
+    public List<AlertUpvoteLog> selectAlertUpvoteLogList(AlertUpvoteLog alertUpvoteLog);
+
+    /**
+     * 新增弹框点赞日志
+     * 
+     * @param alertUpvoteLog 弹框点赞日志
+     * @return 结果
+     */
+    public int insertAlertUpvoteLog(AlertUpvoteLog alertUpvoteLog);
+
+    /**
+     * 修改弹框点赞日志
+     * 
+     * @param alertUpvoteLog 弹框点赞日志
+     * @return 结果
+     */
+    public int updateAlertUpvoteLog(AlertUpvoteLog alertUpvoteLog);
+
+    /**
+     * 批量删除弹框点赞日志
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteAlertUpvoteLogByIds(String ids);
+
+    /**
+     * 删除弹框点赞日志信息
+     * 
+     * @param alertUpvoteId 弹框点赞日志ID
+     * @return 结果
+     */
+    public int deleteAlertUpvoteLogById(Long alertUpvoteId);
+
+    /**
+    * @description: 根据用户ID、弹框ID查询是否有记录
+    * @param userId 用户ID
+	* @param alertId 弹框ID
+    * @return com.dgtly.system.domain.AlertUpvoteLog
+    * @author lc
+    * @date 2024-12-25 11:12
+    */
+    public AlertUpvoteLog selectUpvoteByUidAndAid(Long userId,Long alertId);
+}

+ 2 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/impl/AlertConfigurationServiceImpl.java

@@ -38,7 +38,9 @@ public class AlertConfigurationServiceImpl implements IAlertConfigurationService
     @Override
     public AlertConfiguration selectAlertConfigurationByAlertStatus(String userType,String salesLevel,String orgCode) {
         List<AlertConfiguration> alertConfigurationList = alertConfigurationMapper.selectAlertConfigurationByAlertStatus(userType);
+        // todo
         if(alertConfigurationList !=null && alertConfigurationList.size()> 0 ){
+            // todo 通知类型
             Iterator<AlertConfiguration> it = alertConfigurationList.iterator();
             while (it.hasNext()) {
                 AlertConfiguration alert = it.next();

+ 110 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/impl/AlertUpvoteLogServiceImpl.java

@@ -0,0 +1,110 @@
+package com.dgtly.system.service.impl;
+
+import java.util.List;
+import com.dgtly.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.dgtly.system.mapper.AlertUpvoteLogMapper;
+import com.dgtly.system.domain.AlertUpvoteLog;
+import com.dgtly.system.service.IAlertUpvoteLogService;
+import com.dgtly.common.core.text.Convert;
+
+/**
+ * 弹框点赞日志Service业务层处理
+ * 
+ * @author dgtlc
+ * @date 2024-12-24
+ */
+@Service
+public class AlertUpvoteLogServiceImpl implements IAlertUpvoteLogService 
+{
+    @Autowired
+    private AlertUpvoteLogMapper alertUpvoteLogMapper;
+
+    /**
+     * 查询弹框点赞日志
+     * 
+     * @param alertUpvoteId 弹框点赞日志ID
+     * @return 弹框点赞日志
+     */
+    @Override
+    public AlertUpvoteLog selectAlertUpvoteLogById(Long alertUpvoteId)
+    {
+        return alertUpvoteLogMapper.selectAlertUpvoteLogById(alertUpvoteId);
+    }
+
+    /**
+     * 查询弹框点赞日志列表
+     * 
+     * @param alertUpvoteLog 弹框点赞日志
+     * @return 弹框点赞日志
+     */
+    @Override
+    public List<AlertUpvoteLog> selectAlertUpvoteLogList(AlertUpvoteLog alertUpvoteLog)
+    {
+        return alertUpvoteLogMapper.selectAlertUpvoteLogList(alertUpvoteLog);
+    }
+
+    /**
+     * 新增弹框点赞日志
+     * 
+     * @param alertUpvoteLog 弹框点赞日志
+     * @return 结果
+     */
+    @Override
+    public int insertAlertUpvoteLog(AlertUpvoteLog alertUpvoteLog)
+    {
+        alertUpvoteLog.setCreateTime(DateUtils.getNowDate());
+        return alertUpvoteLogMapper.insertAlertUpvoteLog(alertUpvoteLog);
+    }
+
+    /**
+     * 修改弹框点赞日志
+     * 
+     * @param alertUpvoteLog 弹框点赞日志
+     * @return 结果
+     */
+    @Override
+    public int updateAlertUpvoteLog(AlertUpvoteLog alertUpvoteLog)
+    {
+        alertUpvoteLog.setUpdateTime(DateUtils.getNowDate());
+        return alertUpvoteLogMapper.updateAlertUpvoteLog(alertUpvoteLog);
+    }
+
+    /**
+     * 删除弹框点赞日志对象
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteAlertUpvoteLogByIds(String ids)
+    {
+        return alertUpvoteLogMapper.deleteAlertUpvoteLogByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除弹框点赞日志信息
+     * 
+     * @param alertUpvoteId 弹框点赞日志ID
+     * @return 结果
+     */
+    @Override
+    public int deleteAlertUpvoteLogById(Long alertUpvoteId)
+    {
+        return alertUpvoteLogMapper.deleteAlertUpvoteLogById(alertUpvoteId);
+    }
+
+    /**
+     * @description: 根据用户ID、弹框ID查询是否有记录
+     * @param userId 用户ID
+     * @param alertId 弹框ID
+     * @return com.dgtly.system.domain.AlertUpvoteLog
+     * @author lc
+     * @date 2024-12-25 11:12
+     */
+    @Override
+    public AlertUpvoteLog selectUpvoteByUidAndAid(Long userId, Long alertId) {
+        return alertUpvoteLogMapper.selectUpvoteByUidAndAid(userId, alertId);
+    }
+}

+ 92 - 0
suishenbang-system/src/main/resources/mapper/system/AlertUpvoteLogMapper.xml

@@ -0,0 +1,92 @@
+<?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.dgtly.system.mapper.AlertUpvoteLogMapper">
+    
+    <resultMap type="AlertUpvoteLog" id="AlertUpvoteLogResult">
+        <result property="alertUpvoteId"    column="alert_upvote_id"    />
+        <result property="alertId"    column="alert_id"    />
+        <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="isDelete"    column="is_delete"    />
+        <result property="userId"    column="user_id"    />
+        <result property="status"    column="status"    />
+    </resultMap>
+
+    <sql id="selectAlertUpvoteLogVo">
+        select alert_upvote_id, alert_id, create_by, create_time, update_by, update_time, is_delete, user_id, status from alert_upvote_log
+    </sql>
+
+    <select id="selectAlertUpvoteLogList" parameterType="AlertUpvoteLog" resultMap="AlertUpvoteLogResult">
+        <include refid="selectAlertUpvoteLogVo"/>
+        <where>  
+            <if test="alertId != null "> and alert_id = #{alertId}</if>
+            <if test="isDelete != null "> and is_delete = #{isDelete}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="status != null "> and status = #{status}</if>
+        </where>
+    </select>
+    
+    <select id="selectAlertUpvoteLogById" parameterType="Long" resultMap="AlertUpvoteLogResult">
+        <include refid="selectAlertUpvoteLogVo"/>
+        where alert_upvote_id = #{alertUpvoteId}
+    </select>
+        
+    <insert id="insertAlertUpvoteLog" parameterType="AlertUpvoteLog" useGeneratedKeys="true" keyProperty="alertUpvoteId">
+        insert into alert_upvote_log
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="alertId != null ">alert_id,</if>
+            <if test="createBy != null  and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null  and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
+            <if test="isDelete != null ">is_delete,</if>
+            <if test="userId != null ">user_id,</if>
+            <if test="status != null ">status,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="alertId != null ">#{alertId},</if>
+            <if test="createBy != null  and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null  and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
+            <if test="isDelete != null ">#{isDelete},</if>
+            <if test="userId != null ">#{userId},</if>
+            <if test="status != null ">#{status},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAlertUpvoteLog" parameterType="AlertUpvoteLog">
+        update alert_upvote_log
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="alertId != null ">alert_id = #{alertId},</if>
+            <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null  and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
+            <if test="isDelete != null ">is_delete = #{isDelete},</if>
+            <if test="userId != null ">user_id = #{userId},</if>
+            <if test="status != null ">status = #{status},</if>
+        </trim>
+        where alert_upvote_id = #{alertUpvoteId}
+    </update>
+
+    <delete id="deleteAlertUpvoteLogById" parameterType="Long">
+        delete from alert_upvote_log where alert_upvote_id = #{alertUpvoteId}
+    </delete>
+
+    <delete id="deleteAlertUpvoteLogByIds" parameterType="String">
+        delete from alert_upvote_log where alert_upvote_id in 
+        <foreach item="alertUpvoteId" collection="array" open="(" separator="," close=")">
+            #{alertUpvoteId}
+        </foreach>
+    </delete>
+
+    <select id="selectUpvoteByUidAndAid" parameterType="Long" resultMap="AlertUpvoteLogResult">
+        <include refid="selectAlertUpvoteLogVo"/>
+        where user_id = #{userId} and alert_id = #{alertId}
+    </select>
+</mapper>

+ 33 - 5
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxAlertLogController.java

@@ -7,12 +7,11 @@ import com.dgtly.common.core.domain.AjaxResult;
 import com.dgtly.common.core.domain.ParameterObject;
 import com.dgtly.system.domain.AlertConfiguration;
 import com.dgtly.system.domain.AlertLog;
+import com.dgtly.system.domain.AlertUpvoteLog;
 import com.dgtly.system.domain.SysUserExt;
-import com.dgtly.system.service.IAlertConfigurationService;
-import com.dgtly.system.service.IAlertLogService;
-import com.dgtly.system.service.ISysUserExtService;
-import com.dgtly.system.service.ISysUserService;
+import com.dgtly.system.service.*;
 import io.swagger.annotations.*;
+import net.sf.jsqlparser.statement.select.Select;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -45,6 +44,8 @@ public class WxAlertLogController  extends ApiBaseController {
     private ISysUserExtService sysUserExtService;
     @Autowired
     private IAlertConfigurationService alertConfigurationService;
+    @Autowired
+    private IAlertUpvoteLogService alertUpvoteLogService;
 
 
     @ApiOperation(value = "微信弹框",notes = "参数:{userId:1}")
@@ -58,7 +59,7 @@ public class WxAlertLogController  extends ApiBaseController {
         Long userId = Long.valueOf(obj.getString("userId"));
         SysUserExt sysUserExt = sysUserExtService.selectSysUserExtById(userId);
         String salesLevel = sysUserExt.getSalesLevel();
-        if(("customer_level").equals(salesLevel) ){
+        if(("customer_level").equals(salesLevel)||("reseller_level").equals(salesLevel) ){
             userType = "1";
         }else{
             userType = "0";
@@ -239,4 +240,31 @@ public class WxAlertLogController  extends ApiBaseController {
     }
 
 
+    @ApiOperation(value = "点赞状态",notes = "参数:{userId:1,alertId:1,status:1}")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body")
+    })
+    @PostMapping("/getUpvoteStatus")
+    public Object getUpvoteStatus() throws ParseException {
+        ParameterObject obj = getParameterObject();
+        Long userId = Long.valueOf(obj.getString("userId"));//用户ID
+        Long alertId = Long.valueOf(obj.getString("alertId"));//弹框ID
+        Integer status = Integer.valueOf(obj.getString("status"));//弹框ID
+        //根据用户ID、弹框ID查询是否有记录,,没有新增记录
+        AlertUpvoteLog alertUpvoteLog = alertUpvoteLogService.selectUpvoteByUidAndAid(userId, alertId);
+        if (alertUpvoteLog!=null){
+            //如果有 修改记录
+            alertUpvoteLog.setStatus(status);
+            int i = alertUpvoteLogService.updateAlertUpvoteLog(alertUpvoteLog);
+            return AjaxResult.success(alertUpvoteLog);
+        }else {
+            //没有新增记录
+            AlertUpvoteLog upvoteLog = new AlertUpvoteLog();
+            upvoteLog.setUserId(userId);
+            upvoteLog.setAlertId(alertId);
+            upvoteLog.setStatus(status);
+            int i = alertUpvoteLogService.insertAlertUpvoteLog(upvoteLog);
+            return AjaxResult.success(upvoteLog);
+        }
+    }
 }