Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
map-parent
Commits
2190561d
Commit
2190561d
authored
Jun 01, 2021
by
YANGYANG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户新增修改 提交
parent
97b651db
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
service/zdry/src/main/java/com/founder/zdry/controller/UsersController.java
+3
-2
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/impl/ZdryApiServiceImpl.java
+14
-5
No files found.
service/zdry/src/main/java/com/founder/zdry/controller/UsersController.java
View file @
2190561d
...
...
@@ -97,6 +97,7 @@ public class UsersController {
@RequestBody
UsersAndDevice
usersAndDevice
)
{
// 调用开关接口
String
result
=
serverZdryApi
.
updateDevice
(
usersAndDevice
.
getDevice
());
if
(
result
.
equals
(
"success"
)){
boolean
flag
=
usersService
.
save
(
usersAndDevice
.
getUsers
());
if
(
flag
){
...
...
@@ -107,7 +108,7 @@ public class UsersController {
}
}
else
{
return
MapRestResult
.
build
(
ResultCode
.
ERROR
,
"保存用户开关信息失败"
,
"1"
);
return
MapRestResult
.
build
(
ResultCode
.
ERROR
,
"保存用户开关信息失败"
,
result
);
}
}
...
...
@@ -127,7 +128,7 @@ public class UsersController {
}
}
else
{
return
MapRestResult
.
build
(
ResultCode
.
ERROR
,
"修改用户信息失败"
,
"1"
);
return
MapRestResult
.
build
(
ResultCode
.
ERROR
,
"修改用户信息失败"
,
result
);
}
}
...
...
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/impl/ZdryApiServiceImpl.java
View file @
2190561d
...
...
@@ -124,16 +124,25 @@ public class ZdryApiServiceImpl implements ZdryApiService {
JSONObject
result
=
JSONObject
.
parseObject
(
resultString
);
// 查看是否登录
if
(
result
.
containsKey
(
"error_code
"
))
{
if
(
result
.
getString
(
"error_code"
).
equals
(
"101
"
))
{
if
(
getToken
().
equals
(
"success"
)){
updateDevice
(
deviceParam
);
String
resultStringAll
=
restTemplate
.
postForEntity
(
zdryUrl
+
updateSbxxUrl
+
deviceParam
.
getSbImei
()+
"/4g/edit/"
,
params
,
String
.
class
).
getBody
();
JSONObject
resultAll
=
JSONObject
.
parseObject
(
resultStringAll
);
if
(
resultAll
.
getString
(
"error_code"
).
equals
(
"1"
))
{
return
"无效设备!"
;
}
else
if
(
resultAll
.
getString
(
"success"
).
equals
(
"true"
)){
return
"success"
;
}
}
else
{
return
"
error
"
;
return
"
登录错误!
"
;
};
}
if
(
result
.
containsKey
(
"success"
))
{
}
else
{
if
(
result
.
getString
(
"error_code"
).
equals
(
"1"
))
{
return
"无效设备!"
;
}
else
if
(
result
.
getString
(
"success"
).
equals
(
"true"
)){
return
"success"
;
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
...
...
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