Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
ops
Commits
9880f466
"...operation_platform.git" did not exist on "454aef65f6a48d4347582ed8b9bf269df2301a29"
Commit
9880f466
authored
Feb 28, 2025
by
wujipeng
Browse files
获取打卡详情
parent
aba68342
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/sms/controller/DingAttendanceController.java
View file @
9880f466
package
com.ruzhoukj.sms.controller
;
package
com.ruzhoukj.sms.controller
;
import
com.dingtalk.api.DefaultDingTalkClient
;
import
com.dingtalk.api.DingTalkClient
;
import
com.dingtalk.api.request.OapiAttendanceListRecordRequest
;
import
com.dingtalk.api.response.OapiAttendanceListRecordResponse
;
import
com.ruzhoukj.sms.ding.PermissionConfig
;
import
com.ruzhoukj.sms.model.vo.DingAttendanceDTO
;
import
com.taobao.api.ApiException
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
/**
* @author : wujipeng
* @author : wujipeng
* @date : 2025/2/28 10:00
* @date : 2025/2/28 10:00
...
@@ -15,6 +28,25 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -15,6 +28,25 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping
(
"/ding/attendance"
)
@RequestMapping
(
"/ding/attendance"
)
public
class
DingAttendanceController
{
public
class
DingAttendanceController
{
@Resource
private
PermissionConfig
permissionConfig
;
@ApiOperation
(
value
=
"获取打卡详情"
)
@PostMapping
(
"/getCheckInRecord"
)
public
List
<
OapiAttendanceListRecordResponse
.
Recordresult
>
getCheckInRecord
(
@RequestBody
DingAttendanceDTO
dingAttendanceDTO
)
{
String
accessToken
=
permissionConfig
.
getAccessToken
();
try
{
DingTalkClient
client
=
new
DefaultDingTalkClient
(
"https://oapi.dingtalk.com/attendance/listRecord"
);
OapiAttendanceListRecordRequest
req
=
new
OapiAttendanceListRecordRequest
();
req
.
setCheckDateFrom
(
dingAttendanceDTO
.
getCheckDateFrom
());
req
.
setCheckDateTo
(
dingAttendanceDTO
.
getCheckDateTo
());
req
.
setIsI18n
(
dingAttendanceDTO
.
getIsI18n
());
req
.
setUserIds
(
dingAttendanceDTO
.
getUserIds
());
OapiAttendanceListRecordResponse
rsp
=
client
.
execute
(
req
,
accessToken
);
return
rsp
.
getRecordresult
();
}
catch
(
ApiException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
}
src/main/java/com/ruzhoukj/sms/model/vo/DingAttendanceDTO.java
0 → 100644
View file @
9880f466
package
com.ruzhoukj.sms.model.vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author : wujipeng
* @date : 2025/2/28 11:54
* @Version: 1.0
* @Desc : 考勤
*/
@Data
public
class
DingAttendanceDTO
{
@ApiModelProperty
(
value
=
"员工id集合"
)
private
List
<
String
>
userIds
;
@ApiModelProperty
(
value
=
"打卡开始时间"
)
private
String
checkDateFrom
;
@ApiModelProperty
(
value
=
"打卡结束时间"
)
private
String
checkDateTo
;
private
Boolean
isI18n
=
false
;
}
src/main/java/com/ruzhoukj/sms/model/vo/DingUserVO.java
View file @
9880f466
...
@@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
...
@@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
* @author : wujipeng
* @author : wujipeng
* @date : 2025/2/28 11:44
* @date : 2025/2/28 11:44
* @Version: 1.0
* @Version: 1.0
* @Desc :
描述信息
* @Desc :
员工
*/
*/
@Data
@Data
@Builder
@Builder
...
...
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