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
54943b58
Commit
54943b58
authored
Mar 03, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
3ff3ea58
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
197 additions
and
78 deletions
+197
-78
center-channel/app/base/api/api.base.js
+1
-1
center-channel/app/base/api/impl/opaction/order.js
+2
-4
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
+18
-17
center-channel/app/base/service/impl/utilsSve/utilsOpOrderSve.js
+2
-2
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+109
-29
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
+2
-2
center-channel/app/base/service/impl/utilsSve/utilsPushSve.js
+8
-14
center-channel/app/config/routes/api.js
+7
-8
center-channel/app/config/settings.js
+1
-1
center-channel/app/front/entry/public/apidoc/platform/order.md
+9
-0
center-channel/提示编码使用
+38
-0
No files found.
center-channel/app/base/api/api.base.js
View file @
54943b58
...
...
@@ -94,7 +94,7 @@ class APIBase {
appid
:
req
.
app
.
id
,
appkey
:
req
.
app
.
uappKey
,
requestId
:
req
.
requestId
,
op
:
pobj
.
classname
+
"/"
+
methodname
,
op
:
req
.
classname
+
"/"
+
methodname
,
content
:
e
.
stack
,
clientIp
:
pobj
.
clientIp
,
agent
:
req
.
uagent
,
...
...
center-channel/app/base/api/impl/opaction/order.js
View file @
54943b58
...
...
@@ -4,8 +4,7 @@ var settings = require("../../../../config/settings");
class
ProductAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
}
/**
* 接口跳转-POST请求
...
...
@@ -27,8 +26,7 @@ class ProductAPI extends APIBase {
var
opResult
=
null
;
switch
(
action_type
)
{
case
"addOrder"
:
//创建订单
opResult
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
await
this
.
utilsPushSve
.
pushInfo
(
opResult
,
pobj
,
pobj
.
actionBody
,
"pushBusiness"
);
opResult
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
break
;
case
"getOrderInfo"
:
//获取订单列表信息
opResult
=
await
this
.
utilsOrderSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
View file @
54943b58
...
...
@@ -8,33 +8,34 @@ class UtilsFqAliyunSve extends AppServiceBase {
constructor
()
{
super
();
}
async
pushBusiness
(
pobj
)
{
var
add_order_info
=
pobj
.
actionBody
.
add_order_info
;
if
(
pobj
.
appInfo
.
pay_type
!=
"00"
)
{
if
(
!
add_order_info
.
orderStatus
||
Number
(
add_order_info
.
orderStatus
)
<
2
)
{
return
""
;
}
async
pushBusiness
(
actionBody
)
{
var
orderInfo
=
actionBody
.
order_info
;
if
(
!
orderInfo
)
{
return
""
;
}
if
(
orderInfo
.
orderStatus
<
2
)
{
return
""
;
}
var
orderContact
=
pobj
.
actionBody
.
orderC
ontact
;
var
product
_info
=
pobj
.
actionBody
.
product_info
;
if
(
!
pobj
.
interface_params
)
{
var
orderContact
=
actionBody
.
order_c
ontact
;
var
product
Info
=
actionBody
.
product_info
;
if
(
!
actionBody
.
interface_params
)
{
return
""
;
}
var
interface_params_info
=
JSON
.
parse
(
pobj
.
interface_params
);
var
interface_params_info
=
JSON
.
parse
(
actionBody
.
interface_params
);
if
(
!
interface_params_info
||
!
interface_params_info
.
opUrl
||
!
interface_params_info
.
key
||
!
interface_params_info
.
secret
)
{
return
""
;
}
var
params
=
{
idempotentId
:
add_order_i
nfo
.
orderNo
,
// 是 业务 ID
idempotentSource
:
product
_i
nfo
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
idempotentSourceName
:
product
_i
nfo
.
service_business_code
,
// 是 京东云应用、阿里云应用
idempotentId
:
orderI
nfo
.
orderNo
,
// 是 业务 ID
idempotentSource
:
product
I
nfo
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
idempotentSourceName
:
product
I
nfo
.
service_business_code
,
// 是 京东云应用、阿里云应用
city
:
""
,
// 否 所属城市
phone
:
orderContact
.
mobile
,
// 是 手机号
userId
:
pobj
.
us
erInfo
.
channelUserId
,
// 否 用户 ID
userId
:
ord
erInfo
.
channelUserId
,
// 否 用户 ID
companyName
:
""
,
// 否 公司名称
orderPrice
:
pobj
.
actionBody
.
totalSum
,
// 是 订单金额
productId
:
product
_i
nfo
.
price_item
.
service_code
,
// 是 产品 ID
productQuantity
:
pobj
.
actionBody
.
quantity
,
// 是 产品数量
orderPrice
:
orderInfo
.
totalSum
,
// 是 订单金额
productId
:
product
I
nfo
.
price_item
.
service_code
,
// 是 产品 ID
productQuantity
:
orderInfo
.
quantity
,
// 是 产品数量
};
var
result
=
this
.
opAliyunClientPost
(
"pushBusiness"
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
params
);
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsOpOrderSve.js
View file @
54943b58
...
...
@@ -9,7 +9,7 @@ class UtilsOpOrderService extends AppServiceBase {
}
async
updateContacts
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty
,100310
"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"opaction/opOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
...
...
@@ -17,7 +17,7 @@ class UtilsOpOrderService extends AppServiceBase {
}
async
updateTmOrder
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty
,100320
"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"opaction/opOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
54943b58
...
...
@@ -5,8 +5,11 @@ const AppServiceBase = require("../../app.base");
class
UtilsOrderService
extends
AppServiceBase
{
constructor
()
{
super
();
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
tlPayNotifyUrl
=
settings
.
tlPayNotifyUrl
();
this
.
centerAppUrl
=
settings
.
centerAppUrl
();
this
.
centerAppPayUrl
=
settings
.
centerAppUrl
()
+
"payment/paymentApi/springBoard"
;
};
/*
...
...
@@ -15,11 +18,11 @@ class UtilsOrderService extends AppServiceBase {
async
isOrderVerify
(
pobj
,
actionBody
)
{
var
price_list
=
actionBody
.
product_info
.
price_list
;
if
(
!
price_list
)
{
return
system
.
getResult
(
null
,
"产品价格列表信息有误,100
8
0"
);
return
system
.
getResult
(
null
,
"产品价格列表信息有误,100
04
0"
);
}
var
product_price
=
price_list
.
filter
(
f
=>
f
.
pay_code
==
actionBody
.
payCode
);
if
(
!
product_price
||
product_price
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"支付价格payCode信息有误,10
11
0"
);
return
system
.
getResult
(
null
,
"支付价格payCode信息有误,10
005
0"
);
}
var
totalSum
=
Number
(
product_price
[
0
].
price
)
*
Number
(
actionBody
.
quantity
);
var
buyTotalSum
=
Number
(
actionBody
.
totalSum
||
0
);
...
...
@@ -31,7 +34,7 @@ class UtilsOrderService extends AppServiceBase {
actionBody
.
payTotalSum
=
totalSum
;
}
if
(
Number
(
actionBody
.
totalSum
||
0
)
<
totalSum
)
{
return
system
.
getResult
(
null
,
"订单金额有误,10
13
0"
);
return
system
.
getResult
(
null
,
"订单金额有误,10
006
0"
);
}
pobj
.
actionBody
.
product_info
.
price_item
=
product_price
[
0
];
return
system
.
getResultSuccess
();
...
...
@@ -43,13 +46,13 @@ class UtilsOrderService extends AppServiceBase {
*/
async
addOrder
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
channelItemCode
)
{
return
system
.
getResult
(
null
,
"产品编码有误,10010"
);
return
system
.
getResult
(
null
,
"产品编码有误,100
0
10"
);
}
if
(
!
actionBody
.
payCode
)
{
return
system
.
getResult
(
null
,
"支付价格payCode不能为空,100
3
0"
);
return
system
.
getResult
(
null
,
"支付价格payCode不能为空,100
02
0"
);
}
if
(
!
actionBody
.
quantity
||
Number
(
actionBody
.
quantity
)
<=
0
)
{
return
system
.
getResult
(
null
,
"订单数量为空或有误,100
5
0"
);
return
system
.
getResult
(
null
,
"订单数量为空或有误,100
03
0"
);
}
pobj
.
actionType
=
"getProductDetail"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
...
...
@@ -84,7 +87,7 @@ class UtilsOrderService extends AppServiceBase {
}
async
getOrderDeliveryInfo
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty
,100290
"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
...
...
@@ -92,7 +95,7 @@ class UtilsOrderService extends AppServiceBase {
}
async
getOrderDeliveryFlowInfo
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
sourceOrderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNo can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNo can not be empty
,100300
"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
...
...
@@ -100,10 +103,10 @@ class UtilsOrderService extends AppServiceBase {
}
async
getOrderDeliveryFlowList
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
sourceOrderNoList
)
{
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNoList can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNoList can not be empty
,100070
"
);
}
if
(
actionBody
.
sourceOrderNoList
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNoList length can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNoList length can not be empty
,100080
"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
...
...
@@ -111,7 +114,7 @@ class UtilsOrderService extends AppServiceBase {
}
async
getOrderLogInfo
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
sourceOrderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNo can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNo can not be empty
,100090
"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
...
...
@@ -119,7 +122,7 @@ class UtilsOrderService extends AppServiceBase {
}
async
icOrderStatusNotify
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty
,100100
"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"notifyaction/oporder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
...
...
@@ -132,7 +135,7 @@ class UtilsOrderService extends AppServiceBase {
*/
async
getH5PayUrl
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty
,100110
"
);
}
pobj
.
actionType
=
"getPayOrderInfo"
;
var
orderUrl
=
settings
.
centerOrderUrl
()
+
"action/order/springBoard"
;
...
...
@@ -161,7 +164,7 @@ class UtilsOrderService extends AppServiceBase {
*/
async
getOrderQrCode
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty
,100120
"
);
}
pobj
.
actionType
=
"getPayOrderInfo"
;
var
orderUrl
=
settings
.
centerOrderUrl
()
+
"action/order/springBoard"
;
...
...
@@ -177,14 +180,14 @@ class UtilsOrderService extends AppServiceBase {
pobj
.
actionBody
.
trxid
=
wxPayOrderCode
;
var
wxPayStatus
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
wxPayStatus
&&
wxPayStatus
.
code
==
1
&&
wxPayStatus
.
data
.
trxstatus
==
"0000"
)
{
return
system
.
getResultFail
(
-
1
40
,
"订单已支付,请勿重复付款
"
);
return
system
.
getResultFail
(
-
1
00130
,
"订单已支付,请勿重复付款,100130
"
);
}
}
if
(
receiptVoucher
.
busPayOrderCode
!=
receiptVoucher
.
aliPayOrderCode
)
{
pobj
.
actionBody
.
trxid
=
aliPayOrderCode
;
var
aliPayStatus
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
aliPayStatus
&&
aliPayStatus
.
code
==
1
&&
aliPayStatus
.
data
.
trxstatus
==
"0000"
)
{
return
system
.
getResultFail
(
-
1
50
,
"订单已支付,请勿重复付款
"
);
return
system
.
getResultFail
(
-
1
00140
,
"订单已支付,请勿重复付款,100140
"
);
}
}
...
...
@@ -239,10 +242,10 @@ class UtilsOrderService extends AppServiceBase {
*/
async
queryOrderStatus
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty
,100150
"
);
}
if
(
!
actionBody
.
opType
)
{
return
system
.
getResult
(
null
,
"actionBody.opType can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.opType can not be empty
,100160
"
);
}
pobj
.
actionType
=
"getPayOrderInfo"
;
var
orderUrl
=
settings
.
centerOrderUrl
()
+
"action/order/springBoard"
;
...
...
@@ -276,9 +279,9 @@ class UtilsOrderService extends AppServiceBase {
// return await this.utilstlbankSve.opBackNotify(payStatus.data, "页面回调");
}
else
if
(
payStatus
.
data
&&
payStatus
.
data
.
trxstatus
==
"3045"
)
{
return
system
.
getResultFail
(
-
330
,
"超时未支付,请刷新页面
"
);
return
system
.
getResultFail
(
-
100170
,
"超时未支付,请刷新页面,100170
"
);
}
return
system
.
getResultFail
(
-
1
30
,
"请及时支付
"
);
return
system
.
getResultFail
(
-
1
00180
,
"请及时支付,100180
"
);
}
/**
* 获取pc端支付二维码--不跟订单关联
...
...
@@ -293,19 +296,19 @@ class UtilsOrderService extends AppServiceBase {
*/
async
getQrCode
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
order_num
)
{
return
system
.
getResult
(
null
,
"actionBody.order_num can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.order_num can not be empty
,100190
"
);
}
if
(
!
actionBody
.
total_fee
)
{
return
system
.
getResult
(
null
,
"actionBody.total_fee can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.total_fee can not be empty
,100200
"
);
}
if
(
!
actionBody
.
body_desc
)
{
return
system
.
getResult
(
null
,
"actionBody.body_desc can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.body_desc can not be empty
,100210
"
);
}
if
(
!
actionBody
.
op_type
)
{
return
system
.
getResult
(
null
,
"actionBody.op_type can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.op_type can not be empty
,100220
"
);
}
if
(
actionBody
.
op_type
!=
"wx"
&&
actionBody
.
op_type
!=
"alipay"
)
{
return
system
.
getResult
(
null
,
"actionBody.op_type param error"
);
return
system
.
getResult
(
null
,
"actionBody.op_type param error
,100230
"
);
}
return
await
this
.
restPostUrl
(
pobj
,
this
.
centerAppPayUrl
);
...
...
@@ -317,14 +320,91 @@ class UtilsOrderService extends AppServiceBase {
*/
async
queryOrder
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
trxid
)
{
return
system
.
getResult
(
null
,
"actionBody.trxid can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.trxid can not be empty
,100240
"
);
}
return
await
this
.
restPostUrl
(
pobj
,
this
.
centerAppPayUrl
);
}
async
receiveCallBackNotify
(
pobj
,
actionBody
)
{
//---暂时没有用到
var
url
=
this
.
centerAppUrl
+
"payment/paymentApi/receiveCallBackNotify"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
async
receiveCallBackNotify
(
parmas
,
client_ip
)
{
try
{
if
(
!
parmas
||
Object
.
keys
(
parmas
).
length
==
0
)
{
return
system
.
getResult
(
null
,
"回调parmas中参数信息为空,100250"
);
}
//日志记录
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
":,method="
+
parmas
.
trxcode
,
op
:
"center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js/receiveCallBackNotify"
,
content
:
JSON
.
stringify
(
parmas
),
clientIp
:
client_ip
||
""
});
if
(
parmas
.
trxstatus
&&
parmas
.
trxstatus
==
"0000"
)
{
var
url
=
this
.
centerAppUrl
+
"payment/paymentApi/getAppInfo"
;
var
opResult
=
await
this
.
restPostUrl
({
uappId
:
parmas
.
uappid
},
url
);
if
(
opResult
.
status
!=
0
)
{
return
opResult
;
}
if
(
!
opResult
.
data
)
{
return
system
.
getResult
(
null
,
"应用数据为空,100260"
);
}
// var resultSign = await this.verifySign(parmas, opResult.data.appSecret);
// if (!resultSign || resultSign.status < 0) {
// return resultSign;
// }
var
result
=
await
this
.
opBackNotify
(
parmas
,
opResult
.
data
);
return
result
;
}
else
if
(
parmas
.
trxstatus
==
"3045"
)
{
return
system
.
getResultFail
(
-
100170
,
"超时未支付,请刷新页面,100270"
);
}
return
system
.
getResultFail
(
-
100180
,
"请及时支付,100280"
);
}
catch
(
e
)
{
// await this.cacheManager["ZxPayLocker"].release(getParams.trxid);//测试时放开
this
.
logCtl
.
error
({
optitle
:
"回调业务处理---error异常"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilstlbankSve.js/receiveCallBackNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
)
+
",error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
});
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
async
opBackNotify
(
parmas
,
appInfo
)
{
//操作回调业务逻辑
//获取充值业务锁
// await this.cacheManager["TlPayLocker"].init(parmas.out_trade_no);//---测试时放开
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
parmas
.
out_trade_no
);
if
(
locker
&&
locker
==
"1"
)
{
if
(
parmas
.
trxcode
==
"VSP501"
)
{
parmas
.
pay_type
=
"wx"
;
}
else
{
parmas
.
pay_type
=
"alipay"
;
}
parmas
.
appInfo
=
appInfo
;
parmas
.
orderNo
=
parmas
.
out_trade_no
;
//修改并返回订单支付状态,创建收款单
var
url
=
this
.
centerOrderUrl
+
"opaction/opPayOrder/receivePayCallBackNotify"
;
var
opResult
=
await
this
.
restPostUrl
(
parmas
,
url
);
if
(
opResult
.
status
==
0
)
{
await
this
.
utilsPushSve
.
pushInfo
(
opResult
.
data
,
"pushBusiness"
);
await
this
.
utilsPushSve
.
pushInfo
(
opResult
.
data
,
"pushOrder"
);
}
opResult
.
data
=
null
;
return
opResult
;
}
else
{
// await this.cacheManager["TlPayLocker"].release(parmas.out_trade_no);//---测试时放开
this
.
logCtl
.
info
({
appid
:
appInfo
.
uapp_id
,
appkey
:
appInfo
.
uapp_key
,
op
:
"center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js/opBackNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
),
clientIp
:
parmas
.
client_ip
||
""
,
optitle
:
"通联回调操作频繁---太频繁了,太频繁了"
});
return
system
.
getResultFail
(
-
200
,
"回调操作频繁---太频繁了,太频繁了"
);
}
}
}
module
.
exports
=
UtilsOrderService
;
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
View file @
54943b58
...
...
@@ -17,7 +17,7 @@ class UtilsProductSve extends AppServiceBase {
*/
async
getProductList
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
pathCode
)
{
return
system
.
getResult
(
null
,
"actionBody.pathCode can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.pathCode can not be empty
,100330
"
);
}
pobj
.
actionBody
.
pathCode
=
"/"
+
actionBody
.
pathCode
+
"/"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
...
...
@@ -30,7 +30,7 @@ class UtilsProductSve extends AppServiceBase {
*/
async
getProductDetail
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
channelItemCode
)
{
return
system
.
getResult
(
null
,
"actionBody.channelItemCode can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.channelItemCode can not be empty
,100340
"
);
}
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsPushSve.js
View file @
54943b58
...
...
@@ -6,35 +6,29 @@ class UtilsPushService extends AppServiceBase {
constructor
()
{
super
();
};
async
pushInfo
(
orderResult
,
pobj
,
actionBody
,
opType
)
{
if
(
orderResult
.
status
!=
0
)
{
return
""
;
}
async
pushInfo
(
actionBody
,
opType
)
{
var
interface_list
=
actionBody
.
product_info
.
interface_info
;
if
(
!
interface_list
)
{
return
""
;
}
var
interface_info
=
null
;
var
interface_list_temp
=
interface_list
.
filter
(
f
=>
f
.
op_type
==
opType
)
if
(
interface_list_temp
&&
interface_list_temp
.
length
>
0
)
{
interface_info
=
interface_list_temp
[
0
];
}
if
(
!
interface_info
)
{
if
(
!
interface_list_temp
||
interface_list_temp
.
length
==
0
)
{
return
""
;
}
pobj
.
actionBody
.
add_order_info
=
orderResult
.
data
;
var
refOpResult
=
this
.
reflexAction
(
interface_info
,
pobj
);
return
refOpResult
;
for
(
let
index
=
0
;
index
<
interface_list_temp
.
length
;
index
++
)
{
const
element
=
interface_list_temp
[
index
];
var
refOpResult
=
this
.
reflexAction
(
element
,
actionBody
);
}
}
async
reflexAction
(
interface_info
,
pobj
)
{
var
refResult
=
null
;
if
(
interface_info
.
interface_type
==
"bd"
)
{
if
(
!
interface_info
.
method_name
)
{
return
system
.
getResult
(
null
,
"产品接口参数信息有误,
2011
0"
);
return
system
.
getResult
(
null
,
"产品接口参数信息有误,
10035
0"
);
}
//操作的方法名称
var
invokeObj
=
system
.
getObject
(
interface_info
.
interface_url
);
if
(
!
invokeObj
[
interface_info
.
method_name
])
{
return
system
.
getResult
(
null
,
"产品接口参数方法信息有误,
2013
0"
);
return
system
.
getResult
(
null
,
"产品接口参数方法信息有误,
10036
0"
);
}
pobj
.
interface_params
=
interface_info
.
params
;
var
params
=
[
pobj
];
...
...
center-channel/app/config/routes/api.js
View file @
54943b58
...
...
@@ -4,13 +4,12 @@ var utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve");
module
.
exports
=
function
(
app
)
{
//-----------------------新的模式------------------开始
app
.
use
(
'/tlpay/notify'
,
function
(
req
,
res
)
{
// var client_ip = system.get_client_ip(req);
// // req.body["client_ip"]=client_ip;
// var orderSve = system.getObject("service.dborder.orderSve");
// var p = orderSve.receiveTlCallBackNotify(req.body);
// p.then(r => {
// res.end(JSON.stringify(r));
// });
var
client_ip
=
system
.
get_client_ip
(
req
);
var
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
var
p
=
utilsOrderSve
.
receiveCallBackNotify
(
req
.
body
,
client_ip
);
p
.
then
(
r
=>
{
res
.
end
(
JSON
.
stringify
(
r
));
});
});
app
.
all
(
"/web/*"
,
async
function
(
req
,
res
,
next
)
{
...
...
@@ -50,7 +49,7 @@ module.exports = function (app) {
req
.
body
.
appInfo
=
result
.
data
;
req
.
body
.
actionProcess
=
result
.
data
.
app_code
;
var
lst
=
[
"addOrder"
,
"getH5PayUrl"
,
"getOrderQrCode"
,
"queryOrderStatus"
,
"getOrderInfo"
,
"getOrderDeliveryInfo"
,
"addOrder"
,
"getH5PayUrl"
,
"getOrderQrCode"
,
"queryOrderStatus"
,
"getOrderInfo"
,
"getOrderDeliveryInfo"
,
"getOrderDeliveryFlowInfo"
,
"getOrderDeliveryFlowList"
,
"getOrderLogInfo"
,
"updateContacts"
,
"updateTmOrder"
,
"getNeedInfo"
,
//---暂时没有用到
"tmConfirm"
,
"updateTmInfo"
,
...
...
center-channel/app/config/settings.js
View file @
54943b58
...
...
@@ -79,7 +79,7 @@ var settings = {
},
apiconfig
:
{
opLogUrl
:
function
()
{
return
settings
.
reqEsAddr
()
+
"
bigdata_zc_op
_log/_doc?pretty"
;
return
settings
.
reqEsAddr
()
+
"
center_channel
_log/_doc?pretty"
;
},
opLogEsIsAdd
:
function
()
{
return
1
;
...
...
center-channel/app/front/entry/public/apidoc/platform/order.md
View file @
54943b58
...
...
@@ -18,6 +18,7 @@
```
javascript
{
"channelItemCode"
:
"zzsbzc"
,
// Y 产品的渠道编码
"channelItemAppendName"
:
""
,
// Y 填写的商标名称
"payCode"
:
"zzsbzc-2"
,
// Y 支付价格code
"quantity"
:
1
,
// Y 购买数量
"totalSum"
:
300
,
// Y 订单总金额---(商标自助注册计算格式:小于10项为产品价格×10,大于10项的为产品价格×小项数量)
...
...
@@ -199,6 +200,10 @@
"opNotes"
:
""
,
//操作备注
"channelItemCode"
:
"FW_GOODS-582221-1"
,
//渠道产品编码
"channelItemName"
:
"京东云PLUS公司注册(北京市)"
,
//渠道产品名称
"channelItemAppendName"
:
"北京海淀"
,
//渠道产品附加名称
"price"
:
"10.00"
,
//产品单价
"priceTypeName"
:
"件"
,
//产品单价单位名称
"priceDesc"
:
"海淀区内资一般人"
,
//产品单价描述
"serviceItemCode"
:
null
,
//服务产品编码
"picUrl"
:
null
,
//产品图片地址
"created_at"
:
""
//下单时间
...
...
@@ -221,6 +226,10 @@
"opNotes"
:
""
,
"channelItemCode"
:
"FW_GOODS-582221-1"
,
"channelItemName"
:
"京东云PLUS公司注册(北京市)"
,
"channelItemAppendName"
:
""
,
"price"
:
"10.00"
,
"priceTypeName"
:
"件"
,
"priceDesc"
:
"海淀区内资一般人"
,
"serviceItemCode"
:
null
,
"picUrl"
:
null
,
"created_at"
:
""
...
...
center-channel/提示编码使用
0 → 100644
View file @
54943b58
已经使用的编码汇总:
已经使用的编码汇总:
100010
100020
100030 订单数量为空或有误,100030
100040
100050
100060
100070
100080
100090
100100
100110
100120
-100130 订单已支付,请勿重复付款,100130
-100140 订单已支付,请勿重复付款,100140
100150
100160
-100170 超时未支付,请刷新页面,100170 或100270
-100180 请及时支付,100180 或100280
100190
100200
100210
100220
100230
100240
100250
100260
100270
100280
100290
100300
100310
100320
100330
100340
100350
100360
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