Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
206e07b0
Commit
206e07b0
authored
Feb 13, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
155deecc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
6 deletions
+37
-6
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+34
-4
center-channel/app/config/routes/api.js
+1
-0
center-channel/app/config/settings.js
+2
-2
No files found.
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
206e07b0
...
@@ -7,10 +7,40 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -7,10 +7,40 @@ class UtilsOrderService extends AppServiceBase {
super
();
super
();
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
};
};
async
addOrder
(
pobj
,
req
)
{
/**
* 创建订单
var
url
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
* @param {*} pobj
var
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
* @param {*} actionBody {channelItemCode:渠道产品的编码,id:定价id,quantity:订单数量,totalSum:300}
*/
async
addOrder
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
channelItemCode
)
{
return
system
.
getResult
(
null
,
"产品编码有误,10010"
);
}
if
(
!
actionBody
.
id
||
Number
(
actionBody
.
id
)
<=
0
)
{
return
system
.
getResult
(
null
,
"定价ID有误,10030"
);
}
if
(
!
actionBody
.
quantity
||
Number
(
actionBody
.
quantity
)
<=
0
)
{
return
system
.
getResult
(
null
,
"订单数量有误,10050"
);
}
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
pobj
.
actionType
=
"getProductDetail"
;
var
productItemResult
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
productItemResult
.
status
!=
0
)
{
return
productItemResult
;
}
pobj
.
actionType
=
"getProductInterface"
;
pobj
.
actionBody
.
productId
=
productItemResult
.
data
.
id
;
var
productItemInterfaceResult
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
productItemInterfaceResult
.
status
!=
0
)
{
return
productItemInterfaceResult
;
}
productItemResult
.
data
.
interface_info
=
productItemInterfaceResult
.
data
;
pobj
.
actionBody
.
product_info
=
productItemResult
.
data
;
pobj
.
actionType
=
"addOrder"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
console
.
log
(
pobj
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
return
result
;
}
}
}
}
...
...
center-channel/app/config/routes/api.js
View file @
206e07b0
...
@@ -57,6 +57,7 @@ module.exports = function (app) {
...
@@ -57,6 +57,7 @@ module.exports = function (app) {
return
;
return
;
}
else
{
}
else
{
var
params
=
{
var
params
=
{
"appInfo"
:
req
.
body
.
appInfo
,
"actionType"
:
"getLoginInfo"
,
"actionType"
:
"getLoginInfo"
,
"actionBody"
:
{
"actionBody"
:
{
"userpin"
:
userpin
"userpin"
:
userpin
...
...
center-channel/app/config/settings.js
View file @
206e07b0
...
@@ -7,8 +7,8 @@ var ENVINPUT = {
...
@@ -7,8 +7,8 @@ var ENVINPUT = {
REDIS_HOST
:
process
.
env
.
REDIS_HOST
,
REDIS_HOST
:
process
.
env
.
REDIS_HOST
,
REDIS_PORT
:
process
.
env
.
REDIS_PORT
,
REDIS_PORT
:
process
.
env
.
REDIS_PORT
,
REDIS_PWD
:
process
.
env
.
REDIS_PWD
,
REDIS_PWD
:
process
.
env
.
REDIS_PWD
,
DB_NAME
:
process
.
env
.
ZC_API
_DB_NAME
,
DB_NAME
:
process
.
env
.
CENTER_CHANNEL
_DB_NAME
,
REDIS_DB
:
process
.
env
.
ZC_API
_REDIS_DB
,
REDIS_DB
:
process
.
env
.
CENTER_CHANNEL
_REDIS_DB
,
APP_ENV
:
process
.
env
.
APP_ENV
?
process
.
env
.
APP_ENV
:
"dev"
APP_ENV
:
process
.
env
.
APP_ENV
?
process
.
env
.
APP_ENV
:
"dev"
};
};
var
settings
=
{
var
settings
=
{
...
...
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