Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
2536a57c
Commit
2536a57c
authored
Jun 28, 2019
by
fengshuonan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'enter'
parents
29b418b0
445c0771
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
1752 additions
and
53 deletions
+1752
-53
_sqls/guns_mysql.sql
+0
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/core/constant/factory/ConstantFactory.java
+22
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/core/constant/factory/IConstantFactory.java
+5
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/controller/PositionController.java
+185
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/entity/Position.java
+177
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/entity/UserPos.java
+73
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/PositionMapper.java
+55
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/UserPosMapper.java
+56
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/mapping/PositionMapper.xml
+79
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/mapping/UserPosMapper.xml
+42
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/UserDto.java
+2
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/params/PositionParam.java
+78
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/params/UserPosParam.java
+42
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/result/PositionResult.java
+72
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/result/UserPosResult.java
+36
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/PositionService.java
+77
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/UserPosService.java
+69
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/UserService.java
+45
-3
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/impl/PositionServiceImpl.java
+125
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/impl/UserPosServiceImpl.java
+84
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/warpper/UserWrapper.java
+1
-0
guns-sys/src/main/webapp/assets/modular/system/dept/dept_add.js
+0
-3
guns-sys/src/main/webapp/assets/modular/system/dept/dept_edit.js
+0
-3
guns-sys/src/main/webapp/assets/modular/system/menu/menu.js
+0
-9
guns-sys/src/main/webapp/assets/modular/system/menu/menu_add.js
+0
-3
guns-sys/src/main/webapp/assets/modular/system/menu/menu_edit.js
+0
-3
guns-sys/src/main/webapp/assets/modular/system/notice/notice_add.js
+0
-3
guns-sys/src/main/webapp/assets/modular/system/notice/notice_edit.js
+0
-3
guns-sys/src/main/webapp/assets/modular/system/position/position.js
+150
-0
guns-sys/src/main/webapp/assets/modular/system/position/position_add.js
+47
-0
guns-sys/src/main/webapp/assets/modular/system/position/position_edit.js
+52
-0
guns-sys/src/main/webapp/assets/modular/system/role/role_add.js
+0
-3
guns-sys/src/main/webapp/assets/modular/system/role/role_edit.js
+0
-3
guns-sys/src/main/webapp/assets/modular/system/user/user.js
+1
-3
guns-sys/src/main/webapp/assets/modular/system/user/user_add.js
+10
-4
guns-sys/src/main/webapp/assets/modular/system/user/user_edit.js
+10
-4
guns-sys/src/main/webapp/pages/modular/system/position/position.html
+40
-0
guns-sys/src/main/webapp/pages/modular/system/position/position_add.html
+48
-0
guns-sys/src/main/webapp/pages/modular/system/position/position_edit.html
+48
-0
guns-sys/src/main/webapp/pages/modular/system/user/user_add.html
+12
-4
guns-sys/src/main/webapp/pages/modular/system/user/user_edit.html
+9
-2
No files found.
_sqls/guns_mysql.sql
View file @
2536a57c
This diff is collapsed.
Click to expand it.
guns-sys/src/main/java/cn/stylefeng/guns/sys/core/constant/factory/ConstantFactory.java
View file @
2536a57c
...
@@ -24,6 +24,8 @@ import cn.stylefeng.guns.sys.core.constant.state.MenuStatus;
...
@@ -24,6 +24,8 @@ import cn.stylefeng.guns.sys.core.constant.state.MenuStatus;
import
cn.stylefeng.guns.sys.core.log.LogObjectHolder
;
import
cn.stylefeng.guns.sys.core.log.LogObjectHolder
;
import
cn.stylefeng.guns.sys.modular.system.entity.*
;
import
cn.stylefeng.guns.sys.modular.system.entity.*
;
import
cn.stylefeng.guns.sys.modular.system.mapper.*
;
import
cn.stylefeng.guns.sys.modular.system.mapper.*
;
import
cn.stylefeng.guns.sys.modular.system.service.PositionService
;
import
cn.stylefeng.guns.sys.modular.system.service.UserPosService
;
import
cn.stylefeng.roses.core.util.SpringContextHolder
;
import
cn.stylefeng.roses.core.util.SpringContextHolder
;
import
cn.stylefeng.roses.core.util.ToolUtil
;
import
cn.stylefeng.roses.core.util.ToolUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -51,6 +53,8 @@ public class ConstantFactory implements IConstantFactory {
...
@@ -51,6 +53,8 @@ public class ConstantFactory implements IConstantFactory {
private
UserMapper
userMapper
=
SpringContextHolder
.
getBean
(
UserMapper
.
class
);
private
UserMapper
userMapper
=
SpringContextHolder
.
getBean
(
UserMapper
.
class
);
private
MenuMapper
menuMapper
=
SpringContextHolder
.
getBean
(
MenuMapper
.
class
);
private
MenuMapper
menuMapper
=
SpringContextHolder
.
getBean
(
MenuMapper
.
class
);
private
NoticeMapper
noticeMapper
=
SpringContextHolder
.
getBean
(
NoticeMapper
.
class
);
private
NoticeMapper
noticeMapper
=
SpringContextHolder
.
getBean
(
NoticeMapper
.
class
);
private
UserPosService
userPosService
=
SpringContextHolder
.
getBean
(
UserPosService
.
class
);
private
PositionService
positionService
=
SpringContextHolder
.
getBean
(
PositionService
.
class
);
public
static
IConstantFactory
me
()
{
public
static
IConstantFactory
me
()
{
return
SpringContextHolder
.
getBean
(
"constantFactory"
);
return
SpringContextHolder
.
getBean
(
"constantFactory"
);
...
@@ -329,5 +333,23 @@ public class ConstantFactory implements IConstantFactory {
...
@@ -329,5 +333,23 @@ public class ConstantFactory implements IConstantFactory {
return
parentDeptIds
;
return
parentDeptIds
;
}
}
@Override
public
String
getPositionName
(
Long
userId
)
{
StringBuilder
positionNames
=
new
StringBuilder
();
List
<
UserPos
>
userPosList
=
this
.
userPosService
.
list
(
new
QueryWrapper
<
UserPos
>().
eq
(
"user_id"
,
userId
));
if
(
userPosList
!=
null
&&
userPosList
.
size
()
>
0
)
{
for
(
UserPos
userPos
:
userPosList
)
{
Position
position
=
positionService
.
getById
(
userPos
.
getPosId
());
positionNames
.
append
(
","
).
append
(
position
.
getName
());
}
}
return
StrUtil
.
removePrefix
(
positionNames
.
toString
(),
","
);
}
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/core/constant/factory/IConstantFactory.java
View file @
2536a57c
...
@@ -139,4 +139,9 @@ public interface IConstantFactory {
...
@@ -139,4 +139,9 @@ public interface IConstantFactory {
*/
*/
List
<
Long
>
getParentDeptIds
(
Long
deptId
);
List
<
Long
>
getParentDeptIds
(
Long
deptId
);
/**
* 获取用户的职位名称
*/
String
getPositionName
(
Long
userId
);
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/controller/PositionController.java
0 → 100644
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
controller
;
import
cn.stylefeng.guns.base.enums.CommonStatus
;
import
cn.stylefeng.guns.base.pojo.page.LayuiPageInfo
;
import
cn.stylefeng.guns.sys.modular.system.entity.Position
;
import
cn.stylefeng.guns.sys.modular.system.model.params.PositionParam
;
import
cn.stylefeng.guns.sys.modular.system.service.PositionService
;
import
cn.stylefeng.guns.sys.modular.system.service.UserPosService
;
import
cn.stylefeng.roses.core.base.controller.BaseController
;
import
cn.stylefeng.roses.core.reqres.response.ResponseData
;
import
cn.stylefeng.roses.core.reqres.response.SuccessResponseData
;
import
cn.stylefeng.roses.core.util.ToolUtil
;
import
cn.stylefeng.roses.kernel.model.exception.RequestEmptyException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
/**
* 职位表控制器
*
* @author stylefeng
* @Date 2019-06-27 21:33:47
*/
@Controller
@RequestMapping
(
"/position"
)
public
class
PositionController
extends
BaseController
{
private
String
PREFIX
=
"/modular/system/position"
;
@Autowired
private
PositionService
positionService
;
@Autowired
private
UserPosService
userPosService
;
/**
* 跳转到主页面
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
""
)
public
String
index
()
{
return
PREFIX
+
"/position.html"
;
}
/**
* 新增页面
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/add"
)
public
String
add
()
{
return
PREFIX
+
"/position_add.html"
;
}
/**
* 编辑页面
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/edit"
)
public
String
edit
()
{
return
PREFIX
+
"/position_edit.html"
;
}
/**
* 新增接口
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/addItem"
)
@ResponseBody
public
ResponseData
addItem
(
PositionParam
positionParam
)
{
this
.
positionService
.
add
(
positionParam
);
return
ResponseData
.
success
();
}
/**
* 编辑接口
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/editItem"
)
@ResponseBody
public
ResponseData
editItem
(
PositionParam
positionParam
)
{
this
.
positionService
.
update
(
positionParam
);
return
ResponseData
.
success
();
}
/**
* 删除接口
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/delete"
)
@ResponseBody
public
ResponseData
delete
(
PositionParam
positionParam
)
{
this
.
positionService
.
delete
(
positionParam
);
return
ResponseData
.
success
();
}
/**
* 查看详情接口
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/detail"
)
@ResponseBody
public
ResponseData
detail
(
PositionParam
positionParam
)
{
Position
detail
=
this
.
positionService
.
getById
(
positionParam
.
getPositionId
());
return
ResponseData
.
success
(
detail
);
}
/**
* 查询列表
*
* @author stylefeng
* @Date 2019-06-27
*/
@ResponseBody
@RequestMapping
(
"/list"
)
public
LayuiPageInfo
list
(
@RequestParam
(
value
=
"condition"
,
required
=
false
)
String
condition
)
{
PositionParam
positionParam
=
new
PositionParam
();
if
(
ToolUtil
.
isNotEmpty
(
condition
))
{
positionParam
.
setCode
(
condition
);
positionParam
.
setName
(
condition
);
}
return
this
.
positionService
.
findPageBySpec
(
positionParam
);
}
/**
* 修改状态
*
* @author stylefeng
* @Date 2019-06-27
*/
@ResponseBody
@RequestMapping
(
"/changeStatus"
)
public
ResponseData
changeStatus
(
@RequestParam
(
"positionId"
)
String
positionId
,
@RequestParam
(
"status"
)
Boolean
status
)
{
Position
position
=
this
.
positionService
.
getById
(
positionId
);
if
(
position
==
null
)
{
throw
new
RequestEmptyException
();
}
if
(
status
)
{
position
.
setStatus
(
CommonStatus
.
ENABLE
.
getCode
());
}
else
{
position
.
setStatus
(
CommonStatus
.
DISABLE
.
getCode
());
}
this
.
positionService
.
updateById
(
position
);
return
new
SuccessResponseData
();
}
/**
* 查询所有职位
*
* @author stylefeng
* @Date 2019-03-13
*/
@ResponseBody
@RequestMapping
(
"/listPositions"
)
public
LayuiPageInfo
listlistPositionsTypes
(
@RequestParam
(
value
=
"userId"
,
required
=
false
)
Long
userId
)
{
return
this
.
positionService
.
listPositions
(
userId
);
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/entity/Position.java
0 → 100644
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
entity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 职位表
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
@TableName
(
"sys_position"
)
public
class
Position
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
@TableId
(
value
=
"position_id"
,
type
=
IdType
.
ID_WORKER
)
private
Long
positionId
;
/**
* 职位名称
*/
@TableField
(
"name"
)
private
String
name
;
/**
* 职位编码
*/
@TableField
(
"code"
)
private
String
code
;
/**
* 顺序
*/
@TableField
(
"sort"
)
private
Integer
sort
;
/**
* 状态(字典)
*/
@TableField
(
"status"
)
private
String
status
;
/**
* 备注
*/
@TableField
(
"remark"
)
private
String
remark
;
/**
* 创建时间
*/
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
/**
* 更新者
*/
@TableField
(
value
=
"update_user"
,
fill
=
FieldFill
.
UPDATE
)
private
Long
updateUser
;
/**
* 更新时间
*/
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
UPDATE
)
private
Date
updateTime
;
/**
* 创建者
*/
@TableField
(
value
=
"create_user"
,
fill
=
FieldFill
.
INSERT
)
private
Long
createUser
;
public
Long
getPositionId
()
{
return
positionId
;
}
public
void
setPositionId
(
Long
positionId
)
{
this
.
positionId
=
positionId
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
void
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Long
getUpdateUser
()
{
return
updateUser
;
}
public
void
setUpdateUser
(
Long
updateUser
)
{
this
.
updateUser
=
updateUser
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
@Override
public
String
toString
()
{
return
"Position{"
+
"positionId="
+
positionId
+
", name="
+
name
+
", code="
+
code
+
", sort="
+
sort
+
", status="
+
status
+
", remark="
+
remark
+
", createTime="
+
createTime
+
", updateUser="
+
updateUser
+
", updateTime="
+
updateTime
+
", createUser="
+
createUser
+
"}"
;
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/entity/UserPos.java
0 → 100755
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
java.io.Serializable
;
/**
* <p>
* 用户职位关联表
* </p>
*
* @author stylefeng
* @since 2019-06-28
*/
@TableName
(
"sys_user_pos"
)
public
class
UserPos
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
@TableId
(
value
=
"user_pos_id"
,
type
=
IdType
.
ID_WORKER
)
private
Long
userPosId
;
/**
* 用户id
*/
@TableField
(
"user_id"
)
private
Long
userId
;
/**
* 职位id
*/
@TableField
(
"pos_id"
)
private
Long
posId
;
public
Long
getUserPosId
()
{
return
userPosId
;
}
public
void
setUserPosId
(
Long
userPosId
)
{
this
.
userPosId
=
userPosId
;
}
public
Long
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Long
userId
)
{
this
.
userId
=
userId
;
}
public
Long
getPosId
()
{
return
posId
;
}
public
void
setPosId
(
Long
posId
)
{
this
.
posId
=
posId
;
}
@Override
public
String
toString
()
{
return
"UserPos{"
+
"userPosId="
+
userPosId
+
", userId="
+
userId
+
", posId="
+
posId
+
"}"
;
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/PositionMapper.java
0 → 100644
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
mapper
;
import
cn.stylefeng.guns.sys.modular.system.entity.Position
;
import
cn.stylefeng.guns.sys.modular.system.model.params.PositionParam
;
import
cn.stylefeng.guns.sys.modular.system.model.result.PositionResult
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 职位表 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
public
interface
PositionMapper
extends
BaseMapper
<
Position
>
{
/**
* 获取列表
*
* @author stylefeng
* @Date 2019-06-27
*/
List
<
PositionResult
>
customList
(
@Param
(
"paramCondition"
)
PositionParam
paramCondition
);
/**
* 获取map列表
*
* @author stylefeng
* @Date 2019-06-27
*/
List
<
Map
<
String
,
Object
>>
customMapList
(
@Param
(
"paramCondition"
)
PositionParam
paramCondition
);
/**
* 获取分页实体列表
*
* @author stylefeng
* @Date 2019-06-27
*/
Page
<
PositionResult
>
customPageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"paramCondition"
)
PositionParam
paramCondition
);
/**
* 获取分页map列表
*
* @author stylefeng
* @Date 2019-06-27
*/
Page
<
Map
<
String
,
Object
>>
customPageMapList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"paramCondition"
)
PositionParam
paramCondition
);
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/UserPosMapper.java
0 → 100755
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
mapper
;
import
cn.stylefeng.guns.sys.modular.system.entity.UserPos
;
import
cn.stylefeng.guns.sys.modular.system.model.params.UserPosParam
;
import
cn.stylefeng.guns.sys.modular.system.model.result.UserPosResult
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 用户职位关联表 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2019-06-28
*/
public
interface
UserPosMapper
extends
BaseMapper
<
UserPos
>
{
/**
* 获取列表
*
* @author stylefeng
* @Date 2019-06-28
*/
List
<
UserPosResult
>
customList
(
@Param
(
"paramCondition"
)
UserPosParam
paramCondition
);
/**
* 获取map列表
*
* @author stylefeng
* @Date 2019-06-28
*/
List
<
Map
<
String
,
Object
>>
customMapList
(
@Param
(
"paramCondition"
)
UserPosParam
paramCondition
);
/**
* 获取分页实体列表
*
* @author stylefeng
* @Date 2019-06-28
*/
Page
<
UserPosResult
>
customPageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"paramCondition"
)
UserPosParam
paramCondition
);
/**
* 获取分页map列表
*
* @author stylefeng
* @Date 2019-06-28
*/
Page
<
Map
<
String
,
Object
>>
customPageMapList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"paramCondition"
)
UserPosParam
paramCondition
);
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/mapping/PositionMapper.xml
0 → 100644
View file @
2536a57c
<?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=
"cn.stylefeng.guns.sys.modular.system.mapper.PositionMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.stylefeng.guns.sys.modular.system.entity.Position"
>
<id
column=
"position_id"
property=
"positionId"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"code"
property=
"code"
/>
<result
column=
"sort"
property=
"sort"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"remark"
property=
"remark"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_user"
property=
"updateUser"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"create_user"
property=
"createUser"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
position_id AS "positionId", name AS "name", code AS "code", sort AS "sort", status AS "status", remark AS "remark", create_time AS "createTime", update_user AS "updateUser", update_time AS "updateTime", create_user AS "createUser"
</sql>
<select
id=
"customList"
resultType=
"cn.stylefeng.guns.sys.modular.system.model.result.PositionResult"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.PositionParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_position where 1 = 1
<if
test=
"paramCondition.name != null and paramCondition.name != ''"
>
and name like CONCAT('%',#{paramCondition.name},'%')
</if>
<if
test=
"paramCondition.code != null and paramCondition.code != ''"
>
and code like CONCAT('%',#{paramCondition.code},'%')
</if>
order by sort asc
</select>
<select
id=
"customMapList"
resultType=
"map"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.PositionParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_position where 1 = 1
<if
test=
"paramCondition.name != null and paramCondition.name != ''"
>
and name like CONCAT('%',#{paramCondition.name},'%')
</if>
<if
test=
"paramCondition.code != null and paramCondition.code != ''"
>
and code like CONCAT('%',#{paramCondition.code},'%')
</if>
order by sort asc
</select>
<select
id=
"customPageList"
resultType=
"cn.stylefeng.guns.sys.modular.system.model.result.PositionResult"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.PositionParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_position
<where>
<if
test=
"paramCondition.name != null and paramCondition.name != ''"
>
name like CONCAT('%',#{paramCondition.name},'%')
</if>
<if
test=
"paramCondition.code != null and paramCondition.code != ''"
>
or code like CONCAT('%',#{paramCondition.code},'%')
</if>
</where>
order by sort asc
</select>
<select
id=
"customPageMapList"
resultType=
"map"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.PositionParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_position where 1 = 1
<if
test=
"paramCondition.name != null and paramCondition.name != ''"
>
and name like CONCAT('%',#{paramCondition.name},'%')
</if>
<if
test=
"paramCondition.code != null and paramCondition.code != ''"
>
and code like CONCAT('%',#{paramCondition.code},'%')
</if>
order by sort asc
</select>
</mapper>
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/mapping/UserPosMapper.xml
0 → 100755
View file @
2536a57c
<?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=
"cn.stylefeng.guns.sys.modular.system.mapper.UserPosMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.stylefeng.guns.sys.modular.system.entity.UserPos"
>
<id
column=
"user_pos_id"
property=
"userPosId"
/>
<result
column=
"user_id"
property=
"userId"
/>
<result
column=
"pos_id"
property=
"posId"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
user_pos_id AS "userPosId", user_id AS "userId", pos_id AS "posId"
</sql>
<select
id=
"customList"
resultType=
"cn.stylefeng.guns.sys.modular.system.model.result.UserPosResult"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.UserPosParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_user_pos where 1 = 1
</select>
<select
id=
"customMapList"
resultType=
"map"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.UserPosParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_user_pos where 1 = 1
</select>
<select
id=
"customPageList"
resultType=
"cn.stylefeng.guns.sys.modular.system.model.result.UserPosResult"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.UserPosParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_user_pos where 1 = 1
</select>
<select
id=
"customPageMapList"
resultType=
"map"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.UserPosParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_user_pos where 1 = 1
</select>
</mapper>
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/UserDto.java
View file @
2536a57c
...
@@ -44,4 +44,6 @@ public class UserDto {
...
@@ -44,4 +44,6 @@ public class UserDto {
private
String
status
;
private
String
status
;
private
String
avatar
;
private
String
avatar
;
private
String
position
;
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/params/PositionParam.java
0 → 100644
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
model
.
params
;
import
cn.stylefeng.roses.kernel.model.validator.BaseValidatingParam
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 职位表
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
@Data
public
class
PositionParam
implements
Serializable
,
BaseValidatingParam
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
private
Long
positionId
;
/**
* 职位名称
*/
private
String
name
;
/**
* 职位编码
*/
private
String
code
;
/**
* 顺序
*/
private
Integer
sort
;
/**
* 状态(字典)
*/
private
String
status
;
/**
* 备注
*/
private
String
remark
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新者
*/
private
Long
updateUser
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 创建者
*/
private
Long
createUser
;
@Override
public
String
checkParam
()
{
return
null
;
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/params/UserPosParam.java
0 → 100755
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
model
.
params
;
import
cn.stylefeng.roses.kernel.model.validator.BaseValidatingParam
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* <p>
* 用户职位关联表
* </p>
*
* @author stylefeng
* @since 2019-06-28
*/
@Data
public
class
UserPosParam
implements
Serializable
,
BaseValidatingParam
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
private
Long
userPosId
;
/**
* 用户id
*/
private
Long
userId
;
/**
* 职位id
*/
private
Long
posId
;
@Override
public
String
checkParam
()
{
return
null
;
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/result/PositionResult.java
0 → 100644
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
model
.
result
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 职位表
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
@Data
public
class
PositionResult
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
private
Long
positionId
;
/**
* 职位名称
*/
private
String
name
;
/**
* 职位编码
*/
private
String
code
;
/**
* 顺序
*/
private
Integer
sort
;
/**
* 状态(字典)
*/
private
String
status
;
/**
* 备注
*/
private
String
remark
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新者
*/
private
Long
updateUser
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 创建者
*/
private
Long
createUser
;
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/result/UserPosResult.java
0 → 100755
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
model
.
result
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* <p>
* 用户职位关联表
* </p>
*
* @author stylefeng
* @since 2019-06-28
*/
@Data
public
class
UserPosResult
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
private
Long
userPosId
;
/**
* 用户id
*/
private
Long
userId
;
/**
* 职位id
*/
private
Long
posId
;
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/PositionService.java
0 → 100644
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
service
;
import
cn.stylefeng.guns.base.pojo.page.LayuiPageInfo
;
import
cn.stylefeng.guns.sys.modular.system.entity.Position
;
import
cn.stylefeng.guns.sys.modular.system.model.params.PositionParam
;
import
cn.stylefeng.guns.sys.modular.system.model.result.PositionResult
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* <p>
* 职位表 服务类
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
public
interface
PositionService
extends
IService
<
Position
>
{
/**
* 新增
*
* @author stylefeng
* @Date 2019-06-27
*/
void
add
(
PositionParam
param
);
/**
* 删除
*
* @author stylefeng
* @Date 2019-06-27
*/
void
delete
(
PositionParam
param
);
/**
* 更新
*
* @author stylefeng
* @Date 2019-06-27
*/
void
update
(
PositionParam
param
);
/**
* 查询单条数据,Specification模式
*
* @author stylefeng
* @Date 2019-06-27
*/
PositionResult
findBySpec
(
PositionParam
param
);
/**
* 查询列表,Specification模式
*
* @author stylefeng
* @Date 2019-06-27
*/
List
<
PositionResult
>
findListBySpec
(
PositionParam
param
);
/**
* 查询分页数据,Specification模式
*
* @author stylefeng
* @Date 2019-06-27
*/
LayuiPageInfo
findPageBySpec
(
PositionParam
param
);
/**
* 获取多选框的职位列表
*
* @author stylefeng
* @Date 2019-06-27
*/
LayuiPageInfo
listPositions
(
Long
userId
);
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/UserPosService.java
0 → 100755
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
service
;
import
cn.stylefeng.guns.base.pojo.page.LayuiPageInfo
;
import
cn.stylefeng.guns.sys.modular.system.entity.UserPos
;
import
cn.stylefeng.guns.sys.modular.system.model.params.UserPosParam
;
import
cn.stylefeng.guns.sys.modular.system.model.result.UserPosResult
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* <p>
* 用户职位关联表 服务类
* </p>
*
* @author stylefeng
* @since 2019-06-28
*/
public
interface
UserPosService
extends
IService
<
UserPos
>
{
/**
* 新增
*
* @author stylefeng
* @Date 2019-06-28
*/
void
add
(
UserPosParam
param
);
/**
* 删除
*
* @author stylefeng
* @Date 2019-06-28
*/
void
delete
(
UserPosParam
param
);
/**
* 更新
*
* @author stylefeng
* @Date 2019-06-28
*/
void
update
(
UserPosParam
param
);
/**
* 查询单条数据,Specification模式
*
* @author stylefeng
* @Date 2019-06-28
*/
UserPosResult
findBySpec
(
UserPosParam
param
);
/**
* 查询列表,Specification模式
*
* @author stylefeng
* @Date 2019-06-28
*/
List
<
UserPosResult
>
findListBySpec
(
UserPosParam
param
);
/**
* 查询分页数据,Specification模式
*
* @author stylefeng
* @Date 2019-06-28
*/
LayuiPageInfo
findPageBySpec
(
UserPosParam
param
);
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/UserService.java
View file @
2536a57c
...
@@ -12,11 +12,14 @@ import cn.stylefeng.guns.sys.core.exception.enums.BizExceptionEnum;
...
@@ -12,11 +12,14 @@ import cn.stylefeng.guns.sys.core.exception.enums.BizExceptionEnum;
import
cn.stylefeng.guns.sys.core.shiro.ShiroKit
;
import
cn.stylefeng.guns.sys.core.shiro.ShiroKit
;
import
cn.stylefeng.guns.sys.core.shiro.service.UserAuthService
;
import
cn.stylefeng.guns.sys.core.shiro.service.UserAuthService
;
import
cn.stylefeng.guns.sys.modular.system.entity.User
;
import
cn.stylefeng.guns.sys.modular.system.entity.User
;
import
cn.stylefeng.guns.sys.modular.system.entity.UserPos
;
import
cn.stylefeng.guns.sys.modular.system.factory.UserFactory
;
import
cn.stylefeng.guns.sys.modular.system.factory.UserFactory
;
import
cn.stylefeng.guns.sys.modular.system.mapper.UserMapper
;
import
cn.stylefeng.guns.sys.modular.system.mapper.UserMapper
;
import
cn.stylefeng.guns.sys.modular.system.model.UserDto
;
import
cn.stylefeng.guns.sys.modular.system.model.UserDto
;
import
cn.stylefeng.roses.core.datascope.DataScope
;
import
cn.stylefeng.roses.core.datascope.DataScope
;
import
cn.stylefeng.roses.core.util.ToolUtil
;
import
cn.stylefeng.roses.kernel.model.exception.ServiceException
;
import
cn.stylefeng.roses.kernel.model.exception.ServiceException
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.toolkit.SqlRunner
;
import
com.baomidou.mybatisplus.extension.toolkit.SqlRunner
;
...
@@ -46,12 +49,16 @@ public class UserService extends ServiceImpl<UserMapper, User> {
...
@@ -46,12 +49,16 @@ public class UserService extends ServiceImpl<UserMapper, User> {
@Autowired
@Autowired
private
UserAuthService
userAuthService
;
private
UserAuthService
userAuthService
;
@Autowired
private
UserPosService
userPosService
;
/**
/**
* 添加用戶
* 添加用戶
*
*
* @author fengshuonan
* @author fengshuonan
* @Date 2018/12/24 22:51
* @Date 2018/12/24 22:51
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
addUser
(
UserDto
user
)
{
public
void
addUser
(
UserDto
user
)
{
// 判断账号是否重复
// 判断账号是否重复
...
@@ -64,7 +71,11 @@ public class UserService extends ServiceImpl<UserMapper, User> {
...
@@ -64,7 +71,11 @@ public class UserService extends ServiceImpl<UserMapper, User> {
String
salt
=
ShiroKit
.
getRandomSalt
(
5
);
String
salt
=
ShiroKit
.
getRandomSalt
(
5
);
String
password
=
ShiroKit
.
md5
(
user
.
getPassword
(),
salt
);
String
password
=
ShiroKit
.
md5
(
user
.
getPassword
(),
salt
);
this
.
save
(
UserFactory
.
createUser
(
user
,
password
,
salt
));
User
newUser
=
UserFactory
.
createUser
(
user
,
password
,
salt
);
this
.
save
(
newUser
);
//添加职位关联
addPosition
(
user
.
getPosition
(),
newUser
.
getUserId
());
}
}
/**
/**
...
@@ -73,6 +84,7 @@ public class UserService extends ServiceImpl<UserMapper, User> {
...
@@ -73,6 +84,7 @@ public class UserService extends ServiceImpl<UserMapper, User> {
* @author fengshuonan
* @author fengshuonan
* @Date 2018/12/24 22:53
* @Date 2018/12/24 22:53
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
editUser
(
UserDto
user
)
{
public
void
editUser
(
UserDto
user
)
{
User
oldUser
=
this
.
getById
(
user
.
getUserId
());
User
oldUser
=
this
.
getById
(
user
.
getUserId
());
...
@@ -87,6 +99,12 @@ public class UserService extends ServiceImpl<UserMapper, User> {
...
@@ -87,6 +99,12 @@ public class UserService extends ServiceImpl<UserMapper, User> {
throw
new
ServiceException
(
BizExceptionEnum
.
NO_PERMITION
);
throw
new
ServiceException
(
BizExceptionEnum
.
NO_PERMITION
);
}
}
}
}
//删除职位关联
userPosService
.
remove
(
new
QueryWrapper
<
UserPos
>().
eq
(
"user_id"
,
user
.
getUserId
()));
//添加职位关联
addPosition
(
user
.
getPosition
(),
user
.
getUserId
());
}
}
/**
/**
...
@@ -107,6 +125,9 @@ public class UserService extends ServiceImpl<UserMapper, User> {
...
@@ -107,6 +125,9 @@ public class UserService extends ServiceImpl<UserMapper, User> {
//删除对应的oauth2绑定表
//删除对应的oauth2绑定表
SqlRunner
.
db
().
delete
(
"delete from oauth_user_info where user_id = {0}"
,
userId
);
SqlRunner
.
db
().
delete
(
"delete from oauth_user_info where user_id = {0}"
,
userId
);
//删除职位关联
userPosService
.
remove
(
new
QueryWrapper
<
UserPos
>().
eq
(
"user_id"
,
userId
));
}
}
/**
/**
...
@@ -233,12 +254,33 @@ public class UserService extends ServiceImpl<UserMapper, User> {
...
@@ -233,12 +254,33 @@ public class UserService extends ServiceImpl<UserMapper, User> {
User
user
=
this
.
getById
(
userId
);
User
user
=
this
.
getById
(
userId
);
Map
<
String
,
Object
>
map
=
UserFactory
.
removeUnSafeFields
(
user
);
Map
<
String
,
Object
>
map
=
UserFactory
.
removeUnSafeFields
(
user
);
HashMap
<
Object
,
Object
>
hashMap
=
CollectionUtil
.
newHashMap
();
HashMap
<
String
,
Object
>
hashMap
=
CollectionUtil
.
newHashMap
();
hashMap
.
putAll
(
map
);
hashMap
.
putAll
(
map
);
hashMap
.
put
(
"roleName"
,
ConstantFactory
.
me
().
getRoleName
(
user
.
getRoleId
()));
hashMap
.
put
(
"roleName"
,
ConstantFactory
.
me
().
getRoleName
(
user
.
getRoleId
()));
hashMap
.
put
(
"deptName"
,
ConstantFactory
.
me
().
getDeptName
(
user
.
getDeptId
()));
hashMap
.
put
(
"deptName"
,
ConstantFactory
.
me
().
getDeptName
(
user
.
getDeptId
()));
return
m
ap
;
return
hashM
ap
;
}
}
/**
* 添加职位关联
*
* @author fengshuonan
* @Date 2019-06-28 13:35
*/
private
void
addPosition
(
String
positions
,
Long
userId
)
{
if
(
ToolUtil
.
isNotEmpty
(
positions
))
{
String
[]
position
=
positions
.
split
(
","
);
for
(
String
item
:
position
)
{
UserPos
entity
=
new
UserPos
();
entity
.
setUserId
(
userId
);
entity
.
setPosId
(
Long
.
valueOf
(
item
));
userPosService
.
save
(
entity
);
}
}
}
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/impl/PositionServiceImpl.java
0 → 100644
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
service
.
impl
;
import
cn.stylefeng.guns.base.pojo.page.LayuiPageFactory
;
import
cn.stylefeng.guns.base.pojo.page.LayuiPageInfo
;
import
cn.stylefeng.guns.sys.modular.system.entity.Position
;
import
cn.stylefeng.guns.sys.modular.system.entity.UserPos
;
import
cn.stylefeng.guns.sys.modular.system.mapper.PositionMapper
;
import
cn.stylefeng.guns.sys.modular.system.model.params.PositionParam
;
import
cn.stylefeng.guns.sys.modular.system.model.result.PositionResult
;
import
cn.stylefeng.guns.sys.modular.system.service.PositionService
;
import
cn.stylefeng.guns.sys.modular.system.service.UserPosService
;
import
cn.stylefeng.roses.core.util.ToolUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 职位表 服务实现类
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
@Service
public
class
PositionServiceImpl
extends
ServiceImpl
<
PositionMapper
,
Position
>
implements
PositionService
{
@Autowired
private
UserPosService
userPosService
;
@Override
public
void
add
(
PositionParam
param
)
{
Position
entity
=
getEntity
(
param
);
this
.
save
(
entity
);
}
@Override
public
void
delete
(
PositionParam
param
)
{
this
.
removeById
(
getKey
(
param
));
}
@Override
public
void
update
(
PositionParam
param
)
{
Position
oldEntity
=
getOldEntity
(
param
);
Position
newEntity
=
getEntity
(
param
);
ToolUtil
.
copyProperties
(
newEntity
,
oldEntity
);
this
.
updateById
(
newEntity
);
}
@Override
public
PositionResult
findBySpec
(
PositionParam
param
)
{
return
null
;
}
@Override
public
List
<
PositionResult
>
findListBySpec
(
PositionParam
param
)
{
return
null
;
}
@Override
public
LayuiPageInfo
findPageBySpec
(
PositionParam
param
)
{
Page
pageContext
=
getPageContext
();
IPage
page
=
this
.
baseMapper
.
customPageList
(
pageContext
,
param
);
return
LayuiPageFactory
.
createPageInfo
(
page
);
}
@Override
public
LayuiPageInfo
listPositions
(
Long
userId
)
{
//找出所有职位
QueryWrapper
<
Position
>
objectQueryWrapper
=
new
QueryWrapper
<>();
objectQueryWrapper
.
select
(
"position_id"
,
"name"
);
List
<
Map
<
String
,
Object
>>
list
=
this
.
listMaps
(
objectQueryWrapper
);
//用户id为空,则直接返回
if
(
userId
==
null
)
{
}
else
{
//查询用户的职位id列表
List
<
UserPos
>
userPosList
=
this
.
userPosService
.
list
(
new
QueryWrapper
<
UserPos
>().
eq
(
"user_id"
,
userId
));
if
(
userPosList
!=
null
&&
userPosList
.
size
()
>
0
)
{
for
(
UserPos
userPos
:
userPosList
)
{
for
(
Map
<
String
,
Object
>
positionMap
:
list
)
{
if
(
userPos
.
getPosId
().
equals
(
positionMap
.
get
(
"position_id"
)))
{
positionMap
.
put
(
"selected"
,
true
);
}
}
}
}
}
LayuiPageInfo
layuiPageInfo
=
new
LayuiPageInfo
();
layuiPageInfo
.
setData
(
list
);
return
layuiPageInfo
;
}
private
Serializable
getKey
(
PositionParam
param
)
{
return
param
.
getPositionId
();
}
private
Page
getPageContext
()
{
return
LayuiPageFactory
.
defaultPage
();
}
private
Position
getOldEntity
(
PositionParam
param
)
{
return
this
.
getById
(
getKey
(
param
));
}
private
Position
getEntity
(
PositionParam
param
)
{
Position
entity
=
new
Position
();
ToolUtil
.
copyProperties
(
param
,
entity
);
return
entity
;
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/impl/UserPosServiceImpl.java
0 → 100755
View file @
2536a57c
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
service
.
impl
;
import
cn.stylefeng.guns.base.pojo.page.LayuiPageFactory
;
import
cn.stylefeng.guns.base.pojo.page.LayuiPageInfo
;
import
cn.stylefeng.guns.sys.modular.system.entity.UserPos
;
import
cn.stylefeng.guns.sys.modular.system.mapper.UserPosMapper
;
import
cn.stylefeng.guns.sys.modular.system.model.params.UserPosParam
;
import
cn.stylefeng.guns.sys.modular.system.model.result.UserPosResult
;
import
cn.stylefeng.guns.sys.modular.system.service.UserPosService
;
import
cn.stylefeng.roses.core.util.ToolUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* <p>
* 用户职位关联表 服务实现类
* </p>
*
* @author stylefeng
* @since 2019-06-28
*/
@Service
public
class
UserPosServiceImpl
extends
ServiceImpl
<
UserPosMapper
,
UserPos
>
implements
UserPosService
{
@Override
public
void
add
(
UserPosParam
param
){
UserPos
entity
=
getEntity
(
param
);
this
.
save
(
entity
);
}
@Override
public
void
delete
(
UserPosParam
param
){
this
.
removeById
(
getKey
(
param
));
}
@Override
public
void
update
(
UserPosParam
param
){
UserPos
oldEntity
=
getOldEntity
(
param
);
UserPos
newEntity
=
getEntity
(
param
);
ToolUtil
.
copyProperties
(
newEntity
,
oldEntity
);
this
.
updateById
(
newEntity
);
}
@Override
public
UserPosResult
findBySpec
(
UserPosParam
param
){
return
null
;
}
@Override
public
List
<
UserPosResult
>
findListBySpec
(
UserPosParam
param
){
return
null
;
}
@Override
public
LayuiPageInfo
findPageBySpec
(
UserPosParam
param
){
Page
pageContext
=
getPageContext
();
IPage
page
=
this
.
baseMapper
.
customPageList
(
pageContext
,
param
);
return
LayuiPageFactory
.
createPageInfo
(
page
);
}
private
Serializable
getKey
(
UserPosParam
param
){
return
param
.
getUserPosId
();
}
private
Page
getPageContext
()
{
return
LayuiPageFactory
.
defaultPage
();
}
private
UserPos
getOldEntity
(
UserPosParam
param
)
{
return
this
.
getById
(
getKey
(
param
));
}
private
UserPos
getEntity
(
UserPosParam
param
)
{
UserPos
entity
=
new
UserPos
();
ToolUtil
.
copyProperties
(
param
,
entity
);
return
entity
;
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/warpper/UserWrapper.java
View file @
2536a57c
...
@@ -54,6 +54,7 @@ public class UserWrapper extends BaseControllerWrapper {
...
@@ -54,6 +54,7 @@ public class UserWrapper extends BaseControllerWrapper {
map
.
put
(
"roleName"
,
ConstantFactory
.
me
().
getRoleName
((
String
)
map
.
get
(
"roleId"
)));
map
.
put
(
"roleName"
,
ConstantFactory
.
me
().
getRoleName
((
String
)
map
.
get
(
"roleId"
)));
map
.
put
(
"deptName"
,
ConstantFactory
.
me
().
getDeptName
(
DecimalUtil
.
getLong
(
map
.
get
(
"deptId"
))));
map
.
put
(
"deptName"
,
ConstantFactory
.
me
().
getDeptName
(
DecimalUtil
.
getLong
(
map
.
get
(
"deptId"
))));
map
.
put
(
"statusName"
,
ConstantFactory
.
me
().
getStatusName
((
String
)
map
.
get
(
"status"
)));
map
.
put
(
"statusName"
,
ConstantFactory
.
me
().
getStatusName
((
String
)
map
.
get
(
"status"
)));
map
.
put
(
"positionName"
,
ConstantFactory
.
me
().
getPositionName
((
Long
)
map
.
get
(
"userId"
)));
}
}
}
}
guns-sys/src/main/webapp/assets/modular/system/dept/dept_add.js
View file @
2536a57c
...
@@ -15,9 +15,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
...
@@ -15,9 +15,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
var
admin
=
layui
.
admin
;
var
admin
=
layui
.
admin
;
var
layer
=
layui
.
layer
;
var
layer
=
layui
.
layer
;
// 让当前iframe弹层高度适应
admin
.
iframeAuto
();
// 点击上级角色时
// 点击上级角色时
$
(
'#pName'
).
click
(
function
()
{
$
(
'#pName'
).
click
(
function
()
{
var
formName
=
encodeURIComponent
(
"parent.DeptInfoDlg.data.pName"
);
var
formName
=
encodeURIComponent
(
"parent.DeptInfoDlg.data.pName"
);
...
...
guns-sys/src/main/webapp/assets/modular/system/dept/dept_edit.js
View file @
2536a57c
...
@@ -15,9 +15,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
...
@@ -15,9 +15,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
var
admin
=
layui
.
admin
;
var
admin
=
layui
.
admin
;
var
layer
=
layui
.
layer
;
var
layer
=
layui
.
layer
;
// 让当前iframe弹层高度适应
admin
.
iframeAuto
();
//获取部门信息
//获取部门信息
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/dept/detail/"
+
Feng
.
getUrlParam
(
"deptId"
));
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/dept/detail/"
+
Feng
.
getUrlParam
(
"deptId"
));
var
result
=
ajax
.
start
();
var
result
=
ajax
.
start
();
...
...
guns-sys/src/main/webapp/assets/modular/system/menu/menu.js
View file @
2536a57c
...
@@ -181,13 +181,4 @@ layui.use(['layer', 'form', 'ztree', 'laydate', 'admin', 'ax', 'table', 'treetab
...
@@ -181,13 +181,4 @@ layui.use(['layer', 'form', 'ztree', 'laydate', 'admin', 'ax', 'table', 'treetab
}
}
});
});
// 修改user状态
form
.
on
(
'switch(status)'
,
function
(
obj
)
{
var
userId
=
obj
.
elem
.
value
;
var
checked
=
obj
.
elem
.
checked
?
true
:
false
;
Menu
.
changeUserStatus
(
userId
,
checked
);
});
});
});
guns-sys/src/main/webapp/assets/modular/system/menu/menu_add.js
View file @
2536a57c
...
@@ -16,9 +16,6 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'ax'], function () {
...
@@ -16,9 +16,6 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'ax'], function () {
var
laydate
=
layui
.
laydate
;
var
laydate
=
layui
.
laydate
;
var
layer
=
layui
.
layer
;
var
layer
=
layui
.
layer
;
// 让当前iframe弹层高度适应
admin
.
iframeAuto
();
// 点击父级菜单
// 点击父级菜单
$
(
'#pcodeName'
).
click
(
function
()
{
$
(
'#pcodeName'
).
click
(
function
()
{
var
formName
=
encodeURIComponent
(
"parent.MenuInfoDlg.data.pcodeName"
);
var
formName
=
encodeURIComponent
(
"parent.MenuInfoDlg.data.pcodeName"
);
...
...
guns-sys/src/main/webapp/assets/modular/system/menu/menu_edit.js
View file @
2536a57c
...
@@ -16,9 +16,6 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'ax'], function () {
...
@@ -16,9 +16,6 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'ax'], function () {
var
laydate
=
layui
.
laydate
;
var
laydate
=
layui
.
laydate
;
var
layer
=
layui
.
layer
;
var
layer
=
layui
.
layer
;
// 让当前iframe弹层高度适应
admin
.
iframeAuto
();
//获取菜单信息
//获取菜单信息
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/menu/getMenuInfo?menuId="
+
Feng
.
getUrlParam
(
"menuId"
));
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/menu/getMenuInfo?menuId="
+
Feng
.
getUrlParam
(
"menuId"
));
var
result
=
ajax
.
start
();
var
result
=
ajax
.
start
();
...
...
guns-sys/src/main/webapp/assets/modular/system/notice/notice_add.js
View file @
2536a57c
...
@@ -5,9 +5,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
...
@@ -5,9 +5,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
var
admin
=
layui
.
admin
;
var
admin
=
layui
.
admin
;
var
layer
=
layui
.
layer
;
var
layer
=
layui
.
layer
;
// 让当前iframe弹层高度适应
admin
.
iframeAuto
();
// 表单提交事件
// 表单提交事件
form
.
on
(
'submit(btnSubmit)'
,
function
(
data
)
{
form
.
on
(
'submit(btnSubmit)'
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/add"
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/add"
,
function
(
data
)
{
...
...
guns-sys/src/main/webapp/assets/modular/system/notice/notice_edit.js
View file @
2536a57c
...
@@ -5,9 +5,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
...
@@ -5,9 +5,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
var
admin
=
layui
.
admin
;
var
admin
=
layui
.
admin
;
var
layer
=
layui
.
layer
;
var
layer
=
layui
.
layer
;
// 让当前iframe弹层高度适应
admin
.
iframeAuto
();
// 表单提交事件
// 表单提交事件
form
.
on
(
'submit(btnSubmit)'
,
function
(
data
)
{
form
.
on
(
'submit(btnSubmit)'
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/update"
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/update"
,
function
(
data
)
{
...
...
guns-sys/src/main/webapp/assets/modular/system/position/position.js
0 → 100644
View file @
2536a57c
layui
.
use
([
'table'
,
'admin'
,
'ax'
,
'form'
],
function
()
{
var
$
=
layui
.
$
;
var
table
=
layui
.
table
;
var
$ax
=
layui
.
ax
;
var
admin
=
layui
.
admin
;
var
form
=
layui
.
form
;
/**
* 职位表管理
*/
var
Position
=
{
tableId
:
"positionTable"
};
/**
* 初始化表格的列
*/
Position
.
initColumn
=
function
()
{
return
[[
{
type
:
'checkbox'
},
{
field
:
'positionId'
,
hide
:
true
,
title
:
'主键id'
},
{
field
:
'name'
,
sort
:
true
,
title
:
'职位名称'
},
{
field
:
'code'
,
sort
:
true
,
title
:
'职位编码'
},
{
field
:
'remark'
,
sort
:
true
,
title
:
'备注'
},
{
field
:
'createTime'
,
sort
:
true
,
title
:
'创建时间'
},
{
field
:
'updateTime'
,
sort
:
true
,
title
:
'更新时间'
},
{
field
:
'status'
,
sort
:
true
,
templet
:
'#statusTpl'
,
title
:
'状态'
},
{
align
:
'center'
,
toolbar
:
'#tableBar'
,
title
:
'操作'
}
]];
};
/**
* 点击查询按钮
*/
Position
.
search
=
function
()
{
var
queryData
=
{};
queryData
[
'condition'
]
=
$
(
"#condition"
).
val
();
table
.
reload
(
Position
.
tableId
,
{
where
:
queryData
,
page
:
{
curr
:
1
}
});
};
/**
* 弹出添加对话框
*/
Position
.
openAddDlg
=
function
()
{
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position/add'
;
};
/**
* 导出excel按钮
*/
Position
.
exportExcel
=
function
()
{
var
checkRows
=
table
.
checkStatus
(
Position
.
tableId
);
if
(
checkRows
.
data
.
length
===
0
)
{
Feng
.
error
(
"请选择要导出的数据"
);
}
else
{
table
.
exportFile
(
tableResult
.
config
.
id
,
checkRows
.
data
,
'xls'
);
}
};
/**
* 点击编辑
*
* @param data 点击按钮时候的行数据
*/
Position
.
openEditDlg
=
function
(
data
)
{
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position/edit?positionId='
+
data
.
positionId
;
};
/**
* 点击删除
*
* @param data 点击按钮时候的行数据
*/
Position
.
onDeleteItem
=
function
(
data
)
{
var
operation
=
function
()
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/position/delete"
,
function
(
data
)
{
Feng
.
success
(
"删除成功!"
);
table
.
reload
(
Position
.
tableId
);
},
function
(
data
)
{
Feng
.
error
(
"删除失败!"
+
data
.
responseJSON
.
message
+
"!"
);
});
ajax
.
set
(
"positionId"
,
data
.
positionId
);
ajax
.
start
();
};
Feng
.
confirm
(
"是否删除?"
,
operation
);
};
/**
* 修改职位状态
*/
Position
.
changeStatus
=
function
(
positionId
,
checked
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/position/changeStatus"
,
function
(
data
)
{
Feng
.
success
(
"修改成功!"
);
},
function
(
data
)
{
Feng
.
error
(
"修改成功!"
);
table
.
reload
(
Position
.
tableId
);
});
ajax
.
set
(
"positionId"
,
positionId
);
ajax
.
set
(
"status"
,
checked
);
ajax
.
start
();
};
// 渲染表格
var
tableResult
=
table
.
render
({
elem
:
'#'
+
Position
.
tableId
,
url
:
Feng
.
ctxPath
+
'/position/list'
,
page
:
true
,
height
:
"full-158"
,
cellMinWidth
:
100
,
cols
:
Position
.
initColumn
()
});
// 搜索按钮点击事件
$
(
'#btnSearch'
).
click
(
function
()
{
Position
.
search
();
});
// 添加按钮点击事件
$
(
'#btnAdd'
).
click
(
function
()
{
Position
.
openAddDlg
();
});
// 导出excel
$
(
'#btnExp'
).
click
(
function
()
{
Position
.
exportExcel
();
});
// 工具条点击事件
table
.
on
(
'tool('
+
Position
.
tableId
+
')'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
var
layEvent
=
obj
.
event
;
if
(
layEvent
===
'edit'
)
{
Position
.
openEditDlg
(
data
);
}
else
if
(
layEvent
===
'delete'
)
{
Position
.
onDeleteItem
(
data
);
}
});
// 修改user状态
form
.
on
(
'switch(status)'
,
function
(
obj
)
{
var
positionId
=
obj
.
elem
.
value
;
var
checked
=
obj
.
elem
.
checked
?
true
:
false
;
Position
.
changeStatus
(
positionId
,
checked
);
});
});
guns-sys/src/main/webapp/assets/modular/system/position/position_add.js
0 → 100644
View file @
2536a57c
/**
* 添加或者修改页面
*/
var
PositionInfoDlg
=
{
data
:
{
name
:
""
,
code
:
""
,
sort
:
""
,
status
:
""
,
remark
:
""
,
createTime
:
""
,
updateUser
:
""
,
updateTime
:
""
,
createUser
:
""
}
};
layui
.
use
([
'form'
,
'admin'
,
'ax'
],
function
()
{
var
$
=
layui
.
jquery
;
var
$ax
=
layui
.
ax
;
var
form
=
layui
.
form
;
var
admin
=
layui
.
admin
;
//让当前iframe弹层高度适应
admin
.
iframeAuto
();
//表单提交事件
form
.
on
(
'submit(btnSubmit)'
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/position/addItem"
,
function
(
data
)
{
Feng
.
success
(
"添加成功!"
);
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position'
},
function
(
data
)
{
Feng
.
error
(
"添加失败!"
+
data
.
responseJSON
.
message
)
});
ajax
.
set
(
data
.
field
);
ajax
.
start
();
return
false
;
});
//返回按钮
$
(
"#backupPage"
).
click
(
function
()
{
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position'
});
});
\ No newline at end of file
guns-sys/src/main/webapp/assets/modular/system/position/position_edit.js
0 → 100644
View file @
2536a57c
/**
* 详情对话框
*/
var
PositionInfoDlg
=
{
data
:
{
name
:
""
,
code
:
""
,
sort
:
""
,
status
:
""
,
remark
:
""
,
createTime
:
""
,
updateUser
:
""
,
updateTime
:
""
,
createUser
:
""
}
};
layui
.
use
([
'form'
,
'admin'
,
'ax'
],
function
()
{
var
$
=
layui
.
jquery
;
var
$ax
=
layui
.
ax
;
var
form
=
layui
.
form
;
var
admin
=
layui
.
admin
;
//让当前iframe弹层高度适应
admin
.
iframeAuto
();
//获取详情信息,填充表单
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/position/detail?positionId="
+
Feng
.
getUrlParam
(
"positionId"
));
var
result
=
ajax
.
start
();
form
.
val
(
'positionForm'
,
result
.
data
);
//表单提交事件
form
.
on
(
'submit(btnSubmit)'
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/position/editItem"
,
function
(
data
)
{
Feng
.
success
(
"更新成功!"
);
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position'
},
function
(
data
)
{
Feng
.
error
(
"更新失败!"
+
data
.
responseJSON
.
message
)
});
ajax
.
set
(
data
.
field
);
ajax
.
start
();
return
false
;
});
//返回按钮
$
(
"#backupPage"
).
click
(
function
()
{
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position'
});
});
\ No newline at end of file
guns-sys/src/main/webapp/assets/modular/system/role/role_add.js
View file @
2536a57c
...
@@ -15,9 +15,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
...
@@ -15,9 +15,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
var
admin
=
layui
.
admin
;
var
admin
=
layui
.
admin
;
var
layer
=
layui
.
layer
;
var
layer
=
layui
.
layer
;
// 让当前iframe弹层高度适应
admin
.
iframeAuto
();
// 点击上级角色时
// 点击上级角色时
$
(
'#pName'
).
click
(
function
()
{
$
(
'#pName'
).
click
(
function
()
{
var
formName
=
encodeURIComponent
(
"parent.RoleInfoDlg.data.pName"
);
var
formName
=
encodeURIComponent
(
"parent.RoleInfoDlg.data.pName"
);
...
...
guns-sys/src/main/webapp/assets/modular/system/role/role_edit.js
View file @
2536a57c
...
@@ -15,9 +15,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
...
@@ -15,9 +15,6 @@ layui.use(['layer', 'form', 'admin', 'ax'], function () {
var
admin
=
layui
.
admin
;
var
admin
=
layui
.
admin
;
var
layer
=
layui
.
layer
;
var
layer
=
layui
.
layer
;
// 让当前iframe弹层高度适应
admin
.
iframeAuto
();
//初始化角色的详情数据
//初始化角色的详情数据
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/role/view/"
+
Feng
.
getUrlParam
(
"roleId"
));
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/role/view/"
+
Feng
.
getUrlParam
(
"roleId"
));
var
result
=
ajax
.
start
();
var
result
=
ajax
.
start
();
...
...
guns-sys/src/main/webapp/assets/modular/system/user/user.js
View file @
2536a57c
...
@@ -28,10 +28,8 @@ layui.use(['layer', 'form', 'table', 'ztree', 'laydate', 'admin', 'ax'], functio
...
@@ -28,10 +28,8 @@ layui.use(['layer', 'form', 'table', 'ztree', 'laydate', 'admin', 'ax'], functio
{
field
:
'userId'
,
hide
:
true
,
sort
:
true
,
title
:
'用户id'
},
{
field
:
'userId'
,
hide
:
true
,
sort
:
true
,
title
:
'用户id'
},
{
field
:
'account'
,
align
:
"center"
,
sort
:
true
,
title
:
'账号'
},
{
field
:
'account'
,
align
:
"center"
,
sort
:
true
,
title
:
'账号'
},
{
field
:
'name'
,
align
:
"center"
,
sort
:
true
,
title
:
'姓名'
},
{
field
:
'name'
,
align
:
"center"
,
sort
:
true
,
title
:
'姓名'
},
{
field
:
'sexName'
,
align
:
"center"
,
sort
:
true
,
title
:
'性别'
},
{
field
:
'roleName'
,
align
:
"center"
,
sort
:
true
,
title
:
'角色'
},
{
field
:
'deptName'
,
align
:
"center"
,
sort
:
true
,
title
:
'部门'
},
{
field
:
'deptName'
,
align
:
"center"
,
sort
:
true
,
title
:
'部门'
},
{
field
:
'
email'
,
align
:
"center"
,
sort
:
true
,
title
:
'邮箱'
,
minWidth
:
122
},
{
field
:
'
positionName'
,
align
:
"center"
,
sort
:
true
,
title
:
'职位'
},
{
field
:
'phone'
,
align
:
"center"
,
sort
:
true
,
title
:
'电话'
,
minWidth
:
117
},
{
field
:
'phone'
,
align
:
"center"
,
sort
:
true
,
title
:
'电话'
,
minWidth
:
117
},
{
field
:
'createTime'
,
align
:
"center"
,
sort
:
true
,
title
:
'创建时间'
,
minWidth
:
160
},
{
field
:
'createTime'
,
align
:
"center"
,
sort
:
true
,
title
:
'创建时间'
,
minWidth
:
160
},
{
field
:
'status'
,
align
:
"center"
,
sort
:
true
,
templet
:
'#statusTpl'
,
title
:
'状态'
},
{
field
:
'status'
,
align
:
"center"
,
sort
:
true
,
templet
:
'#statusTpl'
,
title
:
'状态'
},
...
...
guns-sys/src/main/webapp/assets/modular/system/user/user_add.js
View file @
2536a57c
...
@@ -8,16 +8,14 @@ var UserInfoDlg = {
...
@@ -8,16 +8,14 @@ var UserInfoDlg = {
}
}
};
};
layui
.
use
([
'layer'
,
'form'
,
'admin'
,
'laydate'
,
'ax'
],
function
()
{
layui
.
use
([
'layer'
,
'form'
,
'admin'
,
'laydate'
,
'ax'
,
'formSelects'
],
function
()
{
var
$
=
layui
.
jquery
;
var
$
=
layui
.
jquery
;
var
$ax
=
layui
.
ax
;
var
$ax
=
layui
.
ax
;
var
form
=
layui
.
form
;
var
form
=
layui
.
form
;
var
admin
=
layui
.
admin
;
var
admin
=
layui
.
admin
;
var
laydate
=
layui
.
laydate
;
var
laydate
=
layui
.
laydate
;
var
layer
=
layui
.
layer
;
var
layer
=
layui
.
layer
;
var
formSelects
=
layui
.
formSelects
;
// 让当前iframe弹层高度适应
admin
.
iframeAuto
();
// 点击部门时
// 点击部门时
$
(
'#deptName'
).
click
(
function
()
{
$
(
'#deptName'
).
click
(
function
()
{
...
@@ -73,4 +71,11 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'ax'], function () {
...
@@ -73,4 +71,11 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'ax'], function () {
$
(
"#backupPage"
).
click
(
function
()
{
$
(
"#backupPage"
).
click
(
function
()
{
window
.
location
.
href
=
Feng
.
ctxPath
+
"/mgr"
;
window
.
location
.
href
=
Feng
.
ctxPath
+
"/mgr"
;
});
});
//初始化所有的职位列表
formSelects
.
config
(
'selPosition'
,
{
searchUrl
:
Feng
.
ctxPath
+
"/position/listPositions"
,
keyName
:
'name'
,
keyVal
:
'position_id'
});
});
});
\ No newline at end of file
guns-sys/src/main/webapp/assets/modular/system/user/user_edit.js
View file @
2536a57c
...
@@ -8,16 +8,14 @@ var UserInfoDlg = {
...
@@ -8,16 +8,14 @@ var UserInfoDlg = {
}
}
};
};
layui
.
use
([
'layer'
,
'form'
,
'admin'
,
'laydate'
,
'ax'
],
function
()
{
layui
.
use
([
'layer'
,
'form'
,
'admin'
,
'laydate'
,
'ax'
,
'formSelects'
],
function
()
{
var
$
=
layui
.
jquery
;
var
$
=
layui
.
jquery
;
var
$ax
=
layui
.
ax
;
var
$ax
=
layui
.
ax
;
var
form
=
layui
.
form
;
var
form
=
layui
.
form
;
var
admin
=
layui
.
admin
;
var
admin
=
layui
.
admin
;
var
laydate
=
layui
.
laydate
;
var
laydate
=
layui
.
laydate
;
var
layer
=
layui
.
layer
;
var
layer
=
layui
.
layer
;
var
formSelects
=
layui
.
formSelects
;
// 让当前iframe弹层高度适应
admin
.
iframeAuto
();
//获取用户信息
//获取用户信息
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/mgr/getUserInfo?userId="
+
Feng
.
getUrlParam
(
"userId"
));
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/mgr/getUserInfo?userId="
+
Feng
.
getUrlParam
(
"userId"
));
...
@@ -79,4 +77,11 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'ax'], function () {
...
@@ -79,4 +77,11 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'ax'], function () {
$
(
"#backupPage"
).
click
(
function
()
{
$
(
"#backupPage"
).
click
(
function
()
{
window
.
location
.
href
=
Feng
.
ctxPath
+
"/mgr"
;
window
.
location
.
href
=
Feng
.
ctxPath
+
"/mgr"
;
});
});
//初始化所有的职位列表
formSelects
.
config
(
'selPosition'
,
{
searchUrl
:
Feng
.
ctxPath
+
"/position/listPositions?userId="
+
$
(
"#userId"
).
val
(),
keyName
:
'name'
,
keyVal
:
'position_id'
});
});
});
\ No newline at end of file
guns-sys/src/main/webapp/pages/modular/system/position/position.html
0 → 100644
View file @
2536a57c
@layout("/common/_container.html",{js:["/assets/modular/system/position/position.js"]}){
<div
class=
"layui-body-header"
>
<span
class=
"layui-body-header-title"
>
职位表管理
</span>
</div>
<div
class=
"layui-fluid"
>
<div
class=
"layui-row layui-col-space15"
>
<div
class=
"layui-col-sm12 layui-col-md12 layui-col-lg12"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<div
class=
"layui-form toolbar"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<input
id=
"condition"
class=
"layui-input"
type=
"text"
placeholder=
"名称"
/>
</div>
<div
class=
"layui-inline"
>
<button
id=
"btnSearch"
class=
"layui-btn icon-btn"
><i
class=
"layui-icon"
>

</i>
搜索
</button>
<button
id=
"btnAdd"
class=
"layui-btn icon-btn"
><i
class=
"layui-icon"
>

</i>
添加
</button>
<button
id=
"btnExp"
class=
"layui-btn icon-btn"
><i
class=
"layui-icon"
>

</i>
导出
</button>
</div>
</div>
</div>
<table
class=
"layui-table"
id=
"positionTable"
lay-filter=
"positionTable"
></table>
</div>
</div>
</div>
</div>
</div>
<script
type=
"text/html"
id=
"tableBar"
>
<
a
class
=
"layui-btn layui-btn-primary layui-btn-xs"
lay
-
event
=
"edit"
>
修改
<
/a
>
<
a
class
=
"layui-btn layui-btn-danger layui-btn-xs"
lay
-
event
=
"delete"
>
删除
<
/a
>
</script>
<script
type=
"text/html"
id=
"statusTpl"
>
<
input
type
=
"checkbox"
lay
-
filter
=
"status"
value
=
"{{d.positionId}}"
lay
-
skin
=
"switch"
lay
-
text
=
"启用|禁用"
{{
d
.
status
==
'ENABLE'
?
'checked'
:
''
}}
/
>
</script>
@}
\ No newline at end of file
guns-sys/src/main/webapp/pages/modular/system/position/position_add.html
0 → 100644
View file @
2536a57c
@layout("/common/_container.html",{js:["/assets/modular/system/position/position_add.js"]}){
<div
class=
"layui-body-header"
>
<span
class=
"layui-body-header-title"
>
添加
</span>
</div>
<div
class=
"layui-fluid "
style=
""
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<form
id=
"positionForm"
lay-filter=
"positionForm"
class=
"layui-form model-form"
style=
"max-width: 700px;margin: 40px auto;"
>
<input
name=
"positionId"
type=
"hidden"
/>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职位名称
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"name"
name=
"name"
placeholder=
"请输入职位名称"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职位编码
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"code"
name=
"code"
placeholder=
"请输入职位编码"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
顺序
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"sort"
name=
"sort"
placeholder=
"请输入顺序"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
备注
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"remark"
name=
"remark"
placeholder=
"请输入备注"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
>
<button
class=
"layui-btn"
lay-filter=
"btnSubmit"
lay-submit
>
 
提交
 
</button>
<button
class=
"layui-btn layui-btn-primary"
type=
"button"
id=
"backupPage"
>
 
返回
 
</button>
</div>
</div>
</form>
</div>
</div>
</div>
@}
\ No newline at end of file
guns-sys/src/main/webapp/pages/modular/system/position/position_edit.html
0 → 100644
View file @
2536a57c
@layout("/common/_container.html",{js:["/assets/modular/system/position/position_edit.js"]}){
<div
class=
"layui-body-header"
>
<span
class=
"layui-body-header-title"
>
修改
</span>
</div>
<div
class=
"layui-fluid "
style=
""
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<form
id=
"positionForm"
lay-filter=
"positionForm"
class=
"layui-form model-form"
style=
"max-width: 700px;margin: 40px auto;"
>
<input
name=
"positionId"
type=
"hidden"
/>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职位名称
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"name"
name=
"name"
placeholder=
"请输入职位名称"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职位编码
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"code"
name=
"code"
placeholder=
"请输入职位编码"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
顺序
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"sort"
name=
"sort"
placeholder=
"请输入顺序"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
备注
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"remark"
name=
"remark"
placeholder=
"请输入备注"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
>
<button
class=
"layui-btn"
lay-filter=
"btnSubmit"
lay-submit
>
 
提交
 
</button>
<button
class=
"layui-btn layui-btn-primary"
type=
"button"
id=
"backupPage"
>
 
返回
 
</button>
</div>
</div>
</form>
</div>
</div>
</div>
@}
\ No newline at end of file
guns-sys/src/main/webapp/pages/modular/system/user/user_add.html
View file @
2536a57c
@layout("/common/_container.html",{js:["/assets/modular/system/user/user_add.js"]}){
@layout("/common/_container.html",{js:["/assets/modular/system/user/user_add.js"]
,css:["/assets/common/module/formSelects/formSelects-v4.css"]
}){
<div
class=
"layui-body-header"
>
<div
class=
"layui-body-header"
>
<span
class=
"layui-body-header-title"
>
用户管理-添加
</span>
<span
class=
"layui-body-header-title"
>
用户管理-添加
</span>
</div>
</div>
...
@@ -29,19 +29,19 @@
...
@@ -29,19 +29,19 @@
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
密码
<span
style=
"color: red;"
>
*
</span></label>
<label
class=
"layui-form-label"
>
密码
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
name=
"password"
placeholder=
"请输入密码"
type=
"password"
class=
"layui-input"
lay-verify=
"required|psw"
required
/>
<input
name=
"password"
placeholder=
"请输入密码"
type=
"password"
class=
"layui-input"
lay-verify=
"required|psw"
autocomplete=
"new-password"
required
/>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
重复密码
<span
style=
"color: red;"
>
*
</span></label>
<label
class=
"layui-form-label"
>
重复密码
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
name=
"rePassword"
placeholder=
"请输入重复密码"
type=
"password"
class=
"layui-input"
lay-verify=
"required|repsw"
required
/>
<input
name=
"rePassword"
placeholder=
"请输入重复密码"
type=
"password"
class=
"layui-input"
autocomplete=
"new-password"
lay-verify=
"required|repsw"
required
/>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
邮箱
<span
style=
"color: red;"
>
*
</span></label>
<label
class=
"layui-form-label"
>
邮箱
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
name=
"email"
placeholder=
"请输入邮箱"
type=
"text"
class=
"layui-input"
lay-verify=
"required|email"
required
/>
<input
name=
"email"
placeholder=
"请输入邮箱"
type=
"text"
class=
"layui-input"
lay-verify=
"required|email"
autocomplete=
"off"
required
/>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
...
@@ -59,6 +59,14 @@
...
@@ -59,6 +59,14 @@
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职位
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<select
name=
"position"
xm-select=
"selPosition"
>
<option
value=
""
>
请选择职位
</option>
</select>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
电话
</label>
<label
class=
"layui-form-label"
>
电话
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
name=
"phone"
placeholder=
"请输入电话"
type=
"text"
class=
"layui-input"
/>
<input
name=
"phone"
placeholder=
"请输入电话"
type=
"text"
class=
"layui-input"
/>
...
...
guns-sys/src/main/webapp/pages/modular/system/user/user_edit.html
View file @
2536a57c
@layout("/common/_container.html",{js:["/assets/modular/system/user/user_edit.js"]}){
@layout("/common/_container.html",{js:["/assets/modular/system/user/user_edit.js"]
,css:["/assets/common/module/formSelects/formSelects-v4.css"]
}){
<div
class=
"layui-body-header"
>
<div
class=
"layui-body-header"
>
<span
class=
"layui-body-header-title"
>
用户管理-修改
</span>
<span
class=
"layui-body-header-title"
>
用户管理-修改
</span>
</div>
</div>
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<div
class=
"layui-card"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<div
class=
"layui-card-body"
>
<form
id=
"userForm"
lay-filter=
"userForm"
class=
"layui-form model-form"
style=
"max-width: 700px;margin: 40px auto;"
>
<form
id=
"userForm"
lay-filter=
"userForm"
class=
"layui-form model-form"
style=
"max-width: 700px;margin: 40px auto;"
>
<input
name=
"userId"
type=
"hidden"
/>
<input
id=
"userId"
name=
"userId"
type=
"hidden"
/>
<input
name=
"account"
type=
"hidden"
/>
<input
name=
"account"
type=
"hidden"
/>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
姓名
<span
style=
"color: red;"
>
*
</span></label>
<label
class=
"layui-form-label"
>
姓名
<span
style=
"color: red;"
>
*
</span></label>
...
@@ -42,6 +42,13 @@
...
@@ -42,6 +42,13 @@
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职位
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<select
name=
"position"
id=
"position"
xm-select=
"selPosition"
lay-verify=
"required"
required
>
</select>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
电话
</label>
<label
class=
"layui-form-label"
>
电话
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
name=
"phone"
placeholder=
"请输入电话"
type=
"text"
class=
"layui-input"
/>
<input
name=
"phone"
placeholder=
"请输入电话"
type=
"text"
class=
"layui-input"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment