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
89c61ad4
Commit
89c61ad4
authored
Nov 07, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel
parents
00bcf60e
0bb7b291
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
148 additions
and
178 deletions
+148
-178
center-channel/app/base/api/impl/action/qcapi.js
+21
-21
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
+71
-47
center-channel/app/base/service/impl/common/qcCenterOrderSve.js
+0
-0
center-channel/app/base/service/impl/common/signSve.js
+26
-0
center-channel/app/base/service/impl/utilsSve/utilsNeedSve2.js
+16
-16
center-channel/app/base/service/impl/utilsSve/utilsPushSve.js
+9
-6
center-channel/app/base/service/impl/utilsSve/utilsServiceSve.js
+1
-1
center-channel/app/base/utils/baiduClient.js
+3
-86
center-channel/app/config/businessConfig.js
+1
-1
No files found.
center-channel/app/base/api/impl/action/qcapi.js
View file @
89c61ad4
...
...
@@ -4,7 +4,7 @@ var settings = require("../../../../config/settings");
class
QcAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
centero
rderSve
=
system
.
getObject
(
"service.common.qcCenterOrderSve"
);
this
.
qcCenterO
rderSve
=
system
.
getObject
(
"service.common.qcCenterOrderSve"
);
}
/**
* 接口跳转-POST请求
...
...
@@ -23,70 +23,70 @@ class QcAPI extends APIBase {
var
opResult
=
null
;
switch
(
action_type
)
{
case
"getNeedSolutionDetailByUser"
:
//获取方案详情
opResult
=
await
this
.
centero
rderSve
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
opResult
=
await
this
.
qcCenterO
rderSve
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
break
;
case
"submitIcpProgramme"
:
//icp方案提交
opResult
=
await
this
.
centero
rderSve
.
submitIcpProgramme
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
submitIcpProgramme
(
pobj
);
break
;
case
"receiveProgrammeNo"
:
//接收渠道方案号(测试)
opResult
=
await
this
.
centero
rderSve
.
reqCenterOrderApi
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
reqCenterOrderApi
(
pobj
);
break
;
// case "submitIcpMaterial"://icp材料提交
// opResult = await this.
centero
rderSve.submitIcpMaterial(pobj);
// opResult = await this.
qcCenterO
rderSve.submitIcpMaterial(pobj);
// break;
// case "acceptIcpPartnerNotification"://icp通知状态变更
// opResult = await this.
centero
rderSve.acceptIcpPartnerNotification(pobj);
// opResult = await this.
qcCenterO
rderSve.acceptIcpPartnerNotification(pobj);
// break;
case
"abolishIcpProgramme"
:
//服务商icp方案关闭
opResult
=
await
this
.
centero
rderSve
.
abolishIcpProgramme
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
abolishIcpProgramme
(
pobj
);
break
;
case
"getProgrammeInfoByChannelNeedNo"
:
//获取需求方案列表
opResult
=
await
this
.
centero
rderSve
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
opResult
=
await
this
.
qcCenterO
rderSve
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
break
;
case
"serviceProviderSubmitMaterial"
:
//交付商提交材料信息
opResult
=
await
this
.
centero
rderSve
.
serviceProviderSubmitMaterial
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
serviceProviderSubmitMaterial
(
pobj
);
break
;
case
"serviceProviderNotification"
:
//交付商通知状态变更
opResult
=
await
this
.
centero
rderSve
.
serviceProviderNotification
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
serviceProviderNotification
(
pobj
);
break
;
case
"closeOrderDelivery"
:
//交付商关闭交付单
opResult
=
await
this
.
centero
rderSve
.
closeOrderDelivery
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
closeOrderDelivery
(
pobj
);
break
;
// --------- 文网文 ---------
case
"serviceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
opResult
=
await
this
.
centero
rderSve
.
serviceSubmitOption
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
serviceSubmitOption
(
pobj
);
break
;
case
"submitWangwenSolution"
:
//提交方案(文网文)2020-9-26
opResult
=
await
this
.
centero
rderSve
.
submitWangwenSolution
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
submitWangwenSolution
(
pobj
);
break
;
case
"closeNeed"
:
//关闭需求(文网文)2020-9-28
opResult
=
await
this
.
centero
rderSve
.
closeNeed
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
closeNeed
(
pobj
);
break
;
case
"recordLog"
:
//提交沟通记录(文网文)2020-9-28
opResult
=
await
this
.
centero
rderSve
.
recordLog
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
recordLog
(
pobj
);
break
;
case
"recordLogList"
:
//查询沟通记录(文网文)2020-9-29
opResult
=
await
this
.
centero
rderSve
.
recordLogList
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
recordLogList
(
pobj
);
break
;
// --------- 食品 ---------
case
"foodServiceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
opResult
=
await
this
.
centero
rderSve
.
foodServiceSubmitOption
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
foodServiceSubmitOption
(
pobj
);
break
;
case
"submitFoodSolution"
:
//提交方案(文网文)2020-9-26
opResult
=
await
this
.
centero
rderSve
.
submitFoodSolution
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
submitFoodSolution
(
pobj
);
break
;
case
"foodCloseNeed"
:
//关闭需求(文网文)2020-9-28
opResult
=
await
this
.
centero
rderSve
.
foodCloseNeed
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
foodCloseNeed
(
pobj
);
break
;
case
"foodRecordLog"
:
//提交沟通记录(文网文)2020-9-28
opResult
=
await
this
.
centero
rderSve
.
foodRecordLog
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
foodRecordLog
(
pobj
);
break
;
case
"foodRecordLogList"
:
//查询沟通记录(文网文)2020-9-29
opResult
=
await
this
.
centero
rderSve
.
foodRecordLogList
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
foodRecordLogList
(
pobj
);
break
;
default
:
...
...
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
View file @
89c61ad4
...
...
@@ -17,42 +17,51 @@ const uappId = {
'ali'
:
"18"
,
//(阿里icp、edi)
'baidu'
:
"44"
//(百度icp、edi)
}
const
city
=
{
"1"
:
"北京"
,
"2"
:
"上海"
,
"3"
:
"福建"
,
"4"
:
"广西"
,
"5"
:
"广东"
,
"6"
:
"安徽"
,
"7"
:
"河南"
,
"8"
:
"湖北"
,
"9"
:
"浙江"
,
"10"
:
"江苏"
,
"11"
:
"山东"
,
"12"
:
"陕西"
,
"13"
:
"宁夏"
,
"14"
:
"甘肃"
,
"15"
:
"新疆"
,
"16"
:
"青海"
,
"17"
:
"天津"
,
"18"
:
"重庆"
,
"19"
:
"河北"
,
"20"
:
"山西"
,
"21"
:
"辽宁"
,
"22"
:
"吉林"
,
"23"
:
"黑龙江"
,
"24"
:
"江西"
,
"25"
:
"湖南"
,
"26"
:
"四川"
,
"27"
:
"贵州"
,
"28"
:
"云南"
,
"29"
:
"内蒙古"
,
"30"
:
"西藏"
,
"31"
:
"含外资"
,
"32"
:
"全外资"
,
"33"
:
"香港"
,
"34"
:
"海南"
//tui song baidu zhuanyong pinyin 2020-11-6
const
cityLetter
=
{
"北京"
:
"BEIJING"
,
"上海"
:
"SHANGHAI"
,
"福建"
:
"FUJIAN"
,
"广西"
:
"GUANGXI"
,
"广东"
:
"GUANGDONG"
,
"安徽"
:
"ANHUI"
,
"河南"
:
"HENAN"
,
"湖北"
:
"HUBEI"
,
"浙江"
:
"ZHEJIANG"
,
"江苏"
:
"JIANGSU"
,
"山东"
:
"SHANDONG"
,
"陕西"
:
"SHANXI_SHAN"
,
"宁夏"
:
"NINGXIA"
,
"甘肃"
:
"GANSU"
,
"新疆"
:
"XINJIANG"
,
"青海"
:
"QINGHAI"
,
"天津"
:
"TIANJIN"
,
"重庆"
:
"CHONGQING"
,
"河北"
:
"HEBEI"
,
"山西"
:
"SHANXI_JIN"
,
"辽宁"
:
"LIAONING"
,
"吉林"
:
"JILIN"
,
"黑龙江"
:
"HEILONGJIANG"
,
"江西"
:
"JIANGXI"
,
"湖南"
:
"HUNAN"
,
"四川"
:
"SUCHUAN"
,
"贵州"
:
"GUIZHOU"
,
"云南"
:
"YUANNAN"
,
"内蒙古"
:
"NEIMENGGU"
,
"西藏"
:
"XIZANG"
,
"外资"
:
"WAIZI"
,
"海南"
:
"HAINAN"
}
//baidu pinyinzhuanyong 2020-11-6
const
baiduIcpStatus
=
{
507
:
"REGISTRATION"
,
508
:
"SUBMITTED"
,
509
:
"ACCEPTED"
,
510
:
"NOT_ACCEPTED"
,
511
:
"APPROVED"
,
512
:
"NOT_APPROVED"
};
/**
* 资质信息提报相关接口(ICP\EDI)
*/
...
...
@@ -122,6 +131,8 @@ class BaseCenterOrderService extends AppServiceBase {
if
(
needinfo
.
uapp_id
==
uappId
.
baidu
){
//推送数据至baidu
// var bizType = needinfo.channelTypeCode;//业务类型里
solution
.
Area
=
cityLetter
[
solution
.
Area
]
console
.
log
(
'solution.Area++'
,
solution
.
Area
)
var
pushObj
=
{
requirementId
:
needinfo
.
channelNeedNo
,
companyName
:
solution
.
CompanyName
,
...
...
@@ -219,17 +230,17 @@ class BaseCenterOrderService extends AppServiceBase {
console
.
log
(
"pushRes++++"
,
pushRes
)
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
if
(
resData
.
bizId
)
{
if
(
resData
.
result
)
{
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
solutionBizId
:
resData
.
bizId
solutionBizId
:
resData
.
result
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
return
system
.
getResultSuccess
()
;
return
pushRes
;
}
}
}
...
...
@@ -290,9 +301,22 @@ class BaseCenterOrderService extends AppServiceBase {
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
//推送数据至百度
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
var
BizId
=
needsolution
.
orderChannelNo
;
console
.
log
(
'BizId++'
,
BizId
)
var
pushObj
=
{
"bizId"
:
BizId
,
"businessLicense"
:
{
"createdAt"
:
material
.
BusinessLicense
.
CreatedAt
,
"enterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
,
"legalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
,
"address"
:
material
.
BusinessLicense
.
Address
,
"registeredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
,
"name"
:
material
.
BusinessLicense
.
Name
,
"businessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
,
"type"
:
material
.
BusinessLicense
.
Type
,
"scopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
},
"partnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"orderNo"
:
BizId
,
"domain"
:
material
.
Domain
,
"corporateName"
:
material
.
CorporateName
,
"includeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
...
...
@@ -301,7 +325,6 @@ class BaseCenterOrderService extends AppServiceBase {
"partnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"partnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"partnerPlan"
:
material
.
PartnerPlan
||
""
,
"partnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"partnerLaw"
:
material
.
PartnerLaw
||
""
,
"partnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"partnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
...
...
@@ -309,8 +332,8 @@ class BaseCenterOrderService extends AppServiceBase {
};
var
self
=
this
;
//推送方案材料
var
r
=
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
console
.
log
(
"r++"
,
res
)
var
r
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
console
.
log
(
'rrrr+++++'
,
r
)
}
return
system
.
getResultSuccess
();
}
...
...
@@ -332,14 +355,15 @@ class BaseCenterOrderService extends AppServiceBase {
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
res
.
data
.
ApplicationStatus
=
baiduIcpStatus
[
res
.
data
.
ApplicationStatus
];
console
.
log
(
'res.data.channelOrderNo'
,
res
.
data
.
channelOrderNo
)
//推送数据至百度
var
pushObj
=
{
bizId
:
res
.
data
.
BizId
,
officialFileURL
:
res
.
data
.
OfficialFileURL
,
applicationStatus
:
res
.
data
.
ApplicationStatus
orderNo
:
res
.
data
.
channelOrderNo
,
status
:
res
.
data
.
ApplicationStatus
};
//推送状态变更
this
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/
requirement
/update"
,
reqbody
:
pushObj
});
this
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/
license
/update"
,
reqbody
:
pushObj
});
}
return
system
.
getResultSuccess
();
}
...
...
center-channel/app/base/service/impl/common/qcCenterOrderSve.js
View file @
89c61ad4
This diff is collapsed.
Click to expand it.
center-channel/app/base/service/impl/common/signSve.js
View file @
89c61ad4
...
...
@@ -71,6 +71,15 @@ class SignService{
}
var
resultSignStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
app_secret
;
var
resultTmpSign
=
md5
(
resultSignStr
).
toUpperCase
();
// console.log("----------------resultSignStr start");
// console.log(resultSignStr)
// console.log("----------------resultSignStr end");
// console.log("----------------resultTmpSign start");
// console.log(resultTmpSign)
// console.log("----------------resultTmpSign end");
// console.log("----------------params.sign start");
// console.log(params.sign)
// console.log("----------------params.sign end");
if
(
params
.
sign
!=
resultTmpSign
)
{
return
system
.
getResult
(
null
,
"返回值签名验证失败"
);
}
...
...
@@ -127,6 +136,22 @@ module.exports = SignService;
// "bizId":"202011031421",
// "status":"16"
// }
// var obj = {
// "bizId":"202011071358",
// "contactName":"lin",
// "contactMobile":"13911391996",
// "timeUnit":"year",
// "quantity":1,
// "companyInfo":{
// "companyName":"公司宝",
// "taxpayerType":"NORMAL_TAXPAYER",
// "acctgSystemId":"10001",
// "companyForm":"1",
// "industry":1,
// "taxpayerNumber":"123456789",
// "companyArea":"北京"
// }
// }
// task.createSign(obj,"7cbb892450174167b5c7e01we4717z51").then(d=>{
// console.log(d,"!!!!!!!!!!!!!!!!!!!!!!!!!!");
// });
\ No newline at end of file
center-channel/app/base/service/impl/utilsSve/utilsNeedSve2.js
View file @
89c61ad4
...
...
@@ -499,13 +499,13 @@ class UtilsNeedService2 extends AppServiceBase {
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need2/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
//2020-10-28 laolan start
if
(
result
&&
result
.
status
==
0
&&
result
.
data
&&
result
.
data
.
uappIds
){
if
(
result
.
data
.
uappIds
==
uappId
.
ali
){
if
(
result
&&
result
.
status
==
0
&&
result
.
data
){
if
(
result
.
data
==
uappId
.
aliConfirmResult
){
var
res
=
await
self
.
aliclient
.
reqbyget
({
action
:
"writeCommunicationLog"
,
reqbody
:
{
BizId
:
pobj
.
actionBody
.
intentionBizId
,
Note
:
pobj
.
actionBody
.
note
},
apiVersion
:
"2019-05-08"
});
console
.
log
(
"ali+res"
,
res
)
}
if
(
result
.
data
.
uappIds
==
uappId
.
baidu
){
var
ress
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/communication"
,
reqbody
:
{
bizId
:
pobj
.
actionBody
.
intentionBizId
,
note
:
pobj
.
actionBody
.
note
}
});
if
(
result
.
data
==
uappId
.
baidu
){
var
ress
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/communication"
,
reqbody
:
{
requirementId
:
pobj
.
actionBody
.
intentionBizId
,
content
:
pobj
.
actionBody
.
note
}
});
console
.
log
(
"baidu+res"
,
ress
)
}
}
...
...
@@ -534,15 +534,16 @@ class UtilsNeedService2 extends AppServiceBase {
}
async
queryExpertApplyCommunicationLogs
(
pobj
)
{
if
(
!
pobj
.
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,100493"
);
}
if
(
!
pobj
.
actionBody
.
userFeedBack
)
{
return
system
.
getResult
(
null
,
"actionBody.userFeedBack can not be empty,100494"
);
}
//
if (!pobj.actionBody.intentionBizId) {
//
return system.getResult(null, "actionBody.intentionBizId can not be empty,100493");
//
}
//
if (!pobj.actionBody.userFeedBack) {
//
return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
//
}
//2020-10-28 laolan start
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need2/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'jilu+++result++++'
,
result
)
if
(
result
&&
result
.
status
==
0
&&
result
.
data
&&
result
.
data
.
uapp_id
){
if
(
result
.
data
.
uapp_id
==
uappId
.
ali
){
var
res
=
await
this
.
aliclient
.
reqbyget
({
...
...
@@ -558,16 +559,15 @@ class UtilsNeedService2 extends AppServiceBase {
}
if
(
result
.
data
.
uapp_id
==
uappId
.
baidu
){
console
.
log
(
"bbbbb++"
,
pobj
)
var
res
=
await
this
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/providerommunication/list"
,
reqbody
:
{
path
:
"/api/bla/provider
/c
ommunication/list"
,
reqbody
:
{
beginTime
:
pobj
.
actionBody
.
BeginTime
?
pobj
.
actionBody
.
BeginTime
:
""
,
endTime
:
pobj
.
actionBody
.
EndTime
?
pobj
.
actionBody
.
EndTime
:
""
,
bizId
:
pobj
.
actionBody
.
intentionBizId
,
userFeedBack
:
pobj
.
actionBody
.
userFeedBack
,
pageNum
:
pobj
.
actionBody
.
pageNum
||
1
,
pageSize
:
pobj
.
actionBody
.
pageSize
||
10
,
requirementId
:
pobj
.
actionBody
.
intentionBizId
}
});
console
.
log
(
'xxcc+++'
,
res
)
}
}
...
...
@@ -581,7 +581,7 @@ class UtilsNeedService2 extends AppServiceBase {
// var updateRes = await this.utilsneedSve.dao.customUpdate(sql, paramWhere);
// }
// func();
return
system
.
getResultSuccess
(
res
)
;
return
res
;
}
/**
...
...
center-channel/app/base/service/impl/utilsSve/utilsPushSve.js
View file @
89c61ad4
...
...
@@ -53,7 +53,7 @@ class UtilsPushService extends AppServiceBase {
}
async
pushBusInfo
(
pobj
,
opType
,
isDelProductInfo
)
{
//推送业务总入口,不在db中做配置进行调用
console
.
log
(
JSON
.
stringify
(
pobj
),
".......pushBusInfo........................."
);
console
.
log
(
JSON
.
stringify
(
pobj
),
".......pushBusInfo........................."
);
var
interface_list
=
pobj
.
interface_info
?
pobj
.
interface_info
:
pobj
.
actionBody
.
product_info
.
interface_info
;
if
(
!
interface_list
)
{
return
system
.
getResult
(
null
,
"暂无推送配置"
);
...
...
@@ -64,14 +64,16 @@ class UtilsPushService extends AppServiceBase {
}
var
self
=
this
;
let
result
;
if
(
interface_list_temp
&&
interface_list_temp
.
length
==
1
)
{
if
(
interface_list_temp
&&
interface_list_temp
.
length
==
1
)
{
const
element
=
interface_list_temp
[
0
];
var
reflexActionRes
=
await
self
.
reflexAction
(
element
,
opType
,
pobj
,
isDelProductInfo
);
let
reflexActionRes
=
await
self
.
reflexAction
(
element
,
opType
,
pobj
,
isDelProductInfo
);
self
.
execClientNew
.
execLogs
(
"pushBusInfo-reflexAction-result:"
,
pobj
,
"center-channel-reflexAction"
,
reflexActionRes
,
null
);
return
reflexActionRes
;
}
else
{
}
else
{
for
(
let
index
=
0
;
index
<
interface_list_temp
.
length
;
index
++
)
{
const
element
=
interface_list_temp
[
index
];
result
=
await
self
.
reflexAction
(
element
,
opType
,
pobj
,
isDelProductInfo
);
self
.
execClientNew
.
execLogs
(
"pushBusInfo-for---reflexAction-result:"
,
pobj
,
"center-channel-reflexAction"
,
result
,
null
);
}
return
result
;
}
...
...
@@ -84,6 +86,7 @@ class UtilsPushService extends AppServiceBase {
return
system
.
getResult
(
null
,
"暂无推送配置"
);
}
var
result
=
await
this
.
reflexAction
(
interface_info
,
pobj
.
opType
,
pobj
,
pobj
.
isDelProductInfo
||
1
);
this
.
execClientNew
.
execLogs
(
"againPushBusInfo-reflexAction-result:"
,
pobj
,
"center-channel-reflexAction"
,
result
,
null
);
if
(
result
.
status
!=
0
)
{
return
result
;
}
...
...
@@ -124,8 +127,8 @@ class UtilsPushService extends AppServiceBase {
delete
actionBody
[
"product_info"
];
}
//是否删除产品信息进行推送
refResult
=
await
this
.
restPostUrl
(
pobj
.
actionBody
,
interface_info
.
interface_url
);
if
(
refResult
.
code
==
1
)
{
refResult
.
status
=
0
if
(
refResult
.
code
==
1
)
{
refResult
.
status
=
0
}
this
.
disposePushResult
(
pobj
,
refResult
,
"ycUrlPush->reflexAction->refResult"
,
this
.
pushlogFailType
.
NEWRPC
);
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsServiceSve.js
View file @
89c61ad4
...
...
@@ -102,7 +102,7 @@ class utils360Sve extends AppServiceBase {
appInfo
:
pobj
.
appInfo
}
this
.
utilsPushSve
.
aliBusiness2Delivery
(
deliveryObj
,
"submitService"
);
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
(
{
orderNo
:
pobj
.
actionBody
.
orderNo
}
);
}
async
notifyService
(
pobj
,
actionBody
,
req
)
{
...
...
center-channel/app/base/utils/baiduClient.js
View file @
89c61ad4
...
...
@@ -21,49 +21,31 @@ class baiduClient {
let
timestamp
=
new
Date
().
toISOString
()
let
site
=
timestamp
.
lastIndexOf
(
"."
);
timestamp
=
timestamp
.
substring
(
0
,
site
)
+
"Z"
// let timestamp = "2020-11-05T04:00:00Z"
console
.
log
(
'timestamp++'
,
timestamp
)
let
signedHeaders
=
"host"
;
let
extime
=
1800
;
// 因为是post,所以CanonicalQueryString为空
// var signArr = [];
// var keys = Object.keys(actionBody).sort();
// if (keys.length == 0) {
// return system.getResult(null, "请求参数信息为空");
// }
// for (let k = 0; k < keys.length; k++) {
// const tKey = keys[k];
// if (tKey != "sign" && actionBody[tKey] && !(typeof (actionBody[tKey]) === "object")) {
// signArr.push(urlencode(tKey) + "=" + urlencode(actionBody[tKey]));
// }
// }
// let resultSignStr = signArr.join("&");
// console.log('resultSignStr+++',resultSignStr)
let
canonicalHeaders
=
"host:gwgp-mwnn9gk4o4e.i.bdcloudapi.com"
//中间结果1:规范化请求和前缀字符串
let
canonicalRequest
=
"POST"
+
"
\
n"
+
path
+
"
\
n"
+
"
\
n"
+
canonicalHeaders
;
console
.
log
(
'canonicalRequest+++'
,
canonicalRequest
)
//authStringPrefix(前缀字符串,由除sk字段外的签名信息生成)
let
authStringPrefix
=
version
+
"/"
+
accessKey
+
"/"
+
timestamp
+
"/"
+
extime
;
console
.
log
(
'authStringPrefix+++'
,
authStringPrefix
)
//中间结果2:派生签名密钥 signingKey
let
signingKey
=
crypto
.
createHmac
(
'sha256'
,
secretKey
)
.
update
(
authStringPrefix
)
.
digest
(
'hex'
);
console
.
log
(
'signingKey+++'
,
signingKey
)
//中间结果3:签名摘要 signature
let
signature
=
crypto
.
createHmac
(
'sha256'
,
signingKey
)
.
update
(
canonicalRequest
)
.
digest
(
'hex'
);
console
.
log
(
'signature+++'
,
signature
)
//最终结果:认证字符串 authorization
let
authorization
=
authStringPrefix
+
"/"
+
signedHeaders
+
"/"
+
signature
;
console
.
log
(
'authorization+++'
,
authorization
)
var
baiduObj
=
{
authorization
:
authorization
,
data
:
actionBody
}
var
rtn
=
await
this
.
execClient
.
execBaiduPost
(
baiduObj
,
url
);
console
.
log
(
"baiduObj+++++"
,
baiduObj
)
console
.
log
(
"url+++++"
,
url
)
console
.
log
(
"rtn+++++"
,
rtn
)
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"execPost data is empty"
);
}
...
...
@@ -73,7 +55,6 @@ class baiduClient {
//百度接口 2020-10-27 laolan
async
baiduReqbyget
(
obj
,
cbk
)
{
console
.
log
(
'obj+++'
,
obj
)
var
path
=
obj
.
path
;
var
reqbody
=
obj
.
reqbody
;
try
{
...
...
@@ -111,69 +92,5 @@ class baiduClient {
return
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
e
.
stack
);
}
}
async
test
(){
var
obj
=
{
path
:
"/api/bla/provider/plan"
,
reqbody
:{
"area"
:
"北京"
,
"companyName"
:
"demoData"
,
"companyAddress"
:
"demoData"
,
"requirementId"
:
"TRE-nmnHtEoTjeE"
,
"type"
:
"ICP"
}
};
var
actionBody
=
obj
.
reqbody
;
var
path
=
obj
.
path
;
let
domain
=
"https://gwgp-mwnn9gk4o4e.i.bdcloudapi.com"
;
let
url
=
domain
+
path
;
let
version
=
"bce-auth-v1"
;
let
accessKey
=
"ed0f5c4c7c2d4e87aa335d9b07bf9bd4"
;
let
secretKey
=
"f600c4e91f6d43998d637401e6e34ef9"
;
let
timestamp
=
new
Date
().
toISOString
();
let
signedHeaders
=
"host"
;
let
extime
=
1800
;
var
signArr
=
[];
var
keys
=
Object
.
keys
(
actionBody
).
sort
();
if
(
keys
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"请求参数信息为空"
);
}
for
(
let
k
=
0
;
k
<
keys
.
length
;
k
++
)
{
const
tKey
=
keys
[
k
];
if
(
tKey
!=
"sign"
&&
actionBody
[
tKey
]
&&
!
(
typeof
(
actionBody
[
tKey
])
===
"object"
))
{
signArr
.
push
(
urlencode
(
tKey
)
+
"="
+
urlencode
(
actionBody
[
tKey
]));
}
}
let
resultSignStr
=
signArr
.
join
(
"&"
);
console
.
log
(
'resultSignStr+++'
,
resultSignStr
)
let
canonicalHeaders
=
"host:gwgp-mwnn9gk4o4e.i.bdcloudapi.com"
//中间结果1:规范化请求和前缀字符串
let
canonicalRequest
=
"POST"
+
"
\
n"
+
path
+
"
\
n"
+
resultSignStr
+
"
\
n"
+
canonicalHeaders
;
//authStringPrefix(前缀字符串,由除sk字段外的签名信息生成)
let
authStringPrefix
=
version
+
"/"
+
accessKey
+
"/"
+
timestamp
+
"/"
+
extime
;
//中间结果2:派生签名密钥 signingKey
let
signingKey
=
crypto
.
createHmac
(
'sha256'
,
secretKey
)
.
update
(
authStringPrefix
)
.
digest
(
'hex'
);
//中间结果3:签名摘要 signature
let
signature
=
crypto
.
createHmac
(
'sha256'
,
signingKey
)
.
update
(
canonicalRequest
)
.
digest
(
'hex'
);
//最终结果:认证字符串 authorization
let
authorization
=
authStringPrefix
+
"/"
+
signedHeaders
+
"/"
+
signature
;
var
baiduObj
=
{
authorization
:
authorization
,
data
:
actionBody
}
var
rtn
=
await
this
.
execClient
.
execBaiduPost
(
baiduObj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"execPost data is empty"
);
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
!
result
||
!
result
.
result
){
return
system
.
getResultFail
(
"推送失败"
);
}
return
system
.
getResultSuccess
();
}
}
module
.
exports
=
baiduClient
;
center-channel/app/config/businessConfig.js
View file @
89c61ad4
...
...
@@ -18,7 +18,7 @@ module.exports = {
"foodCloseNeed"
,
"foodRecordLog"
,
"foodRecordLogList"
,
"getParamsFor360"
,
"addOrderWeb"
,
"getPayRecords"
,
"getLoginInfo"
,
"putUserMobileByVcode"
,
"putUserPwdByMobile"
,
"icpNotifyNew"
],
apiMustUserpinList
:
[
"submitNeed"
,
"paySuccess"
,
"icpNotify"
,
"getLoginInfo"
,
"icpNotifyNew"
,
"submitIcpProgramme"
,
"serviceProviderSubmitMaterial"
,
"abolishIcpProgramme"
,
"submitService"
],
apiMustUserpinList
:
[
"submitNeed"
,
"paySuccess"
,
"icpNotify"
,
"getLoginInfo"
,
"icpNotifyNew"
,
"submitIcpProgramme"
,
"serviceProviderSubmitMaterial"
,
"abolishIcpProgramme"
,
"submitService"
,
"serviceProviderNotification"
],
apiSecretPathList
:
[
"/api/icp/consultation/submit"
,
"/api/icp/feedback/submit"
,
"/api/icp/order/notify"
,
"/api/opreceive/service/create"
,
"/api/icp/order/close"
,
"/api/opreceive/service/notify"
]
}
}
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