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
3e7d9833
Commit
3e7d9833
authored
Nov 03, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel
parents
fd0f3869
85aee723
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
308 additions
and
124 deletions
+308
-124
center-channel/app/base/api/impl/icp/consultation.js
+117
-8
center-channel/app/base/api/impl/icp/feedback.js
+9
-8
center-channel/app/base/api/impl/icp/order.js
+16
-8
center-channel/app/base/api/impl/nmaction/name.js
+1
-1
center-channel/app/base/api/web.base.js
+9
-4
center-channel/app/base/service/impl/common/signSve.js
+24
-9
center-channel/app/base/service/impl/utilsSve/utils360Sve.js
+41
-59
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
+11
-11
center-channel/app/base/service/impl/utilsSve/utilsDeliverSystemSve.js
+5
-0
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
+5
-3
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+0
-0
center-channel/app/base/utils/execClientNew.js
+1
-0
center-channel/app/config/environment.js
+2
-2
center-channel/app/config/routes/api.js
+9
-6
center-channel/app/config/settings.js
+3
-3
center-channel/app/front/entry/public/apidoc/README.md
+4
-2
center-channel/app/front/entry/public/apidoc/platform/baiduIcp.md
+51
-0
No files found.
center-channel/app/base/api/impl/icp/consultation.js
View file @
3e7d9833
...
@@ -19,19 +19,20 @@ class Consultation extends APIBase {
...
@@ -19,19 +19,20 @@ class Consultation extends APIBase {
}
}
getResultSuccess
(
requestId
)
{
getResultSuccess
(
requestId
)
{
return
{
return
{
"
requestId"
:
requestId
,
"
status"
:
0
,
"
success"
:
true
,
"
msg"
:
"success"
,
"
errorMsg"
:
""
,
"
data"
:
null
,
"
errorCode"
:
"ok"
"
requestId"
:
requestId
}
}
;
}
}
getResultFail
(
errmsg
)
{
getResultFail
(
errmsg
)
{
var
self
=
this
;
var
self
=
this
;
return
{
return
{
"status"
:
-
1
,
"msg"
:
errmsg
,
"requestId"
:
self
.
getUUID
(),
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"data"
:
null
,
"errorMsg"
:
errmsg
,
"bizmsg"
:
"empty"
"errorCode"
:
"ok"
};
};
}
}
...
@@ -50,6 +51,12 @@ class Consultation extends APIBase {
...
@@ -50,6 +51,12 @@ class Consultation extends APIBase {
if
(
!
pobj
.
consultType
)
{
if
(
!
pobj
.
consultType
)
{
return
self
.
getResultFail
(
"consultType不能为空"
);
return
self
.
getResultFail
(
"consultType不能为空"
);
}
}
if
(
pobj
.
consultType
==
"ICP"
)
{
pobj
.
consultType
=
"5"
;
}
if
(
pobj
.
consultType
==
"EDI"
)
{
pobj
.
consultType
=
"7"
;
}
pobj
.
type
=
pobj
.
consultType
;
pobj
.
type
=
pobj
.
consultType
;
pobj
.
mobile
=
pobj
.
phone
;
pobj
.
mobile
=
pobj
.
phone
;
pobj
.
action_type
=
"submitIcpNeed"
;
pobj
.
action_type
=
"submitIcpNeed"
;
...
@@ -157,6 +164,108 @@ class Consultation extends APIBase {
...
@@ -157,6 +164,108 @@ class Consultation extends APIBase {
case
"34"
:
case
"34"
:
pobj
.
area
=
"海南"
;
pobj
.
area
=
"海南"
;
break
;
break
;
case
"BEIJING"
:
pobj
.
area
=
"北京"
;
break
;
case
"SHANGHAI"
:
pobj
.
area
=
"上海"
;
break
;
case
"FUJIAN"
:
pobj
.
area
=
"福建"
;
break
;
case
"GUANGXI"
:
pobj
.
area
=
"广西"
;
break
;
case
"GUANGDONG"
:
pobj
.
area
=
"广东"
;
break
;
case
"ANHUI"
:
pobj
.
area
=
"安徽"
;
break
;
case
"HENAN"
:
pobj
.
area
=
"河南"
;
break
;
case
"HUBEI"
:
pobj
.
area
=
"湖北"
;
break
;
case
"ZHEJIANG"
:
pobj
.
area
=
"浙江"
;
break
;
case
"JIANGSU"
:
pobj
.
area
=
"江苏"
;
break
;
case
"SHANDONG"
:
pobj
.
area
=
"山东"
;
break
;
case
"SHANGXI_SHAN"
:
pobj
.
area
=
"陕西"
;
break
;
case
"NINGXIA"
:
pobj
.
area
=
"宁夏"
;
break
;
case
"GANSU"
:
pobj
.
area
=
"甘肃"
;
break
;
case
"XINJIANG"
:
pobj
.
area
=
"新疆"
;
break
;
case
"QINGHAI"
:
pobj
.
area
=
"青海"
;
break
;
case
"TIANJIN"
:
pobj
.
area
=
"天津"
;
break
;
case
"CHONGQING"
:
pobj
.
area
=
"重庆"
;
break
;
case
"HEBEI"
:
pobj
.
area
=
"河北"
;
break
;
case
"SHANXI_JIN"
:
pobj
.
area
=
"山西"
;
break
;
case
"LIAONING"
:
pobj
.
area
=
"辽宁"
;
break
;
case
"JINLIN"
:
pobj
.
area
=
"吉林"
;
break
;
case
"HEILONGJIANG"
:
pobj
.
area
=
"黑龙江"
;
break
;
case
"JIANGXI"
:
pobj
.
area
=
"江西"
;
break
;
case
"HUNAN"
:
pobj
.
area
=
"湖南"
;
break
;
case
"SICHUAN"
:
pobj
.
area
=
"四川"
;
break
;
case
"GUIZHOU"
:
pobj
.
area
=
"贵州"
;
break
;
case
"YUNNAN"
:
pobj
.
area
=
"云南"
;
break
;
case
"NEIMENGGU"
:
pobj
.
area
=
"内蒙古"
;
break
;
case
"XIZANG"
:
pobj
.
area
=
"西藏"
;
break
;
case
"HANWAIZI"
:
pobj
.
area
=
"含外资"
;
break
;
case
"QUANWAIZI"
:
pobj
.
area
=
"全外资"
;
break
;
case
"XIANGGANG"
:
pobj
.
area
=
"香港"
;
break
;
case
"HAINAN"
:
pobj
.
area
=
"海南"
;
break
;
default
:
default
:
pobj
.
area
=
""
;
pobj
.
area
=
""
;
break
;
break
;
...
...
center-channel/app/base/api/impl/icp/feedback.js
View file @
3e7d9833
...
@@ -19,19 +19,20 @@ class Feedback extends APIBase {
...
@@ -19,19 +19,20 @@ class Feedback extends APIBase {
}
}
getResultSuccess
(
requestId
)
{
getResultSuccess
(
requestId
)
{
return
{
return
{
"
requestId"
:
requestId
,
"
status"
:
0
,
"
success"
:
true
,
"
msg"
:
"success"
,
"
errorMsg"
:
""
,
"
data"
:
null
,
"
errorCode"
:
"ok"
"
requestId"
:
requestId
}
}
;
}
}
getResultFail
(
errmsg
)
{
getResultFail
(
errmsg
)
{
var
self
=
this
;
var
self
=
this
;
return
{
return
{
"status"
:
-
1
,
"msg"
:
errmsg
,
"requestId"
:
self
.
getUUID
(),
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"data"
:
null
,
"errorMsg"
:
errmsg
,
"bizmsg"
:
"empty"
"errorCode"
:
"ok"
};
};
}
}
...
...
center-channel/app/base/api/impl/icp/order.js
View file @
3e7d9833
...
@@ -19,19 +19,20 @@ class Order extends APIBase {
...
@@ -19,19 +19,20 @@ class Order extends APIBase {
}
}
getResultSuccess
(
requestId
)
{
getResultSuccess
(
requestId
)
{
return
{
return
{
"
requestId"
:
requestId
,
"
status"
:
0
,
"
success"
:
true
,
"
msg"
:
"success"
,
"
errorMsg"
:
""
,
"
data"
:
null
,
"
errorCode"
:
"ok"
"
requestId"
:
requestId
}
}
;
}
}
getResultFail
(
errmsg
)
{
getResultFail
(
errmsg
)
{
var
self
=
this
;
var
self
=
this
;
return
{
return
{
"status"
:
-
1
,
"msg"
:
errmsg
,
"requestId"
:
self
.
getUUID
(),
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"data"
:
null
,
"errorMsg"
:
errmsg
,
"bizmsg"
:
"empty"
"errorCode"
:
"ok"
};
};
}
}
...
@@ -57,6 +58,13 @@ class Order extends APIBase {
...
@@ -57,6 +58,13 @@ class Order extends APIBase {
}
}
if
(
pobj
.
isDirectBuy
==
1
&&
!
pobj
.
consultType
)
{
if
(
pobj
.
isDirectBuy
==
1
&&
!
pobj
.
consultType
)
{
return
self
.
getResultFail
(
"直接下单consultType不能为空"
);
return
self
.
getResultFail
(
"直接下单consultType不能为空"
);
}
else
{
if
(
pobj
.
consultType
==
"ICP"
)
{
pobj
.
consultType
=
"5"
;
}
if
(
pobj
.
consultType
==
"EDI"
)
{
pobj
.
consultType
=
"7"
;
}
}
}
pobj
.
action_type
=
"icpOrderStatus"
;
pobj
.
action_type
=
"icpOrderStatus"
;
var
param
=
{
var
param
=
{
...
...
center-channel/app/base/api/impl/nmaction/name.js
View file @
3e7d9833
...
@@ -141,7 +141,7 @@ class NameAPI extends WEBBase {
...
@@ -141,7 +141,7 @@ class NameAPI extends WEBBase {
if
(
result
.
status
!=
0
)
{
if
(
result
.
status
!=
0
)
{
return
result
;
return
result
;
}
}
const
tmpData
=
result
.
data
?
result
.
data
.
companyName
:
[];
const
tmpData
=
result
.
data
?
result
.
data
.
companyName
?
result
.
data
.
companyName
:
result
.
data
:
[];
return
system
.
getResultSuccess
(
tmpData
);
return
system
.
getResultSuccess
(
tmpData
);
}
}
}
}
...
...
center-channel/app/base/api/web.base.js
View file @
3e7d9833
...
@@ -4,6 +4,7 @@ const uuidv4 = require('uuid/v4');
...
@@ -4,6 +4,7 @@ const uuidv4 = require('uuid/v4');
const
md5
=
require
(
"MD5"
);
const
md5
=
require
(
"MD5"
);
class
WEBBase
{
class
WEBBase
{
constructor
()
{
constructor
()
{
this
.
execClientNew
=
system
.
getObject
(
"util.execClientNew"
);
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
execClientNew
=
system
.
getObject
(
"util.execClientNew"
);
this
.
execClientNew
=
system
.
getObject
(
"util.execClientNew"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
...
@@ -21,20 +22,24 @@ class WEBBase {
...
@@ -21,20 +22,24 @@ class WEBBase {
async
doexecMethod
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
async
doexecMethod
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
req
.
requestId
=
this
.
getUUID
();
req
.
requestId
=
this
.
getUUID
();
try
{
try
{
var
rtn
=
await
this
[
methodname
](
pobj
,
query
,
req
);
var
result
=
await
this
[
methodname
](
pobj
,
query
,
req
);
if
(
!
result
.
requestId
)
{
result
.
requestId
=
pobj
.
RequestId
?
pobj
.
RequestId
:
pobj
.
requestId
||
req
.
requestId
;
}
this
.
logCtl
.
createDb
({
this
.
logCtl
.
createDb
({
appid
:
req
.
app
.
id
,
appid
:
req
.
app
.
id
,
appkey
:
req
.
app
.
uappKey
,
appkey
:
req
.
app
.
uappKey
,
requestId
:
req
.
requestId
,
requestId
:
req
.
requestId
,
op
:
req
.
classname
+
"/"
+
methodname
,
op
:
req
.
classname
+
"/"
+
methodname
,
content
:
JSON
.
stringify
(
pobj
),
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
r
tn
),
resultInfo
:
JSON
.
stringify
(
r
esult
),
clientIp
:
req
.
clientIp
,
clientIp
:
req
.
clientIp
,
agent
:
req
.
uagent
,
agent
:
req
.
uagent
,
opTitle
:
"api服务提供方appKey:"
+
settings
.
appKey
,
opTitle
:
"api服务提供方appKey:"
+
settings
.
appKey
,
});
});
rtn
.
requestId
=
req
.
requestId
;
var
tmpResult
=
pobj
.
actionType
&&
pobj
.
actionType
.
indexOf
(
"List"
)
<
0
?
result
:
{
status
:
result
.
status
,
message
:
result
.
message
,
requestId
:
result
.
requestId
};
return
rtn
;
this
.
execClientNew
.
execLogs
(
"reqPath:"
+
req
.
path
,
pobj
,
"center-channel-doexecMethod-web"
,
tmpResult
,
null
);
return
result
;
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
.
stack
,
"api调用出现异常,请联系管理员.........."
)
console
.
log
(
e
.
stack
,
"api调用出现异常,请联系管理员.........."
)
this
.
logCtl
.
createDb
({
this
.
logCtl
.
createDb
({
...
...
center-channel/app/base/service/impl/common/signSve.js
View file @
3e7d9833
...
@@ -5,6 +5,7 @@ class SignService{
...
@@ -5,6 +5,7 @@ class SignService{
constructor
()
{
constructor
()
{
this
.
centerAppUrl
=
settings
.
centerAppUrl
();
this
.
centerAppUrl
=
settings
.
centerAppUrl
();
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
}
}
async
restPostUrl
(
pobj
,
url
)
{
async
restPostUrl
(
pobj
,
url
)
{
try
{
try
{
...
@@ -20,9 +21,23 @@ class SignService{
...
@@ -20,9 +21,23 @@ class SignService{
}
}
}
}
async
getAppInfoByAppKey
(
appkey
){
async
getAppInfoByAppKey
(
appkey
){
let
url
=
this
.
centerAppUrl
+
'payment/paymentApi/getAppInfoByAppKey'
;
try
{
let
appInfoRt
=
await
this
.
restPostUrl
({
appKey
:
appkey
},
url
);
var
shaStr
=
"getAppInfoByAppKey_"
+
appkey
;
return
appInfoRt
;
var
cacheRes
=
await
this
.
redisClient
.
get
(
shaStr
);
if
(
cacheRes
)
{
return
JSON
.
parse
(
cacheRes
);
}
let
url
=
this
.
centerAppUrl
+
'payment/paymentApi/getAppInfoByAppKey'
;
let
appInfoRt
=
await
this
.
restPostUrl
({
appKey
:
appkey
},
url
);
if
(
appInfoRt
&&
appInfoRt
.
status
==
0
){
//保存缓存
await
this
.
redisClient
.
setWithEx
(
shaStr
,
JSON
.
stringify
(
appInfoRt
),
3600
);
}
return
appInfoRt
;
}
catch
(
error
)
{
var
errres
=
system
.
getResultFail
(
"获取应用信息失败!"
);
return
errres
;
}
}
}
/**
/**
* 验证签名
* 验证签名
...
@@ -88,12 +103,12 @@ class SignService{
...
@@ -88,12 +103,12 @@ class SignService{
module
.
exports
=
SignService
;
module
.
exports
=
SignService
;
// var task = new SignService();
// var task = new SignService();
// var obj = {
// var obj = {
//
"intentionBizId": "zhuangbingceshi008
",
//
"intentionBizId": "TRE-nmnHtEoTjeEtest
",
//
"phone": "13075556693
",
//
"phone": "13126673246
",
//
"userName": "庄冰
",
//
"userName": "
",
//
"description": "1111111111111222
",
//
"description": "111111
",
//
"area": "1
",
//
"area": "BEIJING
",
//
"consultType": 5
//
"consultType": "EDI"
// };
// };
// task.createSign(obj,"7cbb892450174167b5c7e01we4716t51").then(d=>{
// task.createSign(obj,"7cbb892450174167b5c7e01we4716t51").then(d=>{
// console.log(d,"!!!!!!!!!!!!!!!!!!!!!!!!!!");
// console.log(d,"!!!!!!!!!!!!!!!!!!!!!!!!!!");
...
...
center-channel/app/base/service/impl/utilsSve/utils360Sve.js
View file @
3e7d9833
...
@@ -13,63 +13,45 @@ class utils360Sve extends AppServiceBase {
...
@@ -13,63 +13,45 @@ class utils360Sve extends AppServiceBase {
}
}
//组合参数,由前端传到360
//组合参数,由前端传到360
async
getParamsFor360
(
pobj
,
actionBody
)
{
async
getParamsFor360
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100110"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100110"
);
}
}
let
seaUrl
=
this
.
centerOrderUrl
+
'opaction/opPayOrder/getOrderListByOrderServiceNo'
;
pobj
.
actionType
=
"getPayOrderInfo"
;
let
seaRet
=
await
this
.
restPostUrl
(
pobj
,
seaUrl
);
let
orderUrl
=
settings
.
centerOrderUrl
()
+
"action/order/springBoard"
;
if
(
seaRet
.
status
!=
0
)
{
let
orderResult
=
await
this
.
restPostUrl
(
pobj
,
orderUrl
);
return
system
.
getResultFail
(
-
1
,
'获取订单信息失败'
)
if
(
orderResult
.
status
!=
0
)
{
}
return
orderResult
;
let
totalSum
=
0
;
}
let
sku_id
=
''
;
pobj
.
actionType
=
"getOrderDeliveryInfo"
;
let
amount
=
0
;
var
deliveryResult
=
await
this
.
restPostUrl
(
pobj
,
orderUrl
);
let
consignee
=
""
;
if
(
deliveryResult
.
status
!=
0
)
{
let
mobile
=
""
;
return
deliveryResult
;
let
email
=
""
;
for
(
let
i
=
0
;
i
<
seaRet
.
data
.
length
;
i
++
)
{
let
item
=
seaRet
.
data
[
i
];
if
(
!
mobile
){
pobj
.
actionType
.
orderNo
=
item
.
orderNo
;
pobj
.
actionType
=
"getOrderDeliveryInfo"
;
let
deliveryResult
=
await
this
.
restPostUrl
(
pobj
,
orderUrl
);
consignee
=
deliveryResult
.
data
.
orderContact
.
contactName
;
mobile
=
deliveryResult
.
data
.
orderContact
.
mobile
;
email
=
deliveryResult
.
data
.
orderContact
.
email
}
sku_id
=
item
.
itemCode
;
totalSum
+=
Number
(
item
.
totalSum
);
amount
+=
Number
(
item
.
payTotalSum
);
}
// let sku_id = orderResult.data.orderProduct.itemCode;
// let price = Number(orderResult.data.orderProduct.price)*100;
let
price
=
totalSum
*
100
;
// let quantity = seaRet.data.length;
// let amount = Number(orderResult.data.receiptVoucher.totalSum)*100;
amount
=
amount
*
100
;
let
order_id
=
pobj
.
actionBody
.
orderNo
;
// let consignee = deliveryResult.data.orderContact.contactName;
// let mobile = deliveryResult.data.orderContact.mobile;
// let email = deliveryResult.data.orderContact.email;
let
singStr
=
sku_id
+
price
+
order_id
+
pobj
.
appInfo
.
uapp_secret
;
let
sign
=
md5
(
singStr
).
toUpperCase
();
// 推送参数
let
result
=
{
sku_id
:
sku_id
,
price
:
price
,
quantity
:
seaRet
.
data
.
length
,
amount
:
amount
,
order_id
:
order_id
,
consignee
:
consignee
,
mobile
:
mobile
,
email
:
email
,
sign
:
sign
}
return
system
.
getResult
(
result
);
}
}
let
sku_id
=
orderResult
.
data
.
orderProduct
.
itemCode
;
let
price
=
Number
(
orderResult
.
data
.
orderProduct
.
price
)
*
100
;
let
quantity
=
orderResult
.
data
.
orderProduct
.
quantity
;
let
amount
=
Number
(
orderResult
.
data
.
receiptVoucher
.
totalSum
)
*
100
;
let
order_id
=
orderResult
.
data
.
receiptVoucher
.
sourceOrderNo
;
let
consignee
=
deliveryResult
.
data
.
orderContact
.
contactName
;
let
mobile
=
deliveryResult
.
data
.
orderContact
.
mobile
;
let
email
=
deliveryResult
.
data
.
orderContact
.
email
;
let
singStr
=
sku_id
+
quantity
+
price
+
amount
+
order_id
+
pobj
.
appInfo
.
uapp_secret
;
let
sign
=
md5
(
singStr
).
toUpperCase
();
let
result
=
{
sku_id
,
price
,
quantity
,
amount
,
order_id
,
consignee
,
mobile
,
email
,
sign
}
return
system
.
getResult
(
result
);
}
//更新订单状态到360
//更新订单状态到360
async
pushOrderStatus
(
pobj
)
{
async
pushOrderStatus
(
pobj
)
{
...
@@ -93,7 +75,7 @@ class utils360Sve extends AppServiceBase {
...
@@ -93,7 +75,7 @@ class utils360Sve extends AppServiceBase {
order_id
,
status
order_id
,
status
}
}
let
result
=
await
this
.
restPostUrl
(
pushObj
,
url
);
let
result
=
await
this
.
restPostUrl
(
pushObj
,
url
);
if
(
result
.
code
==
200
)
{
if
(
result
.
code
==
200
)
{
this
.
pushlogSve
.
createDb
({
this
.
pushlogSve
.
createDb
({
op
:
"360-pushOrderStatus"
,
op
:
"360-pushOrderStatus"
,
content
:
JSON
.
stringify
(
pushObj
),
//推送的参数信息
content
:
JSON
.
stringify
(
pushObj
),
//推送的参数信息
...
@@ -102,7 +84,7 @@ class utils360Sve extends AppServiceBase {
...
@@ -102,7 +84,7 @@ class utils360Sve extends AppServiceBase {
logLevel
:
'1'
,
logLevel
:
'1'
,
opTitle
:
"推送360信息返回成功"
opTitle
:
"推送360信息返回成功"
});
});
}
else
{
}
else
{
this
.
logCtl
.
error
({
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
...
@@ -113,7 +95,7 @@ class utils360Sve extends AppServiceBase {
...
@@ -113,7 +95,7 @@ class utils360Sve extends AppServiceBase {
optitle
:
pobj
.
opType
+
"推送操作异常status->pushOrderStatus"
,
optitle
:
pobj
.
opType
+
"推送操作异常status->pushOrderStatus"
,
});
});
}
}
console
.
log
(
result
,
'-------------push360-----------------'
)
console
.
log
(
result
,
'-------------push360-----------------'
)
return
result
;
return
result
;
}
catch
(
e
)
{
}
catch
(
e
)
{
this
.
logCtl
.
error
({
this
.
logCtl
.
error
({
...
...
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
View file @
3e7d9833
...
@@ -268,19 +268,19 @@ class UtilsAuthService extends AppServiceBase {
...
@@ -268,19 +268,19 @@ class UtilsAuthService extends AppServiceBase {
let
result
=
await
this
.
get360Token
();
let
result
=
await
this
.
get360Token
();
let
token
=
result
.
access_token
;
let
token
=
result
.
access_token
;
//360验证接口
//360验证接口
//
let subData = "pin=" + pin + "&token=" + token;
let
subData
=
"pin="
+
pin
+
"&token="
+
token
;
//
let url = settings.requestUrl360() + 'api/v1/VerifyPin';
let
url
=
settings
.
requestUrl360
()
+
'api/v1/VerifyPin'
;
//
let rtn = await this.restClient.execGet(subData,url);
let
rtn
=
await
this
.
restClient
.
execGet
(
subData
,
url
);
//
if (!rtn || !rtn.stdout) {
if
(
!
rtn
||
!
rtn
.
stdout
)
{
//
return system.getResult(null, "restGet data is empty");
return
system
.
getResult
(
null
,
"restGet data is empty"
);
//
}
}
//
let checkRet = JSON.parse(rtn.stdout);
let
checkRet
=
JSON
.
parse
(
rtn
.
stdout
);
//
if(checkRet.code != 200){
if
(
checkRet
.
code
!=
200
){
//
return system.getResultFail(-1,checkRet.msg)
return
system
.
getResultFail
(
-
1
,
checkRet
.
msg
)
//
}
}
//---渠道用户登录,有则返回userpin ,没有则注册用户并返回userpin
//---渠道用户登录,有则返回userpin ,没有则注册用户并返回userpin
actionBody
.
channelUserId
=
pin
;
actionBody
.
channelUserId
=
pin
;
opResult
=
await
this
.
getLoginByUserName
(
pobj
,
actionBody
);
opResult
=
await
this
.
getLoginByUserName
(
req
,
pobj
,
actionBody
);
return
opResult
;
return
opResult
;
}
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsDeliverSystemSve.js
View file @
3e7d9833
...
@@ -19,6 +19,11 @@ class UtilsDeliverSystemService extends AppServiceBase {
...
@@ -19,6 +19,11 @@ class UtilsDeliverSystemService extends AppServiceBase {
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"deliver->pushBusiness2DeliverSystem->verifyResult"
,
this
.
pushlogFailType
.
FQ
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"deliver->pushBusiness2DeliverSystem->verifyResult"
,
this
.
pushlogFailType
.
FQ
);
}
}
var
interface_params_info
=
verifyResult
.
data
;
var
interface_params_info
=
verifyResult
.
data
;
if
(
interface_params_info
.
headData
){
if
(
pobj
&&
pobj
.
appInfo
&&
pobj
.
appInfo
.
app_code
){
interface_params_info
.
headData
.
appcode
=
pobj
.
appInfo
.
app_code
;
}
}
var
reqParams
=
{
var
reqParams
=
{
actionType
:
"produceData"
,
// Y 功能名称
actionType
:
"produceData"
,
// Y 功能名称
actionBody
:
{
actionBody
:
{
...
...
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
View file @
3e7d9833
...
@@ -27,8 +27,10 @@ class UtilsFqAliyunService extends AppServiceBase {
...
@@ -27,8 +27,10 @@ class UtilsFqAliyunService extends AppServiceBase {
if
(
!
productInfo
||
!
productInfo
.
service_business_code
)
{
if
(
!
productInfo
||
!
productInfo
.
service_business_code
)
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.service_business_code can not be empty,100427"
);
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.service_business_code can not be empty,100427"
);
}
}
if
(
!
productInfo
||
!
productInfo
.
price_item
||
!
productInfo
.
price_item
.
service_code
)
{
if
(
!
[
'360.icp'
,
'360.edi'
].
includes
(
productInfo
.
service_business_code
))
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.price_item.service_code can not be empty,100430"
);
if
(
!
productInfo
||
!
productInfo
.
price_item
||
!
productInfo
.
price_item
.
service_code
)
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.price_item.service_code can not be empty,100430"
);
}
}
}
if
(
verifyResult
.
status
!=
0
)
{
if
(
verifyResult
.
status
!=
0
)
{
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"fq->pushOrderBusinessByProductCode2Fq->verifyResult"
,
this
.
pushlogFailType
.
FQ
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"fq->pushOrderBusinessByProductCode2Fq->verifyResult"
,
this
.
pushlogFailType
.
FQ
);
...
@@ -41,7 +43,7 @@ class UtilsFqAliyunService extends AppServiceBase {
...
@@ -41,7 +43,7 @@ class UtilsFqAliyunService extends AppServiceBase {
idempotentId
:
orderInfo
.
orderNo
,
// 是 业务 ID
idempotentId
:
orderInfo
.
orderNo
,
// 是 业务 ID
idempotentSource
:
productInfo
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
idempotentSource
:
productInfo
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
idempotentSourceName
:
productInfo
.
service_business_name
||
productInfo
.
service_business_code
,
// 是 京东云应用、阿里云应用
idempotentSourceName
:
productInfo
.
service_business_name
||
productInfo
.
service_business_code
,
// 是 京东云应用、阿里云应用
city
:
""
,
// 否 所属城市
area
:
productInfo
.
price_item
.
price_desc
,
// 否 所属城市
phone
:
orderContact
.
mobile
,
// 是 手机号
phone
:
orderContact
.
mobile
,
// 是 手机号
userId
:
orderInfo
.
channelUserId
,
// 否 用户 ID
userId
:
orderInfo
.
channelUserId
,
// 否 用户 ID
companyName
:
""
,
// 否 公司名称
companyName
:
""
,
// 否 公司名称
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
3e7d9833
This diff is collapsed.
Click to expand it.
center-channel/app/base/utils/execClientNew.js
View file @
3e7d9833
...
@@ -92,6 +92,7 @@ class ExecClientNew {
...
@@ -92,6 +92,7 @@ class ExecClientNew {
this
.
execLogs
(
execFile
+
"执行execPostTimeOutByBusiness,errorInfo信息为请求的返回结果"
,
params
,
params
.
identifyCode
,
reqResult
,
rtn
);
this
.
execLogs
(
execFile
+
"执行execPostTimeOutByBusiness,errorInfo信息为请求的返回结果"
,
params
,
params
.
identifyCode
,
reqResult
,
rtn
);
return
reqResult
;
return
reqResult
;
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
"执行execPostByTimeOut存在异常"
,
error
.
stack
);
reqResult
=
system
.
getResultFail
(
-
200
,
execFile
+
"执行execPostByTimeOut存在异常"
);
reqResult
=
system
.
getResultFail
(
-
200
,
execFile
+
"执行execPostByTimeOut存在异常"
);
reqResult
.
requestId
=
requestId
||
uuid
.
v1
();
reqResult
.
requestId
=
requestId
||
uuid
.
v1
();
this
.
execLogs
(
execFile
+
"执行execPostByTimeOut存在异常"
,
params
,
params
.
identifyCode
,
reqResult
,
error
.
stack
);
this
.
execLogs
(
execFile
+
"执行execPostByTimeOut存在异常"
,
params
,
params
.
identifyCode
,
reqResult
,
error
.
stack
);
...
...
center-channel/app/config/environment.js
View file @
3e7d9833
...
@@ -27,10 +27,10 @@ module.exports = function (app) {
...
@@ -27,10 +27,10 @@ module.exports = function (app) {
app
.
all
(
'*'
,
function
(
req
,
res
,
next
)
{
app
.
all
(
'*'
,
function
(
req
,
res
,
next
)
{
req
.
objs
=
system
;
req
.
objs
=
system
;
res
.
header
(
'Access-Control-Allow-Origin'
,
'*'
);
res
.
header
(
'Access-Control-Allow-Origin'
,
'*'
);
res
.
header
(
'Access-Control-Allow-Headers'
,
'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild,Authorization,XAPPKEY,XFROMAPPKEY,XFROMCOMPANYKEY,XREGROLE,XBIZPATH,token'
);
res
.
header
(
'Access-Control-Allow-Headers'
,
'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild,Authorization,XAPPKEY,XFROMAPPKEY,XFROMCOMPANYKEY,XREGROLE,XBIZPATH,token
,userpin
'
);
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'
);
res
.
header
(
'content-type'
,
'
application/json
;charset=UTF-8'
);
if
(
req
.
method
==
'OPTIONS'
)
{
if
(
req
.
method
==
'OPTIONS'
)
{
res
.
send
(
200
);
//让options请求快速返回/
res
.
send
(
200
);
//让options请求快速返回/
}
}
...
...
center-channel/app/config/routes/api.js
View file @
3e7d9833
...
@@ -205,12 +205,7 @@ module.exports = function (app) {
...
@@ -205,12 +205,7 @@ module.exports = function (app) {
try
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
let
result
=
{};
let
result
=
{};
const
orderNo
=
req
.
body
.
orderNo
;
result
=
await
utilsOrderSve
.
channelPayNotify
(
req
.
body
,
client_ip
);
if
(
orderNo
.
indexOf
(
'CN'
)
==
0
){
result
=
await
utilsOrderSve
.
channelOrdersPayNotify
(
req
.
body
,
client_ip
);
}
else
{
result
=
await
utilsOrderSve
.
channelPayNotify
(
req
.
body
,
client_ip
);
}
logCtl
.
info
({
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"渠道支付订单通知 api层"
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"渠道支付订单通知 api层"
,
op
:
"center-channel/orderNotify/channelPayNotify"
,
op
:
"center-channel/orderNotify/channelPayNotify"
,
...
@@ -415,6 +410,13 @@ module.exports = function (app) {
...
@@ -415,6 +410,13 @@ module.exports = function (app) {
res
.
end
(
JSON
.
stringify
(
result
));
res
.
end
(
JSON
.
stringify
(
result
));
return
;
return
;
}
}
var
sign
=
req
.
headers
[
"sign"
]
||
""
;
if
(
!
sign
)
{
result
.
msg
=
"req headers sign can not be empty"
;
result
.
data
=
null
;
res
.
end
(
JSON
.
stringify
(
result
));
return
;
}
//1.通过appkey 获取appInfo
//1.通过appkey 获取appInfo
var
appRes
=
await
signSve
.
getAppInfoByAppKey
(
appkey
);
var
appRes
=
await
signSve
.
getAppInfoByAppKey
(
appkey
);
if
(
!
appRes
||
appRes
.
status
!=
0
){
if
(
!
appRes
||
appRes
.
status
!=
0
){
...
@@ -425,6 +427,7 @@ module.exports = function (app) {
...
@@ -425,6 +427,7 @@ module.exports = function (app) {
}
}
var
appInfo
=
appRes
.
data
;
var
appInfo
=
appRes
.
data
;
//2.通过appsecret 验签
//2.通过appsecret 验签
req
.
body
.
sign
=
sign
;
var
signParams
=
req
.
body
;
var
signParams
=
req
.
body
;
var
verifyRes
=
await
signSve
.
verifySign
(
req
.
body
,
appInfo
.
uapp_secret
);
var
verifyRes
=
await
signSve
.
verifySign
(
req
.
body
,
appInfo
.
uapp_secret
);
if
(
verifyRes
&&
verifyRes
.
status
==
0
){
if
(
verifyRes
&&
verifyRes
.
status
==
0
){
...
...
center-channel/app/config/settings.js
View file @
3e7d9833
...
@@ -150,7 +150,7 @@ var settings = {
...
@@ -150,7 +150,7 @@ var settings = {
},
},
centerChannelUrl
:
function
()
{
centerChannelUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
return
"http://
60.205.209.94
:4012/"
return
"http://
localhost
:4012/"
}
else
{
}
else
{
// return "channel的正式环境" 6.30修改目前只用作生成alipay/wx的通知回调地址
// return "channel的正式环境" 6.30修改目前只用作生成alipay/wx的通知回调地址
return
"http://youke.qifu.gongsibao.com/"
return
"http://youke.qifu.gongsibao.com/"
...
@@ -239,14 +239,14 @@ var settings = {
...
@@ -239,14 +239,14 @@ var settings = {
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
return
"https://oauth2.e.360.cn/site/token"
// 360测试环境
return
"https://oauth2.e.360.cn/site/token"
// 360测试环境
}
else
{
}
else
{
return
""
//
return
"
https://oauth2.e.360.cn/site/token
"
//
}
}
},
},
requestUrl360
:
function
()
{
requestUrl360
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
return
"http://180.163.239.98:38085/"
// 360测试环境
return
"http://180.163.239.98:38085/"
// 360测试环境
}
else
{
}
else
{
return
""
//
return
"
http://180.163.239.98:38085/
"
//
}
}
},
},
aliUappId
:
function
()
{
aliUappId
:
function
()
{
...
...
center-channel/app/front/entry/public/apidoc/README.md
View file @
3e7d9833
...
@@ -67,4 +67,6 @@
...
@@ -67,4 +67,6 @@
1
[
需求相关接口
](
doc/api/platform/opNeed.md
)
1
[
需求相关接口
](
doc/api/platform/opNeed.md
)
## 21. 诊断运营端相关接口
## 21. 诊断运营端相关接口
1
[
诊断运营端相关接口
](
doc/api/appDesc/diagnosisneedbusDesc.md
)
1
[
诊断运营端相关接口
](
doc/api/appDesc/diagnosisneedbusDesc.md
)
\ No newline at end of file
## 22. 百度ICP对接相关接口
1
[
ICP订单接口
](
doc/api/platform/baiduIcp.md
)
\ No newline at end of file
center-channel/app/front/entry/public/apidoc/platform/baiduIcp.md
0 → 100644
View file @
3e7d9833
<a
name=
"menu"
href=
"/doc"
>
返回主目录
</a>
1.
[
接口调用说明
](
#interfaceDesc
)
1.
[
同步需求给服务商
](
#consultationsubmit
)
## **<a name="interfaceDesc"> 接口调用说明</a>**
[
返回到目录
](
#menu
)
##### 接口描述
统一的接口调用,调用其他接口参考此示例
#### sign签名规则
所有请求参数(去除sign参数)首字符进行ASCII正序排序,对排序后的参数值进行签名,如:area=1&consultType=5&description=需求测试_001&intentionBizIdI=20200320201737000001&phone=13800138000&userName=李四
其中参数值拼接后最后在加上key,key为获取的密钥信息,拼接后字符串:
area=1&consultType=5&description=需求测试_001&intentionBizIdI=20200320201737000001&phone=13800138000&userName=李四&key=7cbb892450174167b5c7e01we4716t51
之后对拼接的字符串进行md5加密就得到sign值
## **<a name="consultationsubmit"> 同步需求给服务商</a>**
[
返回到目录
](
#menu
)
##### 接⼝描述
合作方⽤户提交服务咨询后(需求订单),调⽤服务商接⼝提交服务咨询信息
##### URL
[
/api/icp/consultation/submit
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加appkey的值
#### 请求参数
#### 参数示例
```
javascript
{
"intentionBizId"
:
"zhuangbingceshi008"
,
"phone"
:
"13075556693"
,
"userName"
:
"庄冰"
,
"description"
:
"1111111111111222"
,
"area"
:
"1"
,
"consultType"
:
5
,
"sign"
:
"2713C75F75B0713E525EEB39BB7D5BD3"
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
// 0为成功,否则失败
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
"a277fb799d9f4dda9053fb8830f9d252"
}
```
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