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
81cec70b
Commit
81cec70b
authored
Aug 01, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
c0c01b1a
58a8ccbd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
330 additions
and
223 deletions
+330
-223
attendance-performance-manager-ui/admin/src/views/attendance/leave/record/list.vue
...nager-ui/admin/src/views/attendance/leave/record/list.vue
+7
-1
attendance-performance-manager-ui/admin/src/views/check/attend/record/list.vue
...e-manager-ui/admin/src/views/check/attend/record/list.vue
+1
-1
attendance-performance-manager-ui/admin/src/views/perform/attend/record/list.vue
...manager-ui/admin/src/views/perform/attend/record/list.vue
+1
-1
attendance-performance-manager-ui/admin/src/views/staff/perform/summary/dialogshow.vue
...r-ui/admin/src/views/staff/perform/summary/dialogshow.vue
+219
-195
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/PerformApiController.java
...va/com/mortals/xhx/busiz/h5/web/PerformApiController.java
+19
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/dingmsg/api/DingMessageController.java
.../module/attendance/dingmsg/api/DingMessageController.java
+74
-20
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/web/AttendanceLeaveRecordController.java
...odule/attendance/web/AttendanceLeaveRecordController.java
+9
-3
No files found.
attendance-performance-manager-ui/admin/src/views/attendance/leave/record/list.vue
View file @
81cec70b
...
...
@@ -149,7 +149,13 @@ export default {
?
"
审核中
"
:
row
.
auditResult
==
1
?
"
通过
"
:
"
不通过
"
:
row
.
auditResult
==
2
?
"
不通过
"
:
row
.
auditResult
==
3
?
"
撤销审批中
"
:
row
.
auditResult
==
4
?
"
撤销审批完成
"
:
"
--
"
:
"
--
"
;
},
},
...
...
attendance-performance-manager-ui/admin/src/views/check/attend/record/list.vue
View file @
81cec70b
...
...
@@ -219,8 +219,8 @@ export default {
{
label
:
"
上下班时间
"
,
width
:
100
,
prop
:
"
goOffTimeStr
"
,
formatter
:
this
.
formatterDate
,
},
{
...
...
attendance-performance-manager-ui/admin/src/views/perform/attend/record/list.vue
View file @
81cec70b
...
...
@@ -226,8 +226,8 @@ export default {
{
label
:
"
上下班时间
"
,
width
:
100
,
prop
:
"
goOffTimeStr
"
,
formatter
:
this
.
formatterDate
,
},
{
...
...
attendance-performance-manager-ui/admin/src/views/staff/perform/summary/dialogshow.vue
View file @
81cec70b
<
template
>
<!-- 弹出框表单 -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"50%"
append-to-body
>
<div
class=
"userName"
>
<div
class=
"user-left"
>
<div
class=
"user-name"
>
{{
form
.
staffName
}}
</div>
<div
class=
"user-info"
>
<span
class=
"user-i"
>
工号:
{{
form
.
workNum
}}
</span>
<span
class=
"user-i"
>
所属部门:
{{
form
.
deptName
}}
</span>
</div>
</div>
<div
class=
"user-right"
>
<div
class=
"n"
>
{{
form
.
totalScore
}}
</div>
<div
class=
"m"
>
{{
form
.
month
}}
月得分
</div>
</div>
<!-- 弹出框表单 -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"50%"
append-to-body
>
<div
class=
"userName"
>
<div
class=
"user-left"
>
<div
class=
"user-name"
>
{{
form
.
staffName
}}
</div>
<div
class=
"userName user-t-item "
:class=
"
{t2:item.subAddType == 1,t1:item.subAddType == 2}" v-for="(item) in list" :key="item.id">
<div
class=
"user-left"
>
<div
class=
"user-name"
>
{{
dictVal
(
'
checkType
'
,
item
.
checkType
)
}}
</div>
<div
class=
"user-info"
>
<span
class=
"user-i"
>
绩效规则:
{{
item
.
ruleName
}}
</span>
</div>
<div
class=
"user-info"
>
<span
class=
"user-i"
>
核查时间:
{{
momentVal
(
item
.
checkTime
)
}}
</span>
</div>
<div
class=
"user-info"
v-if=
"item.auditStatus==2"
>
<span
class=
"user-i"
>
核查结果:
{{
item
.
subAddType
==
1
?
'
+
'
:
'
-
'
}}{{
item
.
score
}}
(
{{
item
.
checkResult
}}
)
</span>
</div>
</div>
<div
class=
"user-right"
>
<div
class=
"n"
>
{{
item
.
subAddType
==
1
?
'
+
'
:
'
-
'
}}{{
item
.
auditStatus
==
2
?
0
:
item
.
score
}}
</div>
</div>
<div
class=
"user-info"
>
<span
class=
"user-i"
>
工号:
{{
form
.
workNum
}}
</span>
<span
class=
"user-i"
>
所属部门:
{{
form
.
deptName
}}
</span>
</div>
<!--
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
</div>
<div
class=
"user-right"
>
<div
class=
"n"
>
{{
form
.
totalScore
}}
</div>
<div
class=
"m"
>
{{
form
.
month
}}
月得分
</div>
</div>
</div>
<div
class=
"userName user-t-item "
:class=
"
{ t2: item.subAddType == 1, t1: item.subAddType == 2 }"
v-for="item in list"
:key="item.id"
>
<div
class=
"user-left"
>
<div
class=
"user-name"
>
{{
dictVal
(
"
checkType
"
,
item
.
checkType
)
}}
</div>
<div
class=
"user-info"
>
<span
class=
"user-i"
>
绩效规则:
{{
item
.
ruleName
}}
</span>
</div>
<div
class=
"user-info"
>
<span
class=
"user-i"
>
{{
item
.
subAddType
==
1
?
"
加分方式:
"
:
item
.
subAddType
==
2
?
"
扣分方式:
"
:
"
方式:
"
}}{{
util_formatters
(
"
subMethod
"
,
item
.
subMethod
)
}}
</span
>
</div>
<div
class=
"user-info"
>
<span
class=
"user-i"
>
核查时间:
{{
momentVal
(
item
.
checkTime
)
}}
</span>
</div>
<div
class=
"user-info"
v-if=
"item.auditStatus == 2"
>
<span
class=
"user-i"
>
核查结果:
{{
item
.
subAddType
==
1
?
"
+
"
:
"
-
"
}}{{
item
.
score
}}
(
{{
item
.
checkResult
}}
)
</span
>
</div>
</div>
<div
class=
"user-right"
>
<div
class=
"n"
>
{{
item
.
subAddType
==
1
?
"
+
"
:
"
-
"
}}{{
item
.
auditStatus
==
2
?
0
:
item
.
score
}}
</div>
</div>
</div>
<!--
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
<el-row>
<Field
label=
"人员id"
prop=
"staffId"
v-model=
"form.staffId"
placeholder=
"请输入人员id"
/>
<Field
label=
"工号"
prop=
"workNum"
v-model=
"form.workNum"
placeholder=
"请输入工号"
/>
...
...
@@ -57,11 +79,16 @@
</el-row>
</el-form>
-->
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
v-if=
"pageInfo.type !== 'view'"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
v-if=
"pageInfo.type !== 'view'"
@
click=
"submitForm"
>
确 定
</el-button
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</
template
>
<
script
>
...
...
@@ -69,186 +96,183 @@ import form from "@/assets/mixins/formdialog";
import
dialogShow
from
"
./dialogshow
"
;
import
moment
from
"
moment
"
;
export
default
{
mixins
:
[
form
],
components
:
{
dialogShow
,
mixins
:
[
form
],
components
:
{
dialogShow
,
},
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 弹出层标题
title
:
"
员工绩效统计
"
,
// 是否显示弹出层
open
:
false
,
toString
:
[
"
month
"
],
// 表单校验
rules
:
{
year
:
[{
required
:
true
,
message
:
"
请输入年
"
,
trigger
:
"
blur
"
}],
month
:
[{
required
:
true
,
message
:
"
请输入月
"
,
trigger
:
"
blur
"
}],
},
list
:
[],
dict
:
{},
};
},
methods
:
{
// 日期
momentVal
(
v
)
{
return
moment
(
v
).
format
(
"
YYYY-MM-DD HH:SS
"
);
},
// 字典转换
dictVal
(
key
,
val
)
{
return
this
.
dict
[
key
][
val
];
},
/** 查看汇总 */
checkAll
(
id
)
{
this
.
$post
(
"
/check/all/record/list
"
,
{
checkStatus
:
2
,
staffId
:
id
,
}).
then
((
res
)
=>
{
const
{
code
,
data
,
dict
}
=
res
;
if
(
code
==
1
)
{
const
row
=
data
.
data
||
[];
//deductTime申诉时间 checkTime 核查时间 ruleName规则checkType字典 subAddType:1增加2减score
this
.
list
=
row
;
this
.
dict
=
dict
;
console
.
log
(
row
,
dict
,
"
22222222222
"
);
}
});
},
/** 编辑 */
edit
(
row
)
{
this
.
reset
();
this
.
query
=
{
id
:
row
.
id
};
this
.
urls
.
currUrl
=
"
staff/perform/summary/edit
"
;
this
.
getData
();
this
.
pageInfo
.
type
=
"
edit
"
;
this
.
title
=
"
修改员工绩效统计
"
;
},
/** 新增 */
add
(
row
)
{
this
.
reset
();
this
.
urls
.
currUrl
=
"
staff/perform/summary/add
"
;
this
.
getData
();
this
.
pageInfo
.
type
=
"
add
"
;
this
.
title
=
"
新增员工绩效统计
"
;
},
/** 查看*/
view
(
row
)
{
this
.
reset
();
this
.
query
=
{
id
:
row
.
id
};
this
.
urls
.
currUrl
=
"
staff/perform/summary/view
"
;
this
.
getData
();
this
.
pageInfo
.
type
=
"
view
"
;
this
.
title
=
"
员工绩效统计详细
"
;
this
.
checkAll
(
row
.
staffId
);
},
/**取消按钮 */
cancel
()
{
this
.
open
=
false
;
},
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 弹出层标题
title
:
"
员工绩效统计
"
,
// 是否显示弹出层
open
:
false
,
toString
:
[
"
month
"
,
],
// 表单校验
rules
:
{
year
:
[
{
required
:
true
,
message
:
"
请输入年
"
,
trigger
:
"
blur
"
},
],
month
:
[
{
required
:
true
,
message
:
"
请输入月
"
,
trigger
:
"
blur
"
},
],
},
list
:[],
dict
:{}
};
/**获取数据后弹框 */
afterRender
(
data
)
{
this
.
open
=
true
;
},
methods
:
{
// 日期
momentVal
(
v
){
return
moment
(
v
).
format
(
'
YYYY-MM-DD HH:SS
'
)
},
// 字典转换
dictVal
(
key
,
val
){
return
this
.
dict
[
key
][
val
]
},
/** 查看汇总 */
checkAll
(
id
)
{
this
.
$post
(
"
/check/all/record/list
"
,
{
checkStatus
:
2
,
staffId
:
id
}).
then
((
res
)
=>
{
const
{
code
,
data
,
dict
}
=
res
if
(
code
==
1
)
{
const
row
=
data
.
data
||
[]
//deductTime申诉时间 checkTime 核查时间 ruleName规则checkType字典 subAddType:1增加2减score
this
.
list
=
row
this
.
dict
=
dict
console
.
log
(
row
,
dict
,
"
22222222222
"
)
}
});
},
/** 编辑 */
edit
(
row
)
{
this
.
reset
()
this
.
query
=
{
id
:
row
.
id
};
this
.
urls
.
currUrl
=
"
staff/perform/summary/edit
"
;
this
.
getData
();
this
.
pageInfo
.
type
=
"
edit
"
this
.
title
=
"
修改员工绩效统计
"
;
},
/** 新增 */
add
(
row
)
{
this
.
reset
()
this
.
urls
.
currUrl
=
"
staff/perform/summary/add
"
;
this
.
getData
();
this
.
pageInfo
.
type
=
"
add
"
this
.
title
=
"
新增员工绩效统计
"
;
},
/** 查看*/
view
(
row
)
{
this
.
reset
()
this
.
query
=
{
id
:
row
.
id
};
this
.
urls
.
currUrl
=
"
staff/perform/summary/view
"
;
this
.
getData
();
this
.
pageInfo
.
type
=
"
view
"
this
.
title
=
"
员工绩效统计详细
"
;
this
.
checkAll
(
row
.
staffId
)
},
/**取消按钮 */
cancel
()
{
this
.
open
=
false
;
},
/**获取数据后弹框 */
afterRender
(
data
)
{
this
.
open
=
true
;
},
afterSubmit
(
data
)
{
this
.
open
=
false
;
this
.
$emit
(
"
ok
"
);
},
// 表单重置
reset
()
{
this
.
form
=
{
staffId
:
0
,
workNum
:
""
,
staffName
:
""
,
deptId
:
0
,
deptName
:
""
,
attendScore
:
null
,
assessScore
:
null
,
workScore
:
null
,
effectScore
:
null
,
otherScore
:
null
,
errorScore
:
null
,
totalScore
:
null
,
remark
:
""
,
year
:
null
,
month
:
null
,
};
this
.
resetForm
(
"
form
"
);
},
resetForm
(
refName
)
{
if
(
this
.
$refs
[
refName
])
{
this
.
$refs
[
refName
].
resetFields
();
}
},
afterSubmit
(
data
)
{
this
.
open
=
false
;
this
.
$emit
(
"
ok
"
);
},
// 表单重置
reset
()
{
this
.
form
=
{
staffId
:
0
,
workNum
:
""
,
staffName
:
""
,
deptId
:
0
,
deptName
:
""
,
attendScore
:
null
,
assessScore
:
null
,
workScore
:
null
,
effectScore
:
null
,
otherScore
:
null
,
errorScore
:
null
,
totalScore
:
null
,
remark
:
""
,
year
:
null
,
month
:
null
,
};
this
.
resetForm
(
"
form
"
);
},
resetForm
(
refName
)
{
if
(
this
.
$refs
[
refName
])
{
this
.
$refs
[
refName
].
resetFields
();
}
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.userName {
background: rgba(242, 246, 252, 1);
display: flex;
align-items: center;
padding: 15px;
background: rgba(242, 246, 252, 1);
display: flex;
align-items: center;
padding: 15px;
.user-left {
flex: 1;
}
.user-left {
flex: 1;
}
.user-name {
font-size: 18px;
font-weight: bold;
}
.user-name {
font-size: 18px;
font-weight: bold;
}
.user-info {
margin-top: 10px;
.user-info {
margin-top: 10px;
.user-i {
margin-right: 40px;
}
.user-i {
margin-right: 40px;
}
}
.user-right {
text-align: center;
.user-right {
text-align: center;
.n {
font-size: 16px;
font-weight: bold;
}
.n {
font-size: 16px;
font-weight: bold;
}
.m {
font-size: 12px;
}
.m {
font-size: 12px;
}
}
}
.user-t-item {
margin-top: 20px;
border-left: 4px solid #FF
4242;
margin-top: 20px;
border-left: 4px solid #ff
4242;
}
.t1 {
border-color: #FF
4242;
background: rgba(255, 66, 66, 0.07);
border-color: #ff
4242;
background: rgba(255, 66, 66, 0.07);
.user-name,
.n {
color: #FF
4242;
}
.user-name,
.n {
color: #ff
4242;
}
}
.t2 {
border-color: rgba(27, 198, 167, 1);
background: rgba(27, 198, 167, 0.07);
border-color: rgba(27, 198, 167, 1);
background: rgba(27, 198, 167, 0.07);
.user-name,
.n {
color: rgba(27, 198, 167, 1);
}
.user-name,
.n {
color: rgba(27, 198, 167, 1);
}
}
</
style
>
\ No newline at end of file
</
style
>
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/PerformApiController.java
View file @
81cec70b
...
...
@@ -445,30 +445,47 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
PerformDetailInfo
performDetailInfo
=
new
PerformDetailInfo
();
if
(
PerformTypeEnum
.
考勤绩效
.
getValue
().
equals
(
performReq
.
getPerformType
()))
{
CheckAttendRecordEntity
checkEntity
=
checkAttendRecordService
.
get
(
performReq
.
getId
(),
context
);
if
(
checkEntity
==
null
){
throw
new
AppException
(
"绩效核查信息id不正确,查不到相应数据"
);
}
BeanUtils
.
copyProperties
(
checkEntity
,
performDetailInfo
,
BeanUtil
.
getNullPropertyNames
(
checkEntity
));
}
else
if
(
PerformTypeEnum
.
评价差评绩效
.
getValue
().
equals
(
performReq
.
getPerformType
()))
{
CheckReviewRecordEntity
checkEntity
=
checkReviewRecordService
.
get
(
performReq
.
getId
(),
context
);
if
(
checkEntity
==
null
){
throw
new
AppException
(
"绩效核查信息id不正确,查不到相应数据"
);
}
BeanUtils
.
copyProperties
(
checkEntity
,
performDetailInfo
,
BeanUtil
.
getNullPropertyNames
(
checkEntity
));
}
else
if
(
PerformTypeEnum
.
评价投诉绩效
.
getValue
().
equals
(
performReq
.
getPerformType
()))
{
CheckComplainRecordEntity
checkEntity
=
checkComplainRecordService
.
get
(
performReq
.
getId
(),
context
);
if
(
checkEntity
==
null
){
throw
new
AppException
(
"绩效核查信息id不正确,查不到相应数据"
);
}
BeanUtils
.
copyProperties
(
checkEntity
,
performDetailInfo
,
BeanUtil
.
getNullPropertyNames
(
checkEntity
));
}
else
if
(
PerformTypeEnum
.
办件绩效
.
getValue
().
equals
(
performReq
.
getPerformType
()))
{
CheckGoworkRecordEntity
checkEntity
=
checkGoworkRecordService
.
get
(
performReq
.
getId
(),
context
);
if
(
checkEntity
==
null
){
throw
new
AppException
(
"绩效核查信息id不正确,查不到相应数据"
);
}
BeanUtils
.
copyProperties
(
checkEntity
,
performDetailInfo
,
BeanUtil
.
getNullPropertyNames
(
checkEntity
));
}
else
if
(
PerformTypeEnum
.
效能绩效
.
getValue
().
equals
(
performReq
.
getPerformType
()))
{
CheckEffectRecordEntity
checkEntity
=
checkEffectRecordService
.
get
(
performReq
.
getId
(),
context
);
if
(
checkEntity
==
null
){
throw
new
AppException
(
"绩效核查信息id不正确,查不到相应数据"
);
}
BeanUtils
.
copyProperties
(
checkEntity
,
performDetailInfo
,
BeanUtil
.
getNullPropertyNames
(
checkEntity
));
}
else
if
(
PerformTypeEnum
.
其它绩效
.
getValue
().
equals
(
performReq
.
getPerformType
()))
{
CheckOtherRecordEntity
checkEntity
=
checkOtherRecordService
.
get
(
performReq
.
getId
(),
context
);
if
(
checkEntity
==
null
){
throw
new
AppException
(
"绩效核查信息id不正确,查不到相应数据"
);
}
BeanUtils
.
copyProperties
(
checkEntity
,
performDetailInfo
,
BeanUtil
.
getNullPropertyNames
(
checkEntity
));
}
else
{
throw
new
AppException
(
"不支持当前绩效类型"
);
}
PerformAttendAppealEntity
entity
=
appealService
.
selectOne
(
new
PerformAttendAppealQuery
().
checkRecordId
(
performDetailInfo
.
getId
()).
performType
(
performReq
.
getPerformType
()));
log
.
info
(
"entity:{}"
,
JSONObject
.
toJSONString
(
entity
));
if
(!
ObjectUtils
.
isEmpty
(
entity
))
{
log
.
info
(
"entity:{}"
,
JSONObject
.
toJSONString
(
entity
));
Boolean
bool
=
entity
.
newEntity
();
if
(
bool
)
{
performDetailInfo
.
setAppealStatus
(
AppealStatusEnum
.
未申诉
.
getValue
());
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/dingmsg/api/DingMessageController.java
View file @
81cec70b
...
...
@@ -112,7 +112,7 @@ public class DingMessageController {
String
processInstanceId
=
eventJson
.
getString
(
"processInstanceId"
);
// 根据EventType分类处理
if
(
"bpms_instance_change"
.
equals
(
eventType
)){
//请假等需要审批的消息
if
(
"bpms_instance_change"
.
equals
(
eventType
)
||
"bpms_task_change"
.
equals
(
eventType
)
){
//请假等需要审批的消息
// 处理审批实例始末(审批任务开始、结束)
// 存入数据库
// log.info("发生了:" + eventType + "事件" );
...
...
@@ -122,8 +122,7 @@ public class DingMessageController {
GetProcessInstanceResponseBody
.
GetProcessInstanceResponseBodyResult
result
=
rest
.
getData
();
log
.
info
(
"审批详情:"
+
JSONObject
.
toJSONString
(
result
)
);
AttendanceLeaveRecordEntity
leaveRecordEntity
=
new
AttendanceLeaveRecordEntity
();
AttendanceVacationBalanceEntity
attendanceVacationBalanceEntity
=
new
AttendanceVacationBalanceEntity
();
attendanceVacationBalanceEntity
.
initAttrValue
();
leaveRecordEntity
.
initAttrValue
();
leaveRecordEntity
.
setRemark
(
processInstanceId
);
//将钉钉的事物id作为备注填入数据库
...
...
@@ -139,17 +138,13 @@ public class DingMessageController {
leaveRecordEntity
.
setDeptName
(
staffEntity
.
getDeptName
());
leaveRecordEntity
.
setPhoneNumber
(
staffEntity
.
getPhoneNumber
());
attendanceVacationBalanceEntity
.
setStaffId
(
staffEntity
.
getId
());
attendanceVacationBalanceEntity
.
setStaffName
(
staffEntity
.
getName
());
attendanceVacationBalanceEntity
.
setDeptId
(
staffEntity
.
getDeptId
());
attendanceVacationBalanceEntity
.
setDeptName
(
staffEntity
.
getDeptName
());
attendanceVacationBalanceEntity
.
setEntryTime
(
staffEntity
.
getEntryDate
());
if
(
result
.
getTasks
().
size
()
>
0
){
if
(
result
.
getTasks
().
get
(
0
).
getCreateTime
()
!=
null
&&
result
.
getTasks
().
get
(
0
).
getFinishTime
()
!=
null
){
Date
startTime
=
dateFormat
(
result
.
getTasks
().
get
(
0
).
getCreateTime
(),
"yyyy-MM-dd'T'HH:mm'Z'"
);
Date
startTime
=
dateFormat
(
result
.
getTasks
().
get
(
0
).
getCreateTime
(),
"yyyy-MM-dd'T'HH:mm'Z'"
,
false
);
Date
endTime
=
dateFormat
(
result
.
getTasks
().
get
(
0
).
getFinishTime
(),
"yyyy-MM-dd'T'HH:mm'Z'"
);
Date
endTime
=
dateFormat
(
result
.
getTasks
().
get
(
0
).
getFinishTime
(),
"yyyy-MM-dd'T'HH:mm'Z'"
,
false
);
leaveRecordEntity
.
setStartTime
(
startTime
);
leaveRecordEntity
.
setEndTime
(
endTime
);
leaveRecordEntity
.
setDuration
((
int
)
((
endTime
.
getTime
()
-
startTime
.
getTime
())/
1000
));
...
...
@@ -161,15 +156,27 @@ public class DingMessageController {
if
(
result
.
getFormComponentValues
().
size
()
>
0
){
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
result
.
getFormComponentValues
().
get
(
0
).
getValue
());
if
(
jsonArray
.
size
()
>
0
){
Date
startTime1
=
dateFormat
(
jsonArray
.
get
(
0
).
toString
(),
"yyyy-MM-dd HH:mm"
);
Date
startTime1
=
dateFormat
(
jsonArray
.
get
(
0
).
toString
(),
"yyyy-MM-dd HH:mm"
,
true
);
leaveRecordEntity
.
setStartTime
(
startTime1
);
}
if
(
jsonArray
.
size
()
>
1
){
Date
endTime1
=
dateFormat
(
jsonArray
.
get
(
1
).
toString
(),
"yyyy-MM-dd HH:mm"
);
Date
endTime1
=
dateFormat
(
jsonArray
.
get
(
1
).
toString
(),
"yyyy-MM-dd HH:mm"
,
false
);
leaveRecordEntity
.
setEndTime
(
endTime1
);
}
if
(
jsonArray
.
size
()
>
2
){
leaveRecordEntity
.
setDuration
((
int
)
(
Float
.
parseFloat
(
jsonArray
.
get
(
2
).
toString
())*
60
*
60
));
//小时转换成秒
if
(
jsonArray
.
size
()
>
3
){
switch
(
jsonArray
.
get
(
3
).
toString
()){
case
"halfDay"
:
case
"day"
:
leaveRecordEntity
.
setDuration
((
int
)
(
Float
.
parseFloat
(
jsonArray
.
get
(
2
).
toString
())*
60
*
60
*
24
));
//小时转换成秒
break
;
default
:
//除了按天和半天计算的假期 其余都是按小时返回
leaveRecordEntity
.
setDuration
((
int
)
(
Float
.
parseFloat
(
jsonArray
.
get
(
2
).
toString
())*
60
*
60
));
//小时转换成秒
break
;
}
}
}
if
(
jsonArray
.
size
()
>
4
){
leave_name
=
jsonArray
.
get
(
4
).
toString
();
...
...
@@ -255,9 +262,7 @@ public class DingMessageController {
}
else
if
(
result
.
getFormComponentValues
().
size
()
>
1
)
{
//请假理由
GetProcessInstanceResponseBody
.
GetProcessInstanceResponseBodyResultFormComponentValues
resonEntity
=
result
.
getFormComponentValues
().
get
(
1
);
if
(
resonEntity
.
getName
().
equals
(
"请假事由"
)){
leaveRecordEntity
.
setReason
(
resonEntity
.
getValue
());
}
leaveRecordEntity
.
setReason
(
resonEntity
.
getValue
());
}
else
if
(
result
.
getFormComponentValues
().
size
()
>
2
)
{
//上传的附件
GetProcessInstanceResponseBody
.
GetProcessInstanceResponseBodyResultFormComponentValues
picEntity
=
result
.
getFormComponentValues
().
get
(
2
);
if
(
picEntity
.
getName
().
equals
(
"图片"
)
&&
picEntity
.
getValue
()
!=
null
){
...
...
@@ -274,11 +279,26 @@ public class DingMessageController {
}
if
(
result
.
getResult
().
compareToIgnoreCase
(
"AGREE"
)
==
0
){
leaveRecordEntity
.
setAuditResult
(
1
);
if
(
result
.
getTasks
().
size
()
>
1
){
if
(
result
.
getTasks
().
get
(
1
).
getStatus
().
compareToIgnoreCase
(
"CANCELED"
)
==
0
){
leaveRecordEntity
.
setAuditResult
(
4
);
//撤销审批完成
}
else
{
leaveRecordEntity
.
setAuditResult
(
1
);
}
}
}
else
if
(
result
.
equals
(
""
)){
//撤销假期审批中result会为空 撤销审批通过后result为AGREE
if
(
result
.
getTasks
().
size
()
>
1
){
if
(
result
.
getTasks
().
get
(
1
).
getStatus
().
compareToIgnoreCase
(
"CANCELED"
)
==
0
){
leaveRecordEntity
.
setAuditResult
(
3
);
//撤销审批中
}
}
}
else
{
leaveRecordEntity
.
setAuditResult
(
2
);
leaveRecordEntity
.
setAuditResult
(
2
);
//请假审批中
}
log
.
info
(
"钉钉返回的result:"
+
result
.
getResult
()+
"---auditresult:"
+
leaveRecordEntity
.
getAuditResult
());
leaveRecordEntity
.
setAuditDesc
(
result
.
getOperationRecords
().
get
(
0
).
getRemark
());
...
...
@@ -298,16 +318,30 @@ public class DingMessageController {
attendanceLeaveRecordService
.
update
(
leaveRecordEntity
);
}
//假期余额
AttendanceVacationBalanceEntity
attendanceVacationBalanceEntity
=
new
AttendanceVacationBalanceEntity
();
//查询假期余额
Rest
<
OapiAttendanceVacationQuotaListResponse
.
OapiLeaveQuotaUserListVo
>
leaveRecordsResponseBodyResultRest
=
dingPersonService
.
getLeaveRecordByUserId
(
result
.
getOriginatorUserId
(),
leave_code
);
AttendanceVacationBalanceEntity
balanceEntity
=
balanceService
.
selectOne
(
new
AttendanceVacationBalanceQuery
().
staffId
(
staffEntity
.
getId
()));
if
(
ObjectUtils
.
isEmpty
(
balanceEntity
)){
//先判断数据库里没有这个人的请假记录就初始化对象
attendanceVacationBalanceEntity
.
initAttrValue
();
}
attendanceVacationBalanceEntity
.
setStaffId
(
staffEntity
.
getId
());
attendanceVacationBalanceEntity
.
setStaffName
(
staffEntity
.
getName
());
attendanceVacationBalanceEntity
.
setDeptId
(
staffEntity
.
getDeptId
());
attendanceVacationBalanceEntity
.
setDeptName
(
staffEntity
.
getDeptName
());
attendanceVacationBalanceEntity
.
setEntryTime
(
staffEntity
.
getEntryDate
());
if
(
leaveRecordsResponseBodyResultRest
.
getCode
()
==
Rest
.
SUCCESS
){
OapiAttendanceVacationQuotaListResponse
.
OapiLeaveQuotaUserListVo
result1
=
leaveRecordsResponseBodyResultRest
.
getData
();
double
leaveBlance
=
0
;
//如果钉钉有假期余额就写入钉钉返回的余额 否则用数据库表数据减去当前请假的天数
if
(
result1
.
getLeaveQuotas
()
!=
null
&&
result1
.
getLeaveQuotas
().
size
()
>
0
){
leaveBlance
=
(
result1
.
getLeaveQuotas
().
get
(
0
).
getQuotaNumPerDay
()
-
result1
.
getLeaveQuotas
().
get
(
0
).
getUsedNumPerDay
())/
100
;
if
(
leaveRecordEntity
.
getAuditResult
()
==
4
)
{
//撤销休假 要把已经扣除的假期加回来
leaveBlance
=
(
result1
.
getLeaveQuotas
().
get
(
0
).
getQuotaNumPerDay
()
+
result1
.
getLeaveQuotas
().
get
(
0
).
getUsedNumPerDay
())/
100
;
}
else
{
leaveBlance
=
(
result1
.
getLeaveQuotas
().
get
(
0
).
getQuotaNumPerDay
()
-
result1
.
getLeaveQuotas
().
get
(
0
).
getUsedNumPerDay
())/
100
;
}
}
switch
(
leave_name
)
{
...
...
@@ -586,7 +620,27 @@ public class DingMessageController {
return
days
;
}
private
Date
dateFormat
(
String
dateString
,
String
format
){
/**
*
* @param dateString
* @param format
* @param tag 标志位 是否为开始时间 如是开始时间 2023-08-03 上午 转换成 2023-08-03 9:00 如不是是开始时间 2023-08-03 上午 转换成 2023-08-03 12:00
* @return
*/
private
Date
dateFormat
(
String
dateString
,
String
format
,
boolean
tag
){
if
(
dateString
.
contains
(
"上午"
)){
if
(
tag
){
dateString
=
dateString
.
replace
(
"上午"
,
"09:00"
);
}
else
{
dateString
=
dateString
.
replace
(
"上午"
,
"12:00"
);
}
}
else
{
if
(
tag
){
dateString
=
dateString
.
replace
(
"下午"
,
"13:00"
);
}
else
{
dateString
=
dateString
.
replace
(
"下午"
,
"18:00"
);
}
}
SimpleDateFormat
dateFormat_
=
new
SimpleDateFormat
(
format
);
Date
t
;
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/web/AttendanceLeaveRecordController.java
View file @
81cec70b
...
...
@@ -2,6 +2,8 @@ package com.mortals.xhx.module.attendance.web;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.common.code.AppealResultEnum
;
import
com.mortals.xhx.common.code.ProcessStatusEnum
;
import
com.mortals.xhx.module.attendance.model.AttendanceLeaveRecordEntity
;
...
...
@@ -17,6 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
java
.
util
.
stream
.
Collectors
.
toMap
;
/**
*
* 请假记录信息
...
...
@@ -34,6 +38,8 @@ public class AttendanceLeaveRecordController extends BaseCRUDJsonBodyMappingCont
private
DeptService
deptService
;
@Autowired
private
WorkmanService
workmanService
;
@Autowired
private
UserService
userService
;
public
AttendanceLeaveRecordController
(){
super
.
setModuleDesc
(
"请假记录信息"
);
...
...
@@ -41,12 +47,12 @@ public class AttendanceLeaveRecordController extends BaseCRUDJsonBodyMappingCont
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
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
,
"approverId"
,
workmanService
.
find
(
new
WorkmanQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getName
(),(
o
,
n
)->
n
)));
this
.
addDict
(
model
,
"deptId"
,
deptService
.
find
(
new
DeptQuery
()).
stream
().
collect
(
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getDeptName
(),(
o
,
n
)->
n
)));
this
.
addDict
(
model
,
"approverId"
,
workmanService
.
find
(
new
WorkmanQuery
()).
stream
().
collect
(
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getName
(),(
o
,
n
)->
n
)));
this
.
addDict
(
model
,
"leaveType"
,
paramService
.
getParamBySecondOrganize
(
"AttendanceLeaveRecord"
,
"leaveType"
));
this
.
addDict
(
model
,
"auditResult"
,
AppealResultEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"processStatus"
,
ProcessStatusEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"createUserId"
,
userService
.
find
(
new
UserQuery
()).
stream
().
collect
(
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getRealName
(),
(
o
,
n
)
->
n
)));
super
.
init
(
model
,
context
);
...
...
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