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
6a20e8a3
Commit
6a20e8a3
authored
Dec 20, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laolan
parent
0f46314d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
296 additions
and
215 deletions
+296
-215
center-channel/app/base/api/impl/action/regapi.js
+7
-3
center-channel/app/base/service/impl/common/regCenterOrderSve.js
+275
-209
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+10
-0
center-channel/app/base/utils/baiduRegClient.js
+4
-3
No files found.
center-channel/app/base/api/impl/action/regapi.js
View file @
6a20e8a3
...
@@ -24,6 +24,7 @@ class RegAPI extends APIBase {
...
@@ -24,6 +24,7 @@ class RegAPI extends APIBase {
var
opResult
=
null
;
var
opResult
=
null
;
switch
(
action_type
)
{
switch
(
action_type
)
{
//-----------接入百度reg------start----laolan--2020.12.17----------------------------
//-----------接入百度reg------start----laolan--2020.12.17----------------------------
//---------2.
case
"submitRegNeed"
:
//提交需求
case
"submitRegNeed"
:
//提交需求
opResult
=
await
this
.
regCenterOrderSve
.
submitRegNeed
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
regCenterOrderSve
.
submitRegNeed
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
...
@@ -46,7 +47,7 @@ class RegAPI extends APIBase {
...
@@ -46,7 +47,7 @@ class RegAPI extends APIBase {
case
"getSolutionByChannelOrderNo"
:
//根据渠道订单获取方案信息
case
"getSolutionByChannelOrderNo"
:
//根据渠道订单获取方案信息
opResult
=
await
this
.
regCenterOrderSve
.
getSolutionByChannelOrderNo
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
regCenterOrderSve
.
getSolutionByChannelOrderNo
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
//------------3.
case
"submitRegSolution"
:
//方案提交
case
"submitRegSolution"
:
//方案提交
opResult
=
await
this
.
regCenterOrderSve
.
submitRegSolution
(
pobj
);
opResult
=
await
this
.
regCenterOrderSve
.
submitRegSolution
(
pobj
);
break
;
break
;
...
@@ -59,8 +60,11 @@ class RegAPI extends APIBase {
...
@@ -59,8 +60,11 @@ class RegAPI extends APIBase {
case
"updateOrdertatus"
:
//提交交付信息/修改订单状态
case
"updateOrdertatus"
:
//提交交付信息/修改订单状态
opResult
=
await
this
.
regCenterOrderSve
.
updateOrdertatus
(
pobj
);
opResult
=
await
this
.
regCenterOrderSve
.
updateOrdertatus
(
pobj
);
break
;
break
;
case
"closeBdRegNeed"
:
//需求关闭
case
"regNeedClose"
:
//需求关闭
opResult
=
await
this
.
regCenterOrderSve
.
closeBdRegNeed
(
pobj
);
opResult
=
await
this
.
regCenterOrderSve
.
regNeedClose
(
pobj
);
break
;
case
"getRegInfoByChannelNeedNo"
:
//获取需求方案列表
opResult
=
await
this
.
regCenterOrderSve
.
reqCenterOrderApi
(
pobj
,
"action/regapi/springBoard"
);
break
;
break
;
// case "closeRegSolution"://服务商方案关闭
// case "closeRegSolution"://服务商方案关闭
// opResult = await this.regCenterOrderSve.closeRegSolution(pobj);
// opResult = await this.regCenterOrderSve.closeRegSolution(pobj);
...
...
center-channel/app/base/service/impl/common/regCenterOrderSve.js
View file @
6a20e8a3
...
@@ -13,12 +13,12 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -13,12 +13,12 @@ class RegCenterOrderService extends AppServiceBase {
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
opPushQueueUrl
=
settings
.
opPushQueueUrl
();
this
.
opPushQueueUrl
=
settings
.
opPushQueueUrl
();
this
.
baiduclient
=
system
.
getObject
(
"util.baiduClient"
);
this
.
baiduclient
=
system
.
getObject
(
"util.baiduClient"
);
this
.
baiduReg
client
=
system
.
getObject
(
"util.baiduRegc
lient"
);
this
.
baiduReg
Client
=
system
.
getObject
(
"util.baiduRegC
lient"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
};
};
//调用center-order
//调用center-order
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
"action/reg
CenterOrder
/springBoard"
;
var
url
=
this
.
centerOrderUrl
+
"action/reg
api
/springBoard"
;
if
(
reqUrl
)
{
if
(
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
}
}
...
@@ -26,9 +26,9 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -26,9 +26,9 @@ class RegCenterOrderService extends AppServiceBase {
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
return
data
;
return
data
;
}
}
//调用center-order reg需求反馈
//调用center-order reg需求反馈
2.2
async
reqCenterOrderRegApi
(
pobj
,
reqUrl
)
{
async
reqCenterOrderRegApi
(
pobj
,
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
"action/reg
CenterOrderSve
/springBoard"
;
var
url
=
this
.
centerOrderUrl
+
"action/reg
api
/springBoard"
;
if
(
reqUrl
)
{
if
(
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
}
}
...
@@ -261,101 +261,154 @@ async regPaySuccess(pobj) {
...
@@ -261,101 +261,154 @@ async regPaySuccess(pobj) {
this
.
utilsPushSve
.
baiduBusiness2Fq
(
pobj
,
"pushNeedICPBusinessNew"
);
this
.
utilsPushSve
.
baiduBusiness2Fq
(
pobj
,
"pushNeedICPBusinessNew"
);
}
}
return
result
;
return
result
;
}
//状态更新
async
regOrderStatus
(
pobj
)
{
var
actionBody
=
pobj
.
actionBody
;
var
self
=
this
;
if
(
actionBody
.
isDirectBuy
&&
actionBody
.
isDirectBuy
==
1
)
{
actionBody
.
bizId
=
actionBody
.
orderNo
}
if
(
!
actionBody
.
bizId
)
{
return
system
.
getResult
(
null
,
"actionBody.bizId can not be empty,100495"
);
}
}
actionBody
.
BizId
=
actionBody
.
bizId
;
//状态更新
if
(
!
actionBody
.
status
)
{
async
regOrderStatus
(
pobj
)
{
return
system
.
getResult
(
null
,
"actionBody.status can not be empty,100495"
);
var
actionBody
=
pobj
.
actionBody
;
}
var
self
=
this
;
pobj
.
actionType
=
"receiveOrderStatusNotify"
;
if
(
actionBody
.
isDirectBuy
&&
actionBody
.
isDirectBuy
==
1
)
{
var
url
=
settings
.
centerOrderUrl
()
+
"action/qcapi/springBoard"
;
actionBody
.
bizId
=
actionBody
.
orderNo
var
rtn
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
actionBody
.
status
==
2
)
{
var
deliveryObj
=
{
actionBody
:
{
orderNo
:
rtn
.
data
.
orderNo
,
//pobj.actionBody.channelOrder.channelOrderNo,
needsolution
:
rtn
.
data
.
solutionContent
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
channelSolutionNo
:
rtn
.
data
.
channelSolutionNo
,
servicer
:
{
code
:
'gsb'
,
name
:
'公司宝'
}
},
appInfo
:
pobj
.
appInfo
}
}
this
.
utilsPushSve
.
baiduBusiness2Delivery
(
deliveryObj
,
"pushDeliveryOrder"
);
if
(
!
actionBody
.
bizId
)
{
}
return
system
.
getResult
(
null
,
"actionBody.bizId can not be empty,100495"
);
if
(
rtn
.
status
==
0
&&
actionBody
.
status
!=
1
&&
actionBody
.
status
!=
2
&&
rtn
.
data
)
{
var
tmpObj
=
{
actionBody
:
{
orderNo
:
rtn
.
data
.
orderNo
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
needsolution
:
rtn
.
data
.
solutionContent
},
appInfo
:
pobj
.
appInfo
}
}
this
.
utilsPushSve
.
baiduBusiness2Delivery
(
tmpObj
,
"pushDeliveryStatusNotify"
);
actionBody
.
BizId
=
actionBody
.
bizId
;
pobj
.
actionBody
.
orderNo
=
rtn
.
data
.
orderNo
;
if
(
!
actionBody
.
status
)
{
if
(
actionBody
.
status
==
11
)
{
return
system
.
getResult
(
null
,
"actionBody.status can not be empty,100495"
);
var
orderrtn
=
await
self
.
utilsOrderSve
.
delOrder
(
pobj
,
pobj
.
actionBody
);
}
pobj
.
actionType
=
"regOrderStatus"
;
var
url
=
settings
.
centerOrderUrl
()
+
"action/regapi/springBoard"
;
var
rtn
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
actionBody
.
status
==
2
)
{
var
deliveryObj
=
{
actionBody
:
{
orderNo
:
rtn
.
data
.
orderNo
,
//pobj.actionBody.channelOrder.channelOrderNo,
needsolution
:
rtn
.
data
.
solutionContent
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
channelSolutionNo
:
rtn
.
data
.
channelSolutionNo
,
servicer
:
{
code
:
'gsb'
,
name
:
'公司宝'
}
},
appInfo
:
pobj
.
appInfo
}
this
.
utilsPushSve
.
baiduBusiness2Delivery
(
deliveryObj
,
"pushDeliveryOrder"
);
}
if
(
rtn
.
status
==
0
&&
actionBody
.
status
!=
1
&&
actionBody
.
status
!=
2
&&
rtn
.
data
)
{
var
tmpObj
=
{
actionBody
:
{
orderNo
:
rtn
.
data
.
orderNo
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
needsolution
:
rtn
.
data
.
solutionContent
},
appInfo
:
pobj
.
appInfo
}
this
.
utilsPushSve
.
baiduBusiness2Delivery
(
tmpObj
,
"pushDeliveryStatusNotify"
);
pobj
.
actionBody
.
orderNo
=
rtn
.
data
.
orderNo
;
if
(
actionBody
.
status
==
11
)
{
var
orderrtn
=
await
self
.
utilsOrderSve
.
delOrder
(
pobj
,
pobj
.
actionBody
);
if
(
orderrtn
.
status
<
0
)
{
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
}
tmpObj
.
actionBody
.
orderNo
=
rtn
.
data
.
channelSolutionNo
;
self
.
utilsPushSve
.
baiduBusiness2Fq
(
tmpObj
,
"pushOrderICPClose"
);
}
}
//通知更新状态
return
rtn
;
}
//关闭reg订单
async
regOrderClose
(
pobj
)
{
var
actionBody
=
pobj
.
actionBody
;
var
self
=
this
;
var
url
=
settings
.
centerOrderUrl
()
+
"action/regapi/springBoard"
;
var
rtn
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
rtn
.
status
==
0
&&
rtn
.
data
)
{
var
channelOrderNo
=
pobj
.
actionBody
.
orderNo
;
pobj
.
actionBody
.
orderNo
=
rtn
.
data
.
orderNo
;
pobj
.
actionType
=
"delOrder"
;
var
orderrtn
=
await
self
.
utilsOrderSve
.
delOrder
(
pobj
,
actionBody
);
if
(
orderrtn
.
status
<
0
)
{
if
(
orderrtn
.
status
<
0
)
{
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
}
}
tmpObj
.
actionBody
.
orderNo
=
rtn
.
data
.
channelSolutionNo
;
var
tmpObj
=
{
self
.
utilsPushSve
.
baiduBusiness2Fq
(
tmpObj
,
"pushOrderICPClose"
);
actionBody
:
{
}
orderNo
:
rtn
.
data
.
orderNo
,
}
//通知更新状态
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
return
rtn
;
needsolution
:
rtn
.
data
.
solutionContent
}
},
//关闭reg订单
appInfo
:
pobj
.
appInfo
async
regOrderClose
(
pobj
)
{
}
var
actionBody
=
pobj
.
actionBody
;
this
.
utilsPushSve
.
baiduBusiness2Delivery
(
tmpObj
,
"pushDeliveryStatusNotify"
);
var
self
=
this
;
// tmpObj.actionBody.orderNo = channelOrderNo;
var
url
=
settings
.
centerOrderUrl
()
+
"action/qcapi/springBoard"
;
var
tmpObj2
=
{
var
rtn
=
await
this
.
restPostUrl
(
pobj
,
url
);
actionBody
:
{
if
(
rtn
.
status
==
0
&&
rtn
.
data
)
{
orderNo
:
channelOrderNo
,
var
channelOrderNo
=
pobj
.
actionBody
.
orderNo
;
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
pobj
.
actionBody
.
orderNo
=
rtn
.
data
.
orderNo
;
needsolution
:
rtn
.
data
.
solutionContent
pobj
.
actionType
=
"delOrder"
;
},
var
orderrtn
=
await
self
.
utilsOrderSve
.
delOrder
(
pobj
,
actionBody
);
appInfo
:
pobj
.
appInfo
if
(
orderrtn
.
status
<
0
)
{
};
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
self
.
utilsPushSve
.
baiduBusiness2Fq
(
tmpObj2
,
"pushOrderICPClose"
);
}
}
//通知更新状态
var
tmpObj
=
{
return
rtn
;
actionBody
:
{
}
orderNo
:
rtn
.
data
.
orderNo
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
needsolution
:
rtn
.
data
.
solutionContent
//提交交付信息/修改订单状态
},
async
updateOrdertatus
(
pobj
)
{
appInfo
:
pobj
.
appInfo
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/regapi/springBoard"
);
console
.
log
(
'zzzzlllll+++++'
,
res
)
console
.
log
(
'zzzzlllll++pobj+++'
,
pobj
)
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
var
needsolution
=
res
.
data
;
//方案信息
var
ab
=
pobj
.
actionBody
;
if
(
res
.
data
.
uapp_id
==
regCfg
.
uappId
.
baidu
){
//推送数据至百度
var
BizId
=
needsolution
.
orderChannelNo
;
console
.
log
(
'BizId++'
,
BizId
)
var
pushObj
=
{
orderNo
:,
status
:,
deliverContent
:
};
var
self
=
this
;
//推送交付信息/修改订单状态
var
baidu
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
console
.
log
(
'推送交付信息/修改订单状态baidu+++'
,
baidu
)
}
console
.
log
(
'rsrsr++++------------++++'
,
res
)
return
res
}
}
this
.
utilsPushSve
.
baiduBusiness2Delivery
(
tmpObj
,
"pushDeliveryStatusNotify"
);
}
// tmpObj.actionBody.orderNo = channelOrderNo;
var
tmpObj2
=
{
actionBody
:
{
orderNo
:
channelOrderNo
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
needsolution
:
rtn
.
data
.
solutionContent
},
appInfo
:
pobj
.
appInfo
};
self
.
utilsPushSve
.
baiduBusiness2Fq
(
tmpObj2
,
"pushOrderICPClose"
);
}
//通知更新状态
return
rtn
;
}
//通知交付状态变更
// async serviceProviderNotification(pobj) {
// console.log('zhuangtai ++++',pobj)
// var res = await this.reqCenterOrderApi(pobj, "action/regCenterOrder/springBoard");
// if (res && res.status == 0 && res.data) {
// if(res.data.uapp_id == regCfg.uappId.baidu){
// res.data.ApplicationStatus = baiduRegStatus[res.data.ApplicationStatus];
// console.log('res.data.channelOrderNo',res.data.channelOrderNo)
// //推送数据至百度
// var pushObj = {
// orderNo: res.data.channelOrderNo,
// status: res.data.ApplicationStatus
// };
// //推送状态变更
// var baidu = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/update", reqbody: pushObj });
// console.log('res.data baidu +++++',baidu)
// return res;
// }
// }
// }
//--------------3.
//提交reg注册方案
//提交reg注册方案
async
submitRegSolution
(
pobj
)
{
async
submitRegSolution
(
pobj
)
{
console
.
log
(
'reg --- pobj -----'
,
pobj
)
console
.
log
(
'reg --- pobj -----'
,
pobj
)
...
@@ -364,31 +417,13 @@ async regOrderClose(pobj) {
...
@@ -364,31 +417,13 @@ async regOrderClose(pobj) {
console
.
log
(
'reg --- res -----'
,
res
)
console
.
log
(
'reg --- res -----'
,
res
)
var
needinfo
=
res
.
data
.
needinfo
;
//需求信息
var
needinfo
=
res
.
data
.
needinfo
;
//需求信息
var
needsolutions
=
res
.
data
.
needsolutions
;
//方案信息
var
needsolutions
=
res
.
data
.
needsolutions
;
//方案信息
// var ab = pobj.actionBody;
// if (typeof (ab.solutionContent) == "string") {
// ab.solutionContent = JSON.parse(ab.solutionContent);
// }
// if (typeof (needsolutions.solutionContent) == "string") {
// needsolutions.solutionContent = JSON.parse(needsolutions.solutionContent);
// }
// var solution = needsolutions.solutionContent.solution;
var
self
=
this
;
var
self
=
this
;
var
bizTypes
;
var
solutionList
=
[];
if
(
needinfo
.
uapp_id
==
regCfg
.
uappId
.
baidu
){
if
(
needinfo
.
uapp_id
==
regCfg
.
uappId
.
baidu
){
//推送数据至baidu
//推送数据至baidu
// solution.Area = regCfg.baiduAreaCode[solution.Area]
// console.log('solution.Area++',solution.Area)
// var pushObj = {
// intentionBizId: needinfo.channelNeedNo,
// solutionList:{
// gsbBizId:"",
// bizType:"",
// solutionContent:""
// },
// };
var
i
=
0
;
var
i
=
0
;
var
needsolutionsLength
=
needsolutions
.
length
;
var
needsolutionsLength
=
needsolutions
.
length
;
var
bizTypes
;
var
solutionList
=
[];
for
(
i
=
0
;
i
<
needsolutionsLength
;
i
++
){
for
(
i
=
0
;
i
<
needsolutionsLength
;
i
++
){
bizTypes
=
needsolutions
[
i
].
solutionContent
;
bizTypes
=
needsolutions
[
i
].
solutionContent
;
console
.
log
(
'bizTypes-----'
,
bizTypes
)
console
.
log
(
'bizTypes-----'
,
bizTypes
)
...
@@ -407,10 +442,7 @@ async regOrderClose(pobj) {
...
@@ -407,10 +442,7 @@ async regOrderClose(pobj) {
solutionList
:
solutionList
solutionList
:
solutionList
};
};
console
.
log
(
'pushObj---pushObj---'
,
pushObj
)
console
.
log
(
'pushObj---pushObj---'
,
pushObj
)
// if (needsolutions.channelSolutionNo) {
var
pushBaiduRegSolution
=
await
this
.
pushBaiduRegSolution
(
pushObj
,
pobj
.
appInfo
,
self
);
// pushObj["bizId"] = needsolutions.channelSolutionNo;
// }
var
pushBaiduRegSolution
=
await
this
.
pushBaiduRegSolution
(
pushObj
,
needsolutions
.
solutionNo
,
pobj
.
appInfo
,
self
);
console
.
log
(
'pushBaiduRegSolution+++'
,
pushBaiduRegSolution
)
console
.
log
(
'pushBaiduRegSolution+++'
,
pushBaiduRegSolution
)
}
}
this
.
logCtl
.
info
({
this
.
logCtl
.
info
({
...
@@ -435,124 +467,158 @@ async regOrderClose(pobj) {
...
@@ -435,124 +467,158 @@ async regOrderClose(pobj) {
return
res
;
return
res
;
}
}
//推送reg方案
//推送reg方案
async
pushBaiduRegSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
async
pushBaiduRegSolution
(
pushObj
,
appInfo
,
self
)
{
console
.
log
(
'pushObj++baidu+++'
,
pushObj
)
console
.
log
(
'pushObj++baidu+++'
,
pushObj
)
//推送方案信息
//推送方案信息
var
pushRes
=
await
self
.
baiduReg
c
lient
.
baiduReqbyget
({
path
:
"/v1/provider/demand?submitSolutions="
,
reqbody
:
pushObj
});
var
pushRes
=
await
self
.
baiduReg
C
lient
.
baiduReqbyget
({
path
:
"/v1/provider/demand?submitSolutions="
,
reqbody
:
pushObj
});
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
.
planId
)
{
if
(
resData
.
infos
)
{
var
reqObj2
=
{
var
reqObj2
=
{
actionType
:
"
receiveProgrammeN
o"
,
actionType
:
"
saveReginf
o"
,
appInfo
:
appInfo
,
appInfo
:
appInfo
,
actionBody
:
{
actionBody
:
{
solutionNo
:
solutionNo
,
infos
:
resData
.
infos
solutionBizId
:
resData
.
planId
}
}
};
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id,用户确认方案url
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
console
.
log
(
"保存渠道方案id,用户确认方案url 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
url
;
}
}
}
}
}
}
}
//reg回写沟通记录
async
writeRegCommunicationLog
(
pobj
)
{
var
self
=
this
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/regapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
pushObj
=
{}
if
(
result
&&
result
.
status
==
0
&&
result
.
data
)
{
pushObj
=
{
requirementId
:
pobj
.
actionBody
.
intentionBizId
,
note
:
pobj
.
actionBody
.
note
}
if
(
result
.
data
==
regCfg
.
uappId
.
baidu
)
{
var
ress
=
await
self
.
baiduRegClient
.
baiduReqbyget
({
path
:
"/v1/provider/demand?addCommRecord="
,
reqbody
:
pushObj
});
console
.
log
(
"baidu+res"
,
ress
)
}
}
//推送交付系统
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
pobj
.
actionBody
.
intentionBizId
,
status
:
"followingUp"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
}
self
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
var
fqobj
=
{
actionBody
:
{
"bizId"
:
pobj
.
actionBody
.
intentionBizId
,
"follow_date"
:
(
new
Date
()).
toISOString
(),
"follow_content"
:
pobj
.
actionBody
.
note
},
opType
:
"aliFollowup"
,
appInfo
:
pobj
.
appInfo
}
self
.
utilsPushSve
.
aliBusiness2Fq
(
fqobj
,
"aliFollowup"
);
return
system
.
getResultSuccess
();
}
//提交交付信息/修改订单状态
//reg查询沟通记录
async
updateOrdertatus
(
pobj
)
{
async
queryExpertRegCommunicationLogs
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/regCenterOrder/springBoard"
);
var
reqUrl
=
this
.
centerOrderUrl
+
"action/regapi/springBoard"
;
console
.
log
(
'zzzzlllll+++++'
,
res
)
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'zzzzlllll++pobj+++'
,
pobj
)
console
.
log
(
'jilu+++result++++'
,
result
)
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
if
(
result
&&
result
.
status
==
0
&&
result
.
data
&&
result
.
data
.
uapp_id
)
{
var
needsolution
=
res
.
data
;
//方案信息
var
pushObj
=
{};
var
ab
=
pobj
.
actionBody
;
if
(
result
.
data
.
uapp_id
==
regCfg
.
uappId
.
baidu
)
{
if
(
typeof
(
ab
.
material
)
==
"string"
)
{
console
.
log
(
"bbbbb++"
,
pobj
)
ab
.
material
=
JSON
.
parse
(
ab
.
material
);
pushObj
=
{
beginTime
:
pobj
.
actionBody
.
BeginTime
?
pobj
.
actionBody
.
BeginTime
:
""
,
endTime
:
pobj
.
actionBody
.
EndTime
?
pobj
.
actionBody
.
EndTime
:
""
,
intentionBizId
:
pobj
.
actionBody
.
intentionBizId
}
var
res
=
await
this
.
baiduRegClient
.
baiduReqbyget
({
path
:
"/v1/provider/demand?listCommRecords="
,
reqbody
:
pushObj
});
console
.
log
(
'xxcc+++'
,
res
)
}
}
var
material
=
ab
.
material
;
}
if
(
res
.
data
.
uapp_id
==
regCfg
.
uappId
.
baidu
){
if
(
res
&&
res
.
data
&&
res
.
data
.
infos
){
//推送数据至百度
res
.
data
[
'Data'
]
=
res
.
data
.
infos
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
baidu
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
console
.
log
(
'推送交付信息/修改订单状态baidu+++'
,
baidu
)
}
console
.
log
(
'rsrsr++++------------++++'
,
res
)
return
res
}
}
return
system
.
getResultSuccess
(
res
);
}
}
//通知交付状态变更
// async serviceProviderNotification(pobj) {
// console.log('zhuangtai ++++',pobj)
// var res = await this.reqCenterOrderApi(pobj, "action/regCenterOrder/springBoard");
// if (res && res.status == 0 && res.data) {
// if(res.data.uapp_id == regCfg.uappId.baidu){
// res.data.ApplicationStatus = baiduRegStatus[res.data.ApplicationStatus];
// console.log('res.data.channelOrderNo',res.data.channelOrderNo)
// //推送数据至百度
// var pushObj = {
// orderNo: res.data.channelOrderNo,
// status: res.data.ApplicationStatus
// };
// //推送状态变更
// var baidu = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/update", reqbody: pushObj });
// console.log('res.data baidu +++++',baidu)
// return res;
// }
// }
// }
//reg关闭需求
async
regNeedClose
(
pobj
)
{
pobj
.
actionBody
.
intentionBizId
=
pobj
.
actionBody
.
channelNeedNo
;
pobj
.
actionType
=
"regNeedClose"
var
reqUrl
=
this
.
centerOrderUrl
+
"action/regapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'regNeedClose+++result'
,
result
)
var
i
;
var
len
=
result
.
data
.
length
var
orders
=
[]
if
(
result
.
status
==
0
)
{
for
(
i
=
0
;
i
<
len
;
i
++
){
if
(
result
.
data
&&
result
.
data
[
i
].
orderNo
)
{
orders
.
push
(
result
.
data
[
i
].
orderNo
)
pobj
.
actionBody
.
orderNo
=
orders
;
var
orderrtn
=
await
this
.
utilsOrderSve
.
delOrders
(
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
}
this
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
//日志记录
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/regCenterOrderSve.js/regNeedClose"
,
content
:
JSON
.
stringify
(
reqParams
),
resultInfo
:
""
,
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
var
pushObj
=
{
IntentionBizId
:
pobj
.
actionBody
.
needNo
,
Note
:
pobj
.
actionBody
.
note
}
// 推送baidu
var
a
=
await
this
.
baiduRegClient
.
baiduReqbyget
({
path
:
"/v1/provider/demand?close="
,
pushObj
});
console
.
log
(
'regNeedClose+++'
,
a
)
//查看日志
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/regCenterOrderSve.js/regNeedClose"
,
content
:
JSON
.
stringify
(
a
),
resultInfo
:
""
,
optitle
:
"推送baidu-reg关闭需求->closeNeed"
,
});
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseICPNeed"
);
}
return
result
;
}
//-----------接入百度reg------end----------------------------------
//-----------接入百度reg------end----------------------------------
}
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
6a20e8a3
...
@@ -117,6 +117,16 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -117,6 +117,16 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
return
result
;
}
}
//reg关闭订单2020-12-20
async
delOrders
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100025"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
}
async
getOrderInfo
(
pobj
,
actionBody
)
{
async
getOrderInfo
(
pobj
,
actionBody
)
{
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
...
...
center-channel/app/base/utils/baiduReg
c
lient.js
→
center-channel/app/base/utils/baiduReg
C
lient.js
View file @
6a20e8a3
...
@@ -2,7 +2,7 @@ const crypto = require('crypto');
...
@@ -2,7 +2,7 @@ const crypto = require('crypto');
const
sha256
=
require
(
'sha256'
);
const
sha256
=
require
(
'sha256'
);
const
system
=
require
(
"../system"
);
const
system
=
require
(
"../system"
);
var
settings
=
require
(
"../../config/settings"
);
var
settings
=
require
(
"../../config/settings"
);
class
baiduClient
{
class
baidu
Reg
Client
{
constructor
()
{
constructor
()
{
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
...
@@ -100,6 +100,6 @@ class baiduClient {
...
@@ -100,6 +100,6 @@ class baiduClient {
}
}
}
}
}
}
module
.
exports
=
baiduClient
;
module
.
exports
=
baidu
Reg
Client
;
// var task = new baiduClient();
// var task = new baidu
Reg
Client();
// console.log(task.baiduRegClientParams,"11111111111111111");
// console.log(task.baiduRegClientParams,"11111111111111111");
\ No newline at end of file
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