Browse Source

Merge remote-tracking branch 'origin/cyn' into prd

njs 1 year ago
parent
commit
be75e6fd1e
21 changed files with 1630 additions and 0 deletions
  1. 146 0
      suishenbang-admin/src/main/java/com/dgtly/web/controller/system/AlertConfigurationController.java
  2. 1 0
      suishenbang-admin/src/main/java/com/dgtly/web/controller/system/SysRidingLanternController.java
  3. 99 0
      suishenbang-admin/src/main/resources/templates/system/alertConfiguration/add.html
  4. 170 0
      suishenbang-admin/src/main/resources/templates/system/alertConfiguration/configuration.html
  5. 100 0
      suishenbang-admin/src/main/resources/templates/system/alertConfiguration/edit.html
  6. 1 0
      suishenbang-admin/src/main/resources/templates/system/lantern/add.html
  7. 2 0
      suishenbang-common/src/main/java/com/dgtly/common/core/controller/BaseController.java
  8. 8 0
      suishenbang-common/src/main/java/com/dgtly/common/core/domain/AjaxResult.java
  9. 2 0
      suishenbang-common/src/main/java/com/dgtly/common/core/domain/ResultType.java
  10. 1 0
      suishenbang-order/src/main/java/com/dgtly/order/controller/SalesOrderBaseController.java
  11. 139 0
      suishenbang-system/src/main/java/com/dgtly/system/domain/AlertConfiguration.java
  12. 126 0
      suishenbang-system/src/main/java/com/dgtly/system/domain/AlertLog.java
  13. 66 0
      suishenbang-system/src/main/java/com/dgtly/system/mapper/AlertConfigurationMapper.java
  14. 68 0
      suishenbang-system/src/main/java/com/dgtly/system/mapper/AlertLogMapper.java
  15. 66 0
      suishenbang-system/src/main/java/com/dgtly/system/service/IAlertConfigurationService.java
  16. 66 0
      suishenbang-system/src/main/java/com/dgtly/system/service/IAlertLogService.java
  17. 105 0
      suishenbang-system/src/main/java/com/dgtly/system/service/impl/AlertConfigurationServiceImpl.java
  18. 108 0
      suishenbang-system/src/main/java/com/dgtly/system/service/impl/AlertLogServiceImpl.java
  19. 119 0
      suishenbang-system/src/main/resources/mapper/system/AlertConfigurationMapper.xml
  20. 111 0
      suishenbang-system/src/main/resources/mapper/system/AlertLogMapper.xml
  21. 126 0
      suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxAlertLogController.java

+ 146 - 0
suishenbang-admin/src/main/java/com/dgtly/web/controller/system/AlertConfigurationController.java

@@ -0,0 +1,146 @@
+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.AlertConfiguration;
+import com.dgtly.system.service.IAlertConfigurationService;
+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 chenyn
+ * @date 2023-06-13
+ */
+@Controller
+@RequestMapping("/system/configuration")
+public class AlertConfigurationController extends BaseController
+{
+    //前端代码路径
+    private String prefix = "system/alertConfiguration";
+
+    @Autowired
+    private IAlertConfigurationService alertConfigurationService;
+
+    @RequiresPermissions("system:configuration:view")
+    @GetMapping()
+    public String configuration()
+    {
+        return prefix + "/configuration";
+    }
+
+    /**
+     * 查询弹框配置列表
+     */
+    @RequiresPermissions("system:configuration:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(AlertConfiguration alertConfiguration)
+    {
+        startPage();
+        List<AlertConfiguration> list = alertConfigurationService.selectAlertConfigurationList(alertConfiguration);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出弹框配置列表
+     */
+    @RequiresPermissions("system:configuration:export")
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(AlertConfiguration alertConfiguration)
+    {
+        List<AlertConfiguration> list = alertConfigurationService.selectAlertConfigurationList(alertConfiguration);
+        ExcelUtil<AlertConfiguration> util = new ExcelUtil<AlertConfiguration>(AlertConfiguration.class);
+        return util.exportExcel(list, "configuration");
+    }
+
+    /**
+     * 新增弹框配置
+     */
+    @GetMapping("/add")
+    public String add()
+    {
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存弹框配置
+     */
+    @RequiresPermissions("system:configuration:add")
+    @Log(title = "弹框配置", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(AlertConfiguration alertConfiguration)
+    {
+        int num = alertConfigurationService.selectAlertConfigurationListFilter();
+        if (alertConfiguration.getAlertStatus().equals("1")&&num==1){
+            return error("弹幕通知只能有一个启动,请修改后重新添加");
+        }
+        return toAjax(alertConfigurationService.insertAlertConfiguration(alertConfiguration));
+    }
+
+    /**
+     * 修改弹框配置
+     */
+    @GetMapping("/edit/{alertId}")
+    public String edit(@PathVariable("alertId") Long alertId, ModelMap mmap)
+    {
+        AlertConfiguration alertConfiguration = alertConfigurationService.selectAlertConfigurationById(alertId);
+        mmap.put("alertConfiguration", alertConfiguration);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存弹框配置
+     */
+    @RequiresPermissions("system:configuration:edit")
+    @Log(title = "弹框配置", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(AlertConfiguration alertConfiguration)
+    {
+        //没改之前的配置
+        AlertConfiguration alertConfiguration1 = alertConfigurationService.selectAlertConfigurationById(alertConfiguration.getAlertId());
+        //判断之前有没有
+        int num = alertConfigurationService.selectAlertConfigurationListFilter();
+        if(num==1){
+            if (alertConfiguration1.getAlertStatus().equals("1")){
+                return toAjax(alertConfigurationService.updateAlertConfiguration(alertConfiguration));
+            }else {
+                if (alertConfiguration.getAlertStatus().equals("1")){
+                    return AjaxResult.error("列表中只能有一条日志配置启动");
+                }else {
+                    return toAjax(alertConfigurationService.updateAlertConfiguration(alertConfiguration));
+                }
+            }
+        }else {
+            return toAjax(alertConfigurationService.updateAlertConfiguration(alertConfiguration));
+        }
+    }
+
+    /**
+     * 删除弹框配置
+     */
+    @RequiresPermissions("system:configuration:remove")
+    @Log(title = "弹框配置", businessType = BusinessType.DELETE)
+    @PostMapping( "/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids)
+    {
+        return toAjax(alertConfigurationService.deleteAlertConfigurationByIds(ids));
+    }
+}

+ 1 - 0
suishenbang-admin/src/main/java/com/dgtly/web/controller/system/SysRidingLanternController.java

@@ -121,6 +121,7 @@ public class SysRidingLanternController extends BaseController
     @ResponseBody
     public AjaxResult editSave(SysRidingLantern sysRidingLantern)
     {
+        sysRidingLantern.getUserType();
         return toAjax(sysRidingLanternService.updateSysRidingLantern(sysRidingLantern));
     }
 

+ 99 - 0
suishenbang-admin/src/main/resources/templates/system/alertConfiguration/add.html

@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新增弹框配置')" />
+    <th:block th:include="include :: datetimepicker-css" />
+    <th:block th:include="include :: bootstrap-select-css" />
+</head>
+<body class="white-bg">
+<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+    <form class="form-horizontal m" id="form-configuration-add">
+        <div class="form-group">
+            <label class="col-sm-3 control-label">弹框内容:</label>
+            <div class="col-sm-8">
+                <textarea name="alertContent" class="form-control"></textarea>
+            </div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-3 control-label">弹框开始时间:</label>
+            <div class="col-sm-8">
+                <div class="input-group date">
+                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                    <input name="alertStartTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
+                </div>
+            </div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-3 control-label">弹框结束时间:</label>
+            <div class="col-sm-8">
+                <div class="input-group date">
+                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                    <input name="alertEndTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
+                </div>
+            </div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-3 control-label">弹框每日可弹次数:</label>
+            <div class="col-sm-8">
+                <input name="alertNum" class="form-control" type="text">
+            </div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-3 control-label">用户类型:</label>
+            <div class="col-sm-8">
+                <select title="请选择" id="userType" name="userType" class="form-control m-b selectpicker" th:with="type=${@dict.getType('sys_lantern_permission')}" multiple>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                </select>
+            </div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-3 control-label">是否启动:</label>
+            <div class="col-sm-8">
+                <div class="radio-box" th:each="dict : ${@dict.getType('sys_ziti_show_hide')}">
+                    <input type="radio" th:id="${dict.dictCode}" name="alertStatus" th:value="${dict.dictValue}"
+                           th:checked="${dict.default}">
+                    <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
+                </div>
+            </div>
+        </div>
+        <!--<div class="form-group">-->
+            <!--<label class="col-sm-3 control-label">是否启动</label>-->
+            <!--<div class="col-sm-8">-->
+                <!--<label class="radio-box">-->
+                    <!--<input type="radio" name="alertStatus" value="0">未启动-->
+                <!--</label>-->
+                <!--<label class="radio-box">-->
+                    <!--<input type="radio" name="alertStatus" value="1">启动-->
+                <!--</label>-->
+                <!--<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" />
+<th:block th:include="include :: datetimepicker-js" />
+<th:block th:include="include :: bootstrap-select-js" />
+<script type="text/javascript">
+    var prefix = ctx + "system/configuration"
+    $("#form-configuration-add").validate({
+        focusCleanup: true
+    });
+
+    function submitHandler() {
+        if ($.validate.form()) {
+            $.operate.save(prefix + "/add", $('#form-configuration-add').serialize());
+        }
+    }
+
+    $("input[name='alertStartTime']").datetimepicker({
+        format: "yyyy-mm-dd hh:ii",
+        autoclose: true
+    });
+
+    $("input[name='alertEndTime']").datetimepicker({
+        format: "yyyy-mm-dd hh:ii",
+        autoclose: true
+    });
+</script>
+</body>
+</html>

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

@@ -0,0 +1,170 @@
+<!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>弹框内容:</p>
+                                <input type="text" name="alertContent"/>
+                            </li>
+                            <li class="select-time">
+                                <p>弹框开始时间:</p>
+                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="alertStartTime"/>
+
+                            </li>
+                            <li class="select-time">
+                                <p>弹框结束时间:</p>
+                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="alertEndTime"/>
+                            </li>
+                            <li>
+                                <p>用户类型</p>
+                                <select name="userType" th:with="type=${@dict.getType('sys_lantern_permission')}">
+                                    <option value="">所有</option>
+                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                                </select>
+                            </li>
+                            <li>
+                                <p>是否启动</p>
+                                <select name="alertStatus">
+                                    <option value="">所有</option>
+                                    <option value="0">未启动</option>
+                                    <option value="1">启动</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:configuration:add">
+                    <i class="fa fa-plus"></i> 添加
+                </a>
+                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:configuration:edit">
+                    <i class="fa fa-edit"></i> 修改
+                </a>
+                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:configuration:remove">
+                    <i class="fa fa-remove"></i> 删除
+                </a>
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:configuration: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:configuration:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('system:configuration:remove')}]];
+        var prefix = ctx + "system/configuration";
+
+        $(function() {
+            var options = {
+                url: prefix + "/list",
+                createUrl: prefix + "/add",
+                updateUrl: prefix + "/edit/{id}",
+                removeUrl: prefix + "/remove",
+                exportUrl: prefix + "/export",
+                modalName: "弹框配置",
+                columns: [
+                {
+                    field : 'alertId', 
+                    title : 'id',
+                    visible: false
+                },
+                {
+                    field : 'alertContent', 
+                    title : '弹框内容',
+                    width : '300px',
+                    formatter: function(value, row, index) {
+                        return $.table.tooltip(value);
+                    }
+                },
+                {
+                    field : 'alertStartTime', 
+                    title : '弹框开始时间'
+                },
+                {
+                    field : 'alertEndTime', 
+                    title : '弹框结束时间'
+                },
+                {
+                    field : 'alertNum', 
+                    title : '弹框每日可弹次数'
+                },
+                {
+                    field : 'userType',
+                    title : '用户类型',
+                    formatter: function(value, row, index) {
+                        if (value.indexOf('1') != -1 && value.indexOf('0') != -1){
+                            return '立邦人员、经销商';
+                        }
+                        if (value.indexOf('1') != -1 && value.indexOf('0') == -1) {
+                            return '经销商';
+                        }
+                        if (value.indexOf('1') == -1 && value.indexOf('0') != -1) {
+                            return '立邦人员';
+                        }
+                    }
+                },
+                    {
+                        visible: editFlag == 'hidden' ? false : true,
+                        title: '是否启动',
+                        align: 'center',
+                        formatter: function (value, row, index) {
+                            return statusTools(row);
+                        }
+                    },
+                {
+                    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.alertId + '\')"><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.alertId + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        return actions.join('');
+                    }
+                }]
+            };
+            $.table.init(options);
+        });
+
+        /* 启动状态显示 */
+        function statusTools(row) {
+            if (row.alertStatus == 0) {
+                return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.alertId + '\')"></i> ';
+            } else {
+                return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.alertId + '\')"></i> ';
+            }
+        }
+
+        /* 停用 */
+        function disable(roleId) {
+            $.modal.confirm("确认关闭该通知吗?", function() {
+                $.operate.post(prefix + "/edit", { "alertId": roleId, "alertStatus": 0 });
+            })
+        }
+
+        /* 启用 */
+        function enable(roleId) {
+            $.modal.confirm("确认启用该通知吗?", function() {
+                $.operate.post(prefix + "/edit", { "alertId": roleId, "alertStatus": 1 });
+            })
+        }
+    </script>
+</body>
+</html>

+ 100 - 0
suishenbang-admin/src/main/resources/templates/system/alertConfiguration/edit.html

@@ -0,0 +1,100 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('修改弹框配置')" />
+    <th:block th:include="include :: datetimepicker-css" />
+    <th:block th:include="include :: bootstrap-select-css" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-configuration-edit" th:object="${alertConfiguration}">
+            <input name="alertId" th:field="*{alertId}" type="hidden">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">弹框内容:</label>
+                <div class="col-sm-8">
+                    <textarea name="alertContent" class="form-control">[[*{alertContent}]]</textarea>
+                </div>
+            </div>
+
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">弹框开始时间:</label>
+                <div class="col-sm-8">
+                    <div class="input-group date">
+                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                        <input name="alertStartTime" th:value="${#dates.format(alertConfiguration.alertStartTime, 'yyyy-MM-dd hh:mm')}" class="form-control" placeholder="yyyy-MM-dd hh:mm" type="text">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">弹框结束时间:</label>
+                <div class="col-sm-8">
+                    <div class="input-group date">
+                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                        <input name="alertEndTime" th:value="${#dates.format(alertConfiguration.alertEndTime, 'yyyy-MM-dd hh:mm')}" class="form-control" placeholder="yyyy-MM-dd hh:mm" type="text">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">弹框每日可弹次数:</label>
+                <div class="col-sm-8">
+                    <input name="alertNum" th:field="*{alertNum}" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">用户类型:</label>
+                <div class="col-sm-8">
+                    <select title="请选择" id="userType" name="userType" class="form-control m-b selectpicker" th:with="type=${@dict.getType('sys_lantern_permission')}" multiple>
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{userType}"></option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">是否启动:</label>
+                <div class="col-sm-8">
+                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_ziti_show_hide')}">
+                        <input type="radio" th:id="${dict.dictCode}" name="alertStatus" th:value="${dict.dictValue}"
+                               th:field="*{alertStatus}">
+                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
+                    </div>
+                </div>
+            </div>
+            <!--<div class="form-group">    -->
+                <!--<label class="col-sm-3 control-label">是否启动:</label>-->
+                <!--<div class="col-sm-8">-->
+                    <!--<label class="radio-box">-->
+                        <!--<input type="radio" name="alertStatus" value="0">未启动-->
+                    <!--</label>-->
+                    <!--<label class="radio-box">-->
+                        <!--<input type="radio" name="alertStatus" value="1">启动-->
+                    <!--</label>-->
+                <!--</div>-->
+            <!--</div>-->
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <th:block th:include="include :: datetimepicker-js" />
+    <th:block th:include="include :: bootstrap-select-js" />
+    <script type="text/javascript">
+        var prefix = ctx + "system/configuration";
+        $("#form-configuration-edit").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/edit", $('#form-configuration-edit').serialize());
+            }
+        }
+
+        $("input[name='alertStartTime']").datetimepicker({
+            format: "yyyy-mm-dd hh:ii",
+            autoclose: true
+        });
+
+        $("input[name='alertEndTime']").datetimepicker({
+            format: "yyyy-mm-dd hh:ii",
+            autoclose: true
+        });
+    </script>
+</body>
+</html>

+ 1 - 0
suishenbang-admin/src/main/resources/templates/system/lantern/add.html

@@ -26,6 +26,7 @@
                     <div class="input-group date">
                         <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                         <input name="startTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
+                        <!--<input name="startTime" th:value="${#dates.format(alertConfiguration.startTime, 'yyyy-MM-dd HH:mm')}" class="form-control" placeholder="yyyy-MM-dd HH:mm" type="text">-->
                     </div>
                 </div>
             </div>

+ 2 - 0
suishenbang-common/src/main/java/com/dgtly/common/core/controller/BaseController.java

@@ -114,6 +114,8 @@ public class BaseController
         return rows > 0 ? success() : error();
     }
 
+
+
     /**
      * 响应返回结果
      * 

+ 8 - 0
suishenbang-common/src/main/java/com/dgtly/common/core/domain/AjaxResult.java

@@ -130,6 +130,7 @@ public class AjaxResult
         a.msg=msg;
         return a;
     }
+
     /**
      * 返回成功消息
      *
@@ -152,6 +153,13 @@ public class AjaxResult
         return a;
     }
 
+    public static AjaxResult warning(String msg)
+    {
+        AjaxResult  a = new AjaxResult(ResultType.WARNING);
+        a.msg=msg;
+        return a;
+    }
+
     /**
      * 返回错误消息
      * 

+ 2 - 0
suishenbang-common/src/main/java/com/dgtly/common/core/domain/ResultType.java

@@ -9,6 +9,7 @@ public enum ResultType {
 
 
 
+
     /** 查询结果为空错误 */
     ,LESSPARAM(402,"缺少请求参数")
     /** 查询结果为空错误 */
@@ -29,6 +30,7 @@ public enum ResultType {
     ,NOLOGIN(506,"未登录")
     /** 缺少token */
     ,TOKENTIMEOUT(507,"token超时")
+    ,WARNING(203,"警告")
     ;
 
 

+ 1 - 0
suishenbang-order/src/main/java/com/dgtly/order/controller/SalesOrderBaseController.java

@@ -72,6 +72,7 @@ public class SalesOrderBaseController extends BaseController
     {
         List<SalesOrderBase> list = salesOrderBaseService.selectSalesOrderBaseList(salesOrderBase);
         if (list.size() >= 10000) {
+
             return new AjaxResult(301, "数据大于 10000 条Excel将无法打开,请过滤查询条件");
         }
         ExcelUtil<SalesOrderBase> util = new ExcelUtil<SalesOrderBase>(SalesOrderBase.class);

+ 139 - 0
suishenbang-system/src/main/java/com/dgtly/system/domain/AlertConfiguration.java

@@ -0,0 +1,139 @@
+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;
+import java.util.Date;
+
+/**
+ * 弹框配置对象 alert_configuration
+ * 
+ * @author chenyn
+ * @date 2023-06-13
+ */
+public class AlertConfiguration extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long alertId;
+
+    /** 是否删除 */
+    @Excel(name = "是否删除")
+    private Long isDelete;
+
+    /** 弹框内容 */
+    @Excel(name = "弹框内容")
+    private String alertContent;
+
+    /** 弹框开始时间 */
+    @Excel(name = "弹框开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
+    private Date alertStartTime;
+
+    /** 弹框结束时间 */
+    @Excel(name = "弹框结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
+    private Date alertEndTime;
+
+    /** 弹框每日可弹次数 */
+    @Excel(name = "弹框每日可弹次数")
+    private Long alertNum;
+
+    /** 用户类型默认0立邦员工1经销商 */
+    @Excel(name = "用户类型默认0立邦员工1经销商")
+    private String userType;
+
+    /** 是否启动默认0未启动,1启动 */
+    @Excel(name = "是否启动默认0未启动,1启动")
+    private String alertStatus;
+
+    public void setAlertId(Long alertId) 
+    {
+        this.alertId = alertId;
+    }
+
+    public Long getAlertId() 
+    {
+        return alertId;
+    }
+    public void setIsDelete(Long isDelete) 
+    {
+        this.isDelete = isDelete;
+    }
+
+    public Long getIsDelete() 
+    {
+        return isDelete;
+    }
+    public void setAlertContent(String alertContent) 
+    {
+        this.alertContent = alertContent;
+    }
+
+    public String getAlertContent() 
+    {
+        return alertContent;
+    }
+    public void setAlertStartTime(Date alertStartTime) 
+    {
+        this.alertStartTime = alertStartTime;
+    }
+
+    public Date getAlertStartTime() 
+    {
+        return alertStartTime;
+    }
+    public void setAlertEndTime(Date alertEndTime) 
+    {
+        this.alertEndTime = alertEndTime;
+    }
+
+    public Date getAlertEndTime() 
+    {
+        return alertEndTime;
+    }
+    public void setAlertNum(Long alertNum) 
+    {
+        this.alertNum = alertNum;
+    }
+
+    public Long getAlertNum() 
+    {
+        return alertNum;
+    }
+    public void setUserType(String userType) 
+    {
+        this.userType = userType;
+    }
+
+    public String getUserType()
+    {
+        return userType;
+    }
+
+    public String getAlertStatus() {
+        return alertStatus;
+    }
+
+    public void setAlertStatus(String alertStatus) {
+        this.alertStatus = alertStatus;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("alertId", getAlertId())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("isDelete", getIsDelete())
+            .append("alertContent", getAlertContent())
+            .append("alertStartTime", getAlertStartTime())
+            .append("alertEndTime", getAlertEndTime())
+            .append("alertNum", getAlertNum())
+            .append("userType", getUserType())
+            .append("alertStatus", getAlertStatus())
+            .toString();
+    }
+}

+ 126 - 0
suishenbang-system/src/main/java/com/dgtly/system/domain/AlertLog.java

@@ -0,0 +1,126 @@
+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_log
+ * 
+ * @author chenyn
+ * @date 2023-06-13
+ */
+public class AlertLog extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long alertLogId;
+
+    /** 弹框配置id */
+    @Excel(name = "弹框配置id")
+    private Long alertId;
+
+    /** 是否删除 */
+    @Excel(name = "是否删除")
+    private Long isDelete;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 登录名 */
+    @Excel(name = "登录名")
+    private String loginName;
+
+    /** 弹框每日弹的次数 */
+    @Excel(name = "弹框每日弹的次数")
+    private Long alertNum;
+
+    /** 用户类型0立邦员工1经销商 */
+    @Excel(name = "用户类型0立邦员工1经销商")
+    private String userType;
+
+
+    public void setAlertLogId(Long alertLogId) 
+    {
+        this.alertLogId = alertLogId;
+    }
+
+    public Long getAlertLogId() 
+    {
+        return alertLogId;
+    }
+    public void setAlertId(Long alertId) 
+    {
+        this.alertId = alertId;
+    }
+
+    public Long getAlertId() 
+    {
+        return alertId;
+    }
+    public void setIsDelete(Long isDelete) 
+    {
+        this.isDelete = isDelete;
+    }
+
+    public Long getIsDelete() 
+    {
+        return isDelete;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setLoginName(String loginName) 
+    {
+        this.loginName = loginName;
+    }
+
+    public String getLoginName() 
+    {
+        return loginName;
+    }
+    public void setAlertNum(Long alertNum) 
+    {
+        this.alertNum = alertNum;
+    }
+
+    public Long getAlertNum() 
+    {
+        return alertNum;
+    }
+    public void setUserType(String userType) 
+    {
+        this.userType = userType;
+    }
+
+    public String getUserType() 
+    {
+        return userType;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("alertLogId", getAlertLogId())
+            .append("alertId", getAlertId())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("isDelete", getIsDelete())
+            .append("userId", getUserId())
+            .append("loginName", getLoginName())
+            .append("alertNum", getAlertNum())
+            .append("userType", getUserType())
+            .toString();
+    }
+}

+ 66 - 0
suishenbang-system/src/main/java/com/dgtly/system/mapper/AlertConfigurationMapper.java

@@ -0,0 +1,66 @@
+package com.dgtly.system.mapper;
+
+import com.dgtly.system.domain.AlertConfiguration;
+import java.util.List;
+
+/**
+ * 弹框配置Mapper接口
+ * 
+ * @author chenyn
+ * @date 2023-06-13
+ */
+public interface AlertConfigurationMapper 
+{
+    /**
+     * 查询弹框配置
+     * 
+     * @param alertId 弹框配置ID
+     * @return 弹框配置
+     */
+    public AlertConfiguration selectAlertConfigurationById(Long alertId);
+
+    public AlertConfiguration selectAlertConfigurationByAlertStatus(int alertStatus);
+
+
+    /**
+     * 查询弹框配置列表
+     * 
+     * @param alertConfiguration 弹框配置
+     * @return 弹框配置集合
+     */
+    public List<AlertConfiguration> selectAlertConfigurationList(AlertConfiguration alertConfiguration);
+
+    public int selectAlertConfigurationListFilter();
+
+    /**
+     * 新增弹框配置
+     * 
+     * @param alertConfiguration 弹框配置
+     * @return 结果
+     */
+    public int insertAlertConfiguration(AlertConfiguration alertConfiguration);
+
+    /**
+     * 修改弹框配置
+     * 
+     * @param alertConfiguration 弹框配置
+     * @return 结果
+     */
+    public int updateAlertConfiguration(AlertConfiguration alertConfiguration);
+
+    /**
+     * 删除弹框配置
+     * 
+     * @param alertId 弹框配置ID
+     * @return 结果
+     */
+    public int deleteAlertConfigurationById(Long alertId);
+
+    /**
+     * 批量删除弹框配置
+     * 
+     * @param alertIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteAlertConfigurationByIds(String[] alertIds);
+}

+ 68 - 0
suishenbang-system/src/main/java/com/dgtly/system/mapper/AlertLogMapper.java

@@ -0,0 +1,68 @@
+package com.dgtly.system.mapper;
+
+import com.dgtly.system.domain.AlertLog;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 弹框日志Mapper接口
+ * 
+ * @author chenyn
+ * @date 2023-06-13
+ */
+public interface AlertLogMapper 
+{
+    /**
+     * 查询弹框日志
+     * 
+     * @param alertLogId 弹框日志ID
+     * @return 弹框日志
+     */
+    public AlertLog selectAlertLogById(Long alertLogId);
+
+    public AlertLog selectAlertLogByUserId(Long userId);
+
+
+    /**
+     * 查询弹框日志列表
+     * 
+     * @param alertLog 弹框日志
+     * @return 弹框日志集合
+     */
+    public List<AlertLog> selectAlertLogList(AlertLog alertLog);
+
+    /**
+     * 新增弹框日志
+     * 
+     * @param alertLog 弹框日志
+     * @return 结果
+     */
+    public int insertAlertLog(AlertLog alertLog);
+
+    /**
+     * 修改弹框日志
+     * 
+     * @param alertLog 弹框日志
+     * @return 结果
+     */
+    public int updateAlertLog(AlertLog alertLog);
+
+    /**
+     * 删除弹框日志
+     * 
+     * @param alertLogId 弹框日志ID
+     * @return 结果
+     */
+    public int deleteAlertLogById(Long alertLogId);
+
+    /**
+     * 批量删除弹框日志
+     * 
+     * @param alertLogIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteAlertLogByIds(@Param("alertLogIds") String[] alertLogIds);
+
+    public AlertLog selectAlertLogByUserIdAndAlertId(@Param("userId") Long userId,@Param("alertId") Long alertId);
+}

+ 66 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/IAlertConfigurationService.java

@@ -0,0 +1,66 @@
+package com.dgtly.system.service;
+
+import com.dgtly.system.domain.AlertConfiguration;
+import java.util.List;
+
+/**
+ * 弹框配置Service接口
+ * 
+ * @author chenyn
+ * @date 2023-06-13
+ */
+public interface IAlertConfigurationService 
+{
+    /**
+     * 查询弹框配置
+     * 
+     * @param alertId 弹框配置ID
+     * @return 弹框配置
+     */
+    public AlertConfiguration selectAlertConfigurationById(Long alertId);
+
+    public AlertConfiguration selectAlertConfigurationByAlertStatus(int alertStatus);
+
+    /**
+     * 查询弹框配置列表
+     * 
+     * @param alertConfiguration 弹框配置
+     * @return 弹框配置集合
+     */
+    public List<AlertConfiguration> selectAlertConfigurationList(AlertConfiguration alertConfiguration);
+
+//
+    public int selectAlertConfigurationListFilter();
+
+    /**
+     * 新增弹框配置
+     * 
+     * @param alertConfiguration 弹框配置
+     * @return 结果
+     */
+    public int insertAlertConfiguration(AlertConfiguration alertConfiguration);
+
+    /**
+     * 修改弹框配置
+     * 
+     * @param alertConfiguration 弹框配置
+     * @return 结果
+     */
+    public int updateAlertConfiguration(AlertConfiguration alertConfiguration);
+
+    /**
+     * 批量删除弹框配置
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteAlertConfigurationByIds(String ids);
+
+    /**
+     * 删除弹框配置信息
+     * 
+     * @param alertId 弹框配置ID
+     * @return 结果
+     */
+    public int deleteAlertConfigurationById(Long alertId);
+}

+ 66 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/IAlertLogService.java

@@ -0,0 +1,66 @@
+package com.dgtly.system.service;
+
+import com.dgtly.system.domain.AlertLog;
+import java.util.List;
+
+/**
+ * 弹框日志Service接口
+ * 
+ * @author chenyn
+ * @date 2023-06-13
+ */
+public interface IAlertLogService 
+{
+    /**
+     * 查询弹框日志
+     * 
+     * @param alertLogId 弹框日志ID
+     * @return 弹框日志
+     */
+    public AlertLog selectAlertLogById(Long alertLogId);
+
+//  找
+    public AlertLog selectAlertLogByUserId(Long userId);
+
+    public AlertLog selectAlertLogByUserIdAndAlertId(Long userId,Long alertId);
+
+    /**
+     * 查询弹框日志列表
+     * 
+     * @param alertLog 弹框日志
+     * @return 弹框日志集合
+     */
+    public List<AlertLog> selectAlertLogList(AlertLog alertLog);
+
+    /**
+     * 新增弹框日志
+     * 
+     * @param alertLog 弹框日志
+     * @return 结果
+     */
+    public int insertAlertLog(AlertLog alertLog);
+
+    /**
+     * 修改弹框日志
+     * 
+     * @param alertLog 弹框日志
+     * @return 结果
+     */
+    public int updateAlertLog(AlertLog alertLog);
+
+    /**
+     * 批量删除弹框日志
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteAlertLogByIds(String ids);
+
+    /**
+     * 删除弹框日志信息
+     * 
+     * @param alertLogId 弹框日志ID
+     * @return 结果
+     */
+    public int deleteAlertLogById(Long alertLogId);
+}

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

@@ -0,0 +1,105 @@
+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.AlertConfigurationMapper;
+import com.dgtly.system.domain.AlertConfiguration;
+import com.dgtly.system.service.IAlertConfigurationService;
+import com.dgtly.common.core.text.Convert;
+
+/**
+ * 弹框配置Service业务层处理
+ * 
+ * @author chenyn
+ * @date 2023-06-13
+ */
+@Service
+public class AlertConfigurationServiceImpl implements IAlertConfigurationService 
+{
+    @Autowired
+    private AlertConfigurationMapper alertConfigurationMapper;
+
+    /**
+     * 查询弹框配置
+     * 
+     * @param alertId 弹框配置ID
+     * @return 弹框配置
+     */
+    @Override
+    public AlertConfiguration selectAlertConfigurationById(Long alertId)
+    {
+        return alertConfigurationMapper.selectAlertConfigurationById(alertId);
+    }
+
+    @Override
+    public AlertConfiguration selectAlertConfigurationByAlertStatus(int alertStatus) {
+        return alertConfigurationMapper.selectAlertConfigurationByAlertStatus(alertStatus);
+    }
+
+    /**
+     * 查询弹框配置列表
+     * 
+     * @param alertConfiguration 弹框配置
+     * @return 弹框配置
+     */
+    @Override
+    public List<AlertConfiguration> selectAlertConfigurationList(AlertConfiguration alertConfiguration)
+    {
+        return alertConfigurationMapper.selectAlertConfigurationList(alertConfiguration);
+    }
+
+    @Override
+    public int selectAlertConfigurationListFilter() {
+        return alertConfigurationMapper.selectAlertConfigurationListFilter();
+    }
+
+    /**
+     * 新增弹框配置
+     * 
+     * @param alertConfiguration 弹框配置
+     * @return 结果
+     */
+    @Override
+    public int insertAlertConfiguration(AlertConfiguration alertConfiguration)
+    {
+        return alertConfigurationMapper.insertAlertConfiguration(alertConfiguration);
+    }
+
+    /**
+     * 修改弹框配置
+     * 
+     * @param alertConfiguration 弹框配置
+     * @return 结果
+     */
+    @Override
+    public int updateAlertConfiguration(AlertConfiguration alertConfiguration)
+    {
+        return alertConfigurationMapper.updateAlertConfiguration(alertConfiguration);
+    }
+
+    /**
+     * 删除弹框配置对象
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteAlertConfigurationByIds(String ids)
+    {
+        return alertConfigurationMapper.deleteAlertConfigurationByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除弹框配置信息
+     * 
+     * @param alertId 弹框配置ID
+     * @return 结果
+     */
+    @Override
+    public int deleteAlertConfigurationById(Long alertId)
+    {
+        return alertConfigurationMapper.deleteAlertConfigurationById(alertId);
+    }
+}

+ 108 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/impl/AlertLogServiceImpl.java

@@ -0,0 +1,108 @@
+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.AlertLogMapper;
+import com.dgtly.system.domain.AlertLog;
+import com.dgtly.system.service.IAlertLogService;
+import com.dgtly.common.core.text.Convert;
+
+/**
+ * 弹框日志Service业务层处理
+ * 
+ * @author chenyn
+ * @date 2023-06-13
+ */
+@Service
+public class AlertLogServiceImpl implements IAlertLogService 
+{
+    @Autowired
+    private AlertLogMapper alertLogMapper;
+
+    /**
+     * 查询弹框日志
+     * 
+     * @param alertLogId 弹框日志ID
+     * @return 弹框日志
+     */
+    @Override
+    public AlertLog selectAlertLogById(Long alertLogId)
+    {
+        return alertLogMapper.selectAlertLogById(alertLogId);
+    }
+
+    @Override
+    public AlertLog selectAlertLogByUserId(Long userId) {
+        return alertLogMapper.selectAlertLogByUserId(userId);
+    }
+
+    @Override
+    public AlertLog selectAlertLogByUserIdAndAlertId(Long userId,Long alertId) {
+        System.out.println(userId);
+        return alertLogMapper.selectAlertLogByUserIdAndAlertId(userId,alertId);
+    }
+
+    /**
+     * 查询弹框日志列表
+     * 
+     * @param alertLog 弹框日志
+     * @return 弹框日志
+     */
+    @Override
+    public List<AlertLog> selectAlertLogList(AlertLog alertLog)
+    {
+        return alertLogMapper.selectAlertLogList(alertLog);
+    }
+
+    /**
+     * 新增弹框日志
+     * 
+     * @param alertLog 弹框日志
+     * @return 结果
+     */
+    @Override
+    public int insertAlertLog(AlertLog alertLog)
+    {
+        alertLog.setCreateTime(DateUtils.getNowDate());
+        return alertLogMapper.insertAlertLog(alertLog);
+    }
+
+    /**
+     * 修改弹框日志
+     * 
+     * @param alertLog 弹框日志
+     * @return 结果
+     */
+    @Override
+    public int updateAlertLog(AlertLog alertLog)
+    {
+        alertLog.setUpdateTime(DateUtils.getNowDate());
+        return alertLogMapper.updateAlertLog(alertLog);
+    }
+
+    /**
+     * 删除弹框日志对象
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteAlertLogByIds(String ids)
+    {
+        return alertLogMapper.deleteAlertLogByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除弹框日志信息
+     * 
+     * @param alertLogId 弹框日志ID
+     * @return 结果
+     */
+    @Override
+    public int deleteAlertLogById(Long alertLogId)
+    {
+        return alertLogMapper.deleteAlertLogById(alertLogId);
+    }
+}

+ 119 - 0
suishenbang-system/src/main/resources/mapper/system/AlertConfigurationMapper.xml

@@ -0,0 +1,119 @@
+<?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.AlertConfigurationMapper">
+    
+    <resultMap type="AlertConfiguration" id="AlertConfigurationResult">
+        <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="alertContent"    column="alert_content"    />
+        <result property="alertStartTime"    column="alert_start_time"    />
+        <result property="alertEndTime"    column="alert_end_time"    />
+        <result property="alertNum"    column="alert_num"    />
+        <result property="userType"    column="user_type"    />
+        <result property="alertStatus"    column="alert_status"    />
+    </resultMap>
+
+    <sql id="selectAlertConfigurationVo">
+        select alert_id, create_by, create_time, update_by, update_time, is_delete, alert_content, alert_start_time, alert_end_time, alert_num, user_type, alert_status from alert_configuration
+    </sql>
+
+    <select id="selectAlertConfigurationList" parameterType="AlertConfiguration" resultMap="AlertConfigurationResult">
+        <include refid="selectAlertConfigurationVo"/>
+        <where>  
+            <if test="isDelete != null "> and is_delete = #{isDelete}</if>
+            <if test="alertContent != null  and alertContent != ''"> and alert_content like concat('%', #{alertContent}, '%')</if>
+            <if test="alertStartTime != null "> and alert_start_time &gt;= #{alertStartTime}</if>
+            <if test="alertEndTime != null "> and alert_end_time &lt; #{alertEndTime}</if>
+            <if test="alertNum != null "> and alert_num = #{alertNum}</if>
+            <if test="userType != null  and userType != ''"> and user_type = #{userType}</if>
+            <if test="alertStatus != null  and alertStatus != ''"> and alert_status = #{alertStatus}</if>
+        </where>
+    </select>
+
+    <select id="selectAlertConfigurationListFilter" resultType="java.lang.Integer">
+        SELECT
+            count(*)
+        FROM
+            alert_configuration
+        WHERE alert_configuration.alert_status = 1
+
+    </select>
+    
+    <select id="selectAlertConfigurationById" parameterType="Long" resultMap="AlertConfigurationResult">
+        <include refid="selectAlertConfigurationVo"/>
+        where alert_id = #{alertId}
+    </select>
+
+    <select id="selectAlertConfigurationByAlertStatus" parameterType="Long" resultMap="AlertConfigurationResult">
+        select *
+        FROM
+            alert_configuration
+        WHERE alert_configuration.alert_status = 1
+    </select>
+
+    <insert id="insertAlertConfiguration" parameterType="AlertConfiguration" useGeneratedKeys="true" keyProperty="alertId">
+        insert into alert_configuration
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <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="alertContent != null  and alertContent != ''">alert_content,</if>
+            <if test="alertStartTime != null ">alert_start_time,</if>
+            <if test="alertEndTime != null ">alert_end_time,</if>
+            <if test="alertNum != null ">alert_num,</if>
+            <if test="userType != null  and userType != ''">user_type,</if>
+            <if test="alertStatus != null  and alertStatus != ''">alert_status,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <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="alertContent != null  and alertContent != ''">#{alertContent},</if>
+            <if test="alertStartTime != null ">#{alertStartTime},</if>
+            <if test="alertEndTime != null ">#{alertEndTime},</if>
+            <if test="alertNum != null ">#{alertNum},</if>
+            <if test="userType != null  and userType != ''">#{userType},</if>
+            <if test="alertStatus != null  and alertStatus != ''">#{alertStatus},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAlertConfiguration" parameterType="AlertConfiguration">
+        update alert_configuration
+        <trim prefix="SET" suffixOverrides=",">
+            <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="alertContent != null  and alertContent != ''">alert_content = #{alertContent},</if>
+            <if test="alertStartTime != null ">alert_start_time = #{alertStartTime},</if>
+            <if test="alertEndTime != null ">alert_end_time = #{alertEndTime},</if>
+            <if test="alertNum != null ">alert_num = #{alertNum},</if>
+            <if test="userType != null  and userType != ''">user_type = #{userType},</if>
+            <if test="alertStatus != null  and alertStatus != ''">alert_status = #{alertStatus},</if>
+        </trim>
+        where alert_id = #{alertId}
+    </update>
+
+    <delete id="deleteAlertConfigurationById" parameterType="Long">
+        delete from alert_configuration where alert_id = #{alertId}
+    </delete>
+
+    <delete id="deleteAlertConfigurationByIds" parameterType="String">
+        delete from alert_configuration where alert_id in 
+        <foreach item="alertId" collection="array" open="(" separator="," close=")">
+            #{alertId}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 111 - 0
suishenbang-system/src/main/resources/mapper/system/AlertLogMapper.xml

@@ -0,0 +1,111 @@
+<?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.AlertLogMapper">
+    
+    <resultMap type="AlertLog" id="AlertLogResult">
+        <result property="alertLogId"    column="alert_log_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="loginName"    column="login_name"    />
+        <result property="alertNum"    column="alert_num"    />
+        <result property="userType"    column="user_type"    />
+    </resultMap>
+
+    <sql id="selectAlertLogVo">
+        select alert_log_id, alert_id, create_by, create_time, update_by, update_time, is_delete, user_id, login_name, alert_num, user_type from alert_log
+    </sql>
+
+    <select id="selectAlertLogList" parameterType="AlertLog" resultMap="AlertLogResult">
+        <include refid="selectAlertLogVo"/>
+        <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="loginName != null  and loginName != ''"> and login_name like concat('%', #{loginName}, '%')</if>
+            <if test="alertNum != null "> and alert_num = #{alertNum}</if>
+            <if test="userType != null  and userType != ''"> and user_type = #{userType}</if>
+        </where>
+    </select>
+    
+    <select id="selectAlertLogById" parameterType="Long" resultMap="AlertLogResult">
+        <include refid="selectAlertLogVo"/>
+        where alert_log_id = #{alertLogId}
+    </select>
+
+    <select id="selectAlertLogByUserId" parameterType="AlertLog" resultMap="AlertLogResult">
+        <include refid="selectAlertLogVo"/>
+        where user_id = #{userId}
+    </select>
+
+    <select id="selectAlertLogByUserIdAndAlertId" parameterType="AlertLog" resultMap="AlertLogResult">
+        <include refid="selectAlertLogVo"/>
+        where 1=1
+        <if test="userId!=null">and user_id = #{userId}</if>
+        <if test="alertId != null ">and alert_id = #{alertId}</if>
+        and DATE_FORMAT(create_time,'%Y%m%d') = DATE_FORMAT(NOW(),'%Y%m%d')
+    </select>
+
+    <insert id="insertAlertLog" parameterType="AlertLog" useGeneratedKeys="true" keyProperty="alertLogId">
+        insert into alert_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="loginName != null  and loginName != ''">login_name,</if>
+            <if test="alertNum != null ">alert_num,</if>
+            <if test="userType != null  and userType != ''">user_type,</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="loginName != null  and loginName != ''">#{loginName},</if>
+            <if test="alertNum != null ">#{alertNum},</if>
+            <if test="userType != null  and userType != ''">#{userType},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAlertLog" parameterType="AlertLog">
+        update alert_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="loginName != null  and loginName != ''">login_name = #{loginName},</if>
+            <if test="alertNum != null ">alert_num = #{alertNum},</if>
+            <if test="userType != null  and userType != ''">user_type = #{userType},</if>
+        </trim>
+        where alert_log_id = #{alertLogId}
+    </update>
+
+    <delete id="deleteAlertLogById" parameterType="Long">
+        delete from alert_log where alert_log_id = #{alertLogId}
+    </delete>
+
+    <delete id="deleteAlertLogByIds" parameterType="String">
+        delete from alert_log where alert_log_id in 
+        <foreach item="alertLogId" collection="array" open="(" separator="," close=")">
+            #{alertLogId}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 126 - 0
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxAlertLogController.java

@@ -0,0 +1,126 @@
+package com.dgtly.wxportal.controller;
+
+
+import com.dgtly.common.annotation.ApiPassToken;
+import com.dgtly.common.core.controller.ApiBaseController;
+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.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 io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 弹框日志Controller
+ *
+ * @author chenyn
+ * @date 2023-06-13
+ */
+@Api(tags = "微信弹框相关接口")
+@RestController
+@RequestMapping("/wxAlert")
+@ApiPassToken
+public class WxAlertLogController  extends ApiBaseController {
+    @Autowired
+    private IAlertLogService alertLogService;
+    @Autowired
+    private ISysUserService sysUserService;
+    @Autowired
+    private ISysUserExtService sysUserExtService;
+    @Autowired
+    private IAlertConfigurationService alertConfigurationService;
+
+
+    @ApiOperation(value = "微信弹框",notes = "参数:{userId:1}")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body")
+    })
+    @PostMapping("/getAlert")
+    public Object getAlertLog(){
+        ParameterObject obj = getParameterObject();
+        Long userId = Long.valueOf(obj.getString("userId"));
+        //是否有启动
+        AlertConfiguration alertConfiguration1 = alertConfigurationService.selectAlertConfigurationByAlertStatus(1);
+        SysUserExt sysUserExt = sysUserExtService.selectSysUserExtById(userId);
+        String salesLevel = sysUserExt.getSalesLevel();
+        if (alertConfiguration1!=null){
+            //有启动
+            Date date = new Date();
+            int i = date.compareTo(alertConfiguration1.getAlertStartTime());
+            int i1 = date.compareTo(alertConfiguration1.getAlertEndTime());
+            if (i >= 0 && i1 <= 0) {
+                //满足时间
+                String[] split = alertConfiguration1.getUserType().split(",");
+                List<String> strings = Arrays.asList(split);
+
+                if (strings.contains("1")&&sysUserExt.getSalesLevel().equals("customer_level")){
+                    //满足类型对应a
+                    AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId());
+                    if (alertLog!=null){
+                        if (alertLog.getAlertNum()<alertConfiguration1.getAlertNum()){
+                            alertLog.setAlertNum(alertLog.getAlertNum()+1);
+                            alertLogService.updateAlertLog(alertLog);
+                            return AjaxResult.success(alertConfiguration1);
+                        }else {
+                            return AjaxResult.warning("每日弹出次数已满");
+                        }
+                    }else {
+                        //加数据
+                        AlertLog alertLog1 = new AlertLog();
+                        alertLog1.setAlertId(alertConfiguration1.getAlertId());
+                        alertLog1.setUserId(userId);
+                        alertLog1.setUserType("1");
+                        alertLog1.setAlertNum(1L);
+                        alertLogService.insertAlertLog(alertLog1);
+                        return AjaxResult.success(alertConfiguration1);
+                    }
+                }
+                if(strings.contains("0")&&!sysUserExt.getSalesLevel().equals("customer_level")){
+                    System.out.println(userId);
+                    AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId());
+                    if (alertLog!=null){
+                        if (alertLog.getAlertNum()<alertConfiguration1.getAlertNum()){
+                            alertLog.setAlertNum(alertLog.getAlertNum()+1);
+                            alertLogService.updateAlertLog(alertLog);
+                            return AjaxResult.success(alertConfiguration1);
+                        }else {
+                            return AjaxResult.warning("每日弹出次数已满");
+                        }
+                    }else {
+                        //加数据
+                        AlertLog alertLog1 = new AlertLog();
+                        alertLog1.setAlertId(alertConfiguration1.getAlertId());
+                        alertLog1.setUserId(userId);
+                        alertLog1.setUserType("0");
+                        alertLog1.setAlertNum(1L);
+                        alertLogService.insertAlertLog(alertLog1);
+                        return AjaxResult.success(alertConfiguration1);
+                    }
+                }
+                return AjaxResult.warning("没有符合的弹框");
+
+            } else {
+                //超时
+                return AjaxResult.warning("时间超时");
+            }
+        }else {
+            //无启动
+            return AjaxResult.warning("没有启动的弹框");
+        }
+    }
+
+
+}