Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
94d783a3
提交
94d783a3
authored
10月 27, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
条款管理
上级
1a5dd685
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
703 行增加
和
0 行删除
+703
-0
TermController.java
...src/main/java/com/platform/controller/TermController.java
+109
-0
TermDao.java
platform-admin/src/main/java/com/platform/dao/TermDao.java
+13
-0
TermEntity.java
...m-admin/src/main/java/com/platform/entity/TermEntity.java
+153
-0
TermService.java
...admin/src/main/java/com/platform/service/TermService.java
+71
-0
TermServiceImpl.java
.../main/java/com/platform/service/impl/TermServiceImpl.java
+59
-0
TermDao.xml
...orm-admin/src/main/resources/com/platform/dao/TermDao.xml
+113
-0
term.html
platform-admin/src/main/webapp/WEB-INF/page/sys/term.html
+68
-0
term.js
platform-admin/src/main/webapp/js/sys/term.js
+117
-0
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TermController.java
0 → 100644
浏览文件 @
94d783a3
package
com
.
platform
.
controller
;
import
com.platform.entity.TermEntity
;
import
com.platform.service.TermService
;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.Query
;
import
com.platform.utils.R
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
import
java.util.Map
;
/**
* Controller
*
* @author lipengjun
* @date 2020-10-27 17:49:26
*/
@Controller
@RequestMapping
(
"term"
)
public
class
TermController
{
@Autowired
private
TermService
termService
;
/**
* 查看列表
*/
@RequestMapping
(
"/list"
)
@RequiresPermissions
(
"term:list"
)
@ResponseBody
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
//查询列表数据
Query
query
=
new
Query
(
params
);
List
<
TermEntity
>
termList
=
termService
.
queryList
(
query
);
int
total
=
termService
.
queryTotal
(
query
);
PageUtils
pageUtil
=
new
PageUtils
(
termList
,
total
,
query
.
getLimit
(),
query
.
getPage
());
return
R
.
ok
().
put
(
"page"
,
pageUtil
);
}
/**
* 查看信息
*/
@RequestMapping
(
"/info/{id}"
)
@RequiresPermissions
(
"term:info"
)
@ResponseBody
public
R
info
(
@PathVariable
(
"id"
)
String
id
)
{
TermEntity
term
=
termService
.
queryObject
(
id
);
return
R
.
ok
().
put
(
"term"
,
term
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"term:save"
)
@ResponseBody
public
R
save
(
@RequestBody
TermEntity
term
)
{
termService
.
save
(
term
);
return
R
.
ok
();
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"term:update"
)
@ResponseBody
public
R
update
(
@RequestBody
TermEntity
term
)
{
termService
.
update
(
term
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
@RequiresPermissions
(
"term:delete"
)
@ResponseBody
public
R
delete
(
@RequestBody
String
[]
ids
)
{
termService
.
deleteBatch
(
ids
);
return
R
.
ok
();
}
/**
* 查看所有列表
*/
@RequestMapping
(
"/queryAll"
)
@ResponseBody
public
R
queryAll
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
List
<
TermEntity
>
list
=
termService
.
queryList
(
params
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
platform-admin/src/main/java/com/platform/dao/TermDao.java
0 → 100644
浏览文件 @
94d783a3
package
com
.
platform
.
dao
;
import
com.platform.entity.TermEntity
;
/**
* Dao
*
* @author lipengjun
* @date 2020-10-27 17:49:26
*/
public
interface
TermDao
extends
BaseDao
<
TermEntity
>
{
}
platform-admin/src/main/java/com/platform/entity/TermEntity.java
0 → 100644
浏览文件 @
94d783a3
package
com
.
platform
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 实体
* 表名 term
*
* @author lipengjun
* @date 2020-10-27 17:49:26
*/
public
class
TermEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 条款ID
*/
private
String
id
;
/**
* 父条款ID,一级条款为0
*/
private
String
parentId
;
/**
* 条款名称
*/
private
String
termName
;
/**
* 条款内容
*/
private
String
termContent
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 状态 0:无效 1:有效
*/
private
Integer
status
;
/**
* 排序
*/
private
Integer
sort
;
/**
* 设置:条款ID
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 获取:条款ID
*/
public
String
getId
()
{
return
id
;
}
/**
* 设置:父条款ID,一级条款为0
*/
public
void
setParentId
(
String
parentId
)
{
this
.
parentId
=
parentId
;
}
/**
* 获取:父条款ID,一级条款为0
*/
public
String
getParentId
()
{
return
parentId
;
}
/**
* 设置:条款名称
*/
public
void
setTermName
(
String
termName
)
{
this
.
termName
=
termName
;
}
/**
* 获取:条款名称
*/
public
String
getTermName
()
{
return
termName
;
}
/**
* 设置:条款内容
*/
public
void
setTermContent
(
String
termContent
)
{
this
.
termContent
=
termContent
;
}
/**
* 获取:条款内容
*/
public
String
getTermContent
()
{
return
termContent
;
}
/**
* 设置:创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:更新时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:更新时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
* 设置:状态 0:无效 1:有效
*/
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
/**
* 获取:状态 0:无效 1:有效
*/
public
Integer
getStatus
()
{
return
status
;
}
/**
* 设置:排序
*/
public
void
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
}
/**
* 获取:排序
*/
public
Integer
getSort
()
{
return
sort
;
}
}
platform-admin/src/main/java/com/platform/service/TermService.java
0 → 100644
浏览文件 @
94d783a3
package
com
.
platform
.
service
;
import
com.platform.entity.TermEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service接口
*
* @author lipengjun
* @date 2020-10-27 17:49:26
*/
public
interface
TermService
{
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TermEntity
queryObject
(
String
id
);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List
<
TermEntity
>
queryList
(
Map
<
String
,
Object
>
map
);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int
queryTotal
(
Map
<
String
,
Object
>
map
);
/**
* 保存实体
*
* @param term 实体
* @return 保存条数
*/
int
save
(
TermEntity
term
);
/**
* 根据主键更新实体
*
* @param term 实体
* @return 更新条数
*/
int
update
(
TermEntity
term
);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int
delete
(
String
id
);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int
deleteBatch
(
String
[]
ids
);
}
platform-admin/src/main/java/com/platform/service/impl/TermServiceImpl.java
0 → 100644
浏览文件 @
94d783a3
package
com
.
platform
.
service
.
impl
;
import
com.platform.dao.TermDao
;
import
com.platform.entity.TermEntity
;
import
com.platform.service.TermService
;
import
com.platform.utils.IdUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service实现类
*
* @author lipengjun
* @date 2020-10-27 17:49:26
*/
@Service
(
"termService"
)
public
class
TermServiceImpl
implements
TermService
{
@Autowired
private
TermDao
termDao
;
@Override
public
TermEntity
queryObject
(
String
id
)
{
return
termDao
.
queryObject
(
id
);
}
@Override
public
List
<
TermEntity
>
queryList
(
Map
<
String
,
Object
>
map
)
{
return
termDao
.
queryList
(
map
);
}
@Override
public
int
queryTotal
(
Map
<
String
,
Object
>
map
)
{
return
termDao
.
queryTotal
(
map
);
}
@Override
public
int
save
(
TermEntity
term
)
{
term
.
setId
(
IdUtil
.
createIdbyUUID
());
return
termDao
.
save
(
term
);
}
@Override
public
int
update
(
TermEntity
term
)
{
return
termDao
.
update
(
term
);
}
@Override
public
int
delete
(
String
id
)
{
return
termDao
.
delete
(
id
);
}
@Override
public
int
deleteBatch
(
String
[]
ids
)
{
return
termDao
.
deleteBatch
(
ids
);
}
}
platform-admin/src/main/resources/com/platform/dao/TermDao.xml
0 → 100644
浏览文件 @
94d783a3
<?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.platform.dao.TermDao"
>
<resultMap
type=
"com.platform.entity.TermEntity"
id=
"termMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"parentId"
column=
"parent_id"
/>
<result
property=
"termName"
column=
"term_name"
/>
<result
property=
"termContent"
column=
"term_content"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"sort"
column=
"sort"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.TermEntity"
>
select
`id`,
`parent_id`,
`term_name`,
`term_content`,
`create_time`,
`update_time`,
`status`,
`sort`
from term
where id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.TermEntity"
>
select
`id`,
`parent_id`,
`term_name`,
`term_content`,
`create_time`,
`update_time`,
`status`,
`sort`
from term
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from term
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.TermEntity"
>
insert into term(
`id`,
`parent_id`,
`term_name`,
`term_content`,
`create_time`,
`update_time`,
`status`,
`sort`)
values(
#{id},
#{parentId},
#{termName},
#{termContent},
#{createTime},
#{updateTime},
#{status},
#{sort})
</insert>
<update
id=
"update"
parameterType=
"com.platform.entity.TermEntity"
>
update term
<set>
<if
test=
"parentId != null"
>
`parent_id` = #{parentId},
</if>
<if
test=
"termName != null"
>
`term_name` = #{termName},
</if>
<if
test=
"termContent != null"
>
`term_content` = #{termContent},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime},
</if>
<if
test=
"status != null"
>
`status` = #{status},
</if>
<if
test=
"sort != null"
>
`sort` = #{sort}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete from term where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from term where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
platform-admin/src/main/webapp/WEB-INF/page/sys/term.html
0 → 100644
浏览文件 @
94d783a3
<!DOCTYPE html>
<html>
<head>
<title></title>
#parse("sys/header.html")
</head>
<body>
<div
id=
"rrapp"
v-cloak
style=
"height: calc(100% - 15px);"
>
<div
v-show=
"showList"
style=
"height: 100%;"
>
<Row
:gutter=
"16"
>
<div
class=
"search-group"
>
<i-col
span=
"4"
>
<i-input
v-model=
"q.name"
@
on-enter=
"query"
placeholder=
"名称"
/>
</i-col>
<i-button
@
click=
"query"
>
查询
</i-button>
<i-button
@
click=
"reloadSearch"
>
重置
</i-button>
</div>
<div
class=
"buttons-group"
>
#if($shiro.hasPermission("term:save"))
<i-button
type=
"info"
@
click=
"add"
><i
class=
"fa fa-plus"
></i>
新增
</i-button>
#end
#if($shiro.hasPermission("term:update"))
<i-button
type=
"warning"
@
click=
"update"
><i
class=
"fa fa-pencil-square-o"
></i>
修改
</i-button>
#end
#if($shiro.hasPermission("term:delete"))
<i-button
type=
"error"
@
click=
"del"
><i
class=
"fa fa-trash-o"
></i>
删除
</i-button>
#end
</div>
</Row>
<table
id=
"jqGrid"
></table>
</div>
<Card
v-show=
"!showList"
>
<p
slot=
"title"
>
{{title}}
</p>
<i-form
ref=
"formValidate"
:model=
"term"
:rules=
"ruleValidate"
:label-width=
"80"
>
<Form-item
label=
"父条款ID,一级条款为0"
prop=
"parentId"
>
<i-input
v-model=
"term.parentId"
placeholder=
"父条款ID,一级条款为0"
/>
</Form-item>
<Form-item
label=
"条款名称"
prop=
"termName"
>
<i-input
v-model=
"term.termName"
placeholder=
"条款名称"
/>
</Form-item>
<Form-item
label=
"条款内容"
prop=
"termContent"
>
<i-input
v-model=
"term.termContent"
placeholder=
"条款内容"
/>
</Form-item>
<Form-item
label=
"创建时间"
prop=
"createTime"
>
<i-input
v-model=
"term.createTime"
placeholder=
"创建时间"
/>
</Form-item>
<Form-item
label=
"更新时间"
prop=
"updateTime"
>
<i-input
v-model=
"term.updateTime"
placeholder=
"更新时间"
/>
</Form-item>
<Form-item
label=
"状态 0:无效 1:有效"
prop=
"status"
>
<i-input
v-model=
"term.status"
placeholder=
"状态 0:无效 1:有效"
/>
</Form-item>
<Form-item
label=
"排序"
prop=
"sort"
>
<i-input
v-model=
"term.sort"
placeholder=
"排序"
/>
</Form-item>
<Form-item>
<i-button
type=
"primary"
@
click=
"handleSubmit('formValidate')"
>
提交
</i-button>
<i-button
type=
"warning"
@
click=
"reload"
style=
"margin-left: 8px"
/>
返回
</i-button>
<i-button
type=
"ghost"
@
click=
"handleReset('formValidate')"
style=
"margin-left: 8px"
>
重置
</i-button>
</Form-item>
</i-form>
</Card>
</div>
<script
src=
"${rc.contextPath}/js/sys/term.js?_${date.systemTime}"
></script>
</body>
</html>
\ No newline at end of file
platform-admin/src/main/webapp/js/sys/term.js
0 → 100644
浏览文件 @
94d783a3
$
(
function
()
{
$
(
"#jqGrid"
).
Grid
({
url
:
'../term/list'
,
colModel
:
[
{
label
:
'id'
,
name
:
'id'
,
index
:
'id'
,
key
:
true
,
hidden
:
true
},
{
label
:
'父条款ID,一级条款为0'
,
name
:
'parentId'
,
index
:
'parent_id'
,
width
:
80
},
{
label
:
'条款名称'
,
name
:
'termName'
,
index
:
'term_name'
,
width
:
80
},
{
label
:
'条款内容'
,
name
:
'termContent'
,
index
:
'term_content'
,
width
:
80
},
{
label
:
'创建时间'
,
name
:
'createTime'
,
index
:
'create_time'
,
width
:
80
},
{
label
:
'更新时间'
,
name
:
'updateTime'
,
index
:
'update_time'
,
width
:
80
},
{
label
:
'状态 0:无效 1:有效'
,
name
:
'status'
,
index
:
'status'
,
width
:
80
},
{
label
:
'排序'
,
name
:
'sort'
,
index
:
'sort'
,
width
:
80
}]
});
});
let
vm
=
new
Vue
({
el
:
'#rrapp'
,
data
:
{
showList
:
true
,
title
:
null
,
term
:
{},
ruleValidate
:
{
name
:
[
{
required
:
true
,
message
:
'名称不能为空'
,
trigger
:
'blur'
}
]
},
q
:
{
name
:
''
}
},
methods
:
{
query
:
function
()
{
vm
.
reload
();
},
add
:
function
()
{
vm
.
showList
=
false
;
vm
.
title
=
"新增"
;
vm
.
term
=
{};
},
update
:
function
(
event
)
{
let
id
=
getSelectedRow
(
"#jqGrid"
);
if
(
id
==
null
)
{
return
;
}
vm
.
showList
=
false
;
vm
.
title
=
"修改"
;
vm
.
getInfo
(
id
);
},
saveOrUpdate
:
function
(
event
)
{
let
url
=
vm
.
term
.
id
==
null
?
"../term/save"
:
"../term/update"
;
Ajax
.
request
({
url
:
url
,
params
:
JSON
.
stringify
(
vm
.
term
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
(
r
)
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
},
del
:
function
(
event
)
{
let
ids
=
getSelectedRows
(
"#jqGrid"
);
if
(
ids
==
null
){
return
;
}
confirm
(
'确定要删除选中的记录?'
,
function
()
{
Ajax
.
request
({
url
:
"../term/delete"
,
params
:
JSON
.
stringify
(
ids
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
()
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
});
},
getInfo
:
function
(
id
){
Ajax
.
request
({
url
:
"../term/info/"
+
id
,
async
:
true
,
successCallback
:
function
(
r
)
{
vm
.
term
=
r
.
term
;
}
});
},
reload
:
function
(
event
)
{
vm
.
showList
=
true
;
let
page
=
$
(
"#jqGrid"
).
jqGrid
(
'getGridParam'
,
'page'
);
$
(
"#jqGrid"
).
jqGrid
(
'setGridParam'
,
{
postData
:
{
'name'
:
vm
.
q
.
name
},
page
:
page
}).
trigger
(
"reloadGrid"
);
vm
.
handleReset
(
'formValidate'
);
},
reloadSearch
:
function
()
{
vm
.
q
=
{
name
:
''
};
vm
.
reload
();
},
handleSubmit
:
function
(
name
)
{
handleSubmitValidate
(
this
,
name
,
function
()
{
vm
.
saveOrUpdate
()
});
},
handleReset
:
function
(
name
)
{
handleResetForm
(
this
,
name
);
}
}
});
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论