Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
f66cc25f
Commit
f66cc25f
authored
Jan 30, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
8c1743da
6da7355c
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
544 additions
and
299 deletions
+544
-299
attendance-performance-manager-ui/admin/src/assets/utils/table.js
...ce-performance-manager-ui/admin/src/assets/utils/table.js
+0
-1
attendance-performance-manager-ui/admin/src/views/check/window/workman/perform/drawershow.vue
...min/src/views/check/window/workman/perform/drawershow.vue
+5
-4
attendance-performance-manager-ui/admin/src/views/staff/perform/summary/dialogshow.vue
...r-ui/admin/src/views/staff/perform/summary/dialogshow.vue
+5
-2
attendance-performance-manager-ui/admin/src/views/staff/perform/summary/list.vue
...manager-ui/admin/src/views/staff/perform/summary/list.vue
+1
-1
attendance-performance-manager-ui/admin/src/views/staff/perform/summary/view.vue
...manager-ui/admin/src/views/staff/perform/summary/view.vue
+152
-94
attendance-performance-manager-ui/admin/src/views/system/user/list.vue
...rformance-manager-ui/admin/src/views/system/user/list.vue
+252
-94
attendance-performance-manager-ui/admin/src/views/window/workman/perform/drawershow.vue
...-ui/admin/src/views/window/workman/perform/drawershow.vue
+5
-2
attendance-performance-manager-ui/admin/vue.config.js
attendance-performance-manager-ui/admin/vue.config.js
+0
-9
attendance-performance-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
.../java/com/mortals/xhx/base/login/web/LoginController.java
+51
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/base/system/user/service/UserService.java
...com/mortals/xhx/base/system/user/service/UserService.java
+6
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
...ls/xhx/base/system/user/service/impl/UserServiceImpl.java
+35
-30
attendance-performance-manager/src/main/java/com/mortals/xhx/base/system/user/web/UserController.java
.../com/mortals/xhx/base/system/user/web/UserController.java
+32
-4
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/ApiLoginController.java
...java/com/mortals/xhx/busiz/h5/web/ApiLoginController.java
+0
-58
No files found.
attendance-performance-manager-ui/admin/src/assets/utils/table.js
View file @
f66cc25f
...
...
@@ -136,7 +136,6 @@ function handleTree(data, id, parentId, children, rootId) {
const
treeData
=
cloneData
.
filter
((
father
)
=>
{
let
branchArr
=
cloneData
.
filter
((
child
)
=>
{
//返回每一项的子级数组
console
.
log
(
child
[
parentId
]);
return
father
[
id
]
===
child
[
parentId
];
});
branchArr
.
length
>
0
?
(
father
.
children
=
branchArr
)
:
""
;
...
...
attendance-performance-manager-ui/admin/src/views/check/window/workman/perform/drawershow.vue
View file @
f66cc25f
...
...
@@ -10,8 +10,8 @@
<div
class=
"content_box"
>
<div
class=
"text_line"
>
<div
class=
"text_box"
>
<span
style=
"width: 160px;"
>
窗
门
(单位) 名称:
</span>
<span>
{{
form
.
owner
Name
||
"
--
"
}}
</span>
<span
style=
"width: 160px;"
>
窗
口
(单位) 名称:
</span>
<span>
{{
window
Name
||
"
--
"
}}
</span>
</div>
<div
class=
"text_box"
>
<span>
登记年月:
</span>
...
...
@@ -301,6 +301,7 @@ export default {
}
,
data
()
{
return
{
windowName
:
""
,
// 遮罩层
loading
:
true
,
// 弹出层标题
...
...
@@ -324,6 +325,7 @@ export default {
}
,
/** 编辑 */
async
edit
(
row
)
{
this
.
windowName
=
row
.
windowName
;
// this.reset();
// this.query =
{
id
:
row
.
id
}
;
this
.
urls
.
saveUrl
=
"
check/window/workman/perform/examine
"
;
...
...
@@ -429,14 +431,13 @@ export default {
// this.getData();
// this.pageInfo.type = "view";
// this.title = "窗口人员考核汇总核查详细";
this
.
windowName
=
row
.
windowName
;
this
.
form
=
row
;
this
.
reset
();
this
.
query
=
{
id
:
row
.
id
}
;
await
this
.
$get
(
"
/window/workman/perform/info
"
,
{
id
:
row
.
recordId
,
}
).
then
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
code
==
1
)
{
this
.
form
=
res
.
data
;
this
.
form
.
id
=
row
.
id
;
...
...
attendance-performance-manager-ui/admin/src/views/staff/perform/summary/dialogshow.vue
View file @
f66cc25f
...
...
@@ -12,7 +12,10 @@
</div>
</div>
<div
class=
"user-right"
>
<div
class=
"n"
>
{{
form
.
totalScore
}}
</div>
<div
class=
"n"
>
{{
form
.
otherScore
}}
</div>
<div
class=
"m"
>
{{
form
.
month
}}
月自评绩效得分
</div>
<div
class=
"n"
style=
"margin-top: 10px;"
>
{{
form
.
totalScore
}}
</div>
<div
class=
"m"
>
{{
form
.
month
}}
月得分
</div>
</div>
</div>
...
...
@@ -68,7 +71,7 @@
<Field
label=
"评价绩效指标分数"
prop=
"assessScore"
v-model=
"form.assessScore"
placeholder=
"请输入评价绩效指标分数"
/>
<Field
label=
"办件绩效分数"
prop=
"workScore"
v-model=
"form.workScore"
placeholder=
"请输入办件绩效分数"
/>
<Field
label=
"效能绩效分数"
prop=
"effectScore"
v-model=
"form.effectScore"
placeholder=
"请输入效能绩效分数"
/>
<Field
label=
"
其它
绩效分数"
prop=
"otherScore"
v-model=
"form.otherScore"
placeholder=
"请输入其它绩效分数"
/>
<Field
label=
"
自评
绩效分数"
prop=
"otherScore"
v-model=
"form.otherScore"
placeholder=
"请输入其它绩效分数"
/>
<Field
label=
"累计异常分数"
prop=
"errorScore"
v-model=
"form.errorScore"
placeholder=
"请输入累计异常分数"
/>
<Field
label=
"当月得分数"
prop=
"totalScore"
v-model=
"form.totalScore"
placeholder=
"请输入当月得分数"
/>
<Field
label=
"备注"
prop=
"remark"
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入备注"
/>
...
...
attendance-performance-manager-ui/admin/src/views/staff/perform/summary/list.vue
View file @
f66cc25f
...
...
@@ -141,7 +141,7 @@ export default {
},
{
label
:
"
其它
绩效分数
"
,
label
:
"
自评
绩效分数
"
,
prop
:
"
otherScore
"
,
},
...
...
attendance-performance-manager-ui/admin/src/views/staff/perform/summary/view.vue
View file @
f66cc25f
<
template
>
<layout-view>
<el-descriptions
:title=
"title"
:column=
"column"
:size=
"size"
:colon=
"false"
border
>
<template
slot=
"title"
>
<i
class=
"el-icon-tickets"
></i>
基本详细信息
</
template
>
<
template
slot=
"extra"
>
<el-button
type=
"primary"
@
click=
"$router.go(-1)"
size=
"small"
>
返回
</el-button>
</
template
>
<el-descriptions-item
label=
"人员id"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.staffId}}
</el-descriptions-item>
<el-descriptions-item
label=
"工号"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.workNum}}
</el-descriptions-item>
<el-descriptions-item
label=
"人员名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.staffName}}
</el-descriptions-item>
<el-descriptions-item
label=
"部门id号"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.deptId}}
</el-descriptions-item>
<el-descriptions-item
label=
"部门名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.deptName}}
</el-descriptions-item>
<el-descriptions-item
label=
"考勤绩效指标分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.attendScore}}
</el-descriptions-item>
<el-descriptions-item
label=
"评价绩效指标分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.assessScore}}
</el-descriptions-item>
<el-descriptions-item
label=
"办件绩效分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.workScore}}
</el-descriptions-item>
<el-descriptions-item
label=
"效能绩效分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.effectScore}}
</el-descriptions-item>
<el-descriptions-item
label=
"其它绩效分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.otherScore}}
</el-descriptions-item>
<el-descriptions-item
label=
"累计异常分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.errorScore}}
</el-descriptions-item>
<el-descriptions-item
label=
"当月得分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.totalScore}}
</el-descriptions-item>
<el-descriptions-item
label=
"备注"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.remark}}
</el-descriptions-item>
<el-descriptions-item
label=
"年"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.year}}
</el-descriptions-item>
<el-descriptions-item
label=
"月"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.month}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
<layout-view>
<el-descriptions
:title=
"title"
:column=
"column"
:size=
"size"
:colon=
"false"
border
>
<template
slot=
"title"
>
<i
class=
"el-icon-tickets"
></i>
基本详细信息
</
template
>
<
template
slot=
"extra"
>
<el-button
type=
"primary"
@
click=
"$router.go(-1)"
size=
"small"
>
返回
</el-button
>
</
template
>
<el-descriptions-item
label=
"人员id"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.staffId }}
</el-descriptions-item>
<el-descriptions-item
label=
"工号"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.workNum }}
</el-descriptions-item>
<el-descriptions-item
label=
"人员名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.staffName }}
</el-descriptions-item>
<el-descriptions-item
label=
"部门id号"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.deptId }}
</el-descriptions-item>
<el-descriptions-item
label=
"部门名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.deptName }}
</el-descriptions-item>
<el-descriptions-item
label=
"考勤绩效指标分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.attendScore }}
</el-descriptions-item>
<el-descriptions-item
label=
"评价绩效指标分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.assessScore }}
</el-descriptions-item>
<el-descriptions-item
label=
"办件绩效分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.workScore }}
</el-descriptions-item>
<el-descriptions-item
label=
"效能绩效分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.effectScore }}
</el-descriptions-item>
<el-descriptions-item
label=
"自评绩效分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.otherScore }}
</el-descriptions-item>
<el-descriptions-item
label=
"累计异常分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.errorScore }}
</el-descriptions-item>
<el-descriptions-item
label=
"当月得分数"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.totalScore }}
</el-descriptions-item>
<el-descriptions-item
label=
"备注"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.remark }}
</el-descriptions-item>
<el-descriptions-item
label=
"年"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.year }}
</el-descriptions-item>
<el-descriptions-item
label=
"月"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.month }}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<
script
>
import
view
from
"
@/assets/mixins/view
"
;
export
default
{
mixins
:
[
view
],
components
:
{
},
methods
:
{
},
data
()
{
return
{
size
:
"
small
"
,
column
:
2
,
toString
:[
"
month
"
,
],
toArrays
:
[
],
toDate
:
[
]
}
}
}
import
view
from
"
@/assets/mixins/view
"
;
export
default
{
mixins
:
[
view
],
components
:
{},
methods
:
{},
data
()
{
return
{
size
:
"
small
"
,
column
:
2
,
toString
:
[
"
month
"
],
toArrays
:
[],
toDate
:
[],
};
},
};
</
script
>
<
style
lang=
"less"
>
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</
style
>
\ No newline at end of file
.labelClass {
width: 200px;
}
.el-descriptions__body {
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #fff;
}
.contentClass {
width: 600px;
}
</
style
>
attendance-performance-manager-ui/admin/src/views/system/user/list.vue
View file @
f66cc25f
This diff is collapsed.
Click to expand it.
attendance-performance-manager-ui/admin/src/views/window/workman/perform/drawershow.vue
View file @
f66cc25f
...
...
@@ -10,8 +10,8 @@
<div
class=
"content_box"
>
<div
class=
"text_line"
>
<div
class=
"text_box"
>
<span
style=
"width: 160px;"
>
窗
门 (单位) 名称:
</span>
<span>
{{
form
.
owner
Name
||
"
--
"
}}
</span>
<span
style=
"width: 160px;"
>
窗
口 (单位) 名称:
</span>
<span>
{{
window
Name
||
"
--
"
}}
</span>
</div>
<div
class=
"text_box"
>
<span>
登记年月:
</span>
...
...
@@ -301,6 +301,7 @@ export default {
}
,
data
()
{
return
{
windowName
:
""
,
// 遮罩层
loading
:
true
,
// 弹出层标题
...
...
@@ -324,6 +325,7 @@ export default {
}
,
/** 编辑 */
async
edit
(
row
)
{
this
.
windowName
=
row
.
windowName
;
// this.reset();
// this.query =
{
id
:
row
.
id
}
;
this
.
urls
.
currUrl
=
"
check/window/workman/perform/save
"
;
...
...
@@ -421,6 +423,7 @@ export default {
}
,
/** 查看*/
async
view
(
row
)
{
this
.
windowName
=
row
.
windowName
;
// this.reset();
// this.query =
{
id
:
row
.
id
}
;
// this.urls.currUrl = "check/window/workman/perform/view";
...
...
attendance-performance-manager-ui/admin/vue.config.js
View file @
f66cc25f
module
.
exports
=
{
productionSourceMap
:
false
,
/* assetsDir: 's',
configureWebpack: {
externals: {
vue: "Vue",
vuex: "Vuex",
"vue-router": "VueRouter",
"element-ui": "ELEMENT"
},
},*/
lintOnSave
:
false
,
devServer
:
{
inline
:
true
,
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
View file @
f66cc25f
...
...
@@ -204,6 +204,57 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
}
}
/**
* 修改用户登录名
*
* @param userEntity
* @return
* @throws Exception
*/
@RequestMapping
(
"reLoginName"
)
public
String
reLoginName
(
@RequestBody
UserEntity
userEntity
)
throws
Exception
{
JSONObject
ret
=
new
JSONObject
();
Long
id
=
userEntity
.
getId
();
String
loginName
=
userEntity
.
getLoginName
();
Integer
userType
=
userEntity
.
getUserType
();
if
(
ObjectUtils
.
isEmpty
(
userEntity
.
getId
()))
{
throw
new
AppException
(
"修改的用户id不能为空"
);
}
if
(
ObjectUtils
.
isEmpty
(
loginName
))
{
throw
new
AppException
(
"修改的登录名不能问空!"
);
}
try
{
//检测修改的用户名是否存在
UserEntity
entity
=
userService
.
selectOne
(
new
UserQuery
().
loginName
(
loginName
));
if
(!
ObjectUtils
.
isEmpty
(
entity
))
{
throw
new
AppException
(
"修改的用户登录名已经存在!loginName="
+
loginName
);
}
if
(
SysConstains
.
ADMIN_ID
==
id
)
throw
new
AppException
(
"超级管理员不允许修改!"
);
if
(
userType
==
UserType
.
SYSTEM
.
getValue
())
throw
new
AppException
(
"系统用户不允许修改!"
);
userService
.
getUserDao
().
update
(
userEntity
);
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
ret
.
put
(
KEY_RESULT_MSG
,
"修改用户登录名成功!"
);
recordSysLog
(
request
,
userEntity
,
"修改用户登录名成功!"
);
return
ret
.
toJSONString
();
}
catch
(
AppException
e
)
{
log
.
error
(
"login error "
,
e
);
ret
.
put
(
KEY_RESULT_CODE
,
e
.
getCode
());
ret
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
return
ret
.
toJSONString
();
}
catch
(
Exception
e
)
{
log
.
error
(
"系统异常 error "
,
e
);
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
ret
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
return
ret
.
toJSONString
();
}
}
@RequestMapping
(
"logout"
)
public
void
logout
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/base/system/user/service/UserService.java
View file @
f66cc25f
...
...
@@ -114,6 +114,12 @@ public interface UserService extends ICRUDCacheService<UserEntity,Long> {
*/
public
boolean
updateUserPwd
(
String
loginName
,
String
oldPwd
,
String
newPwd
)
throws
AppException
;
/**
*
* @param entity
*/
void
doHandlerUser
(
UserEntity
entity
);
UserDao
getUserDao
();
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
View file @
f66cc25f
...
...
@@ -46,6 +46,7 @@ import java.util.stream.Collectors;
* <p>Description: UserServiceImpl service接口 </p>
* <p>Copyright: Copyright ® </p>
* <p>Company: </p>
*
* @author
* @version 1.0.0
*/
...
...
@@ -65,10 +66,12 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Value
(
"${sms.apiId:ADsUXLrS81vZDU95}"
)
private
String
appid
;
/** 短信模板ID**/
/**
* 短信模板ID
**/
private
static
String
SMS_TPYE
=
"30"
;
private
static
String
SMS_VERIFY_CODE_KEY
=
"login:sms:verify:"
;
private
static
String
SMS_VERIFY_CODE_KEY
=
"login:sms:verify:"
;
@Override
protected
String
getExtKey
(
UserEntity
data
)
{
...
...
@@ -76,8 +79,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
}
private
void
doHandlerUser
(
UserEntity
entity
)
throws
AppException
{
public
void
doHandlerUser
(
UserEntity
entity
)
throws
AppException
{
if
(
StringUtils
.
isNotEmpty
(
entity
.
getLoginPwd
()))
{
try
{
entity
.
setLoginPwd
(
SecurityUtil
.
md5DoubleEncoding
(
entity
.
getLoginPwd
()));
...
...
@@ -101,9 +103,9 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Override
protected
void
saveAfter
(
UserEntity
entity
,
Context
context
)
throws
AppException
{
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getRoleIds
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getRoleIds
()))
{
List
<
RoleUserEntity
>
roleUserEntityList
=
new
ArrayList
<>();
entity
.
getRoleIds
().
stream
().
forEach
(
item
->
{
entity
.
getRoleIds
().
stream
().
forEach
(
item
->
{
RoleUserEntity
roleUserEntity
=
new
RoleUserEntity
();
roleUserEntity
.
setUserId
(
entity
.
getId
());
roleUserEntity
.
setRoleId
(
item
);
...
...
@@ -115,7 +117,10 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Override
protected
void
updateBefore
(
UserEntity
entity
,
Context
context
)
throws
AppException
{
if
(
entity
.
getId
().
longValue
()
==
SysConstains
.
ADMIN_ID
&&
!
context
.
getUser
().
isAdmin
())
{
/* if (entity.getId().longValue() == SysConstains.ADMIN_ID && !context.getUser().isAdmin()) {
throw new AppException("你没有权限执行该操作");
}*/
if
(
entity
.
getId
().
longValue
()
==
SysConstains
.
ADMIN_ID
)
{
throw
new
AppException
(
"你没有权限执行该操作"
);
}
this
.
doHandlerUser
(
entity
);
...
...
@@ -123,9 +128,9 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Override
protected
void
updateAfter
(
UserEntity
entity
,
Context
context
)
throws
AppException
{
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getRoleIds
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getRoleIds
()))
{
List
<
RoleUserEntity
>
roleUserEntityList
=
new
ArrayList
<>();
entity
.
getRoleIds
().
stream
().
forEach
(
item
->
{
entity
.
getRoleIds
().
stream
().
forEach
(
item
->
{
RoleUserEntity
roleUserEntity
=
new
RoleUserEntity
();
roleUserEntity
.
setUserId
(
entity
.
getId
());
roleUserEntity
.
setRoleId
(
item
);
...
...
@@ -156,13 +161,13 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Override
protected
void
findAfter
(
UserEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
UserEntity
>
list
)
throws
AppException
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
list
.
stream
().
forEach
(
item
->
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
list
.
stream
().
forEach
(
item
->
{
RoleUserEntity
query
=
new
RoleUserEntity
();
query
.
setUserId
(
item
.
getId
());
List
<
RoleUserEntity
>
roleUserEntityList
=
roleUserDao
.
getList
(
query
);
List
<
Long
>
roleIds
=
new
ArrayList
<>();
roleUserEntityList
.
stream
().
forEach
(
role
->
{
roleUserEntityList
.
stream
().
forEach
(
role
->
{
roleIds
.
add
(
role
.
getRoleId
());
});
item
.
setRoleIds
(
roleIds
);
...
...
@@ -364,64 +369,64 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Override
public
void
sendSmsVerifyCode
(
String
mobileNumber
)
throws
AppException
{
if
(
StringUtils
.
isEmpty
(
mobileNumber
))
{
if
(
StringUtils
.
isEmpty
(
mobileNumber
))
{
throw
new
AppException
(
"手机号不能为空"
);
}
if
(!
PhoneUtil
.
isPhone
(
mobileNumber
))
{
if
(!
PhoneUtil
.
isPhone
(
mobileNumber
))
{
throw
new
AppException
(
"手机号码格式不正确"
);
}
UserEntity
user
=
this
.
selectOne
(
new
UserQuery
().
mobile
(
mobileNumber
));
if
(
user
==
null
)
{
if
(
user
==
null
)
{
throw
new
AppException
(
"手机号码:"
+
mobileNumber
+
"没有注册用户"
);
}
String
verifyCode
=
cacheService
.
get
(
SMS_VERIFY_CODE_KEY
+
mobileNumber
);
if
(
StringUtils
.
isNotEmpty
(
verifyCode
))
{
if
(
StringUtils
.
isNotEmpty
(
verifyCode
))
{
throw
new
AppException
(
"当前手机号码已发送验证码,请稍后重试"
);
}
try
{
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"appid"
,
appid
);
params
.
put
(
"phone"
,
mobileNumber
);
params
.
put
(
"type"
,
SMS_TPYE
);
params
.
put
(
"appid"
,
appid
);
params
.
put
(
"phone"
,
mobileNumber
);
params
.
put
(
"type"
,
SMS_TPYE
);
String
[]
json
=
new
String
[
2
];
String
vCode
=
RandomUtil
.
randomNumbers
(
6
);
json
[
0
]
=
vCode
;
json
[
1
]
=
"1"
;
params
.
put
(
"json"
,
JSONObject
.
toJSON
(
json
).
toString
());
String
resp
=
HttpUtil
.
doPost
(
smsApiUrl
,
params
);
String
resp
=
HttpUtil
.
doPost
(
smsApiUrl
,
params
);
JSONObject
respJson
=
JSONObject
.
parseObject
(
resp
);
if
(
respJson
.
getIntValue
(
"code"
)==
0
)
{
if
(
respJson
.
getIntValue
(
"code"
)
==
0
)
{
throw
new
AppException
(
"短信发送失败:"
+
respJson
.
getString
(
"message"
));
}
//有效期60秒
cacheService
.
setnx
(
SMS_VERIFY_CODE_KEY
+
mobileNumber
,
vCode
,
60
);
}
catch
(
Exception
e
)
{
log
.
error
(
"短信发送异常"
,
e
);
cacheService
.
setnx
(
SMS_VERIFY_CODE_KEY
+
mobileNumber
,
vCode
,
60
);
}
catch
(
Exception
e
)
{
log
.
error
(
"短信发送异常"
,
e
);
throw
new
AppException
(
"短信发送异常"
);
}
}
@Override
public
UserEntity
doSmsLogin
(
String
mobileNumber
,
String
verifyCode
,
String
loginIp
)
throws
AppException
{
if
(
StringUtils
.
isEmpty
(
mobileNumber
))
{
if
(
StringUtils
.
isEmpty
(
mobileNumber
))
{
throw
new
AppException
(
"手机号不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
verifyCode
))
{
if
(
StringUtils
.
isEmpty
(
verifyCode
))
{
throw
new
AppException
(
"验证码不能为空"
);
}
if
(!
PhoneUtil
.
isPhone
(
mobileNumber
))
{
if
(!
PhoneUtil
.
isPhone
(
mobileNumber
))
{
throw
new
AppException
(
"手机号码格式不正确"
);
}
UserEntity
customer
=
this
.
selectOne
(
new
UserQuery
().
mobile
(
mobileNumber
));
if
(
customer
==
null
)
{
if
(
customer
==
null
)
{
throw
new
AppException
(
"手机号码:"
+
mobileNumber
+
"没有注册用户"
);
}
String
vCode
=
cacheService
.
get
(
SMS_VERIFY_CODE_KEY
+
mobileNumber
);
if
(
StringUtils
.
isEmpty
(
vCode
))
{
if
(
StringUtils
.
isEmpty
(
vCode
))
{
throw
new
AppException
(
"验证码已失效"
);
}
if
(!
verifyCode
.
equals
(
vCode
))
{
if
(!
verifyCode
.
equals
(
vCode
))
{
throw
new
AppException
(
"验证码不正确"
);
}
UserEntity
update
=
new
UserEntity
();
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/base/system/user/web/UserController.java
View file @
f66cc25f
...
...
@@ -19,15 +19,13 @@ import com.mortals.xhx.common.code.UserStatus;
import
com.mortals.xhx.common.code.UserType
;
import
com.mortals.xhx.module.dept.model.DeptQuery
;
import
com.mortals.xhx.module.dept.service.DeptService
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.Jwts
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -54,6 +52,9 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
@Autowired
private
DeptService
deptService
;
@Autowired
private
StaffService
staffService
;
public
UserController
()
{
super
.
setModuleDesc
(
"用户信息"
);
}
...
...
@@ -65,6 +66,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
this
.
addDict
(
model
,
"roleIds"
,
roleService
.
find
(
new
RoleQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getName
())));
this
.
addDict
(
model
,
"deptId"
,
deptService
.
find
(
new
DeptQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getDeptName
(),
(
o
,
n
)
->
n
)));
this
.
addDict
(
model
,
"customerId"
,
staffService
.
getCacheList
().
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getName
(),
(
o
,
n
)
->
n
)));
}
@Override
...
...
@@ -122,6 +125,31 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
}
@RequestMapping
(
value
=
"repassword"
,
method
=
RequestMethod
.
POST
)
public
String
rePassword
(
@RequestBody
UserEntity
userEntity
)
{
JSONObject
ret
=
new
JSONObject
();
try
{
//查询用户是否存在
boolean
existUser
=
service
.
existUser
(
userEntity
.
getLoginName
(),
userEntity
.
getId
());
if
(!
existUser
)
throw
new
AppException
(
"用户不存在!"
);
//修改密码
//service.doHandlerUser(userEntity);
service
.
update
(
userEntity
,
getContext
());
//更新密码
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
ret
.
put
(
KEY_RESULT_MSG
,
"密码修改成功!"
);
}
catch
(
Exception
e
)
{
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
ret
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
}
return
ret
.
toJSONString
();
}
public
static
void
main
(
String
[]
args
)
{
String
token
=
"eyJhbGciOiJIUzI1NiJ9.eyJsb2dpbl91c2VyX2tleSI6IjIzNGE5NDA5ZDVhOTQ3MWNhMzdkYjZkYmMwY2JjZTc5In0.MWyQW40HYDxyUz7PJRf_nRsFPWx3Hr811Ime984nixs"
;
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/ApiLoginController.java
View file @
f66cc25f
...
...
@@ -121,64 +121,6 @@ public class ApiLoginController extends BaseJsonBodyController {
ret
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
return
ret
.
toJSONString
();
}
/*
JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
String ip = super.getRequestIP(request);
if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "未获取到用户信息,请重新登录");
return ret.toJSONString();
}
UserEntity userEntity = null;
try {
loginForm.validate();
userEntity = userService.doLogin(loginName, password, ip);
userEntity.setLastLoginAddress(ip);
recordSysLog(request, userEntity, "H5用户登录系统成功!");
String currUserName = userEntity.getRealName();
if (currUserName == null || currUserName.trim().length() == 0) {
currUserName = "管理员";
}
JSONObject data = new JSONObject();
data.put("currUserName", currUserName);
data.put("id", userEntity.getId());
data.put("userType", userEntity.getUserType());
HashSet<Integer> set = new HashSet<>();
set.add(0);
set.add(2);
set.add(3);
if (ObjectUtils.isEmpty(userEntity.getUserType()) || !set.contains(userEntity.getUserType())) {
throw new AppException("当前用户不支持H5登录!");
}
userEntity.setLoginTime(System.currentTimeMillis());
userEntity.setToken(IdUtil.fastSimpleUUID());
userEntity.setExpireTime(DateUtils.addCurrDate(3).getTime());
String token = authTokenService.createToken(userEntity);
data.put("token", token);
if (!ObjectUtils.isEmpty(loginForm.getDingCode())) {
//更新绑定钉钉
userEntity.setDingUserId(loginForm.getDingCode());
userService.getUserDao().update(userEntity);
}
ret.put(KEY_RESULT_DATA, data);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "用户登录系统成功!");
return ret.toJSONString();
} catch (Exception e) {
log.error("h5 login error ", e);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);SyncDoorsEventTaskImpl
ret.put(KEY_RESULT_MSG, super.convertException(e));SyncDoorsEventTaskImpl
return ret.toJSONString();
}*/
}
@RequestMapping
(
"logout"
)
...
...
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