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
56f26a5f
Commit
56f26a5f
authored
Jul 30, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add loopDistributionUserCache
parent
9a557a21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
11 deletions
+78
-11
center-manage/app/base/db/cache/aliCache.js
+26
-0
center-manage/app/base/db/cache/loopDistributionUserCache.js
+27
-0
center-manage/app/base/service/impl/auth/userSve.js
+0
-0
center-manage/app/base/service/impl/common/channelhandlers/ali.js
+25
-11
No files found.
center-manage/app/base/db/cache/aliCache.js
0 → 100644
View file @
56f26a5f
const
CacheBase
=
require
(
"../cache.base"
);
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
class
AliCache
extends
CacheBase
{
constructor
()
{
super
();
//this.userDao = system.getObject("db.auth.userDao");
}
isdebug
()
{
return
settings
.
env
==
"dev"
;
}
desc
()
{
return
"缓存缓存阿里队列信息"
;
}
prefix
()
{
return
"g_aliInfo_cm:"
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
if
(
val
)
{
return
val
;
}
return
null
;
}
}
module
.
exports
=
AliCache
;
\ No newline at end of file
center-manage/app/base/db/cache/loopDistributionUserCache.js
0 → 100644
View file @
56f26a5f
const
CacheBase
=
require
(
"../cache.base"
);
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
class
LoopDistributionUserCache
extends
CacheBase
{
constructor
()
{
super
();
this
.
userDao
=
system
.
getObject
(
"db.auth.userDao"
);
this
.
channelDao
=
system
.
getObject
(
"db.common.channelDao"
);
}
isdebug
()
{
return
settings
.
env
==
"dev"
;
}
desc
()
{
return
"缓存阿里订单轮循环分配的业务员信息"
;
}
prefix
()
{
return
"g_loopDistributionUserInfo_cm:"
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
if
(
val
)
{
return
val
;
}
return
null
;
}
}
module
.
exports
=
LoopDistributionUserCache
;
\ No newline at end of file
center-manage/app/base/service/impl/auth/userSve.js
View file @
56f26a5f
This diff is collapsed.
Click to expand it.
center-manage/app/base/service/impl/common/channelhandlers/ali.js
View file @
56f26a5f
...
@@ -70,7 +70,7 @@ class AliHandler {
...
@@ -70,7 +70,7 @@ class AliHandler {
"title"
:
"你有新的商机,请尽快处理"
,
"title"
:
"你有新的商机,请尽快处理"
,
"content"
:
"商机编号"
+
params
.
businessMode
+
",商机类型是"
+
params
.
businessName
+
",服务地区是"
+
params
.
serviceName
,
"content"
:
"商机编号"
+
params
.
businessMode
+
",商机类型是"
+
params
.
businessName
+
",服务地区是"
+
params
.
serviceName
,
"sender"
:
"管理员"
,
"sender"
:
"管理员"
,
"sender_id"
:
0
,
"sender_id"
:
0
,
"msgType"
:
"single"
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
params
.
salesmanId
,
"name"
:
params
.
clerkName
},
"target"
:
{
"id"
:
params
.
salesmanId
,
"name"
:
params
.
clerkName
},
}
}
...
@@ -135,12 +135,12 @@ class AliHandler {
...
@@ -135,12 +135,12 @@ class AliHandler {
rtn
=
await
rc
.
execPost3
(
selpar
,
selUrl
);
rtn
=
await
rc
.
execPost3
(
selpar
,
selUrl
);
var
jj
=
JSON
.
parse
(
rtn
.
stdout
);
var
jj
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
"jj------------------------------"
+
rtn
.
stdout
);
console
.
log
(
"jj------------------------------"
+
rtn
.
stdout
);
if
(
jj
.
status
==
0
&&
jj
.
data
){
if
(
jj
.
status
==
0
&&
jj
.
data
)
{
var
msg
=
{
var
msg
=
{
"title"
:
"你有退回的商机,请尽快处理"
,
"title"
:
"你有退回的商机,请尽快处理"
,
"content"
:
"商机编号"
+
jj
.
data
.
businessMode
+
",商机类型是"
+
jj
.
data
.
businessName
,
"content"
:
"商机编号"
+
jj
.
data
.
businessMode
+
",商机类型是"
+
jj
.
data
.
businessName
,
"sender"
:
"管理员"
,
"sender"
:
"管理员"
,
"sender_id"
:
0
,
"sender_id"
:
0
,
"msgType"
:
"single"
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
jj
.
data
.
clerkId
,
"name"
:
jj
.
data
.
clerkName
},
"target"
:
{
"id"
:
jj
.
data
.
clerkId
,
"name"
:
jj
.
data
.
clerkName
},
}
}
...
@@ -191,6 +191,8 @@ class AliHandler {
...
@@ -191,6 +191,8 @@ class AliHandler {
else
{
else
{
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
requrl
=
this
.
icUrl
+
"/deliverybillCtl/findInfoByDeliverCode"
;
var
requrl
=
this
.
icUrl
+
"/deliverybillCtl/findInfoByDeliverCode"
;
//TODO 将下面的actionBody中的所有字段都检查一遍
//TODO 确定订单编号的key, 将datajson.actionBody.orderNum替换
var
delInfo
=
await
rc
.
execPost3
({
"d"
:
{
"deliverNumber"
:
datajson
.
actionBody
.
orderNum
}
},
requrl
);
var
delInfo
=
await
rc
.
execPost3
({
"d"
:
{
"deliverNumber"
:
datajson
.
actionBody
.
orderNum
}
},
requrl
);
console
.
log
(
"jdelInfo---------------------------------------------"
+
delInfo
.
stdout
);
console
.
log
(
"jdelInfo---------------------------------------------"
+
delInfo
.
stdout
);
var
jdelInfo
=
JSON
.
parse
(
delInfo
.
stdout
);
var
jdelInfo
=
JSON
.
parse
(
delInfo
.
stdout
);
...
@@ -210,7 +212,7 @@ class AliHandler {
...
@@ -210,7 +212,7 @@ class AliHandler {
ConsultTypeName
=
datajson
.
actionBody
.
productTypeName
.
split
(
"/"
)[
2
];
ConsultTypeName
=
datajson
.
actionBody
.
productTypeName
.
split
(
"/"
)[
2
];
}
}
console
.
log
(
"ConsultTypeName-----------------------------"
+
ConsultTypeName
);
console
.
log
(
"ConsultTypeName-----------------------------"
+
ConsultTypeName
);
var
salesmanInfo
=
await
this
.
userService
.
getBizUserForDelivery
(
datajson
.
actionBody
.
orderSnapshot
.
contactsPhone
,
datajson
.
actionBody
.
servicerName
,
ConsultTypeName
,
datajson
.
actionBody
.
aliPriceCode
,
datajson
.
actionBody
.
regionName
);
var
salesmanInfo
=
await
this
.
userService
.
getBizUserFor
Ali
Delivery
(
datajson
.
actionBody
.
orderSnapshot
.
contactsPhone
,
datajson
.
actionBody
.
servicerName
,
ConsultTypeName
,
datajson
.
actionBody
.
aliPriceCode
,
datajson
.
actionBody
.
regionName
);
requrl
=
this
.
icUrl
+
"/deliverybillCtl/insertInfo"
;
requrl
=
this
.
icUrl
+
"/deliverybillCtl/insertInfo"
;
var
bizurl
=
this
.
icUrl
+
"/bizoptCtl/updateStatusByDemandCode"
;
var
bizurl
=
this
.
icUrl
+
"/bizoptCtl/updateStatusByDemandCode"
;
var
params
=
{
var
params
=
{
...
@@ -314,7 +316,7 @@ class AliHandler {
...
@@ -314,7 +316,7 @@ class AliHandler {
if
(
datajson
.
actionBody
.
orderSnapshot
.
hasOwnProperty
(
"annualReport"
))
{
//年报信息
if
(
datajson
.
actionBody
.
orderSnapshot
.
hasOwnProperty
(
"annualReport"
))
{
//年报信息
params
.
baseInfo
.
annualReport
=
datajson
.
actionBody
.
orderSnapshot
.
annualReport
;
params
.
baseInfo
.
annualReport
=
datajson
.
actionBody
.
orderSnapshot
.
annualReport
;
}
}
else
{
else
{
if
(
datajson
.
actionBody
.
orderSnapshot
.
annual_report
&&
datajson
.
actionBody
.
orderSnapshot
.
annual_report
!=
'undefined'
)
{
if
(
datajson
.
actionBody
.
orderSnapshot
.
annual_report
&&
datajson
.
actionBody
.
orderSnapshot
.
annual_report
!=
'undefined'
)
{
params
.
baseInfo
.
annualReport
=
true
;
//shifouxuyaonianbao
params
.
baseInfo
.
annualReport
=
true
;
//shifouxuyaonianbao
}
}
...
@@ -406,7 +408,7 @@ class AliHandler {
...
@@ -406,7 +408,7 @@ class AliHandler {
"title"
:
"你有新的交付单,请尽快处理"
,
"title"
:
"你有新的交付单,请尽快处理"
,
"content"
:
"交付单编号"
+
params
.
deliverNumber
+
",产品类型是"
+
params
.
businessName
+
",服务地区是"
+
params
.
serviceName
,
"content"
:
"交付单编号"
+
params
.
deliverNumber
+
",产品类型是"
+
params
.
businessName
+
",服务地区是"
+
params
.
serviceName
,
"sender"
:
"管理员"
,
"sender"
:
"管理员"
,
"sender_id"
:
0
,
"sender_id"
:
0
,
"msgType"
:
"single"
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
params
.
clerkId
,
"name"
:
params
.
clerkName
},
"target"
:
{
"id"
:
params
.
clerkId
,
"name"
:
params
.
clerkName
},
}
}
...
@@ -470,19 +472,19 @@ class AliHandler {
...
@@ -470,19 +472,19 @@ class AliHandler {
//给业务员发信息
//给业务员发信息
var
selUrl
=
this
.
icUrl
+
"/deliverybillCtl/findInfoByDeliverCode"
;
var
selUrl
=
this
.
icUrl
+
"/deliverybillCtl/findInfoByDeliverCode"
;
var
selpar
=
{
var
selpar
=
{
"d"
:{
"d"
:
{
"deliverNumber"
:
datajson
.
actionBody
.
orderNum
"deliverNumber"
:
datajson
.
actionBody
.
orderNum
}
}
}
}
rtn
=
await
rc
.
execPost3
(
selpar
,
selUrl
);
rtn
=
await
rc
.
execPost3
(
selpar
,
selUrl
);
var
jj
=
JSON
.
parse
(
rtn
.
stdout
);
var
jj
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
"jj-------------------------"
+
rtn
.
stdout
);
console
.
log
(
"jj-------------------------"
+
rtn
.
stdout
);
if
(
jj
.
status
==
0
&&
jj
.
data
)
{
if
(
jj
.
status
==
0
&&
jj
.
data
)
{
var
msg
=
{
var
msg
=
{
"title"
:
"你有关闭的交付单,请尽快处理"
,
"title"
:
"你有关闭的交付单,请尽快处理"
,
"content"
:
"交付单编号"
+
jj
.
data
.
delivery_code
+
",产品类型是"
+
jj
.
data
.
product_name
,
"content"
:
"交付单编号"
+
jj
.
data
.
delivery_code
+
",产品类型是"
+
jj
.
data
.
product_name
,
"sender"
:
"管理员"
,
"sender"
:
"管理员"
,
"sender_id"
:
0
,
"sender_id"
:
0
,
"msgType"
:
"single"
,
"msgType"
:
"single"
,
"target"
:
{
"id"
:
jj
.
data
.
salesman_id
,
"name"
:
jj
.
data
.
salesman_name
},
"target"
:
{
"id"
:
jj
.
data
.
salesman_id
,
"name"
:
jj
.
data
.
salesman_name
},
}
}
...
@@ -496,7 +498,7 @@ class AliHandler {
...
@@ -496,7 +498,7 @@ class AliHandler {
}
}
await
this
.
msgService
.
create
(
msg
);
await
this
.
msgService
.
create
(
msg
);
}
}
return
{
return
{
"status"
:
1
,
//1代表成功,否则失败
"status"
:
1
,
//1代表成功,否则失败
"msg"
:
""
,
"msg"
:
""
,
...
@@ -526,3 +528,14 @@ module.exports = new AliHandler();
...
@@ -526,3 +528,14 @@ module.exports = new AliHandler();
// console.log("dddddddddddddd");
// console.log("dddddddddddddd");
// })()
// })()
// let userService = system.getObject("service.auth.userSve");
// start();
// async function start() {
// console.log('开始:')
// try {
// let result = await userService.getBizUserForAliDelivery(" ", "公司宝", "icp", "sv_vat_shareholder_domestic1015", "北京市");
// console.log('=-=-=-=-=-=:'+JSON.stringify(result));
// } catch (error) {
// console.log("getBizUserForAliDelivery err: "+ error);
// }
// }
\ 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