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
b329c2a8
Commit
b329c2a8
authored
May 20, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
7393032f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
1 deletions
+68
-1
xgg-deliver/app/base/controller/impl/order/orderCtl.js
+6
-0
xgg-deliver/app/base/service/impl/order/orderSve.js
+61
-1
xgg-deliver/app/config/environment.js
+1
-0
No files found.
xgg-deliver/app/base/controller/impl/order/orderCtl.js
View file @
b329c2a8
...
@@ -710,6 +710,9 @@ class OrderCtl extends CtlBase {
...
@@ -710,6 +710,9 @@ class OrderCtl extends CtlBase {
"8"
:
"2080"
,
//客户交付
"8"
:
"2080"
,
//客户交付
"9"
:
"2090"
//订单完成
"9"
:
"2090"
//订单完成
};
};
if
(
!
pobj
.
saas_id
){
return
system
.
getResult
(
null
,
`登录失效,请重新登录`
);
}
var
condition
=
{
var
condition
=
{
currentPage
:
Number
(
pobj
.
currentPage
||
1
),
currentPage
:
Number
(
pobj
.
currentPage
||
1
),
pageSize
:
Number
(
pobj
.
pageSize
||
10
),
pageSize
:
Number
(
pobj
.
pageSize
||
10
),
...
@@ -727,6 +730,9 @@ class OrderCtl extends CtlBase {
...
@@ -727,6 +730,9 @@ class OrderCtl extends CtlBase {
if
(
pobj
.
order_id
){
if
(
pobj
.
order_id
){
condition
.
id
=
this
.
trim
(
pobj
.
order_id
);
condition
.
id
=
this
.
trim
(
pobj
.
order_id
);
}
}
if
(
pobj
.
saas_id
){
condition
.
saas_id
=
this
.
trim
(
pobj
.
saas_id
);
}
this
.
doTimeCondition
(
condition
,
[
"createdBegin"
,
"createdEnd"
]);
this
.
doTimeCondition
(
condition
,
[
"createdBegin"
,
"createdEnd"
]);
return
await
this
.
orderSve
.
aliOrderPageAll
(
condition
);
return
await
this
.
orderSve
.
aliOrderPageAll
(
condition
);
}
}
...
...
xgg-deliver/app/base/service/impl/order/orderSve.js
View file @
b329c2a8
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
const
ServiceBase
=
require
(
"../../svems.base"
)
const
settings
=
require
(
"../../../../config/settings"
)
const
settings
=
require
(
"../../../../config/settings"
)
const
axios
=
require
(
"axios"
);
class
OrderService
extends
ServiceBase
{
class
OrderService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
...
@@ -25,8 +26,67 @@ class OrderService extends ServiceBase {
...
@@ -25,8 +26,67 @@ class OrderService extends ServiceBase {
return
rs
;
return
rs
;
}
}
/**
* fn:订单处理流程 (ps:如果有推送状态 这需要 完善puhsOrderInfo)
* @param params
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
*/
async
handleStatus
(
params
)
{
async
handleStatus
(
params
)
{
return
await
this
.
callms
(
"order"
,
"handleStatus"
,
params
);
let
rs
=
await
this
.
callms
(
"order"
,
"handleStatus"
,
params
);
if
(
rs
&&
rs
.
status
===
0
)
{
this
.
pushOrderInfo
(
params
);
}
return
rs
;
}
/**
* fn:推送到业务系统(paltforme)
* @param params
* @returns {Promise<void>}
*
* ps:所有状态
*
*/
async
pushOrderInfo
(
params
)
{
let
order
=
await
this
.
callms
(
"order"
,
"orderInfo"
,
params
)
||
{};
order
=
order
.
data
;
if
(
!
order
)
{
return
;
}
if
(
!
order
.
saas_deliver_api
)
{
return
;
}
if
(
params
.
status
==
1190
)
{
let
data
=
{
source_no
:
order
.
source_no
,
status
:
order
.
status
,
guest_mail_no
:
params
.
guest_mail_no
,
guest_mail_img
:
params
.
guest_mail_img
}
axios
({
method
:
'post'
,
url
:
order
.
saas_deliver_api
,
data
:
data
});
}
else
if
(
params
.
status
==
1200
||
params
.
status
==
2090
){
//推送saas平台个体工商户信息
let
obusinessmen
=
await
this
.
callms
(
"order"
,
"queryObusinessmenInfo"
,
params
)
||
{};
obusinessmen
=
obusinessmen
.
data
;
if
(
!
obusinessmen
)
{
return
;
}
if
(
!
obusinessmen
.
saas_deliver_api
)
{
return
;
}
obusinessmen
.
status
=
"2000000"
;
let
a
=
await
axios
({
method
:
'post'
,
url
:
obusinessmen
.
saas_deliver_api
,
data
:
obusinessmen
});
console
.
log
(
a
)
}
}
}
async
orderInfo
(
params
)
{
async
orderInfo
(
params
)
{
...
...
xgg-deliver/app/config/environment.js
View file @
b329c2a8
...
@@ -30,6 +30,7 @@ module.exports = function (app) {
...
@@ -30,6 +30,7 @@ module.exports = function (app) {
res
.
header
(
'Access-Control-Allow-Headers'
,
'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild, xggadminsid'
);
res
.
header
(
'Access-Control-Allow-Headers'
,
'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild, xggadminsid'
);
res
.
header
(
'Access-Control-Allow-Methods'
,
'PUT, POST, GET, DELETE, OPTIONS'
);
res
.
header
(
'Access-Control-Allow-Methods'
,
'PUT, POST, GET, DELETE, OPTIONS'
);
// res.header('Access-Control-Allow-Credentials', 'true');
// res.header('Access-Control-Allow-Credentials', 'true');
res
.
header
(
'content-type'
,
'text/html;charset=UTF-8'
);
if
(
req
.
method
==
'OPTIONS'
)
{
if
(
req
.
method
==
'OPTIONS'
)
{
res
.
send
(
200
);
//让options请求快速返回/
res
.
send
(
200
);
//让options请求快速返回/
}
}
...
...
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