修改消息配置

This commit is contained in:
459816669@qq.com 2021-03-02 22:28:08 +08:00
parent 9fe430d3fd
commit f65750f963
23 changed files with 1686 additions and 84 deletions

View File

@ -26,7 +26,7 @@ import com.snow.common.core.page.TableDataInfo;
* @date 2021-03-02
*/
@Controller
@RequestMapping("/system/triggers")
@RequestMapping("/system/triggers11")
public class SysActNewsTriggersController extends BaseController
{
private String prefix = "system/triggers";

View File

@ -0,0 +1,154 @@
package com.snow.web.controller.system;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
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.snow.common.annotation.Log;
import com.snow.common.enums.BusinessType;
import org.springframework.stereotype.Controller;
import com.snow.system.domain.SysNewsNode;
import com.snow.system.service.ISysNewsNodeService;
import com.snow.common.core.controller.BaseController;
import com.snow.common.core.domain.AjaxResult;
import com.snow.common.utils.poi.ExcelUtil;
import com.snow.common.utils.StringUtils;
import com.snow.common.core.domain.Ztree;
/**
* 消息配置节点Controller
*
* @author qimingjin
* @date 2021-03-02
*/
@Controller
@RequestMapping("/system/node")
public class SysNewsNodeController extends BaseController
{
private String prefix = "system/node";
@Autowired
private ISysNewsNodeService sysNewsNodeService;
@RequiresPermissions("system:node:view")
@GetMapping()
public String node()
{
return prefix + "/node";
}
/**
* 查询消息配置节点树列表
*/
@RequiresPermissions("system:node:list")
@PostMapping("/list")
@ResponseBody
public List<SysNewsNode> list(SysNewsNode sysNewsNode)
{
List<SysNewsNode> list = sysNewsNodeService.selectSysNewsNodeList(sysNewsNode);
return list;
}
/**
* 导出消息配置节点列表
*/
@RequiresPermissions("system:node:export")
@Log(title = "消息配置节点", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysNewsNode sysNewsNode)
{
List<SysNewsNode> list = sysNewsNodeService.selectSysNewsNodeList(sysNewsNode);
ExcelUtil<SysNewsNode> util = new ExcelUtil<SysNewsNode>(SysNewsNode.class);
return util.exportExcel(list, "node");
}
/**
* 新增消息配置节点
*/
@GetMapping("/add/{id}")
public String add(@PathVariable(value = "id", required = false) Long id, ModelMap mmap)
{
if (StringUtils.isNotNull(id))
{
mmap.put("sysNewsNode", sysNewsNodeService.selectSysNewsNodeById(id.intValue()));
}
return prefix + "/add";
}
/**
* 新增保存消息配置节点
*/
@RequiresPermissions("system:node:add")
@Log(title = "消息配置节点", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SysNewsNode sysNewsNode)
{
return toAjax(sysNewsNodeService.insertSysNewsNode(sysNewsNode));
}
/**
* 修改消息配置节点
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Integer id, ModelMap mmap)
{
SysNewsNode sysNewsNode = sysNewsNodeService.selectSysNewsNodeById(id);
mmap.put("sysNewsNode", sysNewsNode);
return prefix + "/edit";
}
/**
* 修改保存消息配置节点
*/
@RequiresPermissions("system:node:edit")
@Log(title = "消息配置节点", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysNewsNode sysNewsNode)
{
return toAjax(sysNewsNodeService.updateSysNewsNode(sysNewsNode));
}
/**
* 删除
*/
@RequiresPermissions("system:node:remove")
@Log(title = "消息配置节点", businessType = BusinessType.DELETE)
@GetMapping("/remove/{id}")
@ResponseBody
public AjaxResult remove(@PathVariable("id") Integer id)
{
return toAjax(sysNewsNodeService.deleteSysNewsNodeById(id));
}
/**
* 选择消息配置节点树
*/
@GetMapping(value = { "/selectNodeTree/{id}", "/selectNodeTree/" })
public String selectNodeTree(@PathVariable(value = "id", required = false) Long id, ModelMap mmap)
{
if (StringUtils.isNotNull(id))
{
mmap.put("sysNewsNode", sysNewsNodeService.selectSysNewsNodeById(id.intValue()));
}
return prefix + "/tree";
}
/**
* 加载消息配置节点树列表
*/
@GetMapping("/treeData")
@ResponseBody
public List<Ztree> treeData()
{
List<Ztree> ztrees = sysNewsNodeService.selectSysNewsNodeTree();
return ztrees;
}
}

View File

@ -0,0 +1,133 @@
package com.snow.web.controller.system;
import java.util.List;
import com.snow.framework.util.ShiroUtils;
import com.snow.system.domain.SysUser;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
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.snow.common.annotation.Log;
import com.snow.common.enums.BusinessType;
import org.springframework.stereotype.Controller;
import com.snow.system.domain.SysNewsTriggers;
import com.snow.system.service.ISysNewsTriggersService;
import com.snow.common.core.controller.BaseController;
import com.snow.common.core.domain.AjaxResult;
import com.snow.common.utils.poi.ExcelUtil;
import com.snow.common.core.page.TableDataInfo;
/**
* 消息通知配置Controller
*
* @author qimingjin
* @date 2021-03-02
*/
@Controller
@RequestMapping("/system/triggers")
public class SysNewsTriggersController extends BaseController
{
private String prefix = "system/triggers";
@Autowired
private ISysNewsTriggersService sysNewsTriggersService;
@RequiresPermissions("system:triggers:view")
@GetMapping()
public String triggers()
{
return prefix + "/triggers";
}
/**
* 查询消息通知配置列表
*/
@RequiresPermissions("system:triggers:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(SysNewsTriggers sysNewsTriggers)
{
startPage();
List<SysNewsTriggers> list = sysNewsTriggersService.selectSysNewsTriggersList(sysNewsTriggers);
return getDataTable(list);
}
/**
* 导出消息通知配置列表
*/
@RequiresPermissions("system:triggers:export")
@Log(title = "消息通知配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysNewsTriggers sysNewsTriggers)
{
SysUser sysUser = ShiroUtils.getSysUser();
sysNewsTriggers.setUserId(String.valueOf(sysUser.getUserId()));
List<SysNewsTriggers> list = sysNewsTriggersService.selectSysNewsTriggersList(sysNewsTriggers);
ExcelUtil<SysNewsTriggers> util = new ExcelUtil<SysNewsTriggers>(SysNewsTriggers.class);
return util.exportExcel(list, "triggers");
}
/**
* 新增消息通知配置
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存消息通知配置
*/
@RequiresPermissions("system:triggers:add")
@Log(title = "消息通知配置", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SysNewsTriggers sysNewsTriggers)
{
SysUser sysUser = ShiroUtils.getSysUser();
sysNewsTriggers.setUserId(String.valueOf(sysUser.getUserId()));
return toAjax(sysNewsTriggersService.insertSysNewsTriggers(sysNewsTriggers));
}
/**
* 修改消息通知配置
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Integer id, ModelMap mmap)
{
SysNewsTriggers sysNewsTriggers = sysNewsTriggersService.selectSysNewsTriggersById(id);
mmap.put("sysNewsTriggers", sysNewsTriggers);
return prefix + "/edit";
}
/**
* 修改保存消息通知配置
*/
@RequiresPermissions("system:triggers:edit")
@Log(title = "消息通知配置", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysNewsTriggers sysNewsTriggers)
{
return toAjax(sysNewsTriggersService.updateSysNewsTriggers(sysNewsTriggers));
}
/**
* 删除消息通知配置
*/
@RequiresPermissions("system:triggers:remove")
@Log(title = "消息通知配置", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(sysNewsTriggersService.deleteSysNewsTriggersByIds(ids));
}
}

View File

@ -6,9 +6,9 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/snow?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: root
url: jdbc:mysql://rm-bp1j1554xv1qs04295o.mysql.rds.aliyuncs.com:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: cloud_root
password: Jin!152377
# 从库数据源
slave:
# 从数据源开关/默认关闭

View File

@ -69,6 +69,13 @@ spring:
restart:
# 热部署开关
enabled: true
mail:
host: smtp.126.com
username: qimingjin@126.com
#开启POP3之后设置的客户端授权码
password: JSHBRRRDBNHPXPFB
default-encoding: UTF-8
# MyBatis
mybatis:

View File

@ -0,0 +1,71 @@
<!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-node-add">
<div class="form-group">
<label class="col-sm-3 control-label">父消息节点:</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" type="text" onclick="selectNodeTree()" id="treeName" readonly="true" th:value="${sysNewsNode?.newsNodeName}">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">消息节点:</label>
<div class="col-sm-8">
<input name="newsNodeName" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">节点key</label>
<div class="col-sm-8">
<input name="newsNodeKey" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">显示顺序:</label>
<div class="col-sm-8">
<input name="orderNum" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/node"
$("#form-node-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-node-add').serialize());
}
}
/*消息配置节点-新增-选择父部门树*/
function selectNodeTree() {
var options = {
title: '消息配置节点选择',
width: "380",
url: prefix + "/selectNodeTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
</script>
</body>
</html>

View File

@ -0,0 +1,73 @@
<!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-node-edit" th:object="${sysNewsNode}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">父消息节点:</label>
<div class="col-sm-8">
<div class="input-group">
<input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />
<input class="form-control" type="text" onclick="selectNodeTree()" id="treeName" readonly="true" th:field="*{parentName}">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">消息节点:</label>
<div class="col-sm-8">
<input name="newsNodeName" th:field="*{newsNodeName}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">节点key</label>
<div class="col-sm-8">
<input name="newsNodeKey" th:field="*{newsNodeKey}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">显示顺序:</label>
<div class="col-sm-8">
<input name="orderNum" th:field="*{orderNum}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/node";
$("#form-node-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-node-edit').serialize());
}
}
/*消息配置节点-新增-选择父部门树*/
function selectNodeTree() {
var options = {
title: '消息配置节点选择',
width: "380",
url: prefix + "/selectNodeTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
</script>
</body>
</html>

View File

@ -0,0 +1,116 @@
<!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>
<label>消息节点:</label>
<input type="text" name="newsNodeName"/>
</li>
<li>
<label>节点key</label>
<input type="text" name="newsNodeKey"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.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:node:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="system:node:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-info" id="expandAllBtn">
<i class="fa fa-exchange"></i> 展开/折叠
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-tree-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var addFlag = [[${@permission.hasPermi('system:node:add')}]];
var editFlag = [[${@permission.hasPermi('system:node:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:node:remove')}]];
var prefix = ctx + "system/node";
$(function() {
var options = {
code: "id",
parentCode: "parentId",
expandColumn: "1",
uniqueId: "id",
url: prefix + "/list",
createUrl: prefix + "/add/{id}",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove/{id}",
exportUrl: prefix + "/export",
modalName: "消息配置节点",
columns: [{
field: 'selectItem',
radio: true
},
{
field: 'newsNodeName',
title: '消息节点',
align: 'left'
},
{
field: 'newsNodeKey',
title: '节点key',
align: 'left'
},
/* {
field: 'parentId',
title: '父部门id',
align: 'left'
},*/
/* {
field: 'ancestors',
title: '祖级列表',
align: 'left'
},*/
{
field: 'orderNum',
title: '显示顺序',
align: 'left'
},
/* {
field: 'isDelete',
title: '是否删除',
align: 'left'
},*/
{
title: '操作',
align: 'center',
align: 'left',
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.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.id + '\')"><i class="fa fa-plus"></i>新增</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.treeTable.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('消息配置节点树选择')" />
<th:block th:include="include :: ztree-css" />
</head>
<style>
body{height:auto;font-family: "Microsoft YaHei";}
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
</style>
<body class="hold-transition box box-main">
<input id="treeId" name="treeId" type="hidden" th:value="${sysNewsNode?.id}"/>
<input id="treeName" name="treeName" type="hidden" th:value="${sysNewsNode?.newsNodeName}"/>
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
<label id="btnShow" title="显示搜索" style="display:none;"></label>
<label id="btnHide" title="隐藏搜索"></label>
</div>
<div class="treeSearchInput" id="search">
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
</div>
<div class="treeExpandCollapse">
<a href="#" onclick="$.tree.expand()">展开</a> /
<a href="#" onclick="$.tree.collapse()">折叠</a>
</div>
<div id="tree" class="ztree treeselect"></div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script th:inline="javascript">
$(function() {
var url = ctx + "system/node/treeData";
var options = {
url: url,
expandLevel: 2,
onClick : zOnClick
};
$.tree.init(options);
});
function zOnClick(event, treeId, treeNode) {
var treeId = treeNode.id;
var treeName = treeNode.name;
$("#treeId").val(treeId);
$("#treeName").val(treeName);
}
</script>
</body>
</html>

View File

@ -1,39 +1,25 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增流程消息配置')" />
<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-triggers-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">流程消息节点:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_flow_news_node')}">
<label th:each="dict : ${type}" class="check-box">
<input name="newsNodeId" type="checkbox" th:value="${dict.dictValue}" th:text="${dict.dictLabel}">
</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">消息类型:</label>
<!-- <div class="col-sm-8">
<select name="newsType" class="form-control m-b" required>
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>-->
<div class="col-sm-8" th:with="type=${@dict.getType('sys_news_type')}">
<label th:each="dict : ${type}" class="check-box">
<input name="newsType" type="checkbox" th:value="${dict.dictValue}" th:text="${dict.dictLabel}">
</label>
<div class="form-group">
<label class="col-sm-3 control-label is-required">归属节点:</label>
<div class="col-sm-8">
<div class="input-group">
<input name="newsNodeId" onclick="selectNodeTree()" id="treeName" type="text" placeholder="请选择归属节点" class="form-control" required>
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">消息开关:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_news_on_off')}">
<label th:each="dict : ${type}" class="check-box">
<input name="newsType" type="checkbox" th:value="${dict.dictValue}" th:text="${dict.dictLabel}">
</label>
<div class="col-sm-8">
<input name="newsOnOff" class="form-control" type="text">
</div>
</div>
</form>
@ -50,6 +36,28 @@
$.operate.save(prefix + "/add", $('#form-triggers-add').serialize());
}
}
/*消息配置节点-新增-选择父部门树*/
function selectNodeTree() {
var treeId = $("#treeId").val();
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
var options = {
title: '消息配置节点选择',
width: "380",
url:ctx + "system/node/selectNodeTree/" + deptId,
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
</script>
</body>
</html>

View File

@ -1,14 +1,14 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改流程消息配置')" />
<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-triggers-edit" th:object="${sysActNewsTriggers}">
<form class="form-horizontal m" id="form-triggers-edit" th:object="${sysNewsTriggers}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">流程消息节点id(1-流程发起2-任务创建3-任务完成4-流程结束)</label>
<label class="col-sm-3 control-label is-required">流程消息节点key</label>
<div class="col-sm-8">
<input name="newsNodeId" th:field="*{newsNodeId}" class="form-control" type="text" required>
</div>

View File

@ -1,38 +1,51 @@
<!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('流程消息配置列表')" />
<th:block th:include="include :: header('用户列表')" />
<th:block th:include="include :: layout-latest-css" />
<th:block th:include="include :: ztree-css" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="ui-layout-west">
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<i class="fa icon-grid"></i> 消息节点
</div>
<div class="box-tools pull-right">
<a type="button" class="btn btn-box-tool" href="#" onclick="newsNode()" title="消息节点"><i class="fa fa-edit"></i></a>
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新"><i class="fa fa-refresh"></i></button>
</div>
</div>
<div class="ui-layout-content">
<div id="tree" class="ztree"></div>
</div>
</div>
</div>
<div class="ui-layout-center">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<form id="user-form">
<input type="hidden" id="deptId" name="deptId">
<input type="hidden" id="parentId" name="parentId">
<div class="select-list">
<ul>
<li>
<label>流程消息节点id(1-流程发起2-任务创建3-任务完成4-流程结束)</label>
<label>节点key</label>
<input type="text" name="newsNodeId"/>
</li>
<li>
<label>消息类型:</label>
<select name="newsType">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
</select>
</li>
<li>
<label>消息开关:</label>
<input type="text" name="newsOnOff"/>
</li>
<li>
<label>用户id</label>
<input type="text" name="userId"/>
</li>
<li>
<label>是否删除:</label>
<input type="text" name="isDelete"/>
消息类型:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></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>
@ -43,41 +56,59 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:triggers:add">
<i class="fa fa-plus"></i> 添加
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:user:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:triggers:edit">
<a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="system:user:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:triggers:remove">
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:triggers:export">
<a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:user:import">
<i class="fa fa-upload"></i> 导入
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:user: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:triggers:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:triggers:remove')}]];
var prefix = ctx + "system/triggers";
</div>
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "流程消息配置",
columns: [{
checkbox: true
},
<th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="include :: ztree-js" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:triggers:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:triggers:remove')}]];
var prefix = ctx + "system/triggers";
$(function() {
var panehHidden = false;
if ($(this).width() < 769) {
panehHidden = true;
}
$('body').layout({ initClosed: panehHidden, west__size: 185 });
queryUserList();
queryDeptTree();
});
function queryUserList() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "消息通知配置",
columns: [{
checkbox: true
},
{
field: 'id',
title: 'null',
@ -85,7 +116,7 @@
},
{
field: 'newsNodeId',
title: '流程消息节点id(1-流程发起2-任务创建3-任务完成4-流程结束)'
title: '流程消息节点key'
},
{
field: 'newsType',
@ -96,12 +127,16 @@
title: '消息开关'
},
{
field: 'userId',
title: '用户id'
visible: editFlag == 'hidden' ? false : true,
title: '消息开关',
align: 'center',
formatter: function (value, row, index) {
return statusTools(row);
}
},
{
field: 'isDelete',
title: '是否删除'
field: 'userId',
title: '用户id'
},
{
title: '操作',
@ -113,9 +148,100 @@
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
};
$.table.init(options);
}
function queryDeptTree()
{
var url = "/system/node/treeData";
var options = {
url: url,
expandLevel: 2,
onClick : zOnClick
};
$.tree.init(options);
function zOnClick(event, treeId, treeNode) {
$("#deptId").val(treeNode.id);
$("#parentId").val(treeNode.pId);
$.table.search();
}
}
$('#btnExpand').click(function() {
$._tree.expandAll(true);
$(this).hide();
$('#btnCollapse').show();
});
$('#btnCollapse').click(function() {
$._tree.expandAll(false);
$(this).hide();
$('#btnExpand').show();
});
$('#btnRefresh').click(function() {
queryDeptTree();
});
function newsNode() {
var url = ctx + "system/node";
$.modal.openTab("部门管理", url);
}
/* 用户管理-重置密码 */
function resetPwd(userId) {
var url = prefix + '/resetPwd/' + userId;
$.modal.open("重置密码", url, '800', '300');
}
/* 用户管理-分配角色 */
function authRole(userId) {
var url = prefix + '/authRole/' + userId;
$.modal.openTab("用户分配角色", url);
}
/* 用户状态显示 */
function statusTools(row) {
if (row.status == 1) {
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.userId + '\')"></i> ';
} else {
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.userId + '\')"></i> ';
}
}
/* 用户管理-停用 */
function disable(userId) {
$.modal.confirm("确认要停用用户吗?", function() {
$.operate.post(prefix + "/changeStatus", { "userId": userId, "status": 1 });
})
}
/* 用户管理启用 */
function enable(userId) {
$.modal.confirm("确认要启用用户吗?", function() {
$.operate.post(prefix + "/changeStatus", { "userId": userId, "status": 0 });
})
}
</script>
</body>
<!-- 导入区域 -->
<script id="importTpl" type="text/template">
<form enctype="multipart/form-data" class="mt20 mb10">
<div class="col-xs-offset-1">
<input type="file" id="file" name="file"/>
<div class="mt10 pt5">
<input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在,更新这条数据。"> 是否更新已经存在的用户数据
&nbsp; <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
</div>
<font color="red" class="pull-left mt10">
提示仅允许导入“xls”或“xlsx”格式文件
</font>
</div>
</form>
</script>
</html>

View File

@ -31,7 +31,7 @@ import java.util.concurrent.ThreadPoolExecutor;
* @author: 没用的阿吉
* @create: 2021-02-27 16:13
**/
//@Component
@Component
@Slf4j
public class MailService {

View File

@ -0,0 +1,88 @@
package com.snow.system.domain;
import com.snow.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.snow.common.core.domain.BaseEntity;
import com.snow.common.core.domain.TreeEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 消息配置节点对象 sys_news_node
*
* @author qimingjin
* @date 2021-03-02
*/
public class SysNewsNode extends TreeEntity
{
private static final long serialVersionUID = 1L;
/** null */
private Integer id;
/** 流程消息节点名称 */
@Excel(name = "流程消息节点名称")
private String newsNodeName;
/** 流程消息节点key */
@Excel(name = "流程消息节点key")
private String newsNodeKey;
/** 是否删除0--否1--是) */
@Excel(name = "是否删除", readConverterExp = "0=--否1--是")
private Long isDelete;
public void setId(Integer id)
{
this.id = id;
}
public Integer getId()
{
return id;
}
public void setNewsNodeName(String newsNodeName)
{
this.newsNodeName = newsNodeName;
}
public String getNewsNodeName()
{
return newsNodeName;
}
public void setNewsNodeKey(String newsNodeKey)
{
this.newsNodeKey = newsNodeKey;
}
public String getNewsNodeKey()
{
return newsNodeKey;
}
public void setIsDelete(Long isDelete)
{
this.isDelete = isDelete;
}
public Long getIsDelete()
{
return isDelete;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("newsNodeName", getNewsNodeName())
.append("newsNodeKey", getNewsNodeKey())
.append("parentId", getParentId())
.append("ancestors", getAncestors())
.append("orderNum", getOrderNum())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,112 @@
package com.snow.system.domain;
import com.snow.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.snow.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 消息通知配置对象 sys_news_triggers
*
* @author qimingjin
* @date 2021-03-02
*/
public class SysNewsTriggers extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** null */
private Integer id;
/** 流程消息节点key */
@Excel(name = "流程消息节点key")
private Long newsNodeId;
/** 消息类型1-钉钉2-邮件3-短信4-站内消息) */
@Excel(name = "消息类型", readConverterExp = "1=-钉钉2-邮件3-短信4-站内消息")
private Long newsType;
/** 消息开关0--关1--开) */
@Excel(name = "消息开关", readConverterExp = "0=--关1--开")
private Long newsOnOff;
/** 用户id */
@Excel(name = "用户id")
private String userId;
/** 是否删除0--否1--是) */
@Excel(name = "是否删除", readConverterExp = "0=--否1--是")
private Long isDelete;
public void setId(Integer id)
{
this.id = id;
}
public Integer getId()
{
return id;
}
public void setNewsNodeId(Long newsNodeId)
{
this.newsNodeId = newsNodeId;
}
public Long getNewsNodeId()
{
return newsNodeId;
}
public void setNewsType(Long newsType)
{
this.newsType = newsType;
}
public Long getNewsType()
{
return newsType;
}
public void setNewsOnOff(Long newsOnOff)
{
this.newsOnOff = newsOnOff;
}
public Long getNewsOnOff()
{
return newsOnOff;
}
public void setUserId(String userId)
{
this.userId = userId;
}
public String getUserId()
{
return userId;
}
public void setIsDelete(Long isDelete)
{
this.isDelete = isDelete;
}
public Long getIsDelete()
{
return isDelete;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("newsNodeId", getNewsNodeId())
.append("newsType", getNewsType())
.append("newsOnOff", getNewsOnOff())
.append("userId", getUserId())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.snow.system.mapper;
import java.util.List;
import com.snow.system.domain.SysNewsNode;
/**
* 消息配置节点Mapper接口
*
* @author qimingjin
* @date 2021-03-02
*/
public interface SysNewsNodeMapper
{
/**
* 查询消息配置节点
*
* @param id 消息配置节点ID
* @return 消息配置节点
*/
public SysNewsNode selectSysNewsNodeById(Integer id);
/**
* 查询消息配置节点列表
*
* @param sysNewsNode 消息配置节点
* @return 消息配置节点集合
*/
public List<SysNewsNode> selectSysNewsNodeList(SysNewsNode sysNewsNode);
/**
* 新增消息配置节点
*
* @param sysNewsNode 消息配置节点
* @return 结果
*/
public int insertSysNewsNode(SysNewsNode sysNewsNode);
/**
* 修改消息配置节点
*
* @param sysNewsNode 消息配置节点
* @return 结果
*/
public int updateSysNewsNode(SysNewsNode sysNewsNode);
/**
* 删除消息配置节点
*
* @param id 消息配置节点ID
* @return 结果
*/
public int deleteSysNewsNodeById(Integer id);
/**
* 批量删除消息配置节点
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysNewsNodeByIds(String[] ids);
}

View File

@ -0,0 +1,61 @@
package com.snow.system.mapper;
import java.util.List;
import com.snow.system.domain.SysNewsTriggers;
/**
* 消息通知配置Mapper接口
*
* @author qimingjin
* @date 2021-03-02
*/
public interface SysNewsTriggersMapper
{
/**
* 查询消息通知配置
*
* @param id 消息通知配置ID
* @return 消息通知配置
*/
public SysNewsTriggers selectSysNewsTriggersById(Integer id);
/**
* 查询消息通知配置列表
*
* @param sysNewsTriggers 消息通知配置
* @return 消息通知配置集合
*/
public List<SysNewsTriggers> selectSysNewsTriggersList(SysNewsTriggers sysNewsTriggers);
/**
* 新增消息通知配置
*
* @param sysNewsTriggers 消息通知配置
* @return 结果
*/
public int insertSysNewsTriggers(SysNewsTriggers sysNewsTriggers);
/**
* 修改消息通知配置
*
* @param sysNewsTriggers 消息通知配置
* @return 结果
*/
public int updateSysNewsTriggers(SysNewsTriggers sysNewsTriggers);
/**
* 删除消息通知配置
*
* @param id 消息通知配置ID
* @return 结果
*/
public int deleteSysNewsTriggersById(Integer id);
/**
* 批量删除消息通知配置
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysNewsTriggersByIds(String[] ids);
}

View File

@ -0,0 +1,69 @@
package com.snow.system.service;
import java.util.List;
import com.snow.system.domain.SysNewsNode;
import com.snow.common.core.domain.Ztree;
/**
* 消息配置节点Service接口
*
* @author qimingjin
* @date 2021-03-02
*/
public interface ISysNewsNodeService
{
/**
* 查询消息配置节点
*
* @param id 消息配置节点ID
* @return 消息配置节点
*/
public SysNewsNode selectSysNewsNodeById(Integer id);
/**
* 查询消息配置节点列表
*
* @param sysNewsNode 消息配置节点
* @return 消息配置节点集合
*/
public List<SysNewsNode> selectSysNewsNodeList(SysNewsNode sysNewsNode);
/**
* 新增消息配置节点
*
* @param sysNewsNode 消息配置节点
* @return 结果
*/
public int insertSysNewsNode(SysNewsNode sysNewsNode);
/**
* 修改消息配置节点
*
* @param sysNewsNode 消息配置节点
* @return 结果
*/
public int updateSysNewsNode(SysNewsNode sysNewsNode);
/**
* 批量删除消息配置节点
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysNewsNodeByIds(String ids);
/**
* 删除消息配置节点信息
*
* @param id 消息配置节点ID
* @return 结果
*/
public int deleteSysNewsNodeById(Integer id);
/**
* 查询消息配置节点树列表
*
* @return 所有消息配置节点信息
*/
public List<Ztree> selectSysNewsNodeTree();
}

View File

@ -0,0 +1,61 @@
package com.snow.system.service;
import java.util.List;
import com.snow.system.domain.SysNewsTriggers;
/**
* 消息通知配置Service接口
*
* @author qimingjin
* @date 2021-03-02
*/
public interface ISysNewsTriggersService
{
/**
* 查询消息通知配置
*
* @param id 消息通知配置ID
* @return 消息通知配置
*/
public SysNewsTriggers selectSysNewsTriggersById(Integer id);
/**
* 查询消息通知配置列表
*
* @param sysNewsTriggers 消息通知配置
* @return 消息通知配置集合
*/
public List<SysNewsTriggers> selectSysNewsTriggersList(SysNewsTriggers sysNewsTriggers);
/**
* 新增消息通知配置
*
* @param sysNewsTriggers 消息通知配置
* @return 结果
*/
public int insertSysNewsTriggers(SysNewsTriggers sysNewsTriggers);
/**
* 修改消息通知配置
*
* @param sysNewsTriggers 消息通知配置
* @return 结果
*/
public int updateSysNewsTriggers(SysNewsTriggers sysNewsTriggers);
/**
* 批量删除消息通知配置
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysNewsTriggersByIds(String ids);
/**
* 删除消息通知配置信息
*
* @param id 消息通知配置ID
* @return 结果
*/
public int deleteSysNewsTriggersById(Integer id);
}

View File

@ -0,0 +1,121 @@
package com.snow.system.service.impl;
import java.util.List;
import java.util.ArrayList;
import com.snow.common.core.domain.Ztree;
import com.snow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.snow.system.mapper.SysNewsNodeMapper;
import com.snow.system.domain.SysNewsNode;
import com.snow.system.service.ISysNewsNodeService;
import com.snow.common.core.text.Convert;
/**
* 消息配置节点Service业务层处理
*
* @author qimingjin
* @date 2021-03-02
*/
@Service
public class SysNewsNodeServiceImpl implements ISysNewsNodeService
{
@Autowired
private SysNewsNodeMapper sysNewsNodeMapper;
/**
* 查询消息配置节点
*
* @param id 消息配置节点ID
* @return 消息配置节点
*/
@Override
public SysNewsNode selectSysNewsNodeById(Integer id)
{
return sysNewsNodeMapper.selectSysNewsNodeById(id);
}
/**
* 查询消息配置节点列表
*
* @param sysNewsNode 消息配置节点
* @return 消息配置节点
*/
@Override
public List<SysNewsNode> selectSysNewsNodeList(SysNewsNode sysNewsNode)
{
return sysNewsNodeMapper.selectSysNewsNodeList(sysNewsNode);
}
/**
* 新增消息配置节点
*
* @param sysNewsNode 消息配置节点
* @return 结果
*/
@Override
public int insertSysNewsNode(SysNewsNode sysNewsNode)
{
sysNewsNode.setCreateTime(DateUtils.getNowDate());
return sysNewsNodeMapper.insertSysNewsNode(sysNewsNode);
}
/**
* 修改消息配置节点
*
* @param sysNewsNode 消息配置节点
* @return 结果
*/
@Override
public int updateSysNewsNode(SysNewsNode sysNewsNode)
{
sysNewsNode.setUpdateTime(DateUtils.getNowDate());
return sysNewsNodeMapper.updateSysNewsNode(sysNewsNode);
}
/**
* 删除消息配置节点对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteSysNewsNodeByIds(String ids)
{
return sysNewsNodeMapper.deleteSysNewsNodeByIds(Convert.toStrArray(ids));
}
/**
* 删除消息配置节点信息
*
* @param id 消息配置节点ID
* @return 结果
*/
@Override
public int deleteSysNewsNodeById(Integer id)
{
return sysNewsNodeMapper.deleteSysNewsNodeById(id);
}
/**
* 查询消息配置节点树列表
*
* @return 所有消息配置节点信息
*/
@Override
public List<Ztree> selectSysNewsNodeTree()
{
List<SysNewsNode> sysNewsNodeList = sysNewsNodeMapper.selectSysNewsNodeList(new SysNewsNode());
List<Ztree> ztrees = new ArrayList<Ztree>();
for (SysNewsNode sysNewsNode : sysNewsNodeList)
{
Ztree ztree = new Ztree();
ztree.setId(sysNewsNode.getId().longValue());
ztree.setpId(sysNewsNode.getParentId());
ztree.setName(sysNewsNode.getNewsNodeName());
ztree.setTitle(sysNewsNode.getNewsNodeName());
ztrees.add(ztree);
}
return ztrees;
}
}

View File

@ -0,0 +1,97 @@
package com.snow.system.service.impl;
import java.util.List;
import com.snow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.snow.system.mapper.SysNewsTriggersMapper;
import com.snow.system.domain.SysNewsTriggers;
import com.snow.system.service.ISysNewsTriggersService;
import com.snow.common.core.text.Convert;
/**
* 消息通知配置Service业务层处理
*
* @author qimingjin
* @date 2021-03-02
*/
@Service
public class SysNewsTriggersServiceImpl implements ISysNewsTriggersService
{
@Autowired
private SysNewsTriggersMapper sysNewsTriggersMapper;
/**
* 查询消息通知配置
*
* @param id 消息通知配置ID
* @return 消息通知配置
*/
@Override
public SysNewsTriggers selectSysNewsTriggersById(Integer id)
{
return sysNewsTriggersMapper.selectSysNewsTriggersById(id);
}
/**
* 查询消息通知配置列表
*
* @param sysNewsTriggers 消息通知配置
* @return 消息通知配置
*/
@Override
public List<SysNewsTriggers> selectSysNewsTriggersList(SysNewsTriggers sysNewsTriggers)
{
return sysNewsTriggersMapper.selectSysNewsTriggersList(sysNewsTriggers);
}
/**
* 新增消息通知配置
*
* @param sysNewsTriggers 消息通知配置
* @return 结果
*/
@Override
public int insertSysNewsTriggers(SysNewsTriggers sysNewsTriggers)
{
sysNewsTriggers.setCreateTime(DateUtils.getNowDate());
return sysNewsTriggersMapper.insertSysNewsTriggers(sysNewsTriggers);
}
/**
* 修改消息通知配置
*
* @param sysNewsTriggers 消息通知配置
* @return 结果
*/
@Override
public int updateSysNewsTriggers(SysNewsTriggers sysNewsTriggers)
{
sysNewsTriggers.setUpdateTime(DateUtils.getNowDate());
return sysNewsTriggersMapper.updateSysNewsTriggers(sysNewsTriggers);
}
/**
* 删除消息通知配置对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteSysNewsTriggersByIds(String ids)
{
return sysNewsTriggersMapper.deleteSysNewsTriggersByIds(Convert.toStrArray(ids));
}
/**
* 删除消息通知配置信息
*
* @param id 消息通知配置ID
* @return 结果
*/
@Override
public int deleteSysNewsTriggersById(Integer id)
{
return sysNewsTriggersMapper.deleteSysNewsTriggersById(id);
}
}

View File

@ -0,0 +1,102 @@
<?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.snow.system.mapper.SysNewsNodeMapper">
<resultMap type="SysNewsNode" id="SysNewsNodeResult">
<result property="id" column="id" />
<result property="newsNodeName" column="news_node_name" />
<result property="newsNodeKey" column="news_node_key" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="orderNum" column="order_num" />
<result property="isDelete" column="is_delete" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="parentName" column="parent_name" />
</resultMap>
<sql id="selectSysNewsNodeVo">
select id, news_node_name, news_node_key, parent_id, ancestors, order_num, is_delete, create_by, create_time, update_by, update_time from sys_news_node
</sql>
<select id="selectSysNewsNodeList" parameterType="SysNewsNode" resultMap="SysNewsNodeResult">
<include refid="selectSysNewsNodeVo"/>
<where>
<if test="newsNodeName != null and newsNodeName != ''"> and news_node_name like concat('%', #{newsNodeName}, '%')</if>
<if test="newsNodeKey != null and newsNodeKey != ''"> and news_node_key = #{newsNodeKey}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
</where>
order by parent_id
</select>
<select id="selectSysNewsNodeById" parameterType="Integer" resultMap="SysNewsNodeResult">
select t.id, t.news_node_name, t.news_node_key, t.parent_id, t.ancestors, t.order_num, t.is_delete, t.create_by, t.create_time, t.update_by, t.update_time, p.news_node_name as parent_name
from sys_news_node t
left join sys_news_node p on p.id = t.parent_id
where t.id = #{id}
</select>
<insert id="insertSysNewsNode" parameterType="SysNewsNode" useGeneratedKeys="true" keyProperty="id">
insert into sys_news_node
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="newsNodeName != null and newsNodeName != ''">news_node_name,</if>
<if test="newsNodeKey != null">news_node_key,</if>
<if test="parentId != null">parent_id,</if>
<if test="ancestors != null">ancestors,</if>
<if test="orderNum != null">order_num,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="newsNodeName != null and newsNodeName != ''">#{newsNodeName},</if>
<if test="newsNodeKey != null">#{newsNodeKey},</if>
<if test="parentId != null">#{parentId},</if>
<if test="ancestors != null">#{ancestors},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateSysNewsNode" parameterType="SysNewsNode">
update sys_news_node
<trim prefix="SET" suffixOverrides=",">
<if test="newsNodeName != null and newsNodeName != ''">news_node_name = #{newsNodeName},</if>
<if test="newsNodeKey != null">news_node_key = #{newsNodeKey},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="ancestors != null">ancestors = #{ancestors},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysNewsNodeById" parameterType="Integer">
delete from sys_news_node where id = #{id}
</delete>
<delete id="deleteSysNewsNodeByIds" parameterType="String">
delete from sys_news_node where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,93 @@
<?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.snow.system.mapper.SysNewsTriggersMapper">
<resultMap type="SysNewsTriggers" id="SysNewsTriggersResult">
<result property="id" column="id" />
<result property="newsNodeId" column="news_node_id" />
<result property="newsType" column="news_type" />
<result property="newsOnOff" column="news_on_off" />
<result property="userId" column="user_id" />
<result property="isDelete" column="is_delete" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectSysNewsTriggersVo">
select id, news_node_id, news_type, news_on_off, user_id, is_delete, create_by, create_time, update_by, update_time from sys_news_triggers
</sql>
<select id="selectSysNewsTriggersList" parameterType="SysNewsTriggers" resultMap="SysNewsTriggersResult">
<include refid="selectSysNewsTriggersVo"/>
<where>
<if test="newsNodeId != null "> and news_node_id = #{newsNodeId}</if>
<if test="newsType != null "> and news_type = #{newsType}</if>
<if test="newsOnOff != null "> and news_on_off = #{newsOnOff}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
</where>
</select>
<select id="selectSysNewsTriggersById" parameterType="Integer" resultMap="SysNewsTriggersResult">
<include refid="selectSysNewsTriggersVo"/>
where id = #{id}
</select>
<insert id="insertSysNewsTriggers" parameterType="SysNewsTriggers" useGeneratedKeys="true" keyProperty="id">
insert into sys_news_triggers
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="newsNodeId != null">news_node_id,</if>
<if test="newsType != null">news_type,</if>
<if test="newsOnOff != null">news_on_off,</if>
<if test="userId != null and userId != ''">user_id,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="newsNodeId != null">#{newsNodeId},</if>
<if test="newsType != null">#{newsType},</if>
<if test="newsOnOff != null">#{newsOnOff},</if>
<if test="userId != null and userId != ''">#{userId},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateSysNewsTriggers" parameterType="SysNewsTriggers">
update sys_news_triggers
<trim prefix="SET" suffixOverrides=",">
<if test="newsNodeId != null">news_node_id = #{newsNodeId},</if>
<if test="newsType != null">news_type = #{newsType},</if>
<if test="newsOnOff != null">news_on_off = #{newsOnOff},</if>
<if test="userId != null and userId != ''">user_id = #{userId},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysNewsTriggersById" parameterType="Integer">
delete from sys_news_triggers where id = #{id}
</delete>
<delete id="deleteSysNewsTriggersByIds" parameterType="String">
delete from sys_news_triggers where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>