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
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
229 additions
and
259 deletions
+229
-259
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
+82
-82
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
+8
-5
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");
...
@@ -4,7 +4,7 @@ var settings = require("../../../../config/settings");
class
QcAPI
extends
APIBase
{
class
QcAPI
extends
APIBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
centero
rderSve
=
system
.
getObject
(
"service.common.qcCenterOrderSve"
);
this
.
qcCenterO
rderSve
=
system
.
getObject
(
"service.common.qcCenterOrderSve"
);
}
}
/**
/**
* 接口跳转-POST请求
* 接口跳转-POST请求
...
@@ -23,70 +23,70 @@ class QcAPI extends APIBase {
...
@@ -23,70 +23,70 @@ class QcAPI extends APIBase {
var
opResult
=
null
;
var
opResult
=
null
;
switch
(
action_type
)
{
switch
(
action_type
)
{
case
"getNeedSolutionDetailByUser"
:
//获取方案详情
case
"getNeedSolutionDetailByUser"
:
//获取方案详情
opResult
=
await
this
.
centero
rderSve
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
opResult
=
await
this
.
qcCenterO
rderSve
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
break
;
break
;
case
"submitIcpProgramme"
:
//icp方案提交
case
"submitIcpProgramme"
:
//icp方案提交
opResult
=
await
this
.
centero
rderSve
.
submitIcpProgramme
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
submitIcpProgramme
(
pobj
);
break
;
break
;
case
"receiveProgrammeNo"
:
//接收渠道方案号(测试)
case
"receiveProgrammeNo"
:
//接收渠道方案号(测试)
opResult
=
await
this
.
centero
rderSve
.
reqCenterOrderApi
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
reqCenterOrderApi
(
pobj
);
break
;
break
;
// case "submitIcpMaterial"://icp材料提交
// case "submitIcpMaterial"://icp材料提交
// opResult = await this.
centero
rderSve.submitIcpMaterial(pobj);
// opResult = await this.
qcCenterO
rderSve.submitIcpMaterial(pobj);
// break;
// break;
// case "acceptIcpPartnerNotification"://icp通知状态变更
// case "acceptIcpPartnerNotification"://icp通知状态变更
// opResult = await this.
centero
rderSve.acceptIcpPartnerNotification(pobj);
// opResult = await this.
qcCenterO
rderSve.acceptIcpPartnerNotification(pobj);
// break;
// break;
case
"abolishIcpProgramme"
:
//服务商icp方案关闭
case
"abolishIcpProgramme"
:
//服务商icp方案关闭
opResult
=
await
this
.
centero
rderSve
.
abolishIcpProgramme
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
abolishIcpProgramme
(
pobj
);
break
;
break
;
case
"getProgrammeInfoByChannelNeedNo"
:
//获取需求方案列表
case
"getProgrammeInfoByChannelNeedNo"
:
//获取需求方案列表
opResult
=
await
this
.
centero
rderSve
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
opResult
=
await
this
.
qcCenterO
rderSve
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
break
;
break
;
case
"serviceProviderSubmitMaterial"
:
//交付商提交材料信息
case
"serviceProviderSubmitMaterial"
:
//交付商提交材料信息
opResult
=
await
this
.
centero
rderSve
.
serviceProviderSubmitMaterial
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
serviceProviderSubmitMaterial
(
pobj
);
break
;
break
;
case
"serviceProviderNotification"
:
//交付商通知状态变更
case
"serviceProviderNotification"
:
//交付商通知状态变更
opResult
=
await
this
.
centero
rderSve
.
serviceProviderNotification
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
serviceProviderNotification
(
pobj
);
break
;
break
;
case
"closeOrderDelivery"
:
//交付商关闭交付单
case
"closeOrderDelivery"
:
//交付商关闭交付单
opResult
=
await
this
.
centero
rderSve
.
closeOrderDelivery
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
closeOrderDelivery
(
pobj
);
break
;
break
;
// --------- 文网文 ---------
// --------- 文网文 ---------
case
"serviceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
case
"serviceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
opResult
=
await
this
.
centero
rderSve
.
serviceSubmitOption
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
serviceSubmitOption
(
pobj
);
break
;
break
;
case
"submitWangwenSolution"
:
//提交方案(文网文)2020-9-26
case
"submitWangwenSolution"
:
//提交方案(文网文)2020-9-26
opResult
=
await
this
.
centero
rderSve
.
submitWangwenSolution
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
submitWangwenSolution
(
pobj
);
break
;
break
;
case
"closeNeed"
:
//关闭需求(文网文)2020-9-28
case
"closeNeed"
:
//关闭需求(文网文)2020-9-28
opResult
=
await
this
.
centero
rderSve
.
closeNeed
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
closeNeed
(
pobj
);
break
;
break
;
case
"recordLog"
:
//提交沟通记录(文网文)2020-9-28
case
"recordLog"
:
//提交沟通记录(文网文)2020-9-28
opResult
=
await
this
.
centero
rderSve
.
recordLog
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
recordLog
(
pobj
);
break
;
break
;
case
"recordLogList"
:
//查询沟通记录(文网文)2020-9-29
case
"recordLogList"
:
//查询沟通记录(文网文)2020-9-29
opResult
=
await
this
.
centero
rderSve
.
recordLogList
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
recordLogList
(
pobj
);
break
;
break
;
// --------- 食品 ---------
// --------- 食品 ---------
case
"foodServiceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
case
"foodServiceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
opResult
=
await
this
.
centero
rderSve
.
foodServiceSubmitOption
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
foodServiceSubmitOption
(
pobj
);
break
;
break
;
case
"submitFoodSolution"
:
//提交方案(文网文)2020-9-26
case
"submitFoodSolution"
:
//提交方案(文网文)2020-9-26
opResult
=
await
this
.
centero
rderSve
.
submitFoodSolution
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
submitFoodSolution
(
pobj
);
break
;
break
;
case
"foodCloseNeed"
:
//关闭需求(文网文)2020-9-28
case
"foodCloseNeed"
:
//关闭需求(文网文)2020-9-28
opResult
=
await
this
.
centero
rderSve
.
foodCloseNeed
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
foodCloseNeed
(
pobj
);
break
;
break
;
case
"foodRecordLog"
:
//提交沟通记录(文网文)2020-9-28
case
"foodRecordLog"
:
//提交沟通记录(文网文)2020-9-28
opResult
=
await
this
.
centero
rderSve
.
foodRecordLog
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
foodRecordLog
(
pobj
);
break
;
break
;
case
"foodRecordLogList"
:
//查询沟通记录(文网文)2020-9-29
case
"foodRecordLogList"
:
//查询沟通记录(文网文)2020-9-29
opResult
=
await
this
.
centero
rderSve
.
foodRecordLogList
(
pobj
);
opResult
=
await
this
.
qcCenterO
rderSve
.
foodRecordLogList
(
pobj
);
break
;
break
;
default
:
default
:
...
...
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
View file @
89c61ad4
...
@@ -17,42 +17,51 @@ const uappId = {
...
@@ -17,42 +17,51 @@ const uappId = {
'ali'
:
"18"
,
//(阿里icp、edi)
'ali'
:
"18"
,
//(阿里icp、edi)
'baidu'
:
"44"
//(百度icp、edi)
'baidu'
:
"44"
//(百度icp、edi)
}
}
const
city
=
{
//tui song baidu zhuanyong pinyin 2020-11-6
"1"
:
"北京"
,
const
cityLetter
=
{
"2"
:
"上海"
,
"北京"
:
"BEIJING"
,
"3"
:
"福建"
,
"上海"
:
"SHANGHAI"
,
"4"
:
"广西"
,
"福建"
:
"FUJIAN"
,
"5"
:
"广东"
,
"广西"
:
"GUANGXI"
,
"6"
:
"安徽"
,
"广东"
:
"GUANGDONG"
,
"7"
:
"河南"
,
"安徽"
:
"ANHUI"
,
"8"
:
"湖北"
,
"河南"
:
"HENAN"
,
"9"
:
"浙江"
,
"湖北"
:
"HUBEI"
,
"10"
:
"江苏"
,
"浙江"
:
"ZHEJIANG"
,
"11"
:
"山东"
,
"江苏"
:
"JIANGSU"
,
"12"
:
"陕西"
,
"山东"
:
"SHANDONG"
,
"13"
:
"宁夏"
,
"陕西"
:
"SHANXI_SHAN"
,
"14"
:
"甘肃"
,
"宁夏"
:
"NINGXIA"
,
"15"
:
"新疆"
,
"甘肃"
:
"GANSU"
,
"16"
:
"青海"
,
"新疆"
:
"XINJIANG"
,
"17"
:
"天津"
,
"青海"
:
"QINGHAI"
,
"18"
:
"重庆"
,
"天津"
:
"TIANJIN"
,
"19"
:
"河北"
,
"重庆"
:
"CHONGQING"
,
"20"
:
"山西"
,
"河北"
:
"HEBEI"
,
"21"
:
"辽宁"
,
"山西"
:
"SHANXI_JIN"
,
"22"
:
"吉林"
,
"辽宁"
:
"LIAONING"
,
"23"
:
"黑龙江"
,
"吉林"
:
"JILIN"
,
"24"
:
"江西"
,
"黑龙江"
:
"HEILONGJIANG"
,
"25"
:
"湖南"
,
"江西"
:
"JIANGXI"
,
"26"
:
"四川"
,
"湖南"
:
"HUNAN"
,
"27"
:
"贵州"
,
"四川"
:
"SUCHUAN"
,
"28"
:
"云南"
,
"贵州"
:
"GUIZHOU"
,
"29"
:
"内蒙古"
,
"云南"
:
"YUANNAN"
,
"30"
:
"西藏"
,
"内蒙古"
:
"NEIMENGGU"
,
"31"
:
"含外资"
,
"西藏"
:
"XIZANG"
,
"32"
:
"全外资"
,
"外资"
:
"WAIZI"
,
"33"
:
"香港"
,
"海南"
:
"HAINAN"
"34"
:
"海南"
}
}
//baidu pinyinzhuanyong 2020-11-6
const
baiduIcpStatus
=
{
507
:
"REGISTRATION"
,
508
:
"SUBMITTED"
,
509
:
"ACCEPTED"
,
510
:
"NOT_ACCEPTED"
,
511
:
"APPROVED"
,
512
:
"NOT_APPROVED"
};
/**
/**
* 资质信息提报相关接口(ICP\EDI)
* 资质信息提报相关接口(ICP\EDI)
*/
*/
...
@@ -122,6 +131,8 @@ class BaseCenterOrderService extends AppServiceBase {
...
@@ -122,6 +131,8 @@ class BaseCenterOrderService extends AppServiceBase {
if
(
needinfo
.
uapp_id
==
uappId
.
baidu
){
if
(
needinfo
.
uapp_id
==
uappId
.
baidu
){
//推送数据至baidu
//推送数据至baidu
// var bizType = needinfo.channelTypeCode;//业务类型里
// var bizType = needinfo.channelTypeCode;//业务类型里
solution
.
Area
=
cityLetter
[
solution
.
Area
]
console
.
log
(
'solution.Area++'
,
solution
.
Area
)
var
pushObj
=
{
var
pushObj
=
{
requirementId
:
needinfo
.
channelNeedNo
,
requirementId
:
needinfo
.
channelNeedNo
,
companyName
:
solution
.
CompanyName
,
companyName
:
solution
.
CompanyName
,
...
@@ -219,17 +230,17 @@ class BaseCenterOrderService extends AppServiceBase {
...
@@ -219,17 +230,17 @@ class BaseCenterOrderService extends AppServiceBase {
console
.
log
(
"pushRes++++"
,
pushRes
)
console
.
log
(
"pushRes++++"
,
pushRes
)
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
var
resData
=
pushRes
.
data
;
if
(
resData
.
bizId
)
{
if
(
resData
.
result
)
{
var
reqObj2
=
{
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
appInfo
:
appInfo
,
actionBody
:
{
actionBody
:
{
solutionNo
:
solutionNo
,
solutionNo
:
solutionNo
,
solutionBizId
:
resData
.
bizId
solutionBizId
:
resData
.
result
}
}
};
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
return
system
.
getResultSuccess
()
;
return
pushRes
;
}
}
}
}
}
}
...
@@ -290,9 +301,22 @@ class BaseCenterOrderService extends AppServiceBase {
...
@@ -290,9 +301,22 @@ class BaseCenterOrderService extends AppServiceBase {
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
//推送数据至百度
//推送数据至百度
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
var
BizId
=
needsolution
.
orderChannelNo
;
console
.
log
(
'BizId++'
,
BizId
)
var
pushObj
=
{
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
,
"domain"
:
material
.
Domain
,
"corporateName"
:
material
.
CorporateName
,
"corporateName"
:
material
.
CorporateName
,
"includeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"includeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
...
@@ -301,7 +325,6 @@ class BaseCenterOrderService extends AppServiceBase {
...
@@ -301,7 +325,6 @@ class BaseCenterOrderService extends AppServiceBase {
"partnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"partnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"partnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"partnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"partnerPlan"
:
material
.
PartnerPlan
||
""
,
"partnerPlan"
:
material
.
PartnerPlan
||
""
,
"partnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"partnerLaw"
:
material
.
PartnerLaw
||
""
,
"partnerLaw"
:
material
.
PartnerLaw
||
""
,
"partnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"partnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"partnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"partnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
...
@@ -309,8 +332,8 @@ class BaseCenterOrderService extends AppServiceBase {
...
@@ -309,8 +332,8 @@ class BaseCenterOrderService extends AppServiceBase {
};
};
var
self
=
this
;
var
self
=
this
;
//推送方案材料
//推送方案材料
var
r
=
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
var
r
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
console
.
log
(
"r++"
,
res
)
console
.
log
(
'rrrr+++++'
,
r
)
}
}
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
...
@@ -332,14 +355,15 @@ class BaseCenterOrderService extends AppServiceBase {
...
@@ -332,14 +355,15 @@ class BaseCenterOrderService extends AppServiceBase {
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
res
.
data
.
ApplicationStatus
=
baiduIcpStatus
[
res
.
data
.
ApplicationStatus
];
console
.
log
(
'res.data.channelOrderNo'
,
res
.
data
.
channelOrderNo
)
//推送数据至百度
//推送数据至百度
var
pushObj
=
{
var
pushObj
=
{
bizId
:
res
.
data
.
BizId
,
orderNo
:
res
.
data
.
channelOrderNo
,
officialFileURL
:
res
.
data
.
OfficialFileURL
,
status
:
res
.
data
.
ApplicationStatus
applicationStatus
:
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
();
return
system
.
getResultSuccess
();
}
}
...
...
center-channel/app/base/service/impl/common/qcCenterOrderSve.js
View file @
89c61ad4
...
@@ -60,8 +60,8 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -60,8 +60,8 @@ class QcCenterOrderService extends AppServiceBase {
IntentionBizId
:
needinfo
.
channelNeedNo
,
IntentionBizId
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
IcpType
:
solution
.
IcpType
,
CompanyAddress
:
solution
.
CompanyAddress
,
CompanyName
:
solution
.
CompanyName
,
IcpType
:
solution
.
IcpType
,
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
Note
:
solution
.
Note
,
Area
:
solution
.
Area
,
Note
:
solution
.
Note
,
ActionType
:
solution
.
actionType
,
ActionType
:
solution
.
actionType
,
Source
:
"官网"
Source
:
"官网"
};
};
if
(
needsolution
.
channelSolutionNo
)
{
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
...
@@ -196,7 +196,7 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -196,7 +196,7 @@ class QcCenterOrderService extends AppServiceBase {
};
};
var
self
=
this
;
var
self
=
this
;
//推送方案材料
//推送方案材料
if
(
pobj
.
appInfo
.
uapp_id
==
18
)
{
if
(
pobj
.
appInfo
.
uapp_id
==
18
)
{
self
.
aliclient
.
reqbyget
({
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
self
.
aliclient
.
reqbyget
({
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
}
}
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
...
@@ -210,20 +210,20 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -210,20 +210,20 @@ class QcCenterOrderService extends AppServiceBase {
pobj
.
actionType
=
"getOrderByOrderNo"
;
pobj
.
actionType
=
"getOrderByOrderNo"
;
let
orderUrl
=
settings
.
centerOrderUrl
()
+
"action/order/springBoard"
;
let
orderUrl
=
settings
.
centerOrderUrl
()
+
"action/order/springBoard"
;
let
orderResult
=
await
this
.
restPostUrl
(
pobj
,
orderUrl
);
let
orderResult
=
await
this
.
restPostUrl
(
pobj
,
orderUrl
);
if
(
orderResult
.
status
!=
0
)
{
if
(
orderResult
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
1
,
'查询订单失败'
)
return
system
.
getResultFail
(
-
1
,
'查询订单失败'
)
}
}
let
uapp_id
=
orderResult
.
data
.
uapp_id
;
let
uapp_id
=
orderResult
.
data
.
uapp_id
;
pobj
.
appInfo
=
{
uapp_id
:
uapp_id
};
pobj
.
appInfo
=
{
uapp_id
:
uapp_id
};
pobj
.
actionType
=
"getAppInterface"
;
pobj
.
actionType
=
"getAppInterface"
;
var
reqUrl
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
reqUrl
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
productItemInterfaceResult
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
productItemInterfaceResult
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
productItemInterfaceResult
.
status
!=
0
)
{
if
(
productItemInterfaceResult
.
status
!=
0
)
{
system
.
getResultFail
(
-
1
,
'获取接口参数失败'
)
system
.
getResultFail
(
-
1
,
'获取接口参数失败'
)
}
}
pobj
.
interface_info
=
productItemInterfaceResult
.
data
;
pobj
.
interface_info
=
productItemInterfaceResult
.
data
;
pobj
.
pushObj
=
res
.
data
;
pobj
.
pushObj
=
res
.
data
;
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
'pushStatus'
,
1
);
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
'pushStatus'
,
1
);
//推送数据至阿里
//推送数据至阿里
// var pushObj = {
// var pushObj = {
// BizId: res.data.BizId,
// BizId: res.data.BizId,
...
@@ -253,7 +253,7 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -253,7 +253,7 @@ class QcCenterOrderService extends AppServiceBase {
return
res
;
return
res
;
}
}
// ----------- 文网文 -----------
// ----------- 文网文 -----------
//服务商提交服务操作(文网文)2020-9-26
//服务商提交服务操作(文网文)2020-9-26
async
serviceSubmitOption
(
pobj
)
{
async
serviceSubmitOption
(
pobj
)
{
...
@@ -265,12 +265,12 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -265,12 +265,12 @@ class QcCenterOrderService extends AppServiceBase {
BizId
:
pobj
.
actionBody
.
orderNo
,
BizId
:
pobj
.
actionBody
.
orderNo
,
BizType
:
pobj
.
actionBody
.
channelType
,
BizType
:
pobj
.
actionBody
.
channelType
,
OperateType
:
wangwenStatusDisct
[
resStatus
],
OperateType
:
wangwenStatusDisct
[
resStatus
],
ExtInfo
:
pobj
.
actionBody
.
extInfo
ExtInfo
:
pobj
.
actionBody
.
extInfo
};
};
console
.
log
(
"fuwu++++pushObj"
,
pushObj
);
console
.
log
(
"fuwu++++pushObj"
,
pushObj
);
//推送状态变更
//推送状态变更
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"OperateProduceForPartner"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"OperateProduceForPartner"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
console
.
log
(
'ttttssss'
,
r
)
console
.
log
(
'ttttssss'
,
r
)
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
return
res
;
return
res
;
...
@@ -278,10 +278,10 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -278,10 +278,10 @@ class QcCenterOrderService extends AppServiceBase {
//提交方案(文网文)2020-9-27
//提交方案(文网文)2020-9-27
async
submitWangwenSolution
(
pobj
)
{
async
submitWangwenSolution
(
pobj
)
{
console
.
log
(
'文网文提交方案'
,
pobj
)
console
.
log
(
'文网文提交方案'
,
pobj
)
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
console
.
log
(
'www'
,
res
.
data
.
needsolution
.
solutionContent
);
console
.
log
(
'www'
,
res
.
data
.
needsolution
.
solutionContent
);
var
solution
=
res
.
data
.
needsolution
.
solutionContent
;
var
solution
=
res
.
data
.
needsolution
.
solutionContent
;
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
solution
=
JSON
.
parse
(
solution
);
solution
=
JSON
.
parse
(
solution
);
...
@@ -316,7 +316,7 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -316,7 +316,7 @@ class QcCenterOrderService extends AppServiceBase {
// solution: res.data.needsolution.solutionContent
// solution: res.data.needsolution.solutionContent
solution
:
solution
solution
:
solution
};
};
console
.
log
(
"wangwen"
,
pushObj
);
console
.
log
(
"wangwen"
,
pushObj
);
this
.
pushSubmitSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
this
.
pushSubmitSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
...
@@ -329,7 +329,7 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -329,7 +329,7 @@ class QcCenterOrderService extends AppServiceBase {
async
pushSubmitSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
async
pushSubmitSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
//推送状态变更
//推送状态变更
var
pushRes
=
await
this
.
aliclient
.
reqbyget
({
action
:
"SubmitSolution"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
var
pushRes
=
await
this
.
aliclient
.
reqbyget
({
action
:
"SubmitSolution"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
console
.
log
(
'wangwen++++pushRespushRes'
,
pushRes
)
console
.
log
(
'wangwen++++pushRespushRes'
,
pushRes
)
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
var
resData
=
pushRes
.
data
;
var
reqObj2
=
{
var
reqObj2
=
{
...
@@ -359,7 +359,7 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -359,7 +359,7 @@ class QcCenterOrderService extends AppServiceBase {
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'www+++result'
,
result
)
console
.
log
(
'www+++result'
,
result
)
if
(
result
.
status
==
0
)
{
if
(
result
.
status
==
0
)
{
if
(
result
.
data
)
{
if
(
result
.
data
)
{
pobj
.
actionBody
.
orderNo
=
result
.
data
;
pobj
.
actionBody
.
orderNo
=
result
.
data
;
...
@@ -390,8 +390,8 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -390,8 +390,8 @@ class QcCenterOrderService extends AppServiceBase {
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
});
// 推送ali
// 推送ali
var
a
=
await
self
.
aliclient
.
reqbyget
({
action
:
"CloseIntentionForPartner"
,
reqbody
:
{
IntentionBizId
:
pobj
.
actionBody
.
needNo
,
BizType
:
"esp.wangwen"
,
Note
:
pobj
.
actionBody
.
note
},
apiVersion
:
"2020-03-06"
});
var
a
=
await
self
.
aliclient
.
reqbyget
({
action
:
"CloseIntentionForPartner"
,
reqbody
:
{
IntentionBizId
:
pobj
.
actionBody
.
needNo
,
BizType
:
"esp.wangwen"
,
Note
:
pobj
.
actionBody
.
note
},
apiVersion
:
"2020-03-06"
});
console
.
log
(
'alalallala'
,
a
)
console
.
log
(
'alalallala'
,
a
)
// 2020 1021 lin 新增查看日志
// 2020 1021 lin 新增查看日志
self
.
logCtl
.
info
({
self
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
...
@@ -411,7 +411,7 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -411,7 +411,7 @@ class QcCenterOrderService extends AppServiceBase {
//提交沟通记录
//提交沟通记录
async
recordLog
(
pobj
)
{
async
recordLog
(
pobj
)
{
console
.
log
(
'提交沟通记录pobj'
,
pobj
)
console
.
log
(
'提交沟通记录pobj'
,
pobj
)
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
!
pobj
.
actionBody
.
needNo
)
{
if
(
!
pobj
.
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100491"
);
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100491"
);
...
@@ -422,7 +422,7 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -422,7 +422,7 @@ class QcCenterOrderService extends AppServiceBase {
var
self
=
this
;
var
self
=
this
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'www+提交沟通记录result'
,
result
)
console
.
log
(
'www+提交沟通记录result'
,
result
)
//推送交付系统
//推送交付系统
var
reqParams
=
{
var
reqParams
=
{
actionBody
:
{
actionBody
:
{
...
@@ -441,7 +441,7 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -441,7 +441,7 @@ class QcCenterOrderService extends AppServiceBase {
//提交沟通记录
//提交沟通记录
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"SubmitIntentionNote"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"SubmitIntentionNote"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
console
.
log
(
'www+提交沟通记录r'
,
r
)
console
.
log
(
'www+提交沟通记录r'
,
r
)
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
...
@@ -459,10 +459,10 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -459,10 +459,10 @@ class QcCenterOrderService extends AppServiceBase {
PageSize
:
pobj
.
actionBody
.
pageSize
||
10
,
PageSize
:
pobj
.
actionBody
.
pageSize
||
10
,
},
apiVersion
:
"2020-03-06"
},
apiVersion
:
"2020-03-06"
});
});
console
.
log
(
'loglist-----'
,
res
)
console
.
log
(
'loglist-----'
,
res
)
if
(
res
&&
res
.
data
&&
res
.
data
.
Data
)
{
if
(
res
&&
res
.
data
&&
res
.
data
.
Data
)
{
var
len
=
res
.
data
.
Data
.
length
;
var
len
=
res
.
data
.
Data
.
length
;
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
res
.
data
.
Data
[
i
].
CreateTime
=
res
.
data
.
Data
[
i
].
CreateTime
/
1000
res
.
data
.
Data
[
i
].
CreateTime
=
res
.
data
.
Data
[
i
].
CreateTime
/
1000
}
}
}
}
...
@@ -470,10 +470,10 @@ class QcCenterOrderService extends AppServiceBase {
...
@@ -470,10 +470,10 @@ class QcCenterOrderService extends AppServiceBase {
}
}
// ----------- 食品 -----------
// ----------- 食品 -----------
//服务商提交服务操作
//服务商提交服务操作
async
foodServiceSubmitOption
(
pobj
)
{
async
foodServiceSubmitOption
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
//推送数据至阿里
//推送数据至阿里
...
@@ -482,23 +482,23 @@ async foodServiceSubmitOption(pobj) {
...
@@ -482,23 +482,23 @@ async foodServiceSubmitOption(pobj) {
BizId
:
pobj
.
actionBody
.
orderNo
,
BizId
:
pobj
.
actionBody
.
orderNo
,
BizType
:
pobj
.
actionBody
.
channelTpye
,
BizType
:
pobj
.
actionBody
.
channelTpye
,
OperateType
:
wangwenStatusDisct
[
resStatus
],
OperateType
:
wangwenStatusDisct
[
resStatus
],
ExtInfo
:
pobj
.
actionBody
.
extInfo
ExtInfo
:
pobj
.
actionBody
.
extInfo
};
};
//推送状态变更
//推送状态变更
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"OperateProduceForPartner"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"OperateProduceForPartner"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
console
.
log
(
'ttttssss'
,
r
)
console
.
log
(
'ttttssss'
,
r
)
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
return
res
;
return
res
;
}
}
//提交方案
//提交方案
async
submitFoodSolution
(
pobj
)
{
async
submitFoodSolution
(
pobj
)
{
console
.
log
(
'food+++pobj'
,
pobj
)
console
.
log
(
'food+++pobj'
,
pobj
)
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
console
.
log
(
'food+++res'
,
res
)
console
.
log
(
'food+++res'
,
res
)
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
console
.
log
(
'food'
,
res
.
data
.
needsolution
.
solutionContent
);
console
.
log
(
'food'
,
res
.
data
.
needsolution
.
solutionContent
);
var
solution
=
res
.
data
.
needsolution
.
solutionContent
;
var
solution
=
res
.
data
.
needsolution
.
solutionContent
;
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
solution
=
JSON
.
parse
(
solution
);
solution
=
JSON
.
parse
(
solution
);
...
@@ -533,16 +533,16 @@ async submitFoodSolution(pobj) {
...
@@ -533,16 +533,16 @@ async submitFoodSolution(pobj) {
// solution: res.data.needsolution.solutionContent
// solution: res.data.needsolution.solutionContent
solution
:
solution
solution
:
solution
};
};
console
.
log
(
"food"
,
pushObj
);
console
.
log
(
"food"
,
pushObj
);
this
.
pushSubmitSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
this
.
pushSubmitSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
return
res
;
return
res
;
}
}
//关闭需求
//关闭需求
async
foodCloseNeed
(
pobj
)
{
async
foodCloseNeed
(
pobj
)
{
if
(
!
pobj
.
actionBody
.
needNo
)
{
if
(
!
pobj
.
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100395"
);
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100395"
);
...
@@ -555,7 +555,7 @@ async foodCloseNeed(pobj) {
...
@@ -555,7 +555,7 @@ async foodCloseNeed(pobj) {
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'food+++result'
,
result
)
console
.
log
(
'food+++result'
,
result
)
if
(
result
.
status
==
0
)
{
if
(
result
.
status
==
0
)
{
if
(
result
.
data
)
{
if
(
result
.
data
)
{
pobj
.
actionBody
.
orderNo
=
result
.
data
;
pobj
.
actionBody
.
orderNo
=
result
.
data
;
...
@@ -587,17 +587,17 @@ async foodCloseNeed(pobj) {
...
@@ -587,17 +587,17 @@ async foodCloseNeed(pobj) {
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
});
// 推送ali
// 推送ali
var
a
=
await
self
.
aliclient
.
reqbyget
({
action
:
"CloseIntentionForPartner"
,
reqbody
:
{
IntentionBizId
:
pobj
.
actionBody
.
needNo
,
BizType
:
"esp.wangwen"
,
Note
:
pobj
.
actionBody
.
note
},
apiVersion
:
"2020-03-06"
});
var
a
=
await
self
.
aliclient
.
reqbyget
({
action
:
"CloseIntentionForPartner"
,
reqbody
:
{
IntentionBizId
:
pobj
.
actionBody
.
needNo
,
BizType
:
"esp.wangwen"
,
Note
:
pobj
.
actionBody
.
note
},
apiVersion
:
"2020-03-06"
});
self
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseFoodNeed"
);
self
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseFoodNeed"
);
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
else
{
}
else
{
return
system
.
getResult
(
null
,
"close fail 100389 "
);
return
system
.
getResult
(
null
,
"close fail 100389 "
);
}
}
}
}
//提交沟通记录
//提交沟通记录
async
foodRecordLog
(
pobj
)
{
async
foodRecordLog
(
pobj
)
{
console
.
log
(
'提交沟通记录pobj'
,
pobj
)
console
.
log
(
'提交沟通记录pobj'
,
pobj
)
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
!
pobj
.
actionBody
.
needNo
)
{
if
(
!
pobj
.
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100491"
);
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100491"
);
...
@@ -608,7 +608,7 @@ async foodRecordLog(pobj) {
...
@@ -608,7 +608,7 @@ async foodRecordLog(pobj) {
var
self
=
this
;
var
self
=
this
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'提交沟通记录result'
,
result
)
console
.
log
(
'提交沟通记录result'
,
result
)
//推送交付系统
//推送交付系统
var
reqParams
=
{
var
reqParams
=
{
actionBody
:
{
actionBody
:
{
...
@@ -627,12 +627,12 @@ async foodRecordLog(pobj) {
...
@@ -627,12 +627,12 @@ async foodRecordLog(pobj) {
//提交沟通记录
//提交沟通记录
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"SubmitIntentionNote"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"SubmitIntentionNote"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
console
.
log
(
'提交沟通记录r'
,
r
)
console
.
log
(
'提交沟通记录r'
,
r
)
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
//查看沟通记录
//查看沟通记录
async
foodRecordLogList
(
pobj
)
{
async
foodRecordLogList
(
pobj
)
{
if
(
!
pobj
.
actionBody
.
needNo
)
{
if
(
!
pobj
.
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100493"
);
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100493"
);
}
}
...
@@ -645,23 +645,23 @@ async foodRecordLogList(pobj) {
...
@@ -645,23 +645,23 @@ async foodRecordLogList(pobj) {
PageSize
:
pobj
.
actionBody
.
pageSize
||
10
,
PageSize
:
pobj
.
actionBody
.
pageSize
||
10
,
},
apiVersion
:
"2020-03-06"
},
apiVersion
:
"2020-03-06"
});
});
if
(
res
&&
res
.
data
&&
res
.
data
.
Data
)
{
if
(
res
&&
res
.
data
&&
res
.
data
.
Data
)
{
var
len
=
res
.
data
.
Data
.
length
;
var
len
=
res
.
data
.
Data
.
length
;
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
res
.
data
.
Data
[
i
].
CreateTime
=
res
.
data
.
Data
[
i
].
CreateTime
/
1000
res
.
data
.
Data
[
i
].
CreateTime
=
res
.
data
.
Data
[
i
].
CreateTime
/
1000
}
}
}
}
return
system
.
getResultSuccess
(
res
);
return
system
.
getResultSuccess
(
res
);
}
}
//推送订单状态
//推送订单状态
async
pushOrderStatus
(
pobj
){
async
pushOrderStatus
(
pobj
)
{
if
(
!
pobj
.
interface_params
)
{
if
(
!
pobj
.
interface_params
)
{
return
system
.
getResult
(
null
,
"interface_params can not be empty,100400"
);
return
system
.
getResult
(
null
,
"interface_params can not be empty,100400"
);
}
}
let
interface_params_info
=
JSON
.
parse
(
pobj
.
interface_params
);
let
interface_params_info
=
JSON
.
parse
(
pobj
.
interface_params
);
if
(
!
interface_params_info
||
!
interface_params_info
.
pushUrl
||
!
interface_params_info
.
action
||
interface_params_info
.
apiVersion
)
{
if
(
!
interface_params_info
||
!
interface_params_info
.
action
||
!
interface_params_info
.
apiVersion
)
{
return
system
.
getResult
(
null
,
"interface_params(pushUrl、
action、apiVersion) can not be empty,100430"
);
return
system
.
getResult
(
null
,
"interface_params(
action、apiVersion) can not be empty,100430"
);
}
}
let
pushObj
=
{
let
pushObj
=
{
BizId
:
pobj
.
pushObj
.
BizId
,
BizId
:
pobj
.
pushObj
.
BizId
,
...
@@ -669,35 +669,35 @@ async foodRecordLogList(pobj) {
...
@@ -669,35 +669,35 @@ async foodRecordLogList(pobj) {
ApplicationStatus
:
pobj
.
pushObj
.
ApplicationStatus
ApplicationStatus
:
pobj
.
pushObj
.
ApplicationStatus
};
};
let
obj
=
{
let
obj
=
{
action
:
interface_params_info
.
action
,
action
:
interface_params_info
.
action
,
reqbody
:
pushObj
,
reqbody
:
pushObj
,
apiVersion
:
interface_params_info
.
apiVersion
apiVersion
:
interface_params_info
.
apiVersion
}
}
let
result
=
await
this
.
aliclient
.
reqbyget
(
obj
);
let
result
=
await
this
.
aliclient
.
reqbyget
(
obj
);
return
result
;
return
result
;
}
}
// //推送ICP方案
// //推送ICP方案
// async pushIcpSolution1(pushObj, solutionNo, appInfo, self) {
// async pushIcpSolution1(pushObj, solutionNo, appInfo, self) {
// //推送方案确认信息
// //推送方案确认信息
// var confirmRes = await this.aliclient.reqbyget({ action: "ConfirmIntention", reqbody: { BizId: pushObj.IntentionBizId }, apiVersion: "2019-05-08" });
// var confirmRes = await this.aliclient.reqbyget({ action: "ConfirmIntention", reqbody: { BizId: pushObj.IntentionBizId }, apiVersion: "2019-05-08" });
// console.log("confirmRes",confirmRes)
// console.log("confirmRes",confirmRes)
// // if (confirmRes && confirmRes.status == 0 && confirmRes.data) {
// // if (confirmRes && confirmRes.status == 0 && confirmRes.data) {
// // var confirmResData = confirmRes.data;
// // var confirmResData = confirmRes.data;
// // if (confirmResData.ConfirmUrl) {
// // if (confirmResData.ConfirmUrl) {
// // var reqObj3 = {
// // var reqObj3 = {
// // actionType: "receiveIcpConfirmUrl",
// // actionType: "receiveIcpConfirmUrl",
// // appInfo: appInfo,
// // appInfo: appInfo,
// // actionBody: {
// // actionBody: {
// // solutionNo: solutionNo,
// // solutionNo: solutionNo,
// // confirmUrl: confirmResData.ConfirmUrl
// // confirmUrl: confirmResData.ConfirmUrl
// // }
// // }
// // };
// // };
// // var a = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url
// // var a = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url
// // }
// // }
// // }
// // }
// // return confirmRes;
// // return confirmRes;
// }
// }
}
}
module
.
exports
=
QcCenterOrderService
;
module
.
exports
=
QcCenterOrderService
;
...
...
center-channel/app/base/service/impl/common/signSve.js
View file @
89c61ad4
...
@@ -71,6 +71,15 @@ class SignService{
...
@@ -71,6 +71,15 @@ class SignService{
}
}
var
resultSignStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
app_secret
;
var
resultSignStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
app_secret
;
var
resultTmpSign
=
md5
(
resultSignStr
).
toUpperCase
();
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
)
{
if
(
params
.
sign
!=
resultTmpSign
)
{
return
system
.
getResult
(
null
,
"返回值签名验证失败"
);
return
system
.
getResult
(
null
,
"返回值签名验证失败"
);
}
}
...
@@ -127,6 +136,22 @@ module.exports = SignService;
...
@@ -127,6 +136,22 @@ module.exports = SignService;
// "bizId":"202011031421",
// "bizId":"202011031421",
// "status":"16"
// "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=>{
// task.createSign(obj,"7cbb892450174167b5c7e01we4717z51").then(d=>{
// console.log(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 {
...
@@ -499,13 +499,13 @@ class UtilsNeedService2 extends AppServiceBase {
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need2/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need2/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
//2020-10-28 laolan start
//2020-10-28 laolan start
if
(
result
&&
result
.
status
==
0
&&
result
.
data
&&
result
.
data
.
uappIds
){
if
(
result
&&
result
.
status
==
0
&&
result
.
data
){
if
(
result
.
data
.
uappIds
==
uappId
.
ali
){
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"
});
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
)
console
.
log
(
"ali+res"
,
res
)
}
}
if
(
result
.
data
.
uappIds
==
uappId
.
baidu
){
if
(
result
.
data
==
uappId
.
baidu
){
var
ress
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/communication"
,
reqbody
:
{
bizId
:
pobj
.
actionBody
.
intentionBizId
,
note
:
pobj
.
actionBody
.
note
}
});
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
)
console
.
log
(
"baidu+res"
,
ress
)
}
}
}
}
...
@@ -534,15 +534,16 @@ class UtilsNeedService2 extends AppServiceBase {
...
@@ -534,15 +534,16 @@ class UtilsNeedService2 extends AppServiceBase {
}
}
async
queryExpertApplyCommunicationLogs
(
pobj
)
{
async
queryExpertApplyCommunicationLogs
(
pobj
)
{
if
(
!
pobj
.
actionBody
.
intentionBizId
)
{
//
if (!pobj.actionBody.intentionBizId) {
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,100493"
);
//
return system.getResult(null, "actionBody.intentionBizId can not be empty,100493");
}
//
}
if
(
!
pobj
.
actionBody
.
userFeedBack
)
{
//
if (!pobj.actionBody.userFeedBack) {
return
system
.
getResult
(
null
,
"actionBody.userFeedBack can not be empty,100494"
);
//
return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
}
//
}
//2020-10-28 laolan start
//2020-10-28 laolan start
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need2/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need2/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
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
&&
result
.
status
==
0
&&
result
.
data
&&
result
.
data
.
uapp_id
){
if
(
result
.
data
.
uapp_id
==
uappId
.
ali
){
if
(
result
.
data
.
uapp_id
==
uappId
.
ali
){
var
res
=
await
this
.
aliclient
.
reqbyget
({
var
res
=
await
this
.
aliclient
.
reqbyget
({
...
@@ -558,16 +559,15 @@ class UtilsNeedService2 extends AppServiceBase {
...
@@ -558,16 +559,15 @@ class UtilsNeedService2 extends AppServiceBase {
}
}
if
(
result
.
data
.
uapp_id
==
uappId
.
baidu
){
if
(
result
.
data
.
uapp_id
==
uappId
.
baidu
){
console
.
log
(
"bbbbb++"
,
pobj
)
var
res
=
await
this
.
baiduclient
.
baiduReqbyget
({
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
:
""
,
beginTime
:
pobj
.
actionBody
.
BeginTime
?
pobj
.
actionBody
.
BeginTime
:
""
,
endTime
:
pobj
.
actionBody
.
EndTime
?
pobj
.
actionBody
.
EndTime
:
""
,
endTime
:
pobj
.
actionBody
.
EndTime
?
pobj
.
actionBody
.
EndTime
:
""
,
bizId
:
pobj
.
actionBody
.
intentionBizId
,
requirementId
:
pobj
.
actionBody
.
intentionBizId
userFeedBack
:
pobj
.
actionBody
.
userFeedBack
,
pageNum
:
pobj
.
actionBody
.
pageNum
||
1
,
pageSize
:
pobj
.
actionBody
.
pageSize
||
10
,
}
}
});
});
console
.
log
(
'xxcc+++'
,
res
)
}
}
}
}
...
@@ -581,7 +581,7 @@ class UtilsNeedService2 extends AppServiceBase {
...
@@ -581,7 +581,7 @@ class UtilsNeedService2 extends AppServiceBase {
// var updateRes = await this.utilsneedSve.dao.customUpdate(sql, paramWhere);
// var updateRes = await this.utilsneedSve.dao.customUpdate(sql, paramWhere);
// }
// }
// func();
// 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 {
...
@@ -53,7 +53,7 @@ class UtilsPushService extends AppServiceBase {
}
}
async
pushBusInfo
(
pobj
,
opType
,
isDelProductInfo
)
{
//推送业务总入口,不在db中做配置进行调用
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
;
var
interface_list
=
pobj
.
interface_info
?
pobj
.
interface_info
:
pobj
.
actionBody
.
product_info
.
interface_info
;
if
(
!
interface_list
)
{
if
(
!
interface_list
)
{
return
system
.
getResult
(
null
,
"暂无推送配置"
);
return
system
.
getResult
(
null
,
"暂无推送配置"
);
...
@@ -64,14 +64,16 @@ class UtilsPushService extends AppServiceBase {
...
@@ -64,14 +64,16 @@ class UtilsPushService extends AppServiceBase {
}
}
var
self
=
this
;
var
self
=
this
;
let
result
;
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
];
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
;
return
reflexActionRes
;
}
else
{
}
else
{
for
(
let
index
=
0
;
index
<
interface_list_temp
.
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
interface_list_temp
.
length
;
index
++
)
{
const
element
=
interface_list_temp
[
index
];
const
element
=
interface_list_temp
[
index
];
result
=
await
self
.
reflexAction
(
element
,
opType
,
pobj
,
isDelProductInfo
);
result
=
await
self
.
reflexAction
(
element
,
opType
,
pobj
,
isDelProductInfo
);
self
.
execClientNew
.
execLogs
(
"pushBusInfo-for---reflexAction-result:"
,
pobj
,
"center-channel-reflexAction"
,
result
,
null
);
}
}
return
result
;
return
result
;
}
}
...
@@ -84,6 +86,7 @@ class UtilsPushService extends AppServiceBase {
...
@@ -84,6 +86,7 @@ class UtilsPushService extends AppServiceBase {
return
system
.
getResult
(
null
,
"暂无推送配置"
);
return
system
.
getResult
(
null
,
"暂无推送配置"
);
}
}
var
result
=
await
this
.
reflexAction
(
interface_info
,
pobj
.
opType
,
pobj
,
pobj
.
isDelProductInfo
||
1
);
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
)
{
if
(
result
.
status
!=
0
)
{
return
result
;
return
result
;
}
}
...
@@ -124,7 +127,7 @@ class UtilsPushService extends AppServiceBase {
...
@@ -124,7 +127,7 @@ class UtilsPushService extends AppServiceBase {
delete
actionBody
[
"product_info"
];
delete
actionBody
[
"product_info"
];
}
//是否删除产品信息进行推送
}
//是否删除产品信息进行推送
refResult
=
await
this
.
restPostUrl
(
pobj
.
actionBody
,
interface_info
.
interface_url
);
refResult
=
await
this
.
restPostUrl
(
pobj
.
actionBody
,
interface_info
.
interface_url
);
if
(
refResult
.
code
==
1
)
{
if
(
refResult
.
code
==
1
)
{
refResult
.
status
=
0
refResult
.
status
=
0
}
}
this
.
disposePushResult
(
pobj
,
refResult
,
"ycUrlPush->reflexAction->refResult"
,
this
.
pushlogFailType
.
NEWRPC
);
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 {
...
@@ -102,7 +102,7 @@ class utils360Sve extends AppServiceBase {
appInfo
:
pobj
.
appInfo
appInfo
:
pobj
.
appInfo
}
}
this
.
utilsPushSve
.
aliBusiness2Delivery
(
deliveryObj
,
"submitService"
);
this
.
utilsPushSve
.
aliBusiness2Delivery
(
deliveryObj
,
"submitService"
);
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
(
{
orderNo
:
pobj
.
actionBody
.
orderNo
}
);
}
}
async
notifyService
(
pobj
,
actionBody
,
req
)
{
async
notifyService
(
pobj
,
actionBody
,
req
)
{
...
...
center-channel/app/base/utils/baiduClient.js
View file @
89c61ad4
...
@@ -21,49 +21,31 @@ class baiduClient {
...
@@ -21,49 +21,31 @@ class baiduClient {
let
timestamp
=
new
Date
().
toISOString
()
let
timestamp
=
new
Date
().
toISOString
()
let
site
=
timestamp
.
lastIndexOf
(
"."
);
let
site
=
timestamp
.
lastIndexOf
(
"."
);
timestamp
=
timestamp
.
substring
(
0
,
site
)
+
"Z"
timestamp
=
timestamp
.
substring
(
0
,
site
)
+
"Z"
// let timestamp = "2020-11-05T04:00:00Z"
console
.
log
(
'timestamp++'
,
timestamp
)
let
signedHeaders
=
"host"
;
let
signedHeaders
=
"host"
;
let
extime
=
1800
;
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"
let
canonicalHeaders
=
"host:gwgp-mwnn9gk4o4e.i.bdcloudapi.com"
//中间结果1:规范化请求和前缀字符串
//中间结果1:规范化请求和前缀字符串
let
canonicalRequest
=
"POST"
+
"
\
n"
+
path
+
"
\
n"
+
"
\
n"
+
canonicalHeaders
;
let
canonicalRequest
=
"POST"
+
"
\
n"
+
path
+
"
\
n"
+
"
\
n"
+
canonicalHeaders
;
console
.
log
(
'canonicalRequest+++'
,
canonicalRequest
)
//authStringPrefix(前缀字符串,由除sk字段外的签名信息生成)
//authStringPrefix(前缀字符串,由除sk字段外的签名信息生成)
let
authStringPrefix
=
version
+
"/"
+
accessKey
+
"/"
+
timestamp
+
"/"
+
extime
;
let
authStringPrefix
=
version
+
"/"
+
accessKey
+
"/"
+
timestamp
+
"/"
+
extime
;
console
.
log
(
'authStringPrefix+++'
,
authStringPrefix
)
//中间结果2:派生签名密钥 signingKey
//中间结果2:派生签名密钥 signingKey
let
signingKey
=
crypto
.
createHmac
(
'sha256'
,
secretKey
)
let
signingKey
=
crypto
.
createHmac
(
'sha256'
,
secretKey
)
.
update
(
authStringPrefix
)
.
update
(
authStringPrefix
)
.
digest
(
'hex'
);
.
digest
(
'hex'
);
console
.
log
(
'signingKey+++'
,
signingKey
)
//中间结果3:签名摘要 signature
//中间结果3:签名摘要 signature
let
signature
=
crypto
.
createHmac
(
'sha256'
,
signingKey
)
let
signature
=
crypto
.
createHmac
(
'sha256'
,
signingKey
)
.
update
(
canonicalRequest
)
.
update
(
canonicalRequest
)
.
digest
(
'hex'
);
.
digest
(
'hex'
);
console
.
log
(
'signature+++'
,
signature
)
//最终结果:认证字符串 authorization
//最终结果:认证字符串 authorization
let
authorization
=
authStringPrefix
+
"/"
+
signedHeaders
+
"/"
+
signature
;
let
authorization
=
authStringPrefix
+
"/"
+
signedHeaders
+
"/"
+
signature
;
console
.
log
(
'authorization+++'
,
authorization
)
var
baiduObj
=
{
var
baiduObj
=
{
authorization
:
authorization
,
authorization
:
authorization
,
data
:
actionBody
data
:
actionBody
}
}
var
rtn
=
await
this
.
execClient
.
execBaiduPost
(
baiduObj
,
url
);
var
rtn
=
await
this
.
execClient
.
execBaiduPost
(
baiduObj
,
url
);
console
.
log
(
"baiduObj+++++"
,
baiduObj
)
console
.
log
(
"url+++++"
,
url
)
console
.
log
(
"rtn+++++"
,
rtn
)
if
(
!
rtn
||
!
rtn
.
stdout
)
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"execPost data is empty"
);
return
system
.
getResult
(
null
,
"execPost data is empty"
);
}
}
...
@@ -73,7 +55,6 @@ class baiduClient {
...
@@ -73,7 +55,6 @@ class baiduClient {
//百度接口 2020-10-27 laolan
//百度接口 2020-10-27 laolan
async
baiduReqbyget
(
obj
,
cbk
)
{
async
baiduReqbyget
(
obj
,
cbk
)
{
console
.
log
(
'obj+++'
,
obj
)
var
path
=
obj
.
path
;
var
path
=
obj
.
path
;
var
reqbody
=
obj
.
reqbody
;
var
reqbody
=
obj
.
reqbody
;
try
{
try
{
...
@@ -111,69 +92,5 @@ class baiduClient {
...
@@ -111,69 +92,5 @@ class baiduClient {
return
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
e
.
stack
);
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
;
module
.
exports
=
baiduClient
;
center-channel/app/config/businessConfig.js
View file @
89c61ad4
...
@@ -18,7 +18,7 @@ module.exports = {
...
@@ -18,7 +18,7 @@ module.exports = {
"foodCloseNeed"
,
"foodRecordLog"
,
"foodRecordLogList"
,
"getParamsFor360"
,
"addOrderWeb"
,
"getPayRecords"
,
"getLoginInfo"
,
"putUserMobileByVcode"
,
"foodCloseNeed"
,
"foodRecordLog"
,
"foodRecordLogList"
,
"getParamsFor360"
,
"addOrderWeb"
,
"getPayRecords"
,
"getLoginInfo"
,
"putUserMobileByVcode"
,
"putUserPwdByMobile"
,
"icpNotifyNew"
"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"
]
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