Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
qa-platform
Commits
02fb39b7
Commit
02fb39b7
authored
Sep 29, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化羊小咩下单接口
parent
f7252ae5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
YxmController.java
...n/java/cn/qg/qaplatform/controller/yxm/YxmController.java
+20
-0
No files found.
src/main/java/cn/qg/qaplatform/controller/yxm/YxmController.java
View file @
02fb39b7
...
@@ -2,8 +2,11 @@ package cn.qg.qaplatform.controller.yxm;
...
@@ -2,8 +2,11 @@ package cn.qg.qaplatform.controller.yxm;
import
cn.qg.qaplatform.config.SwitchDataSource
;
import
cn.qg.qaplatform.config.SwitchDataSource
;
import
cn.qg.qaplatform.entity.kdsp.TSkuInfo
;
import
cn.qg.qaplatform.entity.kdsp.TSkuInfo
;
import
cn.qg.qaplatform.entity.vcc.Account
;
import
cn.qg.qaplatform.entity.xyqbuser.User
;
import
cn.qg.qaplatform.process.Yxm
;
import
cn.qg.qaplatform.process.Yxm
;
import
cn.qg.qaplatform.service.kdsp.TSkuInfoService
;
import
cn.qg.qaplatform.service.kdsp.TSkuInfoService
;
import
cn.qg.qaplatform.service.vcc.AccountService
;
import
cn.qg.qaplatform.utils.Result
;
import
cn.qg.qaplatform.utils.Result
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
@@ -26,6 +29,9 @@ public class YxmController {
...
@@ -26,6 +29,9 @@ public class YxmController {
@Autowired
@Autowired
TSkuInfoService
tSkuInfoService
;
TSkuInfoService
tSkuInfoService
;
@Autowired
AccountService
accountService
;
/**
/**
* 获取sku列表
* 获取sku列表
* @param namespace 环境
* @param namespace 环境
...
@@ -43,6 +49,10 @@ public class YxmController {
...
@@ -43,6 +49,10 @@ public class YxmController {
String
skuName
,
String
skuName
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
)
{
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
)
{
// namespace不能为空
if
(!
StringUtils
.
isEmpty
(
namespace
))
{
return
Result
.
buildErrorStateResult
(
"namespace不能为空!"
,
false
);
}
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"kdsp"
);
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"kdsp"
);
QueryWrapper
<
TSkuInfo
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
TSkuInfo
>
queryWrapper
=
new
QueryWrapper
<>();
if
(
skuSource
!=
null
)
{
if
(
skuSource
!=
null
)
{
...
@@ -72,6 +82,16 @@ public class YxmController {
...
@@ -72,6 +82,16 @@ public class YxmController {
*/
*/
@PostMapping
(
"/order"
)
@PostMapping
(
"/order"
)
public
Result
yxmShopping
(
String
namespace
,
String
version
,
String
phoneNo
,
String
skuNo
)
{
public
Result
yxmShopping
(
String
namespace
,
String
version
,
String
phoneNo
,
String
skuNo
)
{
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"vcc_talos"
);
QueryWrapper
<
Account
>
accountQueryWrapper
=
new
QueryWrapper
<>();
accountQueryWrapper
.
eq
(
"phone_no"
,
phoneNo
);
Account
account
=
accountService
.
getOne
(
accountQueryWrapper
);
if
(
account
==
null
)
{
return
Result
.
buildErrorStateResult
(
"用户未开通享花卡,请先开通享花卡!"
,
false
);
}
if
(
account
.
getStatus
()
!=
6
)
{
return
Result
.
buildErrorStateResult
(
"用户未开户成功,请先开户成功!"
,
false
);
}
try
{
try
{
String
token
=
Yxm
.
loginApp
(
namespace
,
version
,
phoneNo
);
String
token
=
Yxm
.
loginApp
(
namespace
,
version
,
phoneNo
);
Integer
addressId
=
Yxm
.
getAddressList
(
namespace
,
phoneNo
,
token
);
Integer
addressId
=
Yxm
.
getAddressList
(
namespace
,
phoneNo
,
token
);
...
...
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