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
0b9c9acc
Commit
0b9c9acc
authored
Feb 20, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
7a24dcb1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
4 deletions
+93
-4
center-order/app/base/api/impl/notifyaction/oporder.js
+37
-0
center-order/app/base/db/impl/dbcorder/orderinfoDao.js
+10
-4
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
+46
-0
center-order/app/base/service/sve.base.js
+0
-0
No files found.
center-order/app/base/api/impl/notifyaction/oporder.js
0 → 100644
View file @
0b9c9acc
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
OrderAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
orderinfoSve
=
system
.
getObject
(
"service.dbcorder.orderinfoSve"
);
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
return
result
;
}
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
var
opResult
=
null
;
switch
(
action_type
)
{
case
"icOrderStatusNotify"
:
//操作工商流程通知信息
opResult
=
await
this
.
orderinfoSve
.
icOrderStatusNotify
(
pobj
,
pobj
.
actionBody
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
module
.
exports
=
OrderAPI
;
\ No newline at end of file
center-order/app/base/db/impl/dbcorder/orderinfoDao.js
View file @
0b9c9acc
...
...
@@ -5,11 +5,12 @@ class OrderInfoDao extends Dao {
super
(
Dao
.
getModelName
(
OrderInfoDao
));
}
async
getItemStatusByOrderNo
(
orderNo
,
uapp_id
)
{
return
await
this
.
model
.
findOne
(
{
var
sqlWhere
=
{
where
:
{
orderNo
:
orderNo
,
uapp_id
:
uapp_id
orderNo
:
orderNo
},
attributes
:
[
"id"
,
"orderNo"
,
"channelServiceNo"
,
"channelOrderNo"
,
...
...
@@ -23,9 +24,14 @@ class OrderInfoDao extends Dao {
"totalSum"
,
"payTotalSum"
,
"refundSum"
,
"invoiceApplyStatus"
],
"invoiceApplyStatus"
,
"created_at"
],
raw
:
true
});
};
if
(
uapp_id
)
{
sqlWhere
.
where
.
uapp_id
=
uapp_id
;
}
return
await
this
.
model
.
findOne
(
sqlWhere
);
}
}
module
.
exports
=
OrderInfoDao
;
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
View file @
0b9c9acc
...
...
@@ -238,6 +238,51 @@ class OrderInfoService extends ServiceBase {
}
return
system
.
getResultSuccess
();
}
//-------------------------------服务商通知订单流程-------------start----------------
async
icOrderStatusNotify
(
pobj
,
actionBody
)
{
//获取订单交付信息
var
item
=
await
this
.
dao
.
getItemStatusByOrderNo
(
actionBody
.
orderNo
);
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"order data is empty!"
);
}
var
updateDeliveryInfo
=
[];
var
deliveryInfo
=
await
this
.
getOrderDeliveryInfo
(
pobj
);
var
addi
=
0
;
if
(
deliveryInfo
.
status
==
0
&&
deliveryInfo
.
data
&&
deliveryInfo
.
data
.
length
>
0
)
{
updateDeliveryInfo
=
deliveryInfo
.
data
;
}
else
{
updateDeliveryInfo
.
push
({
orderDeliveryStatus
:
"已下单"
,
orderDeliveryStatusName
:
"已下单"
,
updated
:
item
.
created_at
});
addi
=
1
;
}
var
dataIndex
=
updateDeliveryInfo
.
findIndex
(
f
=>
f
.
orderDeliveryStatus
==
actionBody
.
orderDeliveryStatus
);
if
(
dataIndex
>
-
1
)
{
updateDeliveryInfo
[
dataIndex
].
orderDeliveryStatusName
=
actionBody
.
orderDeliveryStatusName
;
updateDeliveryInfo
[
dataIndex
].
updated
=
actionBody
.
updated
;
}
else
{
updateDeliveryInfo
.
push
({
orderDeliveryStatus
:
actionBody
.
orderDeliveryStatus
,
orderDeliveryStatusName
:
actionBody
.
orderDeliveryStatusName
,
updated
:
actionBody
.
updated
});
}
var
sql
=
null
;
if
(
addi
>
0
)
{
sql
=
"INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('"
+
actionBody
.
orderNo
+
"','"
+
JSON
.
stringify
(
updateDeliveryInfo
)
+
"')"
;
}
else
{
sql
=
"UPDATE `c_order_delivery` SET deliveryContent ='"
+
JSON
.
stringify
(
updateDeliveryInfo
)
+
"' where sourceOrderNo='"
+
actionBody
.
orderNo
+
"'"
;
}
this
.
customQuery
(
sql
);
return
system
.
getResultSuccess
();
}
//-------------------------------服务商通知订单流程-------------end----------------
}
module
.
exports
=
OrderInfoService
;
\ No newline at end of file
center-order/app/base/service/sve.base.js
View file @
0b9c9acc
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