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
977d646c
Commit
977d646c
authored
Jul 04, 2020
by
sxy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-manage' of gitlab.gongsibao.com:jiangyong/zhichan into center-manage
parents
31ff6782
0205c100
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
155 additions
and
18 deletions
+155
-18
center-manage/app/base/controller/ctl.base.js
+19
-0
center-manage/app/base/service/impl/common/channelhandlers/tx.js
+104
-16
center-manage/app/base/system.js
+32
-2
No files found.
center-manage/app/base/controller/ctl.base.js
View file @
977d646c
...
...
@@ -50,6 +50,7 @@ class CtlBase {
credid
:
req
.
headers
[
"x-credential-identifier"
],
regrole
:
req
.
headers
[
"xregrole"
],
bizpath
:
req
.
headers
[
"xbizpath"
],
codetitle
:
req
.
headers
[
"codetitle"
],
}
if
(
!
req
.
xctx
.
appkey
){
return
[
-
200
,
"请求头缺少应用x-app-key"
]
...
...
@@ -104,3 +105,20 @@ class CtlBase {
}
}
module
.
exports
=
CtlBase
;
/*
地址:http://192.168.1.128:401/api/queueAction/producer/springBoard
请求方式:post
参数:
{
"actionType": "produceLogsData",// Y 功能名称
"actionBody": {
"opTitle": "",// N 操作的业务标题
"identifyCode": "logs001",// Y 操作的业务标识
"messageBody": {//日志的描述信息
"opUrl": "http://192.168.1.189:4012/api/test/testApi/springBoard",// N 操作的业务Url
"message": ""// Y 日志消息描述
}
}
}
logs-sytxpublic-msgq-service--日志服务
*/
\ No newline at end of file
center-manage/app/base/service/impl/common/channelhandlers/tx.js
View file @
977d646c
...
...
@@ -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"
:
""
,
...
...
center-manage/app/base/system.js
View file @
977d646c
...
...
@@ -321,4 +321,34 @@ module.exports = System;
// }catch(e){
// console.log(e);
// }
// })()
\ No newline at end of file
// })()
/*
地址:http://192.168.1.128:401/api/queueAction/producer/springBoard
请求方式:post
参数:
{
"actionType": "produceLogsData",// Y 功能名称
"actionBody": {
"opTitle": "",// N 操作的业务标题
"identifyCode": "logs001",// Y 操作的业务标识
"messageBody": {//日志的描述信息
"opUrl": "http://192.168.1.189:4012/api/test/testApi/springBoard",// N 操作的业务Url
"message": ""// Y 日志消息描述
}
}
}
logs-sytxpublic-msgq-service--日志服务
*/
// let obj= {
// "actionType": "produceLogsData",// Y 功能名称
// "actionBody": {
// "opTitle": "",// N 操作的业务标题
// "identifyCode": "logs001",// Y 操作的业务标识
// "messageBody": {//日志的描述信息
// "opUrl": "http://192.168.1.189:4012/api/test/testApi/springBoard",// N 操作的业务Url
// "message": ""// Y 日志消息描述
// }
// }
// }
// System.postJsonTypeReq("http://192.168.1.128:401/api/queueAction/producer/springBoard",)
\ 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