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
2eba617f
Commit
2eba617f
authored
Aug 05, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 消息发送
parent
a2887561
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
31 deletions
+30
-31
center-manage/app/base/service/impl/common/channelhandlers/tx.js
+30
-31
No files found.
center-manage/app/base/service/impl/common/channelhandlers/tx.js
View file @
2eba617f
...
...
@@ -43,9 +43,9 @@ class TxHandler {
"contactsPhone"
:
datajson
.
actionBody
.
ContactsMobile
,
"businessType"
:
datajson
.
actionBody
.
ConsultType
,
"businessName"
:
datajson
.
actionBody
.
ConsultTypeName
,
"currentStatus"
:
"beforeSubmission"
,
"channelSource"
:
"tencentCloud"
,
//渠道
"channelNumber"
:
"tx"
"currentStatus"
:
"beforeSubmission"
,
"channelSource"
:
"tencentCloud"
,
//渠道
"channelNumber"
:
"tx"
}
if
(
datajson
.
actionBody
.
Notes
&&
datajson
.
actionBody
.
Notes
!=
'undefined'
)
{
params
.
memoInfo
=
datajson
.
actionBody
.
Notes
;
...
...
@@ -67,13 +67,13 @@ class TxHandler {
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
JSON
.
stringify
(
j
),
"RRRRRRRRRRRRRRR"
);
if
(
j
.
status
==
1
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入redis缓存
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入redis缓存
//给业务员发信息
var
msg
=
{
"title"
:
"你有新的商机,请尽快处理"
,
"content"
:
"商机编号"
+
params
.
businessMode
+
",商机类型是"
+
params
.
businessName
+
",服务地区是"
+
params
.
serviceName
,
"sender"
:
"管理员"
,
"sender_id"
:
0
,
"sender_id"
:
0
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
params
.
salesmanId
,
"name"
:
params
.
clerkName
},
}
...
...
@@ -85,7 +85,7 @@ class TxHandler {
msg
.
app_key
=
"42d814c1-4daa-4643-88b2-f5dd3ec853f3"
;
msg
.
jump_address
=
"myChance"
}
await
this
.
msgService
.
create
(
msg
);
this
.
msgService
.
create
(
msg
);
}
return
j
;
}
...
...
@@ -126,7 +126,7 @@ class TxHandler {
var
rtn
=
await
rc
.
execPost3
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入缓存
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入缓存
//给业务员发信息
var
selUrl
=
this
.
icUrl
+
"/schemeCtl/findInfoByDemandCode"
;
...
...
@@ -138,12 +138,12 @@ class TxHandler {
rtn
=
await
rc
.
execPost3
(
selpar
,
selUrl
);
var
jj
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
"jj------------------------------"
+
rtn
.
stdout
);
if
(
jj
.
status
==
0
&&
jj
.
data
){
if
(
jj
.
status
==
0
&&
jj
.
data
)
{
var
msg
=
{
"title"
:
"你有退回的商机,请尽快处理"
,
"content"
:
"商机编号"
+
jj
.
data
.
businessMode
+
",商机类型是"
+
jj
.
data
.
businessName
,
"sender"
:
"管理员"
,
"sender_id"
:
0
,
"sender_id"
:
0
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
jj
.
data
.
clerkId
,
"name"
:
jj
.
data
.
clerkName
},
}
...
...
@@ -155,8 +155,7 @@ class TxHandler {
msg
.
app_key
=
"42d814c1-4daa-4643-88b2-f5dd3ec853f3"
;
msg
.
jump_address
=
"myChance"
}
var
msgInfo
=
await
this
.
msgService
.
create
(
msg
);
console
.
log
(
"msgInfo -----------------------------"
+
msgInfo
);
this
.
msgService
.
create
(
msg
);
}
return
{
...
...
@@ -217,8 +216,8 @@ class TxHandler {
requrl
=
this
.
icUrl
+
"/deliverybillCtl/insertInfo"
;
var
bizurl
=
this
.
icUrl
+
"/bizoptCtl/updateStatusByDemandCode"
;
var
params
=
{
"channelSource"
:
"tencentCloud"
,
//渠道
"channelNumber"
:
"tx"
,
"channelSource"
:
"tencentCloud"
,
//渠道
"channelNumber"
:
"tx"
,
"deliverNumber"
:
datajson
.
actionBody
.
orderNum
,
"servicerName"
:
datajson
.
actionBody
.
servicerName
,
"serviceCode"
:
datajson
.
actionBody
.
regionId
,
...
...
@@ -249,7 +248,7 @@ class TxHandler {
params
.
costPrice
=
salesmanInfo
.
cost
;
params
.
servicerCode
=
salesmanInfo
.
compId
;
params
.
baseInfo
.
clerkName
=
salesmanInfo
.
userName
;
// params.baseInfo.clerkPhone = salesmanInfo.mobile
// params.baseInfo.clerkPhone = salesmanInfo.mobile
}
// if (!params.servicerCode || params.servicerCode == 'undefined') {
// if (datajson.actionBody.orderSnapshot.servicerCode && datajson.actionBody.orderSnapshot.servicerCode != 'undefined') {
...
...
@@ -276,11 +275,11 @@ class TxHandler {
params
.
baseInfo
.
isWhether
=
"no"
;
//是否刻章
}
}
else
{
if
(
datajson
.
actionBody
.
contextOrderCount
&&
datajson
.
actionBody
.
contextOrderCount
!=
'undefined'
&&
datajson
.
actionBody
.
contextOrderCount
>
1
){
else
{
if
(
datajson
.
actionBody
.
contextOrderCount
&&
datajson
.
actionBody
.
contextOrderCount
!=
'undefined'
&&
datajson
.
actionBody
.
contextOrderCount
>
1
)
{
params
.
baseInfo
.
isWhether
=
"yes"
;
}
else
{
else
{
params
.
baseInfo
.
isWhether
=
"no"
;
}
}
...
...
@@ -292,11 +291,11 @@ class TxHandler {
params
.
baseInfo
.
financial
=
"no"
;
}
}
else
{
if
(
datajson
.
actionBody
.
contextOrderCount
&&
datajson
.
actionBody
.
contextOrderCount
!=
'undefined'
&&
datajson
.
actionBody
.
contextOrderCount
>
1
){
else
{
if
(
datajson
.
actionBody
.
contextOrderCount
&&
datajson
.
actionBody
.
contextOrderCount
!=
'undefined'
&&
datajson
.
actionBody
.
contextOrderCount
>
1
)
{
params
.
baseInfo
.
financial
=
"yes"
;
}
else
{
else
{
params
.
baseInfo
.
financial
=
"no"
;
}
}
...
...
@@ -336,7 +335,7 @@ class TxHandler {
if
(
datajson
.
actionBody
.
orderSnapshot
.
hasOwnProperty
(
"annualReport"
))
{
//年报信息
params
.
baseInfo
.
annualReport
=
datajson
.
actionBody
.
orderSnapshot
.
annualReport
;
}
else
{
else
{
if
(
datajson
.
actionBody
.
orderSnapshot
.
annual_report
&&
datajson
.
actionBody
.
orderSnapshot
.
annual_report
!=
'undefined'
)
{
params
.
baseInfo
.
annualReport
=
true
;
//shifouxuyaonianbao
}
...
...
@@ -422,13 +421,13 @@ class TxHandler {
var
j1
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
"j1---------------------------------"
+
rtn
.
stdout
);
if
(
j
.
status
==
0
&&
j1
.
status
==
0
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//给业务员发信息
var
msg
=
{
"title"
:
"你有新的交付单,请尽快处理"
,
"content"
:
"交付单编号"
+
params
.
deliverNumber
+
",产品类型是"
+
params
.
businessName
+
",服务地区是"
+
params
.
serviceName
,
"sender"
:
"管理员"
,
"sender_id"
:
0
,
"sender_id"
:
0
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
params
.
clerkId
,
"name"
:
params
.
clerkName
},
}
...
...
@@ -440,7 +439,7 @@ class TxHandler {
msg
.
app_key
=
"42d814c1-4daa-4643-88b2-f5dd3ec853f3"
;
msg
.
jump_address
=
"myDeliver"
}
await
this
.
msgService
.
create
(
msg
);
this
.
msgService
.
create
(
msg
);
return
{
"status"
:
1
,
//1代表成功,否则失败
"msg"
:
""
,
...
...
@@ -487,24 +486,24 @@ class TxHandler {
var
rtn
=
await
rc
.
execPost3
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入缓存
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入缓存
//给业务员发信息
var
selUrl
=
this
.
icUrl
+
"/deliverybillCtl/findInfoByDeliverCode"
;
var
selpar
=
{
"d"
:{
"deliverNumber"
:
datajson
.
actionBody
.
orderNum
"d"
:
{
"deliverNumber"
:
datajson
.
actionBody
.
orderNum
}
}
rtn
=
await
rc
.
execPost3
(
selpar
,
selUrl
);
var
jj
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
"jj-------------------------"
+
rtn
.
stdout
);
if
(
jj
.
status
==
0
&&
jj
.
data
)
{
if
(
jj
.
status
==
0
&&
jj
.
data
)
{
var
msg
=
{
"title"
:
"你有关闭的交付单,请尽快处理"
,
"content"
:
"交付单编号"
+
jj
.
data
.
delivery_code
+
",产品类型是"
+
jj
.
data
.
product_name
,
"sender"
:
"管理员"
,
"sender_id"
:
0
,
"sender_id"
:
0
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
jj
.
data
.
delivery_man_id
,
"name"
:
jj
.
data
.
delivery_man_name
},
}
...
...
@@ -516,9 +515,9 @@ class TxHandler {
msg
.
app_key
=
"42d814c1-4daa-4643-88b2-f5dd3ec853f3"
;
msg
.
jump_address
=
"myDeliver"
}
await
this
.
msgService
.
create
(
msg
);
this
.
msgService
.
create
(
msg
);
}
return
{
"status"
:
1
,
//1代表成功,否则失败
"msg"
:
""
,
...
...
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