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
3b70325b
Commit
3b70325b
authored
Nov 10, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xiugaiIcptype
parent
deab83bc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1309 additions
and
25 deletions
+1309
-25
center-channel/app/base/api/impl/action/qcapi.js
+21
-21
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
+1
-1
center-channel/app/base/service/impl/common/ncSve.js
+688
-0
center-channel/app/base/service/impl/common/rtSve.js
+591
-0
center-channel/app/config/businessConfig.js
+8
-3
No files found.
center-channel/app/base/api/impl/action/qcapi.js
View file @
3b70325b
...
...
@@ -56,38 +56,38 @@ class QcAPI extends APIBase {
// --------- 文网文 ---------
case
"
s
erviceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
opResult
=
await
this
.
qcCenterOrderSve
.
s
erviceSubmitOption
(
pobj
);
case
"
ncS
erviceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
opResult
=
await
this
.
qcCenterOrderSve
.
ncS
erviceSubmitOption
(
pobj
);
break
;
case
"
submitWangwen
Solution"
:
//提交方案(文网文)2020-9-26
opResult
=
await
this
.
qcCenterOrderSve
.
submitWangwen
Solution
(
pobj
);
case
"
ncSubmit
Solution"
:
//提交方案(文网文)2020-9-26
opResult
=
await
this
.
qcCenterOrderSve
.
ncSubmit
Solution
(
pobj
);
break
;
case
"
c
loseNeed"
:
//关闭需求(文网文)2020-9-28
opResult
=
await
this
.
qcCenterOrderSve
.
c
loseNeed
(
pobj
);
case
"
ncC
loseNeed"
:
//关闭需求(文网文)2020-9-28
opResult
=
await
this
.
qcCenterOrderSve
.
ncC
loseNeed
(
pobj
);
break
;
case
"
r
ecordLog"
:
//提交沟通记录(文网文)2020-9-28
opResult
=
await
this
.
qcCenterOrderSve
.
r
ecordLog
(
pobj
);
case
"
ncR
ecordLog"
:
//提交沟通记录(文网文)2020-9-28
opResult
=
await
this
.
qcCenterOrderSve
.
ncR
ecordLog
(
pobj
);
break
;
case
"
r
ecordLogList"
:
//查询沟通记录(文网文)2020-9-29
opResult
=
await
this
.
qcCenterOrderSve
.
r
ecordLogList
(
pobj
);
case
"
ncR
ecordLogList"
:
//查询沟通记录(文网文)2020-9-29
opResult
=
await
this
.
qcCenterOrderSve
.
ncR
ecordLogList
(
pobj
);
break
;
// ---------
食品
---------
// ---------
广电
---------
case
"
food
ServiceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
opResult
=
await
this
.
qcCenterOrderSve
.
food
ServiceSubmitOption
(
pobj
);
case
"
rt
ServiceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
opResult
=
await
this
.
qcCenterOrderSve
.
rt
ServiceSubmitOption
(
pobj
);
break
;
case
"
submitFood
Solution"
:
//提交方案(文网文)2020-9-26
opResult
=
await
this
.
qcCenterOrderSve
.
submitFood
Solution
(
pobj
);
case
"
rtSubmit
Solution"
:
//提交方案(文网文)2020-9-26
opResult
=
await
this
.
qcCenterOrderSve
.
rtSubmit
Solution
(
pobj
);
break
;
case
"
food
CloseNeed"
:
//关闭需求(文网文)2020-9-28
opResult
=
await
this
.
qcCenterOrderSve
.
food
CloseNeed
(
pobj
);
case
"
rt
CloseNeed"
:
//关闭需求(文网文)2020-9-28
opResult
=
await
this
.
qcCenterOrderSve
.
rt
CloseNeed
(
pobj
);
break
;
case
"
food
RecordLog"
:
//提交沟通记录(文网文)2020-9-28
opResult
=
await
this
.
qcCenterOrderSve
.
food
RecordLog
(
pobj
);
case
"
rt
RecordLog"
:
//提交沟通记录(文网文)2020-9-28
opResult
=
await
this
.
qcCenterOrderSve
.
rt
RecordLog
(
pobj
);
break
;
case
"
food
RecordLogList"
:
//查询沟通记录(文网文)2020-9-29
opResult
=
await
this
.
qcCenterOrderSve
.
food
RecordLogList
(
pobj
);
case
"
rt
RecordLogList"
:
//查询沟通记录(文网文)2020-9-29
opResult
=
await
this
.
qcCenterOrderSve
.
rt
RecordLogList
(
pobj
);
break
;
default
:
...
...
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
View file @
3b70325b
...
...
@@ -138,7 +138,7 @@ class BaseCenterOrderService extends AppServiceBase {
companyName
:
solution
.
CompanyName
,
companyAddress
:
solution
.
CompanyAddress
,
area
:
solution
.
Area
,
type
:
solution
.
Action
Type
type
:
solution
.
Icp
Type
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"bizId"
]
=
needsolution
.
channelSolutionNo
;
...
...
center-channel/app/base/service/impl/common/ncSve.js
0 → 100644
View file @
3b70325b
const
system
=
require
(
"../../../system"
);
const
crypto
=
require
(
'crypto'
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
//(文网文状态2020-9-26)
const
wangwenStatusDisct
=
{
601
:
"PARTNER_SUBMIT_MATERIAL"
,
602
:
"CERT_ACCOUNT_REGISTERED"
,
603
:
"CERT_MATERIAL_SUBMITTED"
,
604
:
"CERT_GXB_ACCEPT"
,
605
:
"CERT_GXB_REFUSE"
,
606
:
"CERT_GXB_SUCCESS"
,
607
:
"CERT_GXB_FAIL"
};
//区分渠道的uappid
const
uappId
=
{
'ali'
:
"18"
,
//(阿里icp、edi)
'baidu'
:
"44"
//(百度icp、edi)
}
//推送百度城市拼音转义 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"
}
//百度拼音转义 2020-11-6
const
baiduIcpStatus
=
{
507
:
"REGISTRATION"
,
508
:
"SUBMITTED"
,
509
:
"ACCEPTED"
,
510
:
"NOT_ACCEPTED"
,
511
:
"APPROVED"
,
512
:
"NOT_APPROVED"
};
/**
* 网文相关接口(NC)
*/
class
NcService
extends
AppServiceBase
{
constructor
()
{
super
();
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
//测试用
this
.
opPushQueueUrl
=
settings
.
opPushQueueUrl
();
this
.
baiduclient
=
system
.
getObject
(
"util.baiduClient"
);
};
//调用center-order
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
if
(
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
}
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
return
data
;
}
//提交Icp注册方案
async
submitIcpProgramme
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
needinfo
&&
res
.
data
.
needsolution
)
{
var
needinfo
=
res
.
data
.
needinfo
;
//需求信息
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
var
ab
=
pobj
.
actionBody
;
if
(
typeof
(
ab
.
solutionContent
)
==
"string"
)
{
ab
.
solutionContent
=
JSON
.
parse
(
ab
.
solutionContent
);
}
if
(
typeof
(
needsolution
.
solutionContent
)
==
"string"
)
{
needsolution
.
solutionContent
=
JSON
.
parse
(
needsolution
.
solutionContent
);
}
var
solution
=
needsolution
.
solutionContent
.
solution
;
var
self
=
this
;
//推送方案
// 2020 0916 lin 修改 增加获取返回值
//var pushIcpSolutionRes = await this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
//2020-10-26 laolan 区分百度与阿里
if
(
needinfo
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
// var bizType = needinfo.channelTypeCode;//业务类型里
var
pushObj
=
{
IntentionBizId
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
IcpType
:
solution
.
IcpType
,
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
Note
:
solution
.
Note
,
ActionType
:
solution
.
ActionType
,
Source
:
"官网"
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
}
var
pushIcpSolutionRes
=
await
this
.
pushIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
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
,
companyAddress
:
solution
.
CompanyAddress
,
area
:
solution
.
Area
,
type
:
solution
.
ActionType
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"bizId"
]
=
needsolution
.
channelSolutionNo
;
}
console
.
log
(
'pushObj++'
,
pushObj
)
var
pushIcpSolutionRes
=
await
this
.
pushBaiduIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
// // 2020 0806 lin 新增推送
// var reqParams = {
// actionType: "produceData",// Y 功能名称
// actionBody: {
// pushUrl: pushUrl,// Y 推送地址
// actionType: "updateChanceStatus",// Y 推送地址接收时的功能名称
// notifyUrl: "",// N 推送成功后通知的Url
// identifyCode: "ali.vat",// Y 操作的业务标识
// messageBody: pobj.actionBody, // Y 推送的业务消息,必须有一项对象属性值
// headData: ""//N 请求头信息,Json格式,如:{token:"XXXXXXX"}
// },
// requestId: pobj.requestId || "" // N 请求id
// }
// this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams);
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/qcCenterOrderSve.js/submitIcpProgramme"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
needinfo
),
optitle
:
"createSolution推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
needinfo
.
channelNeedNo
,
status
:
"createSolution"
},
appInfo
:
pobj
.
appInfo
}
this
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
//
return
system
.
getResultSuccess
(
pushIcpSolutionRes
);
}
return
res
;
}
//推送ICP方案ali
async
pushIcpSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
//推送方案信息
var
pushRes
=
await
self
.
aliclient
.
reqbyget
({
action
:
"SubmitIcpSolution"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
if
(
resData
.
BizId
)
{
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
solutionBizId
:
resData
.
BizId
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
if
(
a
&&
a
.
status
==
0
)
{
//推送方案确认信息
var
confirmRes
=
await
self
.
aliclient
.
reqbyget
({
action
:
"ConfirmIntention"
,
reqbody
:
{
BizId
:
pushObj
.
IntentionBizId
},
apiVersion
:
"2019-05-08"
});
if
(
confirmRes
&&
confirmRes
.
status
==
0
&&
confirmRes
.
data
)
{
var
confirmResData
=
confirmRes
.
data
;
if
(
confirmResData
.
ConfirmUrl
)
{
var
reqObj3
=
{
actionType
:
"receiveIcpConfirmUrl"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
confirmUrl
:
confirmResData
.
ConfirmUrl
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
}
}
return
confirmRes
;
}
}
}
}
//推送ICP方案baidu 2020-10-26 laolan
async
pushBaiduIcpSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
console
.
log
(
'pushObj++baidu+++'
,
pushObj
)
//推送方案信息
var
pushRes
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/plan"
,
reqbody
:
pushObj
});
console
.
log
(
"pushRes++++"
,
pushRes
)
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
if
(
resData
.
planId
)
{
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
solutionBizId
:
resData
.
planId
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
if
(
a
&&
a
.
status
==
0
&&
resData
.
path
)
{
var
reqObj3
=
{
actionType
:
"receiveIcpConfirmUrl"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
confirmUrl
:
resData
.
path
}
};
var
url
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
console
.
log
(
'save confirmUrl ++ '
,
url
)
return
pushRes
;
}
}
}
}
//服务商icp方案关闭 2020-10-26 laolan
async
abolishIcpProgramme
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
var
needsolution
=
res
.
data
;
//方案信息
var
ab
=
pobj
.
actionBody
;
if
(
typeof
(
ab
.
material
)
==
"string"
)
{
ab
.
material
=
JSON
.
parse
(
ab
.
material
);
}
//推送数据至阿里
var
pushObj
=
{
BizId
:
ab
.
BizId
,
Note
:
ab
.
Note
};
//关闭方案
this
.
aliclient
.
reqbyget
({
action
:
"CloseIcpProduce"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
return
system
.
getResultSuccess
();
}
return
res
;
}
//交付材料提交
async
serviceProviderSubmitMaterial
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
var
needsolution
=
res
.
data
;
//方案信息
var
ab
=
pobj
.
actionBody
;
if
(
typeof
(
ab
.
material
)
==
"string"
)
{
ab
.
material
=
JSON
.
parse
(
ab
.
material
);
}
var
material
=
ab
.
material
;
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
var
pushObj
=
{
"BizId"
:
BizId
,
"Domain"
:
material
.
Domain
,
"CorporateName"
:
material
.
CorporateName
,
"IncludeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"PartnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"PartnerIdCardList"
:
material
.
PartnerIdCardList
,
"PartnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"PartnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"PartnerPlan"
:
material
.
PartnerPlan
||
""
,
"PartnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"PartnerLaw"
:
material
.
PartnerLaw
||
""
,
"PartnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"PartnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"PartnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
};
var
self
=
this
;
//推送方案材料
self
.
aliclient
.
reqbyget
({
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
//推送数据至百度
var
BizId
=
needsolution
.
orderChannelNo
;
console
.
log
(
'BizId++'
,
BizId
)
var
pushObj
=
{
"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
,
"partnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"partnerIdCardList"
:
material
.
PartnerIdCardList
,
"partnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"partnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"partnerPlan"
:
material
.
PartnerPlan
||
""
,
"partnerLaw"
:
material
.
PartnerLaw
||
""
,
"partnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"partnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"partnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
};
var
self
=
this
;
//推送方案材料
var
r
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
console
.
log
(
'rrrr+++++'
,
r
)
}
return
system
.
getResultSuccess
();
}
return
res
;
}
//通知交付状态变更
async
serviceProviderNotification
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
pushObj
=
{
BizId
:
res
.
data
.
BizId
,
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
ApplicationStatus
:
res
.
data
.
ApplicationStatus
};
//推送状态变更
this
.
aliclient
.
reqbyget
({
action
:
"AcceptPartnerNotification"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
res
.
data
.
ApplicationStatus
=
baiduIcpStatus
[
res
.
data
.
ApplicationStatus
];
console
.
log
(
'res.data.channelOrderNo'
,
res
.
data
.
channelOrderNo
)
//推送数据至百度
var
pushObj
=
{
orderNo
:
res
.
data
.
channelOrderNo
,
status
:
res
.
data
.
ApplicationStatus
};
//推送状态变更
this
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/update"
,
reqbody
:
pushObj
});
}
return
system
.
getResultSuccess
();
}
return
res
;
}
//交付单关闭
async
closeOrderDelivery
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
var
needsolution
=
res
.
data
;
//方案信息
var
ab
=
pobj
.
actionBody
;
//推送数据至阿里
var
pushObj
=
{
BizId
:
needsolution
.
channelSolutionNo
,
Note
:
ab
.
note
};
//关闭方案
this
.
aliclient
.
reqbyget
({
action
:
"CloseIcpProduce"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
return
system
.
getResultSuccess
();
}
return
res
;
}
// ----------- 文网文 -----------
//服务商提交服务操作(文网文)2020-9-26
async
ncServiceSubmitOption
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
if
(
res
.
data
.
uapp_id
=
uappId
.
ali
){
//推送数据至阿里
var
resStatus
=
res
.
data
.
ApplicationStatus
;
var
pushObj
=
{
BizId
:
pobj
.
actionBody
.
orderNo
,
BizType
:
pobj
.
actionBody
.
channelType
,
OperateType
:
wangwenStatusDisct
[
resStatus
],
ExtInfo
:
pobj
.
actionBody
.
extInfo
};
console
.
log
(
"ali fuwu++++pushObj"
,
pushObj
);
//推送状态变更
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"OperateProduceForPartner"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
console
.
log
(
'ali +++ r+++'
,
r
)
}
if
(
res
.
data
.
uapp_id
=
uappId
.
baidu
){
//推送数据至阿里
var
resStatus
=
res
.
data
.
ApplicationStatus
;
var
pushObj
=
{
bizId
:
pobj
.
actionBody
.
orderNo
,
bizType
:
pobj
.
actionBody
.
channelType
,
operateType
:
wangwenStatusDisct
[
resStatus
],
extInfo
:
pobj
.
actionBody
.
extInfo
};
console
.
log
(
" baidu fuwu++++pushObj"
,
pushObj
);
//推送状态变更
var
r
=
await
this
.
baiduclient
.
baiduReqbyget
({
path
:
"////"
,
reqbody
:
pushObj
});
console
.
log
(
'baidu +++ r+++'
,
r
)
}
return
system
.
getResultSuccess
();
}
return
res
;
}
//提交方案(文网文)2020-9-27
async
ncSubmitSolution
(
pobj
)
{
console
.
log
(
'文网文提交方案'
,
pobj
)
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
console
.
log
(
'www'
,
res
.
data
.
needsolution
.
solutionContent
);
var
solution
=
res
.
data
.
needsolution
.
solutionContent
;
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
solution
=
JSON
.
parse
(
solution
);
solution
=
solution
.
solution
solution
=
JSON
.
stringify
(
solution
)
//推送交付系统
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
res
.
data
.
needinfo
.
channelNeedNo
,
status
:
"createSolution"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
}
var
self
=
this
;
self
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
//日志记录
self
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/qcCenterOrderSve.js/submitWangwenSolution"
,
content
:
JSON
.
stringify
(
reqParams
),
resultInfo
:
""
,
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
pushObj
=
{
intentionBizId
:
res
.
data
.
needinfo
.
channelNeedNo
,
bizType
:
res
.
data
.
needinfo
.
channelTypeCode
,
// solution: res.data.needsolution.solutionContent
solution
:
solution
};
console
.
log
(
"wangwen"
,
pushObj
);
this
.
pushAliNcSubmitSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
//推送数据至baidu
var
pushObj
=
{
intentionBizId
:
res
.
data
.
needinfo
.
channelNeedNo
,
bizType
:
res
.
data
.
needinfo
.
channelTypeCode
,
// solution: res.data.needsolution.solutionContent
solution
:
solution
};
console
.
log
(
"wangwen"
,
pushObj
);
this
.
pushBaiduNcSubmitSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
return
system
.
getResultSuccess
();
}
return
res
;
}
//推送方案ali
async
pushAliNcSubmitSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
//推送状态变更
var
pushRes
=
await
this
.
aliclient
.
reqbyget
({
action
:
"SubmitSolution"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
console
.
log
(
'ali wangwen++++pushRespushRes'
,
pushRes
)
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
solutionBizId
:
resData
.
SolutionBizId
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
return
a
;
}
}
//推送方案baidu
async
pushBaiduNcSubmitSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
//推送状态变更
var
pushRes
=
await
this
.
baiduclient
.
baiduReqbyget
({
path
:
"///"
,
reqbody
:
pushObj
});
console
.
log
(
'baidu wangwen++++pushRespushRes'
,
pushRes
)
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
solutionBizId
:
resData
.
SolutionBizId
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
return
a
;
}
}
//关闭需求
async
ncCloseNeed
(
pobj
)
{
// if (!pobj.actionBody.needNo) {
// return system.getResult(null, "actionBody.needNo can not be empty,100395");
// }
// if (!pobj.actionBody.note) {
// return system.getResult(null, "actionBody.note can not be empty,100395");
// }
var
self
=
this
;
pobj
.
actionBody
.
intentionBizId
=
pobj
.
actionBody
.
needNo
;
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'www+++result'
,
result
)
if
(
result
.
status
==
0
)
{
if
(
result
.
data
)
{
pobj
.
actionBody
.
orderNo
=
result
.
data
.
orderNo
;
var
orderrtn
=
await
self
.
utilsOrderSve
.
delOrder
(
pobj
,
pobj
.
actionBody
);
if
(
orderrtn
.
status
<
0
)
{
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
}
}
//推送交付系统
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
pobj
.
actionBody
.
needNo
,
status
:
"closeNeed"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
}
self
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
//日志记录
self
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/qcCenterOrderSve.js/closeNeed"
,
content
:
JSON
.
stringify
(
reqParams
),
resultInfo
:
""
,
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
if
(
result
.
data
.
uapp_id
==
uappId
.
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"
});
console
.
log
(
'alalallala++'
,
a
)
}
if
(
result
.
data
.
uapp_id
==
uappId
.
baidu
){
// 推送baidu
var
a
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"///"
,
reqbody
:
{
intentionBizId
:
pobj
.
actionBody
.
needNo
,
bizType
:
"网络文化许可证"
,
note
:
pobj
.
actionBody
.
note
}
});
console
.
log
(
'baidubaidu++'
,
a
)
}
// 2020 1021 lin 新增查看日志
self
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/qcCenterOrderSve.js/closeNeed"
,
content
:
JSON
.
stringify
(
a
),
resultInfo
:
""
,
optitle
:
"推送ali关闭需求->closeNeed"
,
});
self
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseWangWenNeed"
);
return
system
.
getResultSuccess
();
}
else
{
return
system
.
getResult
(
null
,
"close fail 100389 "
);
}
}
//提交沟通记录
async
ncWriteCommunicationRecord
(
pobj
)
{
console
.
log
(
'提交沟通记录pobj'
,
pobj
)
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
){
var
self
=
this
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'www+提交沟通记录result'
,
result
)
//推送交付系统
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
pobj
.
actionBody
.
needNo
,
status
:
"followingUp"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
}
var
result
=
await
self
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
if
(
result
&&
result
.
status
==
0
){
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
pushObj
=
{
IntentionBizId
:
pobj
.
actionBody
.
needNo
,
Note
:
pobj
.
actionBody
.
note
};
//提交沟通记录
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"SubmitIntentionNote"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
console
.
log
(
'ali www+提交沟通记录r'
,
r
)
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
//推送数据至baidu
var
pushObj
=
{
intentionBizId
:
pobj
.
actionBody
.
needNo
,
note
:
pobj
.
actionBody
.
note
};
//提交沟通记录
var
r
=
await
this
.
aliclient
.
reqbyget
({
path
:
"///"
,
reqbody
:
pushObj
});
console
.
log
(
'baidu www+提交沟通记录r'
,
r
)
}
}
return
system
.
getResultSuccess
();
}
}
//查看沟通记录
async
ncGetCommunicationRecord
(
pobj
)
{
if
(
!
pobj
.
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100493"
);
}
let
res
=
await
this
.
aliclient
.
reqbyget
({
action
:
"ListIntentionNote"
,
reqbody
:
{
BeginTime
:
pobj
.
actionBody
.
BeginTime
?
pobj
.
actionBody
.
BeginTime
:
""
,
EndTime
:
pobj
.
actionBody
.
EndTime
?
pobj
.
actionBody
.
EndTime
:
""
,
IntentionBizId
:
pobj
.
actionBody
.
needNo
,
PageNum
:
pobj
.
actionBody
.
pageNum
||
1
,
PageSize
:
pobj
.
actionBody
.
pageSize
||
10
,
},
apiVersion
:
"2020-03-06"
});
console
.
log
(
'loglist-----'
,
res
)
if
(
res
&&
res
.
data
&&
res
.
data
.
Data
){
var
len
=
res
.
data
.
Data
.
length
;
for
(
var
i
=
0
;
i
<
len
;
i
++
){
res
.
data
.
Data
[
i
].
CreateTime
=
res
.
data
.
Data
[
i
].
CreateTime
/
1000
}
}
return
system
.
getResultSuccess
(
res
);
}
}
module
.
exports
=
NcService
;
\ No newline at end of file
center-channel/app/base/service/impl/common/rtSve.js
0 → 100644
View file @
3b70325b
const
system
=
require
(
"../../../system"
);
const
crypto
=
require
(
'crypto'
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
//(文网文状态2020-9-26)
const
wangwenStatusDisct
=
{
601
:
"PARTNER_SUBMIT_MATERIAL"
,
602
:
"CERT_ACCOUNT_REGISTERED"
,
603
:
"CERT_MATERIAL_SUBMITTED"
,
604
:
"CERT_GXB_ACCEPT"
,
605
:
"CERT_GXB_REFUSE"
,
606
:
"CERT_GXB_SUCCESS"
,
607
:
"CERT_GXB_FAIL"
};
//区分渠道的uappid
const
uappId
=
{
'ali'
:
"18"
,
//(阿里icp、edi)
'baidu'
:
"44"
//(百度icp、edi)
}
//推送百度城市拼音转义 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"
}
//百度拼音转义
2020
-
11
-
6
const
baiduIcpStatus
=
{
507
:
"REGISTRATION"
,
508
:
"SUBMITTED"
,
509
:
"ACCEPTED"
,
510
:
"NOT_ACCEPTED"
,
511
:
"APPROVED"
,
512
:
"NOT_APPROVED"
};
/**
* 广电相关接口(RT)
*/
class
RtService
extends
AppServiceBase
{
constructor
()
{
super
();
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
//测试用
this
.
opPushQueueUrl
=
settings
.
opPushQueueUrl
();
this
.
baiduclient
=
system
.
getObject
(
"util.baiduClient"
);
};
//调用center-order
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
if
(
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
}
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
return
data
;
}
//提交Icp注册方案
async
submitIcpProgramme
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
needinfo
&&
res
.
data
.
needsolution
)
{
var
needinfo
=
res
.
data
.
needinfo
;
//需求信息
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
var
ab
=
pobj
.
actionBody
;
if
(
typeof
(
ab
.
solutionContent
)
==
"string"
)
{
ab
.
solutionContent
=
JSON
.
parse
(
ab
.
solutionContent
);
}
if
(
typeof
(
needsolution
.
solutionContent
)
==
"string"
)
{
needsolution
.
solutionContent
=
JSON
.
parse
(
needsolution
.
solutionContent
);
}
var
solution
=
needsolution
.
solutionContent
.
solution
;
var
self
=
this
;
//推送方案
// 2020 0916 lin 修改 增加获取返回值
//var pushIcpSolutionRes = await this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
//2020-10-26 laolan 区分百度与阿里
if
(
needinfo
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
// var bizType = needinfo.channelTypeCode;//业务类型里
var
pushObj
=
{
IntentionBizId
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
IcpType
:
solution
.
IcpType
,
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
Note
:
solution
.
Note
,
ActionType
:
solution
.
ActionType
,
Source
:
"官网"
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
}
var
pushIcpSolutionRes
=
await
this
.
pushIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
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
,
companyAddress
:
solution
.
CompanyAddress
,
area
:
solution
.
Area
,
type
:
solution
.
ActionType
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"bizId"
]
=
needsolution
.
channelSolutionNo
;
}
console
.
log
(
'pushObj++'
,
pushObj
)
var
pushIcpSolutionRes
=
await
this
.
pushBaiduIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
// // 2020 0806 lin 新增推送
// var reqParams = {
// actionType: "produceData",// Y 功能名称
// actionBody: {
// pushUrl: pushUrl,// Y 推送地址
// actionType: "updateChanceStatus",// Y 推送地址接收时的功能名称
// notifyUrl: "",// N 推送成功后通知的Url
// identifyCode: "ali.vat",// Y 操作的业务标识
// messageBody: pobj.actionBody, // Y 推送的业务消息,必须有一项对象属性值
// headData: ""//N 请求头信息,Json格式,如:{token:"XXXXXXX"}
// },
// requestId: pobj.requestId || "" // N 请求id
// }
// this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams);
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/qcCenterOrderSve.js/submitIcpProgramme"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
needinfo
),
optitle
:
"createSolution推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
needinfo
.
channelNeedNo
,
status
:
"createSolution"
},
appInfo
:
pobj
.
appInfo
}
this
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
//
return
system
.
getResultSuccess
(
pushIcpSolutionRes
);
}
return
res
;
}
//推送ICP方案ali
async
pushIcpSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
//推送方案信息
var
pushRes
=
await
self
.
aliclient
.
reqbyget
({
action
:
"SubmitIcpSolution"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
if
(
resData
.
BizId
)
{
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
solutionBizId
:
resData
.
BizId
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
if
(
a
&&
a
.
status
==
0
)
{
//推送方案确认信息
var
confirmRes
=
await
self
.
aliclient
.
reqbyget
({
action
:
"ConfirmIntention"
,
reqbody
:
{
BizId
:
pushObj
.
IntentionBizId
},
apiVersion
:
"2019-05-08"
});
if
(
confirmRes
&&
confirmRes
.
status
==
0
&&
confirmRes
.
data
)
{
var
confirmResData
=
confirmRes
.
data
;
if
(
confirmResData
.
ConfirmUrl
)
{
var
reqObj3
=
{
actionType
:
"receiveIcpConfirmUrl"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
confirmUrl
:
confirmResData
.
ConfirmUrl
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
}
}
return
confirmRes
;
}
}
}
}
//推送ICP方案baidu 2020-10-26 laolan
async
pushBaiduIcpSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
console
.
log
(
'pushObj++baidu+++'
,
pushObj
)
//推送方案信息
var
pushRes
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/plan"
,
reqbody
:
pushObj
});
console
.
log
(
"pushRes++++"
,
pushRes
)
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
if
(
resData
.
planId
)
{
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
solutionBizId
:
resData
.
planId
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
if
(
a
&&
a
.
status
==
0
&&
resData
.
path
)
{
var
reqObj3
=
{
actionType
:
"receiveIcpConfirmUrl"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
confirmUrl
:
resData
.
path
}
};
var
url
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
console
.
log
(
'save confirmUrl ++ '
,
url
)
return
pushRes
;
}
}
}
}
//服务商icp方案关闭 2020-10-26 laolan
async
abolishIcpProgramme
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
var
needsolution
=
res
.
data
;
//方案信息
var
ab
=
pobj
.
actionBody
;
if
(
typeof
(
ab
.
material
)
==
"string"
)
{
ab
.
material
=
JSON
.
parse
(
ab
.
material
);
}
//推送数据至阿里
var
pushObj
=
{
BizId
:
ab
.
BizId
,
Note
:
ab
.
Note
};
//关闭方案
this
.
aliclient
.
reqbyget
({
action
:
"CloseIcpProduce"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
return
system
.
getResultSuccess
();
}
return
res
;
}
//交付材料提交
async
serviceProviderSubmitMaterial
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
var
needsolution
=
res
.
data
;
//方案信息
var
ab
=
pobj
.
actionBody
;
if
(
typeof
(
ab
.
material
)
==
"string"
)
{
ab
.
material
=
JSON
.
parse
(
ab
.
material
);
}
var
material
=
ab
.
material
;
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
var
pushObj
=
{
"BizId"
:
BizId
,
"Domain"
:
material
.
Domain
,
"CorporateName"
:
material
.
CorporateName
,
"IncludeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"PartnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"PartnerIdCardList"
:
material
.
PartnerIdCardList
,
"PartnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"PartnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"PartnerPlan"
:
material
.
PartnerPlan
||
""
,
"PartnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"PartnerLaw"
:
material
.
PartnerLaw
||
""
,
"PartnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"PartnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"PartnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
};
var
self
=
this
;
//推送方案材料
self
.
aliclient
.
reqbyget
({
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
//推送数据至百度
var
BizId
=
needsolution
.
orderChannelNo
;
console
.
log
(
'BizId++'
,
BizId
)
var
pushObj
=
{
"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
,
"partnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"partnerIdCardList"
:
material
.
PartnerIdCardList
,
"partnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"partnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"partnerPlan"
:
material
.
PartnerPlan
||
""
,
"partnerLaw"
:
material
.
PartnerLaw
||
""
,
"partnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"partnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"partnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
};
var
self
=
this
;
//推送方案材料
var
r
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
console
.
log
(
'rrrr+++++'
,
r
)
}
return
system
.
getResultSuccess
();
}
return
res
;
}
//通知交付状态变更
async
serviceProviderNotification
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
pushObj
=
{
BizId
:
res
.
data
.
BizId
,
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
ApplicationStatus
:
res
.
data
.
ApplicationStatus
};
//推送状态变更
this
.
aliclient
.
reqbyget
({
action
:
"AcceptPartnerNotification"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
res
.
data
.
ApplicationStatus
=
baiduIcpStatus
[
res
.
data
.
ApplicationStatus
];
console
.
log
(
'res.data.channelOrderNo'
,
res
.
data
.
channelOrderNo
)
//推送数据至百度
var
pushObj
=
{
orderNo
:
res
.
data
.
channelOrderNo
,
status
:
res
.
data
.
ApplicationStatus
};
//推送状态变更
this
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/update"
,
reqbody
:
pushObj
});
}
return
system
.
getResultSuccess
();
}
return
res
;
}
//交付单关闭
async
closeOrderDelivery
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
var
needsolution
=
res
.
data
;
//方案信息
var
ab
=
pobj
.
actionBody
;
//推送数据至阿里
var
pushObj
=
{
BizId
:
needsolution
.
channelSolutionNo
,
Note
:
ab
.
note
};
//关闭方案
this
.
aliclient
.
reqbyget
({
action
:
"CloseIcpProduce"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
return
system
.
getResultSuccess
();
}
return
res
;
}
// ----------- 广电 -----------
//服务商提交服务操作
async
foodServiceSubmitOption
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
//推送数据至阿里
var
resStatus
=
res
.
data
.
ApplicationStatus
;
var
pushObj
=
{
BizId
:
pobj
.
actionBody
.
orderNo
,
BizType
:
pobj
.
actionBody
.
channelTpye
,
OperateType
:
wangwenStatusDisct
[
resStatus
],
ExtInfo
:
pobj
.
actionBody
.
extInfo
};
//推送状态变更
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"OperateProduceForPartner"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
console
.
log
(
'ttttssss'
,
r
)
return
system
.
getResultSuccess
();
}
return
res
;
}
//提交方案
async
submitFoodSolution
(
pobj
)
{
console
.
log
(
'food+++pobj'
,
pobj
)
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
console
.
log
(
'food+++res'
,
res
)
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
console
.
log
(
'food'
,
res
.
data
.
needsolution
.
solutionContent
);
var
solution
=
res
.
data
.
needsolution
.
solutionContent
;
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
solution
=
JSON
.
parse
(
solution
);
solution
=
solution
.
solution
solution
=
JSON
.
stringify
(
solution
)
//推送交付系统
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
pobj
.
actionBody
.
needNo
,
status
:
"createSolution"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
}
var
self
=
this
;
self
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
//日志记录
self
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/qcCenterOrderSve.js/submitFoodSolution"
,
content
:
JSON
.
stringify
(
reqParams
),
resultInfo
:
""
,
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
//推送数据至阿里
var
pushObj
=
{
intentionBizId
:
res
.
data
.
needinfo
.
channelNeedNo
,
bizType
:
res
.
data
.
needinfo
.
channelTypeCode
,
// solution: res.data.needsolution.solutionContent
solution
:
solution
};
console
.
log
(
"food"
,
pushObj
);
this
.
pushSubmitSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
return
system
.
getResultSuccess
();
}
return
res
;
}
//关闭需求
async
foodCloseNeed
(
pobj
)
{
if
(
!
pobj
.
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100395"
);
}
if
(
!
pobj
.
actionBody
.
note
)
{
return
system
.
getResult
(
null
,
"actionBody.note can not be empty,100395"
);
}
var
self
=
this
;
pobj
.
actionBody
.
intentionBizId
=
pobj
.
actionBody
.
needNo
;
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'food+++result'
,
result
)
if
(
result
.
status
==
0
)
{
if
(
result
.
data
)
{
pobj
.
actionBody
.
orderNo
=
result
.
data
;
var
orderrtn
=
await
self
.
utilsOrderSve
.
delOrder
(
pobj
,
pobj
.
actionBody
);
if
(
orderrtn
.
status
<
0
)
{
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
}
}
//推送交付系统
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
pobj
.
actionBody
.
needNo
,
status
:
"closeNeed"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
}
var
self
=
this
;
self
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
//日志记录
self
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/qcCenterOrderSve.js/foodCloseNeed"
,
content
:
JSON
.
stringify
(
reqParams
),
resultInfo
:
""
,
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
// 推送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"
});
self
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseFoodNeed"
);
return
system
.
getResultSuccess
();
}
else
{
return
system
.
getResult
(
null
,
"close fail 100389 "
);
}
}
//提交沟通记录
async
foodRecordLog
(
pobj
)
{
console
.
log
(
'提交沟通记录pobj'
,
pobj
)
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
!
pobj
.
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100491"
);
}
if
(
!
pobj
.
actionBody
.
note
)
{
return
system
.
getResult
(
null
,
"actionBody.note can not be empty,100492"
);
}
var
self
=
this
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'提交沟通记录result'
,
result
)
//推送交付系统
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
pobj
.
actionBody
.
needNo
,
status
:
"followingUp"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
}
self
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
//推送数据至阿里
var
pushObj
=
{
IntentionBizId
:
pobj
.
actionBody
.
needNo
,
note
:
pobj
.
actionBody
.
note
};
//提交沟通记录
var
r
=
await
this
.
aliclient
.
reqbyget
({
action
:
"SubmitIntentionNote"
,
reqbody
:
pushObj
,
apiVersion
:
"2020-03-06"
});
console
.
log
(
'提交沟通记录r'
,
r
)
return
system
.
getResultSuccess
();
}
//查看沟通记录
async
foodRecordLogList
(
pobj
)
{
if
(
!
pobj
.
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100493"
);
}
let
res
=
await
this
.
aliclient
.
reqbyget
({
action
:
"ListIntentionNote"
,
reqbody
:
{
BeginTime
:
pobj
.
actionBody
.
BeginTime
?
pobj
.
actionBody
.
BeginTime
:
""
,
EndTime
:
pobj
.
actionBody
.
EndTime
?
pobj
.
actionBody
.
EndTime
:
""
,
IntentionBizId
:
pobj
.
actionBody
.
needNo
,
PageNum
:
pobj
.
actionBody
.
pageNum
||
1
,
PageSize
:
pobj
.
actionBody
.
pageSize
||
10
,
},
apiVersion
:
"2020-03-06"
});
if
(
res
&&
res
.
data
&&
res
.
data
.
Data
){
var
len
=
res
.
data
.
Data
.
length
;
for
(
var
i
=
0
;
i
<
len
;
i
++
){
res
.
data
.
Data
[
i
].
CreateTime
=
res
.
data
.
Data
[
i
].
CreateTime
/
1000
}
}
return
system
.
getResultSuccess
(
res
);
}
}
module
.
exports
=
RtService
;
\ No newline at end of file
center-channel/app/config/businessConfig.js
View file @
3b70325b
...
...
@@ -14,11 +14,16 @@ module.exports = {
"orderTotalSum"
,
"collect"
,
"reg"
,
"orderCheck"
,
"getReOrderList"
,
"getOfficalList"
,
"addReviewList"
,
"opSubmitNeed"
,
"opNeedClose"
,
"opNeedList"
,
"getItemByNeedNo"
,
"opNeedDetailByChannelNo"
,
"getNeedListUser"
,
"manualEvaluation"
,
"diagnosisInfo"
,
"check"
,
"enterpriseInfo"
,
"diagnosisDetail"
,
"submitIcpIntention"
,
"queryIntentionList"
,
"confirmIcpIntention"
,
"tmAccept"
,
"tmStatus"
,
"needBatchUpload"
,
"
serviceSubmitOption"
,
"submitWangwenSolution"
,
"closeNeed"
,
"recordLog"
,
"recordLogList"
,
"foodServiceSubmitOption"
,
"submitFood
Solution"
,
"
foodCloseNeed"
,
"foodRecordLog"
,
"foodRecordLogList
"
,
"getParamsFor360"
,
"addOrderWeb"
,
"getPayRecords"
,
"getLoginInfo"
,
"putUserMobileByVcode"
,
"
ncServiceSubmitOption"
,
"ncSubmitSolution"
,
"ncCloseNeed"
,
"ncWriteCommunicationRecord"
,
"ncGetCommunicationRecord"
,
"rtServiceSubmitOption"
,
"rtSubmit
Solution"
,
"
rtCloseNeed"
,
"rtWriteCommunicationRecord"
,
"rtGetCommunicationRecord
"
,
"getParamsFor360"
,
"addOrderWeb"
,
"getPayRecords"
,
"getLoginInfo"
,
"putUserMobileByVcode"
,
"putUserPwdByMobile"
,
"icpNotifyNew"
],
apiMustUserpinList
:
[
"submitNeed"
,
"paySuccess"
,
"icpNotify"
,
"getLoginInfo"
,
"icpNotifyNew"
,
"submitIcpProgramme"
,
"serviceProviderSubmitMaterial"
,
"abolishIcpProgramme"
,
"submitService"
,
"serviceProviderNotification"
],
apiMustUserpinList
:
[
"submitNeed"
,
"paySuccess"
,
"icpNotify"
,
"getLoginInfo"
,
"icpNotifyNew"
,
"submitIcpProgramme"
,
"serviceProviderSubmitMaterial"
,
"abolishIcpProgramme"
,
"submitService"
,
"serviceProviderNotification"
,
"ncServiceSubmitOption"
,
"ncSubmitSolution"
,
"ncCloseNeed"
,
"ncWriteCommunicationRecord"
,
"ncGetCommunicationRecord"
,
"rtServiceSubmitOption"
,
"rtSubmitSolution"
,
"rtCloseNeed"
,
"rtWriteCommunicationRecord"
,
"rtGetCommunicationRecord"
,
],
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