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
9465e5a4
Commit
9465e5a4
authored
Sep 17, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
651918c6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
DataSourceConfig.java
src/main/java/com/egolm/shop/config/DataSourceConfig.java
+2
-2
UserController.java
src/main/java/com/egolm/shop/controller/UserController.java
+4
-2
UserServiceImpl.java
...ain/java/com/egolm/shop/service/impl/UserServiceImpl.java
+2
-2
No files found.
src/main/java/com/egolm/shop/config/DataSourceConfig.java
View file @
9465e5a4
...
@@ -12,7 +12,7 @@ import org.springframework.transaction.PlatformTransactionManager;
...
@@ -12,7 +12,7 @@ import org.springframework.transaction.PlatformTransactionManager;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.dialect.
MySql
Dialect
;
import
com.egolm.common.jdbc.dialect.
SqlServer
Dialect
;
@Configuration
@Configuration
public
class
DataSourceConfig
{
public
class
DataSourceConfig
{
...
@@ -35,7 +35,7 @@ public class DataSourceConfig {
...
@@ -35,7 +35,7 @@ public class DataSourceConfig {
public
JdbcTemplate
getJdbcTemplate
(
DataSource
dataSource
)
{
public
JdbcTemplate
getJdbcTemplate
(
DataSource
dataSource
)
{
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
();
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
();
jdbcTemplate
.
setDataSource
(
dataSource
);
jdbcTemplate
.
setDataSource
(
dataSource
);
jdbcTemplate
.
setDialect
(
new
MySql
Dialect
());
jdbcTemplate
.
setDialect
(
new
SqlServer
Dialect
());
jdbcTemplate
.
setSql_level
(
3
);
jdbcTemplate
.
setSql_level
(
3
);
return
jdbcTemplate
;
return
jdbcTemplate
;
}
}
...
...
src/main/java/com/egolm/shop/controller/UserController.java
View file @
9465e5a4
...
@@ -174,6 +174,7 @@ public class UserController {
...
@@ -174,6 +174,7 @@ public class UserController {
@ApiOperation
(
"小程序登陆"
)
@ApiOperation
(
"小程序登陆"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"openId"
,
dataType
=
"String"
,
required
=
false
,
value
=
"OPENID"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"openId"
,
dataType
=
"String"
,
required
=
false
,
value
=
"OPENID"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"unionId"
,
dataType
=
"String"
,
required
=
false
,
value
=
"unionId"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"mobile"
,
dataType
=
"String"
,
required
=
false
,
value
=
"手机号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"mobile"
,
dataType
=
"String"
,
required
=
false
,
value
=
"手机号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
false
,
value
=
"orgNo"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
false
,
value
=
"orgNo"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
...
@@ -182,16 +183,17 @@ public class UserController {
...
@@ -182,16 +183,17 @@ public class UserController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
})
@RequestMapping
(
value
=
"/loginByOpenId"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/loginByOpenId"
,
method
=
RequestMethod
.
POST
)
public
String
loginByOpenId
(
String
openId
,
String
mobile
,
String
orgNo
,
String
langID
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
String
loginByOpenId
(
String
openId
,
String
mobile
,
String
orgNo
,
String
unionId
,
String
langID
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
customerMap
=
userService
.
queryCustomerByOpenId
(
openId
);
Map
<
String
,
Object
>
customerMap
=
userService
.
queryCustomerByOpenId
(
openId
);
if
(
customerMap
==
null
)
{
if
(
customerMap
==
null
)
{
customerMap
=
userService
.
queryCustomerByMobile
(
mobile
);
customerMap
=
userService
.
queryCustomerByMobile
(
mobile
);
}
}
if
(
customerMap
==
null
)
{
if
(
customerMap
==
null
)
{
if
(
StringUtil
.
isNotBlank
(
openId
,
mobile
))
{
if
(
StringUtil
.
isNotBlank
(
openId
,
mobile
))
{
customerMap
=
userService
.
createCustomer
(
openId
,
mobile
);
}
else
{
throw
new
XException
(
"手机号码和OPENID不能为空"
);
throw
new
XException
(
"手机号码和OPENID不能为空"
);
}
}
customerMap
=
userService
.
createCustomer
(
openId
,
mobile
);
}
}
String
custNo
=
(
String
)
customerMap
.
get
(
"sCustNO"
);
String
custNo
=
(
String
)
customerMap
.
get
(
"sCustNO"
);
List
<
Map
<
String
,
Object
>>
shopList
=
userService
.
queryShopList
(
custNo
);
List
<
Map
<
String
,
Object
>>
shopList
=
userService
.
queryShopList
(
custNo
);
...
...
src/main/java/com/egolm/shop/service/impl/UserServiceImpl.java
View file @
9465e5a4
...
@@ -474,8 +474,8 @@ public class UserServiceImpl implements UserService {
...
@@ -474,8 +474,8 @@ public class UserServiceImpl implements UserService {
map
.
put
(
"sMobile"
,
mobile
);
map
.
put
(
"sMobile"
,
mobile
);
map
.
put
(
"sCustNO"
,
mobile
);
map
.
put
(
"sCustNO"
,
mobile
);
map
.
put
(
"sCustName"
,
mobile
);
map
.
put
(
"sCustName"
,
mobile
);
map
.
put
(
"sCustLeve
l
Type"
,
"普通客户"
);
map
.
put
(
"sCustLeveType"
,
"普通客户"
);
map
.
put
(
"sCustLeve
l
TypeID"
,
"1"
);
map
.
put
(
"sCustLeveTypeID"
,
"1"
);
map
.
put
(
"nTag"
,
0
);
map
.
put
(
"nTag"
,
0
);
map
.
put
(
"sCreateUser"
,
""
);
map
.
put
(
"sCreateUser"
,
""
);
map
.
put
(
"dCreateDate"
,
new
Date
());
map
.
put
(
"dCreateDate"
,
new
Date
());
...
...
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