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
0205c100
Commit
0205c100
authored
Jul 04, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-manage' of gitlab.gongsibao.com:jiangyong/zhichan into center-manage
parents
9d8bbb2d
edbeb796
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
104 additions
and
16 deletions
+104
-16
center-manage/app/base/service/impl/common/channelhandlers/tx.js
+104
-16
No files found.
center-manage/app/base/service/impl/common/channelhandlers/tx.js
View file @
0205c100
...
...
@@ -5,6 +5,7 @@ class TxHandler {
constructor
()
{
this
.
icUrl
=
settings
.
icUrl
()
+
"/web/bizchance"
;
this
.
userService
=
system
.
getObject
(
"service.auth.userSve"
);
this
.
msgService
=
system
.
getObject
(
"service.msg.msgSve"
)
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
}
/**
...
...
@@ -56,14 +57,31 @@ class TxHandler {
params
.
salesmanOpcode
=
salesmanInfo
.
opath
;
params
.
salesmanId
=
salesmanInfo
.
userId
;
params
.
clerkName
=
salesmanInfo
.
userName
;
params
.
clerkPhone
=
salesmanInfo
.
mobile
,
params
.
servicerCode
=
salesmanInfo
.
compId
params
.
clerkPhone
=
salesmanInfo
.
mobile
;
params
.
servicerCode
=
salesmanInfo
.
compId
}
var
rtn
=
await
rc
.
execPost3
({
"d"
:
params
},
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
JSON
.
stringify
(
j
),
"RRRRRRRRRRRRRRR"
);
if
(
j
.
status
==
1
)
{
//插入redis缓存
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
null
,
1200000
);
if
(
j
.
status
==
1
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
null
,
1200000
);
//插入redis缓存
//给业务员发信息
var
msg
=
{
"title"
:
"你有新的商机,请尽快处理"
,
"content"
:
"商机编号"
+
params
.
businessMode
+
",商机类型是"
+
params
.
businessName
+
",服务地区是"
+
params
.
serviceName
,
"sender"
:
"管理员"
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
params
.
salesmanId
,
"name"
:
params
.
clerkName
},
}
if
(
params
.
businessType
==
"/qcfw/icp/"
||
params
.
businessType
==
"/qcfw/edi/"
||
params
.
businessType
==
"/qcfw/icpannals/"
||
params
.
businessType
==
"/qcfw/ediannals/"
)
{
msg
.
app_key
=
"5ae2da88-0ced-4b7a-98ea-60d5e1ff7e2e"
;
msg
.
jump_address
=
"allDispose"
}
else
{
msg
.
app_key
=
"42d814c1-4daa-4643-88b2-f5dd3ec853f3"
;
msg
.
jump_address
=
"myChance"
}
await
this
.
msgService
.
create
(
msg
);
}
return
j
;
}
...
...
@@ -104,7 +122,34 @@ 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
,
null
,
1200000
);
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
null
,
1200000
);
//插入缓存
//给业务员发信息
var
selUrl
=
this
.
icUrl
+
"/schemeCtl/findInfoByDemandCode"
;
var
selpar
=
{
"d"
:
{
"businessMode"
:
datajson
.
actionBody
.
NeedNum
}
}
rtn
=
await
rc
.
execPost3
(
selpar
,
selUrl
);
var
jj
=
JSON
.
parse
(
rtn
.
stdout
);
var
msg
=
{
"title"
:
"你有退回的商机,请尽快处理"
,
"content"
:
"商机编号"
+
jj
.
businessMode
+
",商机类型是"
+
jj
.
businessName
,
"sender"
:
"管理员"
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
jj
.
clerkId
,
"name"
:
jj
.
clerkName
},
}
if
(
jj
.
businessType
==
"ICP"
||
params
.
businessType
==
"EDI"
||
params
.
businessType
==
"ICPANNUALREPORT"
||
params
.
businessType
==
"EDIANNUALREPORT"
)
{
msg
.
app_key
=
"5ae2da88-0ced-4b7a-98ea-60d5e1ff7e2e"
;
msg
.
jump_address
=
"allDispose"
}
else
{
msg
.
app_key
=
"42d814c1-4daa-4643-88b2-f5dd3ec853f3"
;
msg
.
jump_address
=
"myChance"
}
await
this
.
msgService
.
create
(
msg
);
return
{
"status"
:
1
,
//1代表成功,否则失败
"msg"
:
"成功"
,
...
...
@@ -185,14 +230,14 @@ class TxHandler {
"express_info"
:
{}
}
if
(
salesmanInfo
&&
salesmanInfo
!=
'undefined'
)
{
params
.
clerkOpcode
=
salesmanInfo
.
opath
,
params
.
clerkId
=
salesmanInfo
.
userId
,
params
.
clerkName
=
salesmanInfo
.
userName
,
params
.
clerkPhone
=
salesmanInfo
.
mobile
,
params
.
costPrice
=
salesmanInfo
.
cost
,
params
.
servicerCode
=
salesmanInfo
.
compId
,
params
.
baseInfo
.
clerkName
=
salesmanInfo
.
userName
,
params
.
baseInfo
.
clerkPhone
=
salesmanInfo
.
mobile
params
.
clerkOpcode
=
salesmanInfo
.
opath
;
params
.
clerkId
=
salesmanInfo
.
userId
;
params
.
clerkName
=
salesmanInfo
.
userName
;
params
.
clerkPhone
=
salesmanInfo
.
mobile
;
params
.
costPrice
=
salesmanInfo
.
cost
;
params
.
servicerCode
=
salesmanInfo
.
compId
;
params
.
baseInfo
.
clerkName
=
salesmanInfo
.
userName
;
params
.
baseInfo
.
clerkPhone
=
salesmanInfo
.
mobile
}
if
(
!
params
.
serviceCode
||
params
.
serviceCode
==
'undefined'
)
{
if
(
datajson
.
actionBody
.
orderSnapshot
.
servicerCode
&&
datajson
.
actionBody
.
orderSnapshot
.
servicerCode
!=
'undefined'
)
{
...
...
@@ -220,7 +265,7 @@ class TxHandler {
}
}
if
(
datajson
.
actionBody
.
orderSnapshot
.
hasOwnProperty
(
"financial"
))
{
if
(
datajson
.
actionBody
.
orderSnapshot
.
financial
===
true
||
datajson
.
actionBody
.
orderSnapshot
.
financial
===
"yes"
)
{
if
(
datajson
.
actionBody
.
orderSnapshot
.
financial
===
true
||
datajson
.
actionBody
.
orderSnapshot
.
financial
===
"yes"
)
{
params
.
baseInfo
.
financial
=
"yes"
;
}
else
{
...
...
@@ -325,7 +370,7 @@ class TxHandler {
if
(
datajson
.
actionBody
.
orderSnapshot
.
annual_report
&&
datajson
.
actionBody
.
orderSnapshot
.
annual_report
!=
'undefined'
)
{
params
.
baseInfo
.
annualReport
=
true
;
//shifouxuyaonianbao
}
else
{
else
{
params
.
baseInfo
.
annualReport
=
false
;
}
...
...
@@ -342,6 +387,23 @@ class TxHandler {
console
.
log
(
"j1---------------------------------"
+
rtn
.
stdout
);
if
(
j
.
status
==
0
&&
j1
.
status
==
0
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
null
,
1200000
);
//给业务员发信息
var
msg
=
{
"title"
:
"你有新的交付单,请尽快处理"
,
"content"
:
"交付单编号"
+
params
.
deliverNumber
+
",产品类型是"
+
params
.
businessName
+
",服务地区是"
+
params
.
serviceName
,
"sender"
:
"管理员"
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
params
.
clerkId
,
"name"
:
params
.
clerkName
},
}
if
(
params
.
businessType
==
"/qcfw/icp/"
||
params
.
businessType
==
"/qcfw/edi/"
||
params
.
businessType
==
"/qcfw/icpannals/"
||
params
.
businessType
==
"/qcfw/ediannals/"
)
{
msg
.
app_key
=
"5ae2da88-0ced-4b7a-98ea-60d5e1ff7e2e"
;
msg
.
jump_address
=
"deliveryAll"
}
else
{
msg
.
app_key
=
"42d814c1-4daa-4643-88b2-f5dd3ec853f3"
;
msg
.
jump_address
=
"myDeliver"
}
await
this
.
msgService
.
create
(
msg
);
return
{
"status"
:
1
,
//1代表成功,否则失败
"msg"
:
""
,
...
...
@@ -388,7 +450,33 @@ 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
,
null
,
1200000
);
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
null
,
1200000
);
//插入缓存
//给业务员发信息
var
selUrl
=
this
.
icUrl
+
"/deliverybillCtl/findInfoByDeliverCode"
;
var
selpar
=
{
"d"
:{
"deliverNumber"
:
datajson
.
actionBody
.
orderNum
}
}
rtn
=
await
rc
.
execPost3
(
selpar
,
selUrl
);
var
jj
=
JSON
.
parse
(
rtn
.
stdout
);
var
msg
=
{
"title"
:
"你有关闭的交付单,请尽快处理"
,
"content"
:
"交付单编号"
+
jj
.
delivery_code
+
",产品类型是"
+
jj
.
product_name
,
"sender"
:
"管理员"
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
jj
.
salesman_id
,
"name"
:
jj
.
salesman_name
},
}
if
(
jj
.
product_code
==
"ICP"
||
jj
.
product_code
==
"EDI"
||
jj
.
product_code
==
"ICPANNUALREPORT"
||
jj
.
product_code
==
"EDIANNUALREPORT"
)
{
msg
.
app_key
=
"5ae2da88-0ced-4b7a-98ea-60d5e1ff7e2e"
;
msg
.
jump_address
=
"deliveryAll"
}
else
{
msg
.
app_key
=
"42d814c1-4daa-4643-88b2-f5dd3ec853f3"
;
msg
.
jump_address
=
"myDeliver"
}
await
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