Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
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
Administrator
browser-backend
Commits
a4d43e3e
Commit
a4d43e3e
authored
Apr 03, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志时间
parent
5e9a7946
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
LoginHistoryDto.java
...com/edgec/browserbackend/browser/dto/LoginHistoryDto.java
+1
-1
ShopServiceImpl.java
.../browserbackend/browser/service/Impl/ShopServiceImpl.java
+20
-5
No files found.
src/main/java/com/edgec/browserbackend/browser/dto/LoginHistoryDto.java
View file @
a4d43e3e
...
@@ -30,7 +30,7 @@ public class LoginHistoryDto {
...
@@ -30,7 +30,7 @@ public class LoginHistoryDto {
if
(
loginHistory
.
getLoginPlace
()
!=
null
)
if
(
loginHistory
.
getLoginPlace
()
!=
null
)
this
.
loginPlace
=
loginHistory
.
getLoginPlace
();
this
.
loginPlace
=
loginHistory
.
getLoginPlace
();
if
(
loginHistory
.
getLoginTime
()
!=
0
)
if
(
loginHistory
.
getLoginTime
()
!=
0
)
this
.
loginTime
=
Instant
.
ofEpochMilli
(
loginHistory
.
getLoginTime
()).
atZone
(
Zone
Offset
.
UTC
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
this
.
loginTime
=
Instant
.
ofEpochMilli
(
loginHistory
.
getLoginTime
()).
atZone
(
Zone
Id
.
of
(
"Asia/Shanghai"
)
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
}
}
public
String
getNickname
()
{
public
String
getNickname
()
{
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/ShopServiceImpl.java
View file @
a4d43e3e
...
@@ -269,21 +269,36 @@ public class ShopServiceImpl implements ShopService {
...
@@ -269,21 +269,36 @@ public class ShopServiceImpl implements ShopService {
throw
new
ClientRequestException
(
AccountErrorCode
.
NOPERMISSION
);
throw
new
ClientRequestException
(
AccountErrorCode
.
NOPERMISSION
);
}
}
}
}
shops
.
stream
().
forEach
(
shop
->
{
if
(
shops
.
size
()
==
1
)
{
try
{
try
{
userShopRepository
.
deleteByShopIdExceptOwner
(
shop
.
getShopId
(),
shop
.
getOwner
());
userShopRepository
.
deleteByShopIdExceptOwner
(
shop
s
.
get
(
0
).
getShopId
(),
shops
.
get
(
0
)
.
getOwner
());
for
(
Account
account1
:
accounts
)
{
for
(
Account
account1
:
accounts
)
{
UserShop
userShop1
=
userShopRepository
.
findByUsernameAndShopId
(
account1
.
getName
(),
shop
.
getShopId
());
UserShop
userShop1
=
userShopRepository
.
findByUsernameAndShopId
(
account1
.
getName
(),
shop
s
.
get
(
0
)
.
getShopId
());
if
(
userShop1
!=
null
)
if
(
userShop1
!=
null
)
return
;
return
;
userShop1
=
new
UserShop
(
account1
.
getName
(),
shop
.
getShopId
(),
"-1"
);
userShop1
=
new
UserShop
(
account1
.
getName
(),
shop
s
.
get
(
0
)
.
getShopId
(),
"-1"
);
userShopRepository
.
save
(
userShop1
);
userShopRepository
.
save
(
userShop1
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"fail to assign"
,
e
.
getMessage
());
logger
.
error
(
"fail to assign"
,
e
.
getMessage
());
throw
new
ClientRequestException
(
BrowserErrorCode
.
UNKNOWN
);
throw
new
ClientRequestException
(
BrowserErrorCode
.
UNKNOWN
);
}
}
});
}
else
{
shops
.
stream
().
forEach
(
shop
->
{
try
{
for
(
Account
account1
:
accounts
)
{
UserShop
userShop1
=
userShopRepository
.
findByUsernameAndShopId
(
account1
.
getName
(),
shop
.
getShopId
());
if
(
userShop1
!=
null
)
return
;
userShop1
=
new
UserShop
(
account1
.
getName
(),
shop
.
getShopId
(),
"-1"
);
userShopRepository
.
save
(
userShop1
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"fail to assign"
,
e
.
getMessage
());
throw
new
ClientRequestException
(
BrowserErrorCode
.
UNKNOWN
);
}
});
}
}
}
@Override
@Override
...
...
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