Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
entrance_api
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王琮
entrance_api
Commits
31b49141
Commit
31b49141
authored
Dec 27, 2022
by
zhangyanduan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改数据哈
parent
53928c65
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
3 deletions
+63
-3
JieLinkInterController.java
...ntegration/jieLink/Controller/JieLinkInterController.java
+25
-2
IJieLinkService.java
.../rcisoft/integration/jieLink/service/IJieLinkService.java
+3
-0
JieLinkServiceImpl.java
.../integration/jieLink/service/impl/JieLinkServiceImpl.java
+35
-1
No files found.
src/main/java/org/rcisoft/integration/jieLink/Controller/JieLinkInterController.java
View file @
31b49141
...
...
@@ -8,6 +8,7 @@ import org.rcisoft.core.operlog.enums.CyLogTypeEnum;
import
org.rcisoft.integration.jieLink.dto.JieLinkDoorRecordDto
;
import
org.rcisoft.integration.jieLink.dto.JieLinkResultDto
;
import
org.rcisoft.integration.jieLink.service.IJieLinkService
;
import
org.rcisoft.sys.sysuser.entity.SysUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -21,7 +22,7 @@ public class JieLinkInterController {
@CyOpeLogAnno
(
title
=
"jieLinkInter-捷顺道闸上传门禁记录"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@ApiOperation
(
value
=
"捷顺对接集成"
,
notes
=
"门禁数据上传"
)
@ApiOperation
(
value
=
"捷顺对接集成
-门禁数据上传
"
,
notes
=
"门禁数据上传"
)
@PostMapping
(
value
=
"/doorrecord"
)
public
JieLinkResultDto
addDoorrecord
(
@RequestBody
JieLinkDoorRecordDto
recodeDto
)
{
JieLinkResultDto
result
=
new
JieLinkResultDto
();
...
...
@@ -53,7 +54,7 @@ public class JieLinkInterController {
}
@ApiOperation
(
value
=
"捷顺对接集成"
,
notes
=
"同步设备信息"
)
@ApiOperation
(
value
=
"捷顺对接集成
-同步设备信息
"
,
notes
=
"同步设备信息"
)
@GetMapping
(
value
=
"/syncDeviceData"
)
public
JieLinkResultDto
syncDeviceData
()
{
jieLinkService
.
syncDeviceInfo
();
...
...
@@ -63,5 +64,27 @@ public class JieLinkInterController {
return
result
;
}
@ApiOperation
(
value
=
"捷顺对接集成-获取部门信息"
,
notes
=
"获取部门信息"
)
@GetMapping
(
value
=
"/getDeptList"
)
public
JieLinkResultDto
getDeptList
()
{
jieLinkService
.
getDeptList
();
JieLinkResultDto
result
=
new
JieLinkResultDto
();
result
.
setMsg
(
"同步完成"
);
result
.
setCode
(
"0"
);
return
result
;
}
@ApiOperation
(
value
=
"捷顺对接集成-获取部门信息"
,
notes
=
"获取部门信息"
)
@GetMapping
(
value
=
"/delUser"
)
public
JieLinkResultDto
delUser
(
String
personId
)
{
SysUser
delUser
=
new
SysUser
();
delUser
.
setPersonId
(
personId
);
jieLinkService
.
pushDelUserData
(
delUser
);
JieLinkResultDto
result
=
new
JieLinkResultDto
();
result
.
setMsg
(
"删除完成"
);
result
.
setCode
(
"0"
);
return
result
;
}
}
src/main/java/org/rcisoft/integration/jieLink/service/IJieLinkService.java
View file @
31b49141
...
...
@@ -73,4 +73,7 @@ public interface IJieLinkService {
public
JieLinkResultDto
saveDoorRecordInfo
(
JieLinkDoorRecordDto
recordDto
);
public
void
syncDeviceInfo
();
public
void
getDeptList
();
}
src/main/java/org/rcisoft/integration/jieLink/service/impl/JieLinkServiceImpl.java
View file @
31b49141
...
...
@@ -31,7 +31,6 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.web.client.RestTemplate
;
import
java.io.IOException
;
import
java.math.BigInteger
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.*
;
...
...
@@ -201,6 +200,8 @@ public class JieLinkServiceImpl implements IJieLinkService {
if
(
headers
!=
null
){
JieLinkPersonDto
pushData
=
this
.
convertUserBean
(
userData
);
pushData
.
setPersonId
(
userData
.
getPersonId
());
//此处写死部门
pushData
.
setDeptId
(
"5a9dc528-e7ad-4952-9f21-a885b6564a1c"
);
HttpEntity
<
JieLinkPersonDto
>
httpEntity
=
new
HttpEntity
<>(
pushData
,
headers
);
StringBuffer
uriAddr
=
new
StringBuffer
();
uriAddr
.
append
(
jieLinkUri
).
append
(
apiUri
);
...
...
@@ -734,6 +735,39 @@ public class JieLinkServiceImpl implements IJieLinkService {
}
}
@Override
public
void
getDeptList
()
{
String
apiUri
=
"/api/base/depts"
;
HttpHeaders
headers
=
this
.
loadHeaderHandle
();
if
(
headers
!=
null
){
JSONObject
pushData
=
new
JSONObject
();
pushData
.
put
(
"pageIndex"
,
1
);
pushData
.
put
(
"pageSize"
,
300
);
HttpEntity
<
JSONObject
>
httpEntity
=
new
HttpEntity
<>(
pushData
,
headers
);
StringBuffer
uriAddr
=
new
StringBuffer
();
uriAddr
.
append
(
jieLinkUri
).
append
(
apiUri
);
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
try
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
log
.
info
(
"getDeptList接口返回信息:"
+
responseEntity
.
getBody
().
toJSONString
());
JSONObject
body
=
responseEntity
.
getBody
();
if
(
StringUtils
.
equals
(
body
.
getString
(
"code"
),
"0"
)){
}
else
{
log
.
error
(
"syncDeviceInfo接口返回错误信息:"
+
body
.
getString
(
"msg"
));
}
}
else
{
log
.
error
(
"syncDeviceInfo接口请求失败"
);
}
}
catch
(
Exception
ex
){
log
.
error
(
ex
.
getMessage
(),
ex
);
}
}
else
{
//认证信息获取失败
log
.
error
(
"syncDeviceInfo接口获取认证参数失败"
);
}
}
/**
* 创建hander头信息
...
...
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