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
990354f4
Commit
990354f4
authored
Dec 02, 2021
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug474 添加删除考勤机内成员接口代码
parent
547dd23f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+41
-0
No files found.
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
990354f4
...
...
@@ -11,16 +11,19 @@ import java.util.Map;
import
java.util.concurrent.locks.ReentrantLock
;
import
cn.timer.api.bean.dzht.DzhtAssoMbzj
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.StringUtils
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestClientException
;
...
...
@@ -1717,6 +1720,44 @@ public class TimeCardController {
/**
* 移除考勤机管理员
*/
@SuppressWarnings
(
"all"
)
@PostMapping
(
value
=
"/removeemp/{kqjid}/{id}"
)
@ApiOperation
(
value
=
"删除考勤机内成员"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
46
)
public
Result
<
Object
>
RemoveEmp
(
@PathVariable
int
kqjid
,
@PathVariable
int
id
,
@RequestBody
Map
<
String
,
String
>
mmd
)
{
String
[]
xgyh
=
mmd
.
get
(
"a"
).
split
(
","
);
if
(
xgyh
.
length
>
0
){
KqglAssoKqj
kqj
=
KqglAssoKqj
.
builder
().
id
(
kqjid
).
build
().
selectById
();
//查询考勤机“序列号”
for
(
int
a
=
0
;
a
<
xgyh
.
length
;
a
++){
String
url
=
mac_command
+
"/deleteUser"
;
HttpHeaders
headers
=
new
HttpHeaders
();
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"devId"
,
kqj
.
getCode
());
params
.
add
(
"userId"
,
xgyh
[
a
]);
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
try
{
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
url
,
httpEntity
,
String
.
class
);
if
(!
StringUtils
.
isEmpty
(
request
)
&&
request
.
getStatusCode
()
==
HttpStatus
.
OK
)
{
Logoutput
(
request
.
getBody
());
JSONObject
jsonObj
=
JSON
.
parseObject
(
request
.
getBody
());
if
(!
"200"
.
equals
(
jsonObj
.
getString
(
"code"
)))
{
return
ResultUtil
.
error
(
jsonObj
.
getString
(
"message"
));
}
}
}
catch
(
RestClientException
e
)
{
Logoutput
(
"提示:考勤机服务出错-3"
);
return
ResultUtil
.
success
(
"失败"
);
}
KqglAssoYhsb
.
builder
().
id
(
id
).
build
().
deleteById
();
}
}
return
ResultUtil
.
success
(
"成功"
);
}
/**
* 根据用户id和假期id查询余额具体数据
*/
@PostMapping
(
value
=
"/modify_employee_balance"
)
...
...
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