Selaa lähdekoodia

系统字典;客户名唯一校验

lzm 3 vuotta sitten
vanhempi
commit
aaac70bbdf

+ 9 - 0
sp-admin/sa-frame/menu-list-sp.js

@@ -48,4 +48,13 @@ window.menuList.unshift(
 			{id: 'sp-cfg-server', name: '服务器私有配置', url: 'sa-view-sp/sp-cfg/server-cfg.html'},
 		]
 	},
+	{
+		id: 'sys-dict',
+		name: '系统字典',
+		icon: 'el-icon-setting',
+		info: '系统字典配置',
+		childList: [
+			{id: 'sys-dict-list', name: '字典列表', url: 'sa-view/sys-dict/sys-dict-list.html'},
+		]
+	},
 );

+ 125 - 0
sp-admin/sa-view/sys-dict-item/sys-dict-item-add.html

@@ -0,0 +1,125 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>-添加/修改</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css js 资源 -->
+		<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
+		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
+		<script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
+		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
+		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<style type="text/css">
+			.c-panel .el-form .c-label{width: 7em !important;}
+			.c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner{width: 250px;}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+                    <div class="c-title" v-if="id == 0">数据添加</div>
+					<div class="c-title" v-else>数据修改</div>
+					<el-form v-if="m">
+						<sa-item type="text" name="字典值" v-model="m.itemValue" br></sa-item>
+						<sa-item type="text" name="字典文本" v-model="m.itemText" br></sa-item>
+						<sa-item type="text" name="描述" v-model="m.des" br></sa-item>
+						<sa-item type="num" name="排序" v-model="m.sort" br></sa-item>
+						<sa-item type="num" name="状态"  br>
+							<el-radio-group v-model="m.status" size="mini">
+								<el-radio-button :label="0">禁用</el-radio-button>
+								<el-radio-button :label="1">启用</el-radio-button>
+							</el-radio-group>
+						</sa-item>
+						<sa-item name="" class="s-ok" br>
+							<el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
+						</sa-item>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="primary" @click="ok()">确定</el-button>
+				<el-button @click="sa.closeCurrIframe()">取消</el-button>
+			</div>
+		</div>
+        <script>
+			
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0),		// 获取超链接中的id参数(0=添加,非0=修改) 
+					m: null,		// 实体对象 
+				},
+				methods: {
+					// 创建一个 默认Model 
+					createModel: function() {
+						return {
+							id: '',		// 主键 
+							dictId: sa.p('dictId',''),		// 字典ID
+							itemValue: '',		// 字典值 
+							itemText: '',		// 字典文本 
+							des: '',		// 描述 
+							sort: '1',		// 排序
+							status: '1',		// 状态(0=禁用,1=启用)
+						}
+					},
+					// 提交数据 
+					ok: function(){
+						// 表单校验 
+						let m = this.m;
+						// sa.checkNull(m.id, '请输入 [主键]');
+						// sa.checkNull(m.dictId, '请输入 [字典ID]');
+						sa.checkNull(m.itemValue, '请输入 [字典值]');
+						sa.checkNull(m.itemText, '请输入 [字典文本]');
+						sa.checkNull(m.des, '请输入 [描述]');
+						sa.checkNull(m.sort, '请输入 [排序]');
+						sa.checkNull(m.status, '请输入 [状态]');
+				
+						// 开始增加或修改
+						if(this.id <= 0) {	// 添加
+							sa.ajax('/SysDictItem/add', m, function(res){
+								sa.alert('增加成功', this.clean); 
+							}.bind(this));
+						} else {	// 修改
+							sa.ajax('/SysDictItem/update', m, function(res){
+								sa.alert('修改成功', this.clean);
+							}.bind(this));
+						}
+					},
+					// 添加/修改 完成后的动作
+					clean: function() {
+						if(this.id == 0) {
+							this.m = this.createModel();
+						} else {
+							parent.app.f5();		// 刷新父页面列表
+							sa.closeCurrIframe();	// 关闭本页 
+						}
+					}
+				},
+				mounted: function(){
+					// 初始化数据 
+					if(this.id <= 0) {	
+						this.m = this.createModel();
+					} else {	
+						sa.ajax('/SysDictItem/getById?id=' + this.id, function(res) {
+							this.m = res.data;
+							if(res.data == null) {
+								sa.alert('未能查找到 id=' + this.id + " 详细数据");
+							}
+						}.bind(this))
+					}
+				}
+			})
+			
+		</script>
+	</body>
+</html>

+ 153 - 0
sp-admin/sa-view/sys-dict-item/sys-dict-item-list.html

@@ -0,0 +1,153 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>-列表</title>
+		<meta charset="utf-8">
+		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css & js 资源 -->
+		<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
+		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
+		<script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
+		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
+		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+	</head>
+	<body>
+		<div class="vue-box" style="display: none;" :style="'display: block;'">
+			<div class="c-panel">
+				<!-- ------------- 检索参数 ------------- -->
+				<!-- ------------- 快捷按钮 ------------- -->
+				<sa-item type="fast-btn" show="add,reset"></sa-item>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList" >
+					<sa-td type="selection"></sa-td>
+					<sa-td name="字典值" prop="itemValue" ></sa-td>
+					<sa-td name="字典文本" prop="itemText" ></sa-td>
+					<sa-td name="描述" prop="des" ></sa-td>
+					<sa-td name="排序" prop="sort" type="num"></sa-td>
+<!--					<sa-td name="状态" prop="status" type="num">-->
+<!--						<template slot-scope="s">-->
+<!--							<el-switch v-model="s.row.status" :active-value="1" :inactive-value="0"-->
+<!--									   @change="updateStatus(s.row)" inactive-color="#ff4949" style="vertical-align: top;">-->
+<!--							</el-switch>-->
+<!--							<span style="color: #999;" v-if="s.row.status == 1">启用</span>-->
+<!--							<span style="color: #999;" v-if="s.row.status == 0">禁用</span>-->
+<!--						</template>-->
+<!--					</sa-td>-->
+					<sa-td name="状态" prop="status" type="switch" :jv="{0: '禁用[#ff0000]', 1: '启用[#005500]'}"
+						   @change="s => updateStatus(s.row)"></sa-td>
+					<el-table-column label="操作" fixed="right"  width="240px">
+						<template slot-scope="s">
+							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
+							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+				<!-- ------------- 分页 ------------- -->
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),  
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),		
+				},
+				el: '.vue-box',
+				data: {
+					p: { // 查询参数  
+						dictId: sa.p('dictId', ''),
+						pageNo: 1,		// 当前页 
+						pageSize: 10,	// 页大小 
+						sortType: 0		// 排序方式 
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合 
+				},
+				methods: {
+					// 刷新
+					f5: function() {
+						sa.ajax('/SysDictItem/getList', sa.removeNull(this.p), function(res) {
+							this.dataList = res.data; // 数据
+							this.dataCount = res.dataCount; // 数据总数 
+							sa.f5TableHeight();		// 刷新表格高度 
+						}.bind(this));
+					},
+					// 查看
+					get: function(data) {
+						sa.showIframe('数据详情', 'sys-dict-item-info.html?id=' + data.id, '1050px', '90%');
+					},
+					// 查看 - 根据选中的
+					getBySelect: function(data) {
+						var selection = this.$refs['data-table'].selection;
+						if(selection.length == 0) {
+							return sa.msg('请选择一条数据')
+						}
+						this.get(selection[0]);
+					},
+					// 修改
+					update: function(data) {
+						sa.showIframe('修改数据', 'sys-dict-item-add.html?id=' + data.id + '&dictId=' + this.p.dictId,
+								'450px', '60%');
+					},
+					// 新增
+					add: function(data) {
+						sa.showIframe('新增数据', 'sys-dict-item-add.html?id=-1&dictId=' + this.p.dictId, '450px', '60%');
+					},
+					// 删除
+					del: function(data) {
+						sa.confirm('是否删除,此操作不可撤销', function() {
+							sa.ajax('/SysDictItem/delete?id=' + data.id, function(res) {
+								sa.arrayDelete(this.dataList, data);
+								sa.ok('删除成功');
+								sa.f5TableHeight();		// 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 批量删除
+					deleteByIds: function() {
+						// 获取选中元素的id列表 
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if(selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						// 提交删除 
+						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
+							sa.ajax('/SysDictItem/deleteByIds', {ids: ids.join(',')}, function(res) {
+								sa.arrayDelete(this.dataList, selection);
+								sa.ok('删除成功');
+								sa.f5TableHeight();		// 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 改 - 是否可用(0=可用,1=不可用)
+					updateStatus: function(data) {
+						// 声明变量记录是否成功
+						var isOk = false;
+						var oldValue = data.status;
+						var ajax = sa.ajax('/SysDictItem/updateStatus', {
+							id: data.id,
+							value: data.status
+						}, function(res) {
+							isOk = true;
+							sa.msg('修改成功');
+						}.bind(this));
+						// 如果未能修改成功, 则回滚
+						$.when(ajax).done(function() {
+							if (isOk == false) {
+								data.status = oldValue;
+							}
+						})
+					},
+				},
+				created: function() {
+					this.f5();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
+</html>

+ 112 - 0
sp-admin/sa-view/sys-dict/sys-dict-add.html

@@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>字典表-添加/修改</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css js 资源 -->
+		<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
+		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
+		<script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
+		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
+		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<style type="text/css">
+			.c-panel .el-form .c-label{width: 7em !important;}
+			.c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner{width: 250px;}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+                    <div class="c-title" v-if="id == 0">数据添加</div>
+					<div class="c-title" v-else>数据修改</div>
+					<el-form v-if="m">
+						<sa-item type="text" name="字典名称" v-model="m.name" br></sa-item>
+						<sa-item type="text" name="编号" v-model="m.code" br></sa-item>
+						<sa-item type="text" name="描述" v-model="m.des" br></sa-item>
+						<sa-item name="" class="s-ok" br>
+							<el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
+						</sa-item>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="primary" @click="ok()">确定</el-button>
+				<el-button @click="sa.closeCurrIframe()">取消</el-button>
+			</div>
+		</div>
+        <script>
+			
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0),		// 获取超链接中的id参数(0=添加,非0=修改) 
+					m: null,		// 实体对象 
+				},
+				methods: {
+					// 创建一个 默认Model 
+					createModel: function() {
+						return {
+							id: '',		// 主键 
+							name: '',		// 字典名称 
+							code: '',		// 编号 
+							des: '',		// 描述
+						}
+					},
+					// 提交数据 
+					ok: function(){
+						// 表单校验 
+						let m = this.m;
+						// sa.checkNull(m.id, '请输入 [主键]');
+						sa.checkNull(m.name, '请输入 [字典名称]');
+						sa.checkNull(m.code, '请输入 [编号]');
+						sa.checkNull(m.des, '请输入 [描述]');
+				
+						// 开始增加或修改
+						if(this.id <= 0) {	// 添加
+							sa.ajax('/SysDict/add', m, function(res){
+								sa.alert('增加成功', this.clean); 
+							}.bind(this));
+						} else {	// 修改
+							sa.ajax('/SysDict/update', m, function(res){
+								sa.alert('修改成功', this.clean);
+							}.bind(this));
+						}
+					},
+					// 添加/修改 完成后的动作
+					clean: function() {
+						if(this.id == 0) {
+							this.m = this.createModel();
+						} else {
+							parent.app.f5();		// 刷新父页面列表
+							sa.closeCurrIframe();	// 关闭本页 
+						}
+					}
+				},
+				mounted: function(){
+					// 初始化数据 
+					if(this.id <= 0) {	
+						this.m = this.createModel();
+					} else {	
+						sa.ajax('/SysDict/getById?id=' + this.id, function(res) {
+							this.m = res.data;
+							if(res.data == null) {
+								sa.alert('未能查找到 id=' + this.id + " 详细数据");
+							}
+						}.bind(this))
+					}
+				}
+			})
+			
+		</script>
+	</body>
+</html>

+ 133 - 0
sp-admin/sa-view/sys-dict/sys-dict-list.html

@@ -0,0 +1,133 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>字典表-列表</title>
+		<meta charset="utf-8">
+		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css & js 资源 -->
+		<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
+		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
+		<script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
+		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
+		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+	</head>
+	<body>
+		<div class="vue-box" style="display: none;" :style="'display: block;'">
+			<div class="c-panel">
+				<!-- ------------- 检索参数 ------------- -->
+				<div class="c-title">检索参数</div>
+				<el-form ref="form" :model='p' @submit.native.prevent>
+					<sa-item type="text" name="字典名称" v-model="p.name"></sa-item>
+					<sa-item type="text" name="编号" v-model="p.code"></sa-item>
+					<sa-item type="text" name="描述" v-model="p.des"></sa-item>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<br />
+				</el-form>
+				<!-- ------------- 快捷按钮 ------------- -->
+				<sa-item type="fast-btn" show="add,reset"></sa-item>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList" >
+					<sa-td type="selection"></sa-td>
+					<sa-td name="字典名称" prop="name" ></sa-td>
+					<sa-td name="编号" prop="code" ></sa-td>
+					<sa-td name="描述" prop="des" ></sa-td>
+					<el-table-column label="操作" fixed="right"  width="240px">
+						<template slot-scope="s">
+							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">字典表项</el-button>
+							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
+							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+				<!-- ------------- 分页 ------------- -->
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),  
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),		
+				},
+				el: '.vue-box',
+				data: {
+					p: { // 查询参数  
+						id: '',		// 主键 
+						name: '',		// 字典名称 
+						code: '',		// 编号 
+						des: '',		// 描述
+						pageNo: 1,		// 当前页 
+						pageSize: 10,	// 页大小 
+						sortType: 0		// 排序方式 
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合 
+				},
+				methods: {
+					// 刷新
+					f5: function() {
+						sa.ajax('/SysDict/getList', sa.removeNull(this.p), function(res) {
+							this.dataList = res.data; // 数据
+							this.dataCount = res.dataCount; // 数据总数 
+							sa.f5TableHeight();		// 刷新表格高度 
+						}.bind(this));
+					},
+					// 查看
+					get: function(data) {
+						sa.showIframe('字典项', '../sys-dict-item/sys-dict-item-list.html?dictId=' + data.id, '950px', '90%');
+					},
+					// 查看 - 根据选中的
+					getBySelect: function(data) {
+						var selection = this.$refs['data-table'].selection;
+						if(selection.length == 0) {
+							return sa.msg('请选择一条数据')
+						}
+						this.get(selection[0]);
+					},
+					// 修改
+					update: function(data) {
+						sa.showIframe('修改数据', 'sys-dict-add.html?id=' + data.id, '450px', '70%');
+					},
+					// 新增
+					add: function(data) {
+						sa.showIframe('新增数据', 'sys-dict-add.html?id=-1', '450px', '70%');
+					},
+					// 删除
+					del: function(data) {
+						sa.confirm('是否删除,此操作不可撤销', function() {
+							sa.ajax('/SysDict/delete?id=' + data.id, function(res) {
+								sa.arrayDelete(this.dataList, data);
+								sa.ok('删除成功');
+								sa.f5TableHeight();		// 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 批量删除
+					deleteByIds: function() {
+						// 获取选中元素的id列表 
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if(selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						// 提交删除 
+						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
+							sa.ajax('/SysDict/deleteByIds', {ids: ids.join(',')}, function(res) {
+								sa.arrayDelete(this.dataList, selection);
+								sa.ok('删除成功');
+								sa.f5TableHeight();		// 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+				},
+				created: function() {
+					this.f5();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
+</html>

+ 0 - 1
sp-server/app.pid

@@ -1 +0,0 @@
-6124

+ 0 - 108
sp-server/sp-server.iml

@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
-  <component name="FacetManager">
-    <facet type="Spring" name="Spring">
-      <configuration />
-    </facet>
-    <facet type="web" name="Web">
-      <configuration>
-        <webroots />
-      </configuration>
-    </facet>
-  </component>
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
-    <output url="file://$MODULE_DIR$/target/classes" />
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
-    <content url="file://$MODULE_DIR$">
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
-      <excludeFolder url="file://$MODULE_DIR$/target" />
-    </content>
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
-    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.13.3" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.13.3" level="project" />
-    <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
-    <orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.26" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.2" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.2" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.37" level="project" />
-    <orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.37" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" />
-    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.3.2" level="project" />
-    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.3.2" level="project" />
-    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.3.2" level="project" />
-    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.3.2" level="project" />
-    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.3.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13" level="project" />
-    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1" level="project" />
-    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.1" level="project" />
-    <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.3" level="project" />
-    <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.3" level="project" />
-    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" />
-    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" />
-    <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" />
-    <orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.21" level="project" />
-    <orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.10" level="project" />
-    <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.10" level="project" />
-    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
-    <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.12" level="project" />
-    <orderEntry type="library" name="Maven: cn.dev33:sa-token-spring-boot-starter:1.28.0" level="project" />
-    <orderEntry type="library" name="Maven: cn.dev33:sa-token-servlet:1.28.0" level="project" />
-    <orderEntry type="library" name="Maven: cn.dev33:sa-token-dao-redis-jackson:1.28.0" level="project" />
-    <orderEntry type="library" name="Maven: cn.dev33:sa-token-core:1.28.0" level="project" />
-    <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.7.15" level="project" />
-    <orderEntry type="library" name="Maven: com.ejlchina:okhttps:3.2.0" level="project" />
-    <orderEntry type="library" name="Maven: com.ejlchina:data-core:1.0.1" level="project" />
-    <orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.9" level="project" />
-    <orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.5" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: io.lettuce:lettuce-core:5.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-common:4.1.51.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.51.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.51.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.51.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.51.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.51.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.9.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.1" level="project" />
-    <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.73" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.3.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: com.auth0:java-jwt:3.3.0" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.2" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.2" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.2" level="project" />
-    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.14" level="project" />
-  </component>
-</module>

+ 65 - 0
sp-server/src/main/java/com/pj/project/sys_dict/SysDict.java

@@ -0,0 +1,65 @@
+package com.pj.project.sys_dict;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * Model: sys_dict -- 字典表
+ * @author qzyReal 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(SysDict.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class SysDict extends Model<SysDict> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "sys_dict";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "sys-dict";	
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+
+	private String id;
+
+	/**
+	 * 字典名称 
+	 */
+	private String name;
+
+	/**
+	 * 编号 
+	 */
+	private String code;
+
+	/**
+	 * 描述 
+	 */
+	private String des;
+
+
+
+
+
+	
+
+
+}

+ 116 - 0
sp-server/src/main/java/com/pj/project/sys_dict/SysDictController.java

@@ -0,0 +1,116 @@
+package com.pj.project.sys_dict;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.pj.current.satoken.StpUserUtil;
+import com.pj.project4sp.SP;
+import com.pj.utils.sg.AjaxError;
+import com.pj.utils.sg.AjaxJson;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+/**
+ * Controller: sys_dict -- 字典表
+ *
+ * @author qzyReal
+ */
+@RestController
+@RequestMapping("/SysDict/")
+public class SysDictController {
+
+    /**
+     * 底层 Service 对象
+     */
+    @Autowired
+    SysDictService sysDictService;
+
+    /**
+     * 增
+     */
+    @RequestMapping("add")
+    @SaCheckPermission(SysDict.PERMISSION_CODE)
+    @Transactional(rollbackFor = Exception.class)
+    public AjaxJson add(SysDict s) {
+        sysDictService.add(s);
+        return AjaxJson.getSuccessData(s);
+    }
+
+    /**
+     * 删
+     */
+    @RequestMapping("delete")
+    @SaCheckPermission(SysDict.PERMISSION_CODE)
+    public AjaxJson delete(Long id) {
+        int line = sysDictService.delete(id);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 删 - 根据id列表
+     */
+    @RequestMapping("deleteByIds")
+    @SaCheckPermission(SysDict.PERMISSION_CODE)
+    public AjaxJson deleteByIds() {
+        List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+        int line = SP.publicMapper.deleteByIds(SysDict.TABLE_NAME, ids);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 改
+     */
+    @RequestMapping("update")
+    @SaCheckPermission(SysDict.PERMISSION_CODE)
+    public AjaxJson update(SysDict s) {
+        int line = sysDictService.update(s);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 查 - 根据id
+     */
+    @RequestMapping("getById")
+    public AjaxJson getById(Long id) {
+        SysDict s = sysDictService.getById(id);
+        return AjaxJson.getSuccessData(s);
+    }
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    @RequestMapping("getList")
+    public AjaxJson getList() {
+        SoMap so = SoMap.getRequestSoMap();
+        List<SysDict> list = sysDictService.getList(so.startPage());
+        return AjaxJson.getPageData(so.getDataCount(), list);
+    }
+
+
+
+
+    // ------------------------- 前端接口 -------------------------
+
+
+    /**
+     * 改 - 不传不改 [G]
+     */
+    @RequestMapping("updateByNotNull")
+    public AjaxJson updateByNotNull(Long id) {
+        AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
+        // 鉴别身份,是否为数据创建者
+        long userId = SP.publicMapper.getColumnByIdToLong(SysDict.TABLE_NAME, "user_id", id);
+        AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
+        // 开始修改 (请只保留需要修改的字段)
+        SoMap so = SoMap.getRequestSoMap();
+        so.clearNotIn("id", "name", "code", "desc").clearNull().humpToLineCase();
+        int line = SP.publicMapper.updateBySoMapById(SysDict.TABLE_NAME, so, id);
+        return AjaxJson.getByLine(line);
+    }
+
+
+}

+ 56 - 0
sp-server/src/main/java/com/pj/project/sys_dict/SysDictMapper.java

@@ -0,0 +1,56 @@
+package com.pj.project.sys_dict;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.pj.utils.so.SoMap;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * Mapper: sys_dict -- 字典表
+ * @author qzyReal 
+ */
+
+@Mapper
+@Repository
+public interface SysDictMapper extends BaseMapper <SysDict> {
+
+	/**
+	 * 增  
+	 * @param s 实体对象 
+	 * @return 受影响行数 
+	 */
+	int add(SysDict s);
+
+	/**
+	 * 删  
+	 * @param id 要删除的数据id  
+	 * @return 受影响行数 
+	 */
+	int delete(Long id);	 
+
+	/** 
+	 * 改  
+	 * @param s 实体对象 
+	 * @return 受影响行数 
+	 */
+	int update(SysDict s);
+
+	/** 
+	 * 查 - 根据id  
+	 * @param id 要查询的数据id 
+	 * @return 实体对象 
+	 */
+	SysDict getById(Long id);	 
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<SysDict> getList(SoMap so);
+
+
+}

+ 72 - 0
sp-server/src/main/java/com/pj/project/sys_dict/SysDictMapper.xml

@@ -0,0 +1,72 @@
+<?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.pj.project.sys_dict.SysDictMapper">
+
+    <!-- 增 [G] -->
+    <insert id="add">
+		insert into 
+		sys_dict (id, name, code, `des`)
+		values (#{id}, #{name}, #{code}, #{des})
+	</insert>
+
+    <!-- 删 -->
+    <delete id="delete">
+		delete from sys_dict 
+		where id = #{id}
+	</delete>
+
+    <!-- 改 [G] -->
+    <update id="update">
+		update sys_dict set
+		id = #{id}, 
+		name = #{name}, 
+		code = #{code}, 
+		`des` = #{des}
+		where id = #{id}
+	</update>
+
+
+    <!-- ================================== 查询相关 ================================== -->
+    <!-- select id, name, code, desc from sys_dict  -->
+
+    <!-- 通用映射:手动模式 -->
+    <resultMap id="model" type="com.pj.project.sys_dict.SysDict">
+        <result property="id" column="id"/>
+        <result property="name" column="name"/>
+        <result property="code" column="code"/>
+        <result property="des" column="des"/>
+    </resultMap>
+
+    <!-- 公共查询sql片段 -->
+    <sql id="select_sql">
+		select * 
+		from sys_dict 
+	</sql>
+
+    <!-- 查 - 根据id -->
+    <select id="getById" resultMap="model">
+        <include refid="select_sql"></include>
+        where id = #{id}
+    </select>
+
+    <!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+    <select id="getList" resultMap="model">
+        <include refid="select_sql"></include>
+        <where>
+            <if test=' this.isNotNull("id") '>and id = #{id}</if>
+            <if test=' this.isNotNull("name") '>and name like concat('%',#{name},'%')</if>
+            <if test=' this.isNotNull("code") '>and code = #{code}</if>
+            <if test=' this.isNotNull("des") '>and `des` like concat('%',#{des},'%')</if>
+        </where>
+        order by
+        <choose>
+            <when test='sortType == 1'>id desc</when>
+            <when test='sortType == 2'>name desc</when>
+            <when test='sortType == 3'>code desc</when>
+            <when test='sortType == 4'>`des` desc</when>
+            <otherwise>id desc</otherwise>
+        </choose>
+    </select>
+
+
+</mapper>

+ 76 - 0
sp-server/src/main/java/com/pj/project/sys_dict/SysDictService.java

@@ -0,0 +1,76 @@
+package com.pj.project.sys_dict;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * Service: sys_dict -- 字典表
+ *
+ * @author qzyReal
+ */
+@Service
+public class SysDictService extends ServiceImpl<SysDictMapper, SysDict> implements IService<SysDict> {
+
+    /**
+     * 底层 Mapper 对象
+     */
+    @Autowired
+    SysDictMapper sysDictMapper;
+
+    /**
+     * 增
+     */
+    int add(SysDict s) {
+        return sysDictMapper.add(s);
+    }
+
+    /**
+     * 删
+     */
+    int delete(Long id) {
+        return sysDictMapper.delete(id);
+    }
+
+    /**
+     * 改
+     */
+    int update(SysDict s) {
+        return sysDictMapper.update(s);
+    }
+
+    /**
+     * 查
+     */
+    SysDict getById(Long id) {
+        return sysDictMapper.getById(id);
+    }
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    List<SysDict> getList(SoMap so) {
+        return sysDictMapper.getList(so);
+    }
+
+    /**
+     * 根据编号查询
+     * @param code
+     * @return
+     */
+    SysDict findByCode(String code) {
+        QueryWrapper<SysDict> ew = new QueryWrapper<>();
+        ew.eq("code", code);
+        return this.getOne(ew);
+    }
+
+
+
+}

+ 82 - 0
sp-server/src/main/java/com/pj/project/sys_dict_item/SysDictItem.java

@@ -0,0 +1,82 @@
+package com.pj.project.sys_dict_item;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * Model: sys_dict_item -- 
+ * @author qzyReal 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(SysDictItem.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class SysDictItem extends Model<SysDictItem> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "sys_dict_item";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "sys-dict-item";	
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+
+	private String id;
+
+	/**
+	 * 字典ID 
+	 */
+	private String dictId;
+
+	/**
+	 * 字典值 
+	 */
+	private String itemValue;
+
+	/**
+	 * 字典文本 
+	 */
+	private String itemText;
+
+	/**
+	 * 描述 
+	 */
+	private String des;
+
+	/**
+	 * 排序 
+	 */
+	private int sort;
+
+	/**
+	 * 状态(0=禁用,1=启用) 
+	 */
+	private int status;
+
+
+
+
+
+	
+
+
+}

+ 112 - 0
sp-server/src/main/java/com/pj/project/sys_dict_item/SysDictItemController.java

@@ -0,0 +1,112 @@
+package com.pj.project.sys_dict_item;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.pj.current.satoken.StpUserUtil;
+import com.pj.project.sys_dict.SysDict;
+import com.pj.project4sp.SP;
+import com.pj.utils.sg.AjaxError;
+import com.pj.utils.sg.AjaxJson;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+/**
+ * Controller: sys_dict_item -- 
+ * @author qzyReal 
+ */
+@RestController
+@RequestMapping("/SysDictItem/")
+public class SysDictItemController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	SysDictItemService sysDictItemService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(SysDict.PERMISSION_CODE)
+	@Transactional(rollbackFor = Exception.class)
+	public AjaxJson add(SysDictItem s){
+		sysDictItemService.add(s);
+		return AjaxJson.getSuccessData(s);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(SysDict.PERMISSION_CODE)
+	public AjaxJson delete(String id){
+		int line = sysDictItemService.delete(id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(SysDict.PERMISSION_CODE)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+		int line = SP.publicMapper.deleteByIds(SysDictItem.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(SysDict.PERMISSION_CODE)
+	public AjaxJson update(SysDictItem s){
+		int line = sysDictItemService.update(s);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+	public AjaxJson getById(String id){
+		SysDictItem s = sysDictItemService.getById(id);
+		return AjaxJson.getSuccessData(s);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<SysDictItem> list = sysDictItemService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+
+	/** 改 - 是否可用(0=可用,1=不可用) */
+	@RequestMapping("updateStatus")
+	@SaCheckPermission(SysDict.PERMISSION_CODE)
+	public AjaxJson updateStatus(Long id, int value){
+		SP.publicMapper.updateColumnById(SysDictItem.TABLE_NAME, "status", value, id);
+		return AjaxJson.getSuccess();
+	}
+	
+	
+	
+	// ------------------------- 前端接口 -------------------------
+	
+	
+	/** 改 - 不传不改 [G] */
+	@RequestMapping("updateByNotNull")
+	public AjaxJson updateByNotNull(String id){
+		AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
+		// 鉴别身份,是否为数据创建者 
+		long userId = SP.publicMapper.getColumnByIdToLong(SysDictItem.TABLE_NAME, "user_id", id);
+		AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
+		// 开始修改 (请只保留需要修改的字段)
+		SoMap so = SoMap.getRequestSoMap();
+		so.clearNotIn("id", "dictId", "itemValue", "itemText", "desc", "sort", "status").clearNull().humpToLineCase();	
+		int line = SP.publicMapper.updateBySoMapById(SysDictItem.TABLE_NAME, so, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	
+	
+	
+	
+	
+
+}

+ 56 - 0
sp-server/src/main/java/com/pj/project/sys_dict_item/SysDictItemMapper.java

@@ -0,0 +1,56 @@
+package com.pj.project.sys_dict_item;
+
+import java.util.List;
+
+import com.pj.utils.so.SoMap;
+import org.apache.ibatis.annotations.Mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: sys_dict_item -- 
+ * @author qzyReal 
+ */
+
+@Mapper
+@Repository
+public interface SysDictItemMapper extends BaseMapper <SysDictItem> {
+
+	/**
+	 * 增  
+	 * @param s 实体对象 
+	 * @return 受影响行数 
+	 */
+	int add(SysDictItem s);
+
+	/**
+	 * 删  
+	 * @param id 要删除的数据id  
+	 * @return 受影响行数 
+	 */
+	int delete(String id);	 
+
+	/** 
+	 * 改  
+	 * @param s 实体对象 
+	 * @return 受影响行数 
+	 */
+	int update(SysDictItem s);
+
+	/** 
+	 * 查 - 根据id  
+	 * @param id 要查询的数据id 
+	 * @return 实体对象 
+	 */
+	SysDictItem getById(String id);	 
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<SysDictItem> getList(SoMap so);
+
+
+}

+ 92 - 0
sp-server/src/main/java/com/pj/project/sys_dict_item/SysDictItemMapper.xml

@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.project.sys_dict_item.SysDictItemMapper">
+
+	<!-- 增 [G] -->
+	<insert id="add">
+		insert into 
+		sys_dict_item (id, dict_id, item_value, item_text, des, sort, status)
+		values (#{id}, #{dictId}, #{itemValue}, #{itemText}, #{des}, #{sort}, #{status})
+	</insert>
+
+	<!-- 删 -->
+	<delete id="delete">
+		delete from sys_dict_item 
+		where id = #{id}
+	</delete>
+
+	<!-- 改 [G] -->
+	<update id="update">
+		update sys_dict_item set
+		id = #{id}, 
+		dict_id = #{dictId}, 
+		item_value = #{itemValue}, 
+		item_text = #{itemText}, 
+		des = #{des},
+		sort = #{sort}, 
+		status = #{status}
+		where id = #{id}
+	</update>
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, dict_id, item_value, item_text, desc, sort, status from sys_dict_item  -->
+	
+	<!-- 通用映射:手动模式 -->
+	<resultMap id="model" type="com.pj.project.sys_dict_item.SysDictItem">
+		<result property="id" column="id" />
+		<result property="dictId" column="dict_id" />
+		<result property="itemValue" column="item_value" />
+		<result property="itemText" column="item_text" />
+		<result property="des" column="des" />
+		<result property="sort" column="sort" />
+		<result property="status" column="status" />
+	</resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from sys_dict_item 
+	</sql>
+	
+	<!-- 查 - 根据id -->
+	<select id="getById" resultMap="model">
+		<include refid="select_sql"></include>
+		where id = #{id}
+	</select>
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.isNotNull("id") '> and id = #{id} </if>
+			<if test=' this.isNotNull("dictId") '> and dict_id = #{dictId} </if>
+			<if test=' this.isNotNull("itemValue") '> and item_value = #{itemValue} </if>
+			<if test=' this.isNotNull("itemText") '> and item_text = #{itemText} </if>
+			<if test=' this.isNotNull("des") '> and desc= #{des} </if>
+			<if test=' this.isNotNull("sort") '> and sort = #{sort} </if>
+			<if test=' this.isNotNull("status") '> and status = #{status} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> dict_id desc </when>
+			<when test='sortType == 3'> item_value desc </when>
+			<when test='sortType == 4'> item_text desc </when>
+			<when test='sortType == 5'> des desc </when>
+			<when test='sortType == 6'> sort desc </when>
+			<when test='sortType == 7'> status desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 54 - 0
sp-server/src/main/java/com/pj/project/sys_dict_item/SysDictItemService.java

@@ -0,0 +1,54 @@
+package com.pj.project.sys_dict_item;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * Service: sys_dict_item -- 
+ * @author qzyReal 
+ */
+@Service
+public class SysDictItemService  extends ServiceImpl <SysDictItemMapper,SysDictItem> implements IService<SysDictItem>  {
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	SysDictItemMapper sysDictItemMapper;
+
+	/** 增 */
+	int add(SysDictItem s){
+		return sysDictItemMapper.add(s);
+	}
+
+	/** 删 */
+	int delete(String id){
+		return sysDictItemMapper.delete(id);
+	}
+
+	/** 改 */
+	int update(SysDictItem s){
+		return sysDictItemMapper.update(s);
+	}
+
+	/** 查 */
+	SysDictItem getById(String id){
+		return sysDictItemMapper.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<SysDictItem> getList(SoMap so) {
+		return sysDictItemMapper.getList(so);	
+	}
+	
+
+	public List<SysDictItem> findByDictId(Long dictId){
+		QueryWrapper<SysDictItem>ew=new QueryWrapper<>();
+		ew.eq("dict_id",dictId);
+		return this.list(ew);
+	}
+}

+ 22 - 1
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerService.java

@@ -8,6 +8,7 @@ import java.util.stream.Collectors;
 import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.constants.RoleEnum;
@@ -53,6 +54,9 @@ public class TbCostomerService extends ServiceImpl<TbCostomerMapper, TbCostomer>
      * 增
      */
     int add(TbCostomer t) {
+        if (!validateName(t)) {
+            throw new RuntimeException("该企业名称已存在");
+        }
         t.setCreareTime(new Date()).setJudgeContent("平台创建,直接通过").setJudgeTime(new Date());
         this.save(t);
         List<RoleEnum> roleEnums = RoleEnum.getCustomerInitRoleList();
@@ -69,6 +73,21 @@ public class TbCostomerService extends ServiceImpl<TbCostomerMapper, TbCostomer>
         return 1;
     }
 
+    private boolean validateName(TbCostomer t) {
+        String costomerName = t.getName();
+        TbCostomer db = this.findByName(costomerName);
+        if (db == null) {
+            return true;
+        }
+        return StrUtil.equals(db.getId(), t.getId());
+    }
+
+    TbCostomer findByName(String name){
+        QueryWrapper<TbCostomer> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("name", name);
+        return this.getOne(queryWrapper);
+    }
+
     /**
      * 删
      */
@@ -90,7 +109,9 @@ public class TbCostomerService extends ServiceImpl<TbCostomerMapper, TbCostomer>
      * 改
      */
     int update(TbCostomer t) {
-
+        if (!validateName(t)) {
+            throw new RuntimeException("该企业名称已存在");
+        }
         this.updateById(t);
         return 1;
     }