Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
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
曲欣亮
shop
Commits
dc22513e
Commit
dc22513e
authored
Aug 15, 2024
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
需求 #17240
parent
a916094f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
UserController.java
src/main/java/com/egolm/shop/api/UserController.java
+3
-1
UserService.java
src/main/java/com/egolm/shop/api/service/UserService.java
+1
-1
UserServiceImpl.java
...java/com/egolm/shop/api/service/impl/UserServiceImpl.java
+15
-1
No files found.
src/main/java/com/egolm/shop/api/UserController.java
View file @
dc22513e
...
...
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.web.ServletUtil
;
import
com.egolm.shop.api.service.UserService
;
import
com.egolm.shop.bean.TCustomer
;
import
com.egolm.shop.common.XException
;
...
...
@@ -210,7 +211,8 @@ public class UserController {
XException
.
assertNotBlank
(
openId
,
"OpenID不能为空"
);
mobile
=
StringUtil
.
isBlank
(
mobile
)
?
""
:
mobile
;
name
=
StringUtil
.
isBlank
(
name
)
?
""
:
name
;
Map
<
String
,
Object
>
map
=
userService
.
loginByOpenId
(
appId
,
orgNo
,
openId
,
mobile
,
unionId
,
name
);
String
clientIp
=
ServletUtil
.
remoteIp
(
request
);
Map
<
String
,
Object
>
map
=
userService
.
loginByOpenId
(
appId
,
orgNo
,
openId
,
mobile
,
unionId
,
name
,
clientIp
);
Rjx
rjx
=
Rjx
.
jsonOk
();
rjx
.
putAll
(
map
);
return
rjx
.
toJson
();
...
...
src/main/java/com/egolm/shop/api/service/UserService.java
View file @
dc22513e
...
...
@@ -49,7 +49,7 @@ public interface UserService {
public
List
<
Map
<
String
,
Object
>>
queryBankList
(
String
sCustNO
);
public
Map
<
String
,
Object
>
loginByOpenId
(
String
appId
,
String
orgNo
,
String
openId
,
String
mobile
,
String
unionId
,
String
name
);
public
Map
<
String
,
Object
>
loginByOpenId
(
String
appId
,
String
orgNo
,
String
openId
,
String
mobile
,
String
unionId
,
String
name
,
String
clientIp
);
public
Map
<
String
,
Object
>
loginUpdateOpenId
(
String
appId
,
String
orgNo
,
String
openId
,
String
mobile
,
String
unionId
,
String
name
);
...
...
src/main/java/com/egolm/shop/api/service/impl/UserServiceImpl.java
View file @
dc22513e
...
...
@@ -18,6 +18,7 @@ import org.apache.commons.logging.LogFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.dao.DataAccessException
;
import
org.springframework.dao.DuplicateKeyException
;
import
org.springframework.dao.EmptyResultDataAccessException
;
import
org.springframework.data.redis.core.RedisTemplate
;
...
...
@@ -861,7 +862,7 @@ public class UserServiceImpl implements UserService {
}
@Override
public
Map
<
String
,
Object
>
loginByOpenId
(
String
appId
,
String
orgNo
,
String
openId
,
String
mobile
,
String
unionId
,
String
name
)
{
public
Map
<
String
,
Object
>
loginByOpenId
(
String
appId
,
String
orgNo
,
String
openId
,
String
mobile
,
String
unionId
,
String
name
,
String
clientIp
)
{
mobile
=
StringUtil
.
isBlank
(
mobile
)
?
null
:
mobile
;
String
sql
=
"exec up_B2BUserLogin ?, ?, ?, ?, ?,?"
;
ResultMutil
result
=
readJdbcTemplate
.
executeMutil
(
sql
,
orgNo
,
openId
,
mobile
,
unionId
,
name
,
appId
);
...
...
@@ -891,9 +892,22 @@ public class UserServiceImpl implements UserService {
map
.
put
(
"shopList"
,
shopList
);
map
.
put
(
"payServiceList"
,
payServiceList
);
map
.
put
(
"shopAgentList"
,
shopAgentList
);
addCustLoginLog
(
uMap
.
get
(
"sUserNO"
)+
""
,
openId
,
clientIp
);
return
map
;
}
}
//需求 #17240
public
void
addCustLoginLog
(
String
custNO
,
String
openId
,
String
ip
)
{
try
{
String
sql
=
"INSERT INTO dbo.tCustLoginLog (sCustNO, dLoginTime, sLoginSite, sIPAddress, sTerminalTypeID, sTerminalType, dLastUpdateTime) "
+
" VALUES ('"
+
custNO
+
"', getdate(), '"
+
openId
+
"', '"
+
ip
+
"', 'wx', '', getdate()) "
;
jdbcTemplate
.
execute
(
sql
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"保存tCustLoginLog 日志失败 ,custNO="
+
custNO
+
",openId="
+
openId
+
",ip="
+
ip
+
" "
+
e
);
}
}
@Override
public
Map
<
String
,
Object
>
loginUpdateOpenId
(
String
appId
,
String
orgNo
,
String
openId
,
String
mobile
,
String
unionId
,
String
name
)
{
...
...
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