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
7bf295ec
Commit
7bf295ec
authored
Jul 26, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
5e1068eb
7f4ea0d1
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
876 additions
and
476 deletions
+876
-476
attendance-performance-manager-ui/admin/src/assets/utils/dateFormat.js
...rformance-manager-ui/admin/src/assets/utils/dateFormat.js
+110
-99
attendance-performance-manager-ui/admin/src/views/attendance/class/dialogshow.vue
...anager-ui/admin/src/views/attendance/class/dialogshow.vue
+378
-347
attendance-performance-manager/pom.xml
attendance-performance-manager/pom.xml
+6
-6
attendance-performance-manager/src/main/java/com/mortals/xhx/common/code/LeaveRulesEnum.java
...main/java/com/mortals/xhx/common/code/LeaveRulesEnum.java
+32
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/dingmsg/api/DingMessageController.java
.../module/attendance/dingmsg/api/DingMessageController.java
+293
-10
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/AbstractDingTalkService.java
.../mortals/xhx/module/dingding/AbstractDingTalkService.java
+7
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/personal/service/IDingPersonService.java
.../module/dingding/personal/service/IDingPersonService.java
+9
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/personal/service/impl/DingPersonServiceImpl.java
...dingding/personal/service/impl/DingPersonServiceImpl.java
+40
-13
attendance-performance-manager/src/main/resources/bootstrap.yml
...ance-performance-manager/src/main/resources/bootstrap.yml
+1
-0
No files found.
attendance-performance-manager-ui/admin/src/assets/utils/dateFormat.js
View file @
7bf295ec
export
const
timestampToTime
=
(
timestamp
,
transLength
)
=>
{
// 时间戳为10位需*1000,时间戳为13位不需乘1000
let
date
=
null
if
(
timestamp
.
length
<
13
){
date
=
new
Date
(
timestamp
*
1000
);
}
else
{
date
=
new
Date
(
timestamp
);
}
let
Y
=
date
.
getFullYear
()
+
"
-
"
;
let
M
=
(
date
.
getMonth
()
+
1
<
10
?
"
0
"
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
"
-
"
;
let
D
=
(
date
.
getDate
()
<
10
?
"
0
"
+
date
.
getDate
()
:
date
.
getDate
());
let
h
=
"
"
+
(
date
.
getHours
()
<
10
?
'
0
'
+
date
.
getHours
():
date
.
getHours
())
+
"
:
"
;
let
m
=
(
date
.
getMinutes
()
<
10
?
'
0
'
+
date
.
getMinutes
():
date
.
getMinutes
())
+
"
:
"
;
let
s
=
(
date
.
getSeconds
()
<
10
?
'
0
'
+
date
.
getSeconds
():
date
.
getSeconds
());
switch
(
transLength
){
case
3
:
return
Y
+
M
+
D
;
case
6
:
return
Y
+
M
+
D
+
h
+
m
+
s
;
}
export
const
timestampToTime
=
(
timestamp
,
transLength
)
=>
{
// 时间戳为10位需*1000,时间戳为13位不需乘1000
let
date
=
null
;
if
(
timestamp
.
length
<
13
)
{
date
=
new
Date
(
timestamp
*
1000
);
}
else
{
date
=
new
Date
(
timestamp
);
}
// 小时:分钟 ==》 转分钟
let
Y
=
date
.
getFullYear
()
+
"
-
"
;
let
M
=
(
date
.
getMonth
()
+
1
<
10
?
"
0
"
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
"
-
"
;
let
D
=
date
.
getDate
()
<
10
?
"
0
"
+
date
.
getDate
()
:
date
.
getDate
();
let
h
=
"
"
+
(
date
.
getHours
()
<
10
?
"
0
"
+
date
.
getHours
()
:
date
.
getHours
())
+
"
:
"
;
let
m
=
(
date
.
getMinutes
()
<
10
?
"
0
"
+
date
.
getMinutes
()
:
date
.
getMinutes
())
+
"
:
"
;
let
s
=
date
.
getSeconds
()
<
10
?
"
0
"
+
date
.
getSeconds
()
:
date
.
getSeconds
();
switch
(
transLength
)
{
case
3
:
return
Y
+
M
+
D
;
case
6
:
return
Y
+
M
+
D
+
h
+
m
+
s
;
}
};
// 小时:分钟 ==》 转分钟
export
const
transFormMinut
=
(
String
)
=>
{
if
(
typeof
(
String
)
===
'
number
'
){
return
}
if
(
!
String
){
return
0
}
let
arr
=
String
.
split
(
'
:
'
)
let
hour
=
arr
[
0
].
indexOf
(
'
0
'
)
===
0
?
arr
[
0
].
substring
(
1
,
arr
[
0
].
length
):
arr
[
0
]
let
minu
=
arr
[
1
].
indexOf
(
'
0
'
)
===
0
?
arr
[
1
].
substring
(
1
,
arr
[
1
].
length
):
arr
[
1
]
return
hour
*
60
+
minu
*
1
}
if
(
typeof
String
===
"
number
"
)
{
return
;
}
if
(
!
String
)
{
return
0
;
}
let
arr
=
String
.
split
(
"
:
"
);
let
hour
=
arr
[
0
].
indexOf
(
"
0
"
)
===
0
?
arr
[
0
].
substring
(
1
,
arr
[
0
].
length
)
:
arr
[
0
];
let
minu
=
arr
[
1
].
indexOf
(
"
0
"
)
===
0
?
arr
[
1
].
substring
(
1
,
arr
[
1
].
length
)
:
arr
[
1
];
return
hour
*
60
+
minu
*
1
;
// return JSON.stringify(hour * 60 + minu * 1);
};
// // 分钟 ==》 小时
export
const
transFormTime
=
(
num
)
=>
{
if
(
typeof
(
num
)
!=
'
string
'
&&
num
!==
0
)
{
return
(
Math
.
floor
(
num
/
60
)).
toString
()
+
"
:
"
+
(
num
%
60
).
toString
()
}
else
{
return
"
0:00
"
;
}
}
if
(
typeof
num
!=
"
string
"
&&
num
!==
0
)
{
return
Math
.
floor
(
num
/
60
).
toString
()
+
"
:
"
+
(
num
%
60
).
toString
();
}
else
{
return
"
0:00
"
;
}
};
//当前月第一天
export
const
getFirstDay
=
()
=>
{
export
const
getFirstDay
=
()
=>
{
let
y
=
new
Date
().
getFullYear
();
//获取年份
let
m
=
new
Date
().
getMonth
()
+
1
;
//获取月份
let
d
=
'
01
'
;
m
=
m
<
10
?
'
0
'
+
m
:
m
;
//月份补 0
return
[
y
,
m
,
d
].
join
(
"
-
"
)
}
let
d
=
"
01
"
;
m
=
m
<
10
?
"
0
"
+
m
:
m
;
//月份补 0
return
[
y
,
m
,
d
].
join
(
"
-
"
);
}
;
//当前月最后一天
export
const
getLastDay
=
()
=>
{
let
y
=
new
Date
().
getFullYear
();
//获取年份
let
m
=
new
Date
().
getMonth
()
+
1
;
//获取月份
let
d
=
new
Date
(
y
,
m
,
0
).
getDate
();
//获取当月最后一日
m
=
m
<
10
?
'
0
'
+
m
:
m
;
//月份补 0
d
=
d
<
10
?
'
0
'
+
d
:
d
;
//日数补 0
return
[
y
,
m
,
d
].
join
(
"
-
"
)
}
export
const
getLastDay
=
()
=>
{
let
y
=
new
Date
().
getFullYear
();
//获取年份
let
m
=
new
Date
().
getMonth
()
+
1
;
//获取月份
let
d
=
new
Date
(
y
,
m
,
0
).
getDate
();
//获取当月最后一日
m
=
m
<
10
?
"
0
"
+
m
:
m
;
//月份补 0
d
=
d
<
10
?
"
0
"
+
d
:
d
;
//日数补 0
return
[
y
,
m
,
d
].
join
(
"
-
"
);
}
;
//获取两日期之间日期列表函数
export
const
getdiffdate
=
(
stime
,
etime
)
=>
{
//初始化日期列表,数组
let
diffdate
=
new
Array
();
let
i
=
0
;
//开始日期小于等于结束日期,并循环
while
(
stime
<=
etime
){
diffdate
[
i
]
=
stime
;
//获取开始日期时间戳
let
stime_ts
=
new
Date
(
stime
).
getTime
();
//增加一天时间戳后的日期
let
next_date
=
stime_ts
+
(
24
*
60
*
60
*
1000
);
//拼接年月日,这里的月份会返回(0-11),所以要+1
let
next_dates_y
=
new
Date
(
next_date
).
getFullYear
()
+
'
-
'
;
let
next_dates_m
=
(
new
Date
(
next_date
).
getMonth
()
+
1
<
10
)?
'
0
'
+
(
new
Date
(
next_date
).
getMonth
()
+
1
)
+
'
-
'
:(
new
Date
(
next_date
).
getMonth
()
+
1
)
+
'
-
'
;
let
next_dates_d
=
(
new
Date
(
next_date
).
getDate
()
<
10
)?
'
0
'
+
new
Date
(
next_date
).
getDate
():
new
Date
(
next_date
).
getDate
();
stime
=
next_dates_y
+
next_dates_m
+
next_dates_d
;
//增加数组key
i
++
;
}
return
diffdate
;
}
export
const
getdiffdate
=
(
stime
,
etime
)
=>
{
//初始化日期列表,数组
let
diffdate
=
new
Array
();
let
i
=
0
;
//开始日期小于等于结束日期,并循环
while
(
stime
<=
etime
)
{
diffdate
[
i
]
=
stime
;
//获取开始日期时间戳
let
stime_ts
=
new
Date
(
stime
).
getTime
();
//增加一天时间戳后的日期
let
next_date
=
stime_ts
+
24
*
60
*
60
*
1000
;
//拼接年月日,这里的月份会返回(0-11),所以要+1
let
next_dates_y
=
new
Date
(
next_date
).
getFullYear
()
+
"
-
"
;
let
next_dates_m
=
new
Date
(
next_date
).
getMonth
()
+
1
<
10
?
"
0
"
+
(
new
Date
(
next_date
).
getMonth
()
+
1
)
+
"
-
"
:
new
Date
(
next_date
).
getMonth
()
+
1
+
"
-
"
;
let
next_dates_d
=
new
Date
(
next_date
).
getDate
()
<
10
?
"
0
"
+
new
Date
(
next_date
).
getDate
()
:
new
Date
(
next_date
).
getDate
();
stime
=
next_dates_y
+
next_dates_m
+
next_dates_d
;
//增加数组key
i
++
;
}
return
diffdate
;
};
// 获取某个日期是周几
export
const
getMyDay
=
(
date
)
=>
{
let
week
;
if
(
date
.
getDay
()
==
0
)
week
=
"
周日
"
if
(
date
.
getDay
()
==
1
)
week
=
"
周一
"
if
(
date
.
getDay
()
==
2
)
week
=
"
周二
"
if
(
date
.
getDay
()
==
3
)
week
=
"
周三
"
if
(
date
.
getDay
()
==
4
)
week
=
"
周四
"
if
(
date
.
getDay
()
==
5
)
week
=
"
周五
"
if
(
date
.
getDay
()
==
6
)
week
=
"
周六
"
return
week
;
}
let
week
;
if
(
date
.
getDay
()
==
0
)
week
=
"
周日
"
;
if
(
date
.
getDay
()
==
1
)
week
=
"
周一
"
;
if
(
date
.
getDay
()
==
2
)
week
=
"
周二
"
;
if
(
date
.
getDay
()
==
3
)
week
=
"
周三
"
;
if
(
date
.
getDay
()
==
4
)
week
=
"
周四
"
;
if
(
date
.
getDay
()
==
5
)
week
=
"
周五
"
;
if
(
date
.
getDay
()
==
6
)
week
=
"
周六
"
;
return
week
;
}
;
// 求两个日期的 分钟差
export
const
getMinu
=
(
s1
,
s2
)
=>
{
var
reDate
=
/
\d{4}
-
\d{1,2}
-
\d{1,2}
/
;
s1
=
new
Date
((
reDate
.
test
(
s1
)
?
s1
:
'
2023-01-01
'
+
s1
).
replace
(
/-/g
,
'
/
'
));
s2
=
new
Date
((
reDate
.
test
(
s2
)
?
s2
:
'
2023-01-01
'
+
s2
).
replace
(
/-/g
,
'
/
'
));
s1
=
new
Date
((
reDate
.
test
(
s1
)
?
s1
:
"
2023-01-01
"
+
s1
).
replace
(
/-/g
,
"
/
"
));
s2
=
new
Date
((
reDate
.
test
(
s2
)
?
s2
:
"
2023-01-01
"
+
s2
).
replace
(
/-/g
,
"
/
"
));
var
ms
=
s2
.
getTime
()
-
s1
.
getTime
();
if
(
ms
<
0
)
return
0
;
return
Math
.
floor
(
ms
/
1000
/
60
);
//分钟
}
\ No newline at end of file
return
Math
.
floor
(
ms
/
1000
/
60
);
//分钟
};
attendance-performance-manager-ui/admin/src/views/attendance/class/dialogshow.vue
View file @
7bf295ec
This diff is collapsed.
Click to expand it.
attendance-performance-manager/pom.xml
View file @
7bf295ec
...
...
@@ -37,12 +37,10 @@
<profiles.hik.appSecret>
2m9RcPJOKq5j2QPQM4v5
</profiles.hik.appSecret>
<profiles.dingtalk.domain>
https://oapi.dingtalk.com
</profiles.dingtalk.domain>
<profiles.dingtalk.oaUrl>
api.dingtalk.com
</profiles.dingtalk.oaUrl>
<profiles.dingtalk.agentId>
2652674890
</profiles.dingtalk.agentId>
<profiles.dingtalk.appKey>
dingpqzradgfr4efdi2j
</profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>
bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd
</profiles.dingtalk.appSecret>
<profiles.dingtalk.aesKey>
1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ
</profiles.dingtalk.aesKey>
<profiles.dingtalk.token>
m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd
</profiles.dingtalk.token>
<profiles.dingtalk.agentId>
2625340030
</profiles.dingtalk.agentId>
<profiles.dingtalk.appKey>
dingjcqjqjh1j82ho5zx
</profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>
_wNw2J6sxTYcu3ddNkFlG3U-3UlQ-P_7ufLSJ4wRxgdUflm3lPf8LIODCQOGkydy
</profiles.dingtalk.appSecret>
<profiles.dingtalk.opUserId>
manager8325
</profiles.dingtalk.opUserId>
<profiles.webUrl>
http://8.136.255.30:11039/attendance
</profiles.webUrl>
<package.environment>
serve
</package.environment>
<skipUi>
false
</skipUi>
...
...
@@ -77,6 +75,7 @@
<profiles.dingtalk.appSecret>
bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd
</profiles.dingtalk.appSecret>
<profiles.dingtalk.aesKey>
1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ
</profiles.dingtalk.aesKey>
<profiles.dingtalk.token>
m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd
</profiles.dingtalk.token>
<profiles.dingtalk.opUserId>
manager8325
</profiles.dingtalk.opUserId>
<profiles.webUrl>
http://8.136.255.30:11039/attendance
</profiles.webUrl>
<package.environment>
test
</package.environment>
<skipUi>
false
</skipUi>
...
...
@@ -108,6 +107,7 @@
<profiles.dingtalk.appSecret>
bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd
</profiles.dingtalk.appSecret>
<profiles.dingtalk.aesKey>
1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ
</profiles.dingtalk.aesKey>
<profiles.dingtalk.token>
m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd
</profiles.dingtalk.token>
<profiles.dingtalk.opUserId>
manager8325
</profiles.dingtalk.opUserId>
<profiles.webUrl>
https://ybswxxcx.zwfwhfgjjfzj.yibin.gov.cn/performance-h5
</profiles.webUrl>
<package.environment>
build
</package.environment>
<skipUi>
false
</skipUi>
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/common/code/LeaveRulesEnum.java
0 → 100644
View file @
7bf295ec
package
com.mortals.xhx.common.code
;
public
enum
LeaveRulesEnum
{
事假
(
"71f9fcc4-6fb3-45da-9be7-ef0d7d72a3c2"
,
"hour"
),
调休
(
"47f2fb3b-571a-4dcd-9ed7-17c0a58dbd08"
,
"hour"
),
病假
(
"cc344abc-d228-423f-94ef-b71c60341d02"
,
"hour"
),
年假
(
"c0f1f8af-4fb4-404d-a306-edd0c7df8375"
,
"halfDay"
),
产假
(
"195cd54f-6e1e-4aa9-be93-20fd997db9b2"
,
"day"
),
陪产假
(
"8b32bb86-09a0-46bf-ab83-3638f4d03173"
,
"day"
),
婚假
(
"f1981cae-e595-41bc-a9ae-f0206ddc98fb"
,
"day"
),
例假
(
"ef04cb2e-6883-4d78-a104-c380fbed8ecb"
,
"halfday"
),
丧假
(
"937b8a4c-64b0-4c82-8cfc-a9bda2935e2c"
,
"day"
),
哺乳假
(
"d512ffd1-6958-4387-aaee-98d78de6f9cd"
,
"hour"
),
探亲假
(
"37529169-eabe-4b0f-97f3-2a8dd30538e0"
,
"day"
);
private
String
leave_code
;
//假期标识
private
String
leave_view_unit
;
//假期时间分类 day:天,halfDay:半天,hour:小时
LeaveRulesEnum
(
String
leave_code
,
String
leave_view_unit
)
{
this
.
leave_code
=
leave_code
;
this
.
leave_view_unit
=
leave_view_unit
;
}
public
String
getLeave_code
()
{
return
leave_code
;
}
public
String
getLeave_view_unit
()
{
return
leave_view_unit
;
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/dingmsg/api/DingMessageController.java
View file @
7bf295ec
This diff is collapsed.
Click to expand it.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/AbstractDingTalkService.java
View file @
7bf295ec
...
...
@@ -53,11 +53,17 @@ public abstract class AbstractDingTalkService implements IDingPersonService {
protected
String
appSecret
;
/**
*
appKey
*
oaurl
*/
@Value
(
"${dingtalk.oaUrl:}"
)
protected
String
oaUrl
;
/**
* opUeserid
*/
@Value
(
"${dingtalk.opUserId:}"
)
protected
String
opUserId
;
@Autowired
private
ICacheService
cacheService
;
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/personal/service/IDingPersonService.java
View file @
7bf295ec
package
com.mortals.xhx.module.dingding.personal.service
;
import
com.aliyun.dingtalkattendance_1_0.models.GetLeaveRecordsResponseBody
;
import
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceResponseBody
;
import
com.dingtalk.api.response.OapiAttendanceVacationQuotaListResponse
;
import
com.dingtalk.api.response.OapiV2UserGetResponse
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.module.dingding.IDingTalkService
;
...
...
@@ -59,5 +61,12 @@ public interface IDingPersonService extends IDingTalkService {
*/
Rest
<
GetProcessInstanceResponseBody
.
GetProcessInstanceResponseBodyResult
>
getOaRecordsById
(
String
processInstanceId
);
/**
* 查询userid的特定假期余额
* @param user_id 被查询员工的id集合 多个用,分隔
* @param leave_code 假期类型编码
* @return
*/
Rest
<
OapiAttendanceVacationQuotaListResponse
.
OapiLeaveQuotaUserListVo
>
getLeaveRecordByUserId
(
String
user_id
,
String
leave_code
);
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/personal/service/impl/DingPersonServiceImpl.java
View file @
7bf295ec
package
com.mortals.xhx.module.dingding.personal.service.impl
;
import
com.alibaba.fastjson.JSON
;
import
com.aliyun.dingtalkattendance_1_0.Client
;
import
com.aliyun.dingtalkattendance_1_0.models.GetLeaveRecordsHeaders
;
import
com.aliyun.dingtalkattendance_1_0.models.GetLeaveRecordsResponse
;
import
com.aliyun.dingtalkattendance_1_0.models.GetLeaveRecordsResponseBody
;
import
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceResponse
;
import
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceResponseBody
;
import
com.aliyun.tea.TeaException
;
import
com.aliyun.teautil.models.RuntimeOptions
;
import
com.dingtalk.api.DefaultDingTalkClient
;
import
com.dingtalk.api.DingTalkClient
;
import
com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request
;
import
com.dingtalk.api.request.OapiV2UserGetRequest
;
import
com.dingtalk.api.request.OapiV2UserGetbymobileRequest
;
import
com.dingtalk.api.request.OapiV2UserGetuserinfoRequest
;
import
com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response
;
import
com.dingtalk.api.response.OapiV2UserGetResponse
;
import
com.dingtalk.api.response.OapiV2UserGetbymobileResponse
;
import
com.dingtalk.api.response.OapiV2UserGetuserinfoResponse
;
import
com.dingtalk.api.request.*
;
import
com.dingtalk.api.response.*
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.module.dingding.AbstractDingTalkService
;
import
com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq
;
...
...
@@ -135,23 +135,22 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
}
/**
* 使用 Token 初始化账号Client
*
* 设置client的config参数
* @return Client
* @throws Exception
*/
public
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
createClient
()
throws
Exception
{
public
com
.
aliyun
.
teaopenapi
.
models
.
Config
setConfig
()
{
com
.
aliyun
.
teaopenapi
.
models
.
Config
config
=
new
com
.
aliyun
.
teaopenapi
.
models
.
Config
();
config
.
protocol
=
"http"
;
config
.
regionId
=
"central"
;
config
.
endpoint
=
oaUrl
;
return
new
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
(
config
)
;
return
config
;
}
@Override
public
Rest
<
GetProcessInstanceResponseBody
.
GetProcessInstanceResponseBodyResult
>
getOaRecordsById
(
String
processInstanceId
)
{
try
{
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
client
=
createClient
(
);
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
client
=
new
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
(
setConfig
()
);
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
GetProcessInstanceHeaders
getProcessInstanceHeaders
=
new
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
GetProcessInstanceHeaders
();
getProcessInstanceHeaders
.
xAcsDingtalkAccessToken
=
getToken
();
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
...
...
@@ -169,4 +168,32 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
}
}
@Override
public
Rest
<
OapiAttendanceVacationQuotaListResponse
.
OapiLeaveQuotaUserListVo
>
getLeaveRecordByUserId
(
String
user_id
,
String
leave_code
)
{
try
{
DingTalkClient
client
=
getDingTalkClient
(
"/topapi/attendance/vacation/quota/list"
);
OapiAttendanceVacationQuotaListRequest
req
=
new
OapiAttendanceVacationQuotaListRequest
();
req
.
setLeaveCode
(
leave_code
);
req
.
setOpUserid
(
opUserId
);
req
.
setUserids
(
user_id
);
req
.
setOffset
(
0L
);
req
.
setSize
(
50L
);
OapiAttendanceVacationQuotaListResponse
rsp
=
client
.
execute
(
req
,
getToken
());
log
.
info
(
"假期余额:{}"
,
JSON
.
toJSONString
(
rsp
.
getResult
()));
if
(
rsp
.
getErrcode
()
==
0
)
{
return
Rest
.
ok
(
"成功"
,
rsp
.
getResult
());
}
else
{
return
Rest
.
fail
(
String
.
format
(
"code:%s,msg:%s"
,
rsp
.
getErrcode
(),
rsp
.
getErrmsg
()));
}
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
log
.
error
(
"根据id查询假期余额异常"
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
}
}
attendance-performance-manager/src/main/resources/bootstrap.yml
View file @
7bf295ec
...
...
@@ -75,4 +75,5 @@ dingtalk:
AesKey
:
@
profiles.dingtalk.aesKey@
token
:
@
profiles.dingtalk.token@
oaUrl
:
@
profiles.dingtalk.oaUrl@
opUserId
:
@
profiles.dingtalk.opUserId@
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