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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
88 additions
and
49 deletions
+88
-49
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
+0
-0
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 {
...
@@ -94,7 +94,7 @@ class APIBase {
appid
:
req
.
app
.
id
,
appid
:
req
.
app
.
id
,
appkey
:
req
.
app
.
uappKey
,
appkey
:
req
.
app
.
uappKey
,
requestId
:
req
.
requestId
,
requestId
:
req
.
requestId
,
op
:
pobj
.
classname
+
"/"
+
methodname
,
op
:
req
.
classname
+
"/"
+
methodname
,
content
:
e
.
stack
,
content
:
e
.
stack
,
clientIp
:
pobj
.
clientIp
,
clientIp
:
pobj
.
clientIp
,
agent
:
req
.
uagent
,
agent
:
req
.
uagent
,
...
...
center-channel/app/base/api/impl/opaction/order.js
View file @
54943b58
...
@@ -4,8 +4,7 @@ var settings = require("../../../../config/settings");
...
@@ -4,8 +4,7 @@ var settings = require("../../../../config/settings");
class
ProductAPI
extends
APIBase
{
class
ProductAPI
extends
APIBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
}
}
/**
/**
* 接口跳转-POST请求
* 接口跳转-POST请求
...
@@ -27,8 +26,7 @@ class ProductAPI extends APIBase {
...
@@ -27,8 +26,7 @@ class ProductAPI extends APIBase {
var
opResult
=
null
;
var
opResult
=
null
;
switch
(
action_type
)
{
switch
(
action_type
)
{
case
"addOrder"
:
//创建订单
case
"addOrder"
:
//创建订单
opResult
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
await
this
.
utilsPushSve
.
pushInfo
(
opResult
,
pobj
,
pobj
.
actionBody
,
"pushBusiness"
);
break
;
break
;
case
"getOrderInfo"
:
//获取订单列表信息
case
"getOrderInfo"
:
//获取订单列表信息
opResult
=
await
this
.
utilsOrderSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
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 {
...
@@ -8,33 +8,34 @@ class UtilsFqAliyunSve extends AppServiceBase {
constructor
()
{
constructor
()
{
super
();
super
();
}
}
async
pushBusiness
(
pobj
)
{
async
pushBusiness
(
actionBody
)
{
var
add_order_info
=
pobj
.
actionBody
.
add_order_info
;
var
orderInfo
=
actionBody
.
order_info
;
if
(
pobj
.
appInfo
.
pay_type
!=
"00"
)
{
if
(
!
orderInfo
)
{
if
(
!
add_order_info
.
orderStatus
||
Number
(
add_order_info
.
orderStatus
)
<
2
)
{
return
""
;
return
""
;
}
}
if
(
orderInfo
.
orderStatus
<
2
)
{
return
""
;
}
}
var
orderContact
=
pobj
.
actionBody
.
orderC
ontact
;
var
orderContact
=
actionBody
.
order_c
ontact
;
var
product
_info
=
pobj
.
actionBody
.
product_info
;
var
product
Info
=
actionBody
.
product_info
;
if
(
!
pobj
.
interface_params
)
{
if
(
!
actionBody
.
interface_params
)
{
return
""
;
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
)
{
if
(
!
interface_params_info
||
!
interface_params_info
.
opUrl
||
!
interface_params_info
.
key
||
!
interface_params_info
.
secret
)
{
return
""
;
return
""
;
}
}
var
params
=
{
var
params
=
{
idempotentId
:
add_order_i
nfo
.
orderNo
,
// 是 业务 ID
idempotentId
:
orderI
nfo
.
orderNo
,
// 是 业务 ID
idempotentSource
:
product
_i
nfo
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
idempotentSource
:
product
I
nfo
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
idempotentSourceName
:
product
_i
nfo
.
service_business_code
,
// 是 京东云应用、阿里云应用
idempotentSourceName
:
product
I
nfo
.
service_business_code
,
// 是 京东云应用、阿里云应用
city
:
""
,
// 否 所属城市
city
:
""
,
// 否 所属城市
phone
:
orderContact
.
mobile
,
// 是 手机号
phone
:
orderContact
.
mobile
,
// 是 手机号
userId
:
pobj
.
us
erInfo
.
channelUserId
,
// 否 用户 ID
userId
:
ord
erInfo
.
channelUserId
,
// 否 用户 ID
companyName
:
""
,
// 否 公司名称
companyName
:
""
,
// 否 公司名称
orderPrice
:
pobj
.
actionBody
.
totalSum
,
// 是 订单金额
orderPrice
:
orderInfo
.
totalSum
,
// 是 订单金额
productId
:
product
_i
nfo
.
price_item
.
service_code
,
// 是 产品 ID
productId
:
product
I
nfo
.
price_item
.
service_code
,
// 是 产品 ID
productQuantity
:
pobj
.
actionBody
.
quantity
,
// 是 产品数量
productQuantity
:
orderInfo
.
quantity
,
// 是 产品数量
};
};
var
result
=
this
.
opAliyunClientPost
(
"pushBusiness"
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
params
);
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 {
...
@@ -9,7 +9,7 @@ class UtilsOpOrderService extends AppServiceBase {
}
}
async
updateContacts
(
pobj
,
actionBody
)
{
async
updateContacts
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
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
reqUrl
=
this
.
centerOrderUrl
+
"opaction/opOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
...
@@ -17,7 +17,7 @@ class UtilsOpOrderService extends AppServiceBase {
...
@@ -17,7 +17,7 @@ class UtilsOpOrderService extends AppServiceBase {
}
}
async
updateTmOrder
(
pobj
,
actionBody
)
{
async
updateTmOrder
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
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
reqUrl
=
this
.
centerOrderUrl
+
"opaction/opOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
54943b58
This diff is collapsed.
Click to expand it.
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
View file @
54943b58
...
@@ -17,7 +17,7 @@ class UtilsProductSve extends AppServiceBase {
...
@@ -17,7 +17,7 @@ class UtilsProductSve extends AppServiceBase {
*/
*/
async
getProductList
(
pobj
,
actionBody
)
{
async
getProductList
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
pathCode
)
{
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
+
"/"
;
pobj
.
actionBody
.
pathCode
=
"/"
+
actionBody
.
pathCode
+
"/"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
...
@@ -30,7 +30,7 @@ class UtilsProductSve extends AppServiceBase {
...
@@ -30,7 +30,7 @@ class UtilsProductSve extends AppServiceBase {
*/
*/
async
getProductDetail
(
pobj
,
actionBody
)
{
async
getProductDetail
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
channelItemCode
)
{
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"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
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 {
...
@@ -6,35 +6,29 @@ class UtilsPushService extends AppServiceBase {
constructor
()
{
constructor
()
{
super
();
super
();
};
};
async
pushInfo
(
orderResult
,
pobj
,
actionBody
,
opType
)
{
async
pushInfo
(
actionBody
,
opType
)
{
if
(
orderResult
.
status
!=
0
)
{
return
""
;
}
var
interface_list
=
actionBody
.
product_info
.
interface_info
;
var
interface_list
=
actionBody
.
product_info
.
interface_info
;
if
(
!
interface_list
)
{
if
(
!
interface_list
)
{
return
""
;
return
""
;
}
}
var
interface_info
=
null
;
var
interface_list_temp
=
interface_list
.
filter
(
f
=>
f
.
op_type
==
opType
)
var
interface_list_temp
=
interface_list
.
filter
(
f
=>
f
.
op_type
==
opType
)
if
(
interface_list_temp
&&
interface_list_temp
.
length
>
0
)
{
if
(
!
interface_list_temp
||
interface_list_temp
.
length
==
0
)
{
interface_info
=
interface_list_temp
[
0
];
}
if
(
!
interface_info
)
{
return
""
;
return
""
;
}
}
pobj
.
actionBody
.
add_order_info
=
orderResult
.
data
;
for
(
let
index
=
0
;
index
<
interface_list_temp
.
length
;
index
++
)
{
var
refOpResult
=
this
.
reflexAction
(
interface_info
,
pobj
);
const
element
=
interface_list_temp
[
index
];
return
refOpResult
;
var
refOpResult
=
this
.
reflexAction
(
element
,
actionBody
);
}
}
}
async
reflexAction
(
interface_info
,
pobj
)
{
async
reflexAction
(
interface_info
,
pobj
)
{
var
refResult
=
null
;
var
refResult
=
null
;
if
(
interface_info
.
interface_type
==
"bd"
)
{
if
(
interface_info
.
interface_type
==
"bd"
)
{
if
(
!
interface_info
.
method_name
)
{
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
);
var
invokeObj
=
system
.
getObject
(
interface_info
.
interface_url
);
if
(
!
invokeObj
[
interface_info
.
method_name
])
{
if
(
!
invokeObj
[
interface_info
.
method_name
])
{
return
system
.
getResult
(
null
,
"产品接口参数方法信息有误,
2013
0"
);
return
system
.
getResult
(
null
,
"产品接口参数方法信息有误,
10036
0"
);
}
}
pobj
.
interface_params
=
interface_info
.
params
;
pobj
.
interface_params
=
interface_info
.
params
;
var
params
=
[
pobj
];
var
params
=
[
pobj
];
...
...
center-channel/app/config/routes/api.js
View file @
54943b58
...
@@ -4,13 +4,12 @@ var utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve");
...
@@ -4,13 +4,12 @@ var utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve");
module
.
exports
=
function
(
app
)
{
module
.
exports
=
function
(
app
)
{
//-----------------------新的模式------------------开始
//-----------------------新的模式------------------开始
app
.
use
(
'/tlpay/notify'
,
function
(
req
,
res
)
{
app
.
use
(
'/tlpay/notify'
,
function
(
req
,
res
)
{
// var client_ip = system.get_client_ip(req);
var
client_ip
=
system
.
get_client_ip
(
req
);
// // req.body["client_ip"]=client_ip;
var
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
// var orderSve = system.getObject("service.dborder.orderSve");
var
p
=
utilsOrderSve
.
receiveCallBackNotify
(
req
.
body
,
client_ip
);
// var p = orderSve.receiveTlCallBackNotify(req.body);
p
.
then
(
r
=>
{
// p.then(r => {
res
.
end
(
JSON
.
stringify
(
r
));
// res.end(JSON.stringify(r));
});
// });
});
});
app
.
all
(
"/web/*"
,
async
function
(
req
,
res
,
next
)
{
app
.
all
(
"/web/*"
,
async
function
(
req
,
res
,
next
)
{
...
@@ -50,7 +49,7 @@ module.exports = function (app) {
...
@@ -50,7 +49,7 @@ module.exports = function (app) {
req
.
body
.
appInfo
=
result
.
data
;
req
.
body
.
appInfo
=
result
.
data
;
req
.
body
.
actionProcess
=
result
.
data
.
app_code
;
req
.
body
.
actionProcess
=
result
.
data
.
app_code
;
var
lst
=
[
var
lst
=
[
"addOrder"
,
"getH5PayUrl"
,
"getOrderQrCode"
,
"queryOrderStatus"
,
"getOrderInfo"
,
"getOrderDeliveryInfo"
,
"addOrder"
,
"getH5PayUrl"
,
"getOrderQrCode"
,
"queryOrderStatus"
,
"getOrderInfo"
,
"getOrderDeliveryInfo"
,
"getOrderDeliveryFlowInfo"
,
"getOrderDeliveryFlowList"
,
"getOrderLogInfo"
,
"updateContacts"
,
"updateTmOrder"
,
"getOrderDeliveryFlowInfo"
,
"getOrderDeliveryFlowList"
,
"getOrderLogInfo"
,
"updateContacts"
,
"updateTmOrder"
,
"getNeedInfo"
,
//---暂时没有用到
"getNeedInfo"
,
//---暂时没有用到
"tmConfirm"
,
"updateTmInfo"
,
"tmConfirm"
,
"updateTmInfo"
,
...
...
center-channel/app/config/settings.js
View file @
54943b58
...
@@ -79,7 +79,7 @@ var settings = {
...
@@ -79,7 +79,7 @@ var settings = {
},
},
apiconfig
:
{
apiconfig
:
{
opLogUrl
:
function
()
{
opLogUrl
:
function
()
{
return
settings
.
reqEsAddr
()
+
"
bigdata_zc_op
_log/_doc?pretty"
;
return
settings
.
reqEsAddr
()
+
"
center_channel
_log/_doc?pretty"
;
},
},
opLogEsIsAdd
:
function
()
{
opLogEsIsAdd
:
function
()
{
return
1
;
return
1
;
...
...
center-channel/app/front/entry/public/apidoc/platform/order.md
View file @
54943b58
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
```
javascript
```
javascript
{
{
"channelItemCode"
:
"zzsbzc"
,
// Y 产品的渠道编码
"channelItemCode"
:
"zzsbzc"
,
// Y 产品的渠道编码
"channelItemAppendName"
:
""
,
// Y 填写的商标名称
"payCode"
:
"zzsbzc-2"
,
// Y 支付价格code
"payCode"
:
"zzsbzc-2"
,
// Y 支付价格code
"quantity"
:
1
,
// Y 购买数量
"quantity"
:
1
,
// Y 购买数量
"totalSum"
:
300
,
// Y 订单总金额---(商标自助注册计算格式:小于10项为产品价格×10,大于10项的为产品价格×小项数量)
"totalSum"
:
300
,
// Y 订单总金额---(商标自助注册计算格式:小于10项为产品价格×10,大于10项的为产品价格×小项数量)
...
@@ -199,6 +200,10 @@
...
@@ -199,6 +200,10 @@
"opNotes"
:
""
,
//操作备注
"opNotes"
:
""
,
//操作备注
"channelItemCode"
:
"FW_GOODS-582221-1"
,
//渠道产品编码
"channelItemCode"
:
"FW_GOODS-582221-1"
,
//渠道产品编码
"channelItemName"
:
"京东云PLUS公司注册(北京市)"
,
//渠道产品名称
"channelItemName"
:
"京东云PLUS公司注册(北京市)"
,
//渠道产品名称
"channelItemAppendName"
:
"北京海淀"
,
//渠道产品附加名称
"price"
:
"10.00"
,
//产品单价
"priceTypeName"
:
"件"
,
//产品单价单位名称
"priceDesc"
:
"海淀区内资一般人"
,
//产品单价描述
"serviceItemCode"
:
null
,
//服务产品编码
"serviceItemCode"
:
null
,
//服务产品编码
"picUrl"
:
null
,
//产品图片地址
"picUrl"
:
null
,
//产品图片地址
"created_at"
:
""
//下单时间
"created_at"
:
""
//下单时间
...
@@ -221,6 +226,10 @@
...
@@ -221,6 +226,10 @@
"opNotes"
:
""
,
"opNotes"
:
""
,
"channelItemCode"
:
"FW_GOODS-582221-1"
,
"channelItemCode"
:
"FW_GOODS-582221-1"
,
"channelItemName"
:
"京东云PLUS公司注册(北京市)"
,
"channelItemName"
:
"京东云PLUS公司注册(北京市)"
,
"channelItemAppendName"
:
""
,
"price"
:
"10.00"
,
"priceTypeName"
:
"件"
,
"priceDesc"
:
"海淀区内资一般人"
,
"serviceItemCode"
:
null
,
"serviceItemCode"
:
null
,
"picUrl"
:
null
,
"picUrl"
:
null
,
"created_at"
:
""
"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