Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
8timerv2
8timerapiv200
Commits
8089dcc9
Commit
8089dcc9
authored
Jul 04, 2020
by
lal
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
3c14aca7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
5 deletions
+80
-5
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+51
-5
src/main/java/cn/timer/api/dto/kqmk/AttendanceMachineStatus.java
+14
-0
src/main/java/cn/timer/api/dto/kqmk/AttstateDate.java
+15
-0
No files found.
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
8089dcc9
...
@@ -9,6 +9,7 @@ import java.util.Date;
...
@@ -9,6 +9,7 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
org.codehaus.jettison.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpEntity
;
...
@@ -29,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -29,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
import
org.springframework.web.client.RestClientException
;
import
org.springframework.web.client.RestClientException
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
...
@@ -97,8 +99,10 @@ import cn.timer.api.dto.kqmk.AttSchedule;
...
@@ -97,8 +99,10 @@ import cn.timer.api.dto.kqmk.AttSchedule;
import
cn.timer.api.dto.kqmk.AttSchedulingDto
;
import
cn.timer.api.dto.kqmk.AttSchedulingDto
;
import
cn.timer.api.dto.kqmk.AttendanceAssistantDto
;
import
cn.timer.api.dto.kqmk.AttendanceAssistantDto
;
import
cn.timer.api.dto.kqmk.AttendanceCardListDto
;
import
cn.timer.api.dto.kqmk.AttendanceCardListDto
;
import
cn.timer.api.dto.kqmk.AttendanceMachineStatus
;
import
cn.timer.api.dto.kqmk.AttendanceSummaryQueryDto
;
import
cn.timer.api.dto.kqmk.AttendanceSummaryQueryDto
;
import
cn.timer.api.dto.kqmk.AttqueryCriteriaDto
;
import
cn.timer.api.dto.kqmk.AttqueryCriteriaDto
;
import
cn.timer.api.dto.kqmk.AttstateDate
;
import
cn.timer.api.dto.kqmk.BalanceSheetDataDto
;
import
cn.timer.api.dto.kqmk.BalanceSheetDataDto
;
import
cn.timer.api.dto.kqmk.CalendarDetailsDto
;
import
cn.timer.api.dto.kqmk.CalendarDetailsDto
;
import
cn.timer.api.dto.kqmk.CalendarPunchDetailsDto
;
import
cn.timer.api.dto.kqmk.CalendarPunchDetailsDto
;
...
@@ -579,6 +583,44 @@ public class TimeCardController {
...
@@ -579,6 +583,44 @@ public class TimeCardController {
return
ResultUtil
.
data
(
attendanList
,
"操作成功!"
);
return
ResultUtil
.
data
(
attendanList
,
"操作成功!"
);
}
}
@PostMapping
(
value
=
"/att_machine_status"
)
@ApiOperation
(
value
=
"15.1:获取考勤机状态"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
28
)
public
Result
<
Object
>
AttendanceMachineStatus
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttendanceMachineStatus
balance
)
{
String
msg
=
""
;
List
<
AttstateDate
>
stas
=
new
ArrayList
<
AttstateDate
>();
String
[]
state
=
balance
.
getState
();
if
(
state
.
length
>
0
)
{
for
(
int
p
=
0
;
p
<
state
.
length
;
p
++){
AttstateDate
sta
=
AttstateDate
.
builder
().
build
();
String
url
=
mac_command
+
"/getDevInfo"
;
HttpHeaders
headers
=
new
HttpHeaders
();
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"devId"
,
state
[
p
]);
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
try
{
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
url
,
httpEntity
,
String
.
class
);
com
.
alibaba
.
fastjson
.
JSONObject
object
=
JSON
.
parseObject
(
request
.
getBody
());
System
.
err
.
println
(
object
.
get
(
"message"
));
msg
=
object
.
get
(
"message"
).
toString
();
sta
.
setCode
(
state
[
p
]);
sta
.
setState
(
Integer
.
valueOf
(
object
.
get
(
"data"
).
toString
()));
stas
.
add
(
sta
);
}
catch
(
RestClientException
e
)
{
System
.
err
.
println
(
"提示:考勤机服务出错"
);
return
ResultUtil
.
success
(
"失败"
);
}
}
}
return
ResultUtil
.
data
(
stas
,
msg
);
}
@SuppressWarnings
(
"all"
)
@SuppressWarnings
(
"all"
)
@GetMapping
(
value
=
"/synchrotime/{code}"
)
@GetMapping
(
value
=
"/synchrotime/{code}"
)
@ApiOperation
(
value
=
"考勤机一键同步"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"考勤机一键同步"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
...
@@ -685,6 +727,7 @@ public class TimeCardController {
...
@@ -685,6 +727,7 @@ public class TimeCardController {
KqglAssoKqj
kqj
=
KqglAssoKqj
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoKqj
>().
lambda
().
eq
(
KqglAssoKqj:
:
getCode
,
kqglassokqj
.
getCode
()));
KqglAssoKqj
kqj
=
KqglAssoKqj
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoKqj
>().
lambda
().
eq
(
KqglAssoKqj:
:
getCode
,
kqglassokqj
.
getCode
()));
if
(
kqj
==
null
)
{
if
(
kqj
==
null
)
{
String
msg
=
""
;
if
(!
kqglassokqj
.
insert
())
if
(!
kqglassokqj
.
insert
())
return
ResultUtil
.
error
(
"操作失败--新增考勤机"
);
return
ResultUtil
.
error
(
"操作失败--新增考勤机"
);
...
@@ -697,13 +740,15 @@ public class TimeCardController {
...
@@ -697,13 +740,15 @@ public class TimeCardController {
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
try
{
try
{
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
url
,
httpEntity
,
String
.
class
);
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
url
,
httpEntity
,
String
.
class
);
System
.
err
.
print
(
request
.
getBody
());
com
.
alibaba
.
fastjson
.
JSONObject
object
=
JSON
.
parseObject
(
request
.
getBody
());
System
.
err
.
println
(
object
.
get
(
"message"
));
msg
=
object
.
get
(
"message"
).
toString
();
}
catch
(
RestClientException
e
)
{
}
catch
(
RestClientException
e
)
{
System
.
err
.
println
(
"提示:考勤机服务出错"
);
//
System.err.println("提示:考勤机服务出错");
return
ResultUtil
.
success
(
"失败"
);
return
ResultUtil
.
success
(
msg
);
}
}
return
ResultUtil
.
data
(
kqglassokqj
,
"操作成功!"
);
return
ResultUtil
.
data
(
kqglassokqj
,
msg
);
}
else
{
}
else
{
return
ResultUtil
.
error
(
"考勤机已存在或已被使用"
);
return
ResultUtil
.
error
(
"考勤机已存在或已被使用"
);
}
}
...
@@ -1167,6 +1212,7 @@ public class TimeCardController {
...
@@ -1167,6 +1212,7 @@ public class TimeCardController {
System
.
err
.
print
(
request
.
getBody
());
System
.
err
.
print
(
request
.
getBody
());
}
catch
(
RestClientException
e
)
{
}
catch
(
RestClientException
e
)
{
System
.
err
.
println
(
"提示:考勤机服务出错"
);
System
.
err
.
println
(
"提示:考勤机服务出错"
);
return
ResultUtil
.
error
(
"删除失败:提示:考勤机服务出错"
);
return
ResultUtil
.
error
(
"删除失败:提示:考勤机服务出错"
);
}
}
}
}
...
@@ -2848,7 +2894,7 @@ public class TimeCardController {
...
@@ -2848,7 +2894,7 @@ public class TimeCardController {
@GetMapping
(
value
=
"/Weekly_attendance_data/{date}"
)
@GetMapping
(
value
=
"/Weekly_attendance_data/{date}"
)
@ApiOperation
(
value
=
"考勤周数据"
,
httpMethod
=
"GET"
,
notes
=
"查询数据"
)
@ApiOperation
(
value
=
"考勤周数据
--app接口
"
,
httpMethod
=
"GET"
,
notes
=
"查询数据"
)
public
Result
<
Object
>
Weekly_attendance_data
(
@CurrentUser
UserBean
userBean
,
@PathVariable
(
"date"
)
String
date
)
throws
ParseException
{
public
Result
<
Object
>
Weekly_attendance_data
(
@CurrentUser
UserBean
userBean
,
@PathVariable
(
"date"
)
String
date
)
throws
ParseException
{
...
...
src/main/java/cn/timer/api/dto/kqmk/AttendanceMachineStatus.java
0 → 100644
View file @
8089dcc9
package
cn
.
timer
.
api
.
dto
.
kqmk
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
AttendanceMachineStatus
{
private
String
[]
state
;
}
src/main/java/cn/timer/api/dto/kqmk/AttstateDate.java
0 → 100644
View file @
8089dcc9
package
cn
.
timer
.
api
.
dto
.
kqmk
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
AttstateDate
{
private
String
code
;
private
int
state
;
}
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