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
fff5209e
Commit
fff5209e
authored
Aug 25, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gyq
parent
8a5c2404
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
32 deletions
+109
-32
center-manage/app/base/service/impl/common/channelhandlers/tx.js
+94
-32
center-manage/app/config/settings.js
+15
-0
No files found.
center-manage/app/base/service/impl/common/channelhandlers/tx.js
View file @
fff5209e
...
...
@@ -7,6 +7,8 @@ class TxHandler {
this
.
userService
=
system
.
getObject
(
"service.auth.userSve"
);
this
.
msgService
=
system
.
getObject
(
"service.msg.msgSve"
)
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
queueUrl
=
settings
.
bpushUrl
();
this
.
bookUrl
=
settings
.
bookUrl
()
+
"/web/bizchance"
;
}
/**
* 需要调用生成者接口,把数据丢入队列
...
...
@@ -554,51 +556,111 @@ class TxHandler {
}
async
createLeads
(
datajson
)
{
//财税需求处理
async
ServiceCreate
(
datajson
)
{
//获取融易算服务实例到队列
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
var
cacheInfo
=
await
this
.
cacheManager
[
"TxCache"
].
getCache
(
cachestr
);
if
(
cacheInfo
&&
cacheInfo
!=
'undefined'
)
{
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
requrl
=
this
.
queueUrl
;
var
params
=
{
"actionType"
:
"produceData"
,
"actionBody"
:
{
"pushUrl"
:
this
.
bookUrl
+
"/deliverybillCtl"
,
"actionType"
:
"insertInfo"
,
"identifyCode"
:
"book-manage"
,
"messageBody"
:
datajson
,
"headData"
:
{
'Authorization'
:
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJvcnpaWmhXRXBKNVVFZzRZUU5uUmlyVEJXa1FQbnZ6UyIsImlhdCI6MTU5MjcwOTYzNn0.TWk_F6Tz3fRMqspoG24VSt5RiC4ldFembFYcLcAbowE'
,
'XAPPKEY'
:
'647a68c9-da01-40d3-9763-1ffa0f64cf3f'
}
}
}
var
rtn
=
await
rc
.
execPost
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
1
)
{
return
{
"status"
:
1
,
//1代表成功,否则失败
"msg"
:
"已处理成功!"
,
"data"
:
""
,
"requestId"
:
""
"requestId"
:
datajson
.
requestId
,
"success"
:
true
,
"errorCode"
:
0
,
"errorMsg"
:
"ok"
,
"data"
:
null
}
}
else
{
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
requrl
=
this
.
icUrl
+
"/bizoptCtl/insertInfo"
;
//这个地方要改
var
params
=
{
"businessMode"
:
datajson
.
actionBody
.
NeedNum
,
//需求编号
"servicerName"
:
datajson
.
actionBody
.
ServicerName
,
//服务商编码
"serviceCode"
:
datajson
.
actionBody
.
RegionId
,
//服务地区编码
"serviceName"
:
datajson
.
actionBody
.
RegionName
,
//服务地区名字,需要转换
//"contactsName": datajson.actionBody.ContactsName,
"contactsPhone"
:
datajson
.
actionBody
.
ContactsMobile
,
//联系人电话
"businessType"
:
datajson
.
actionBody
.
ConsultType
,
//需求类型
"businessName"
:
datajson
.
actionBody
.
ConsultTypeName
,
//需求名称
"currentStatus"
:
"beforeSubmission"
,
"channelSource"
:
"tencentCloud"
,
//渠道
"channelNumber"
:
"tx"
return
{
"requestId"
:
datajson
.
requestId
,
"success"
:
false
,
"errorCode"
:
-
1
,
"errorMsg"
:
rtn
.
stderr
,
"data"
:
null
}
}
}
catch
(
error
)
{
return
system
.
getResultError
(
error
);
return
{
"requestId"
:
datajson
.
requestId
,
"success"
:
false
,
"errorCode"
:
-
1
,
"errorMsg"
:
error
,
"data"
:
null
}
}
}
// async createLeads(datajson) {//财税需求处理
// try {
// var cachestr = sha235(JSON.stringify(datajson));
// var cacheInfo = await this.cacheManager["TxCache"].getCache(cachestr);
// if (cacheInfo && cacheInfo != 'undefined') {
// return {
// "status": 1, //1代表成功,否则失败
// "msg": "已处理成功!",
// "data": "",
// "requestId": ""
// }
// }
// else {
// var rc = system.getObject("util.execClient");
// var requrl = this.icUrl + "/bizoptCtl/insertInfo";//这个地方要改
// var params = {
// "businessMode": datajson.actionBody.NeedNum,//需求编号
// "servicerName": datajson.actionBody.ServicerName,//服务商编码
// "serviceCode": datajson.actionBody.RegionId,//服务地区编码
// "serviceName": datajson.actionBody.RegionName,//服务地区名字,需要转换
// //"contactsName": datajson.actionBody.ContactsName,
// "contactsPhone": datajson.actionBody.ContactsMobile,//联系人电话
// "businessType": datajson.actionBody.ConsultType,//需求类型
// "businessName": datajson.actionBody.ConsultTypeName,//需求名称
// "currentStatus": "beforeSubmission",
// "channelSource": "tencentCloud",//渠道
// "channelNumber": "tx"
// }
// }
// }
// catch (error) {
// return system.getResultError(error);
// }
// }
}
module
.
exports
=
new
TxHandler
();
// (async ()=>{
// var task = new TxHandler();
// var d = await task.userService.getBizUserForDelivery("16512345678","公司宝","公司注册","sv_business_registration_category_limited1","北京");
// console.log("ddddddddddddd");
// console.log(JSON.stringify(d));
// console.log("dddddddddddddd");
// })()
(
async
()
=>
{
var
task
=
new
TxHandler
();
var
obj
=
{
"requestId"
:
"825da0a74432-738f-4bed-b48d-d51aa808"
,
"bizId"
:
"5892748825"
,
"contactsPhone"
:
"18510669321"
,
"userId"
:
"10973452443103825"
,
"orderId"
:
"3411844566204567787"
,
"areatype"
:
"city"
,
"area"
:
"100010"
,
"topOrgCode"
:
"rong_yi_suan"
,
"taxpayerType"
:
1
}
var
d
=
await
task
.
ServiceCreate
(
obj
);
console
.
log
(
"ddddddddddddd"
);
console
.
log
(
JSON
.
stringify
(
d
));
console
.
log
(
"dddddddddddddd"
);
})()
center-manage/app/config/settings.js
View file @
fff5209e
...
...
@@ -47,6 +47,13 @@ var settings = {
return
"http://icdeliver-service"
;
}
},
bookUrl
:
function
()
{
if
(
this
.
env
==
"localhost"
)
{
return
"http://book.com:8000"
;
}
else
{
return
"http://icdeliver-service"
;
}
},
logUrl
:
function
()
{
if
(
this
.
env
==
"localhost"
)
{
return
"http://192.168.1.128:4019/api/queueAction/producer/springBoard"
;
...
...
@@ -61,6 +68,14 @@ var settings = {
return
"http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard"
;
}
},
bpushUrl
:
function
()
{
if
(
this
.
env
==
"localhost"
)
{
return
"http://127.0.0.1:4018/api/queueAction/producer/springBoard"
;
}
else
{
return
"http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard"
;
}
},
pmappname
:
"center-app"
,
pmappid
:
1
,
pmcompanyid
:
1
,
...
...
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