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
f373b023
Commit
f373b023
authored
Aug 26, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
47c4680b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
32 deletions
+43
-32
center-manage/app/base/service/impl/auth/userSve.js
+25
-25
center-manage/app/base/service/impl/common/channelhandlers/ali.js
+0
-0
center-manage/app/base/service/impl/common/channelhandlers/aliCloud.js
+18
-7
No files found.
center-manage/app/base/service/impl/auth/userSve.js
View file @
f373b023
...
...
@@ -390,7 +390,7 @@ class UserService extends ServiceBase {
* @param {*} productCatName 产品类型名称
* @param {*} regionName 区域
*/
async
getBizUserForBizChance
(
clientMobile
,
spName
,
productCatName
,
regionName
)
{
async
getBizUserForBizChance
(
clientMobile
,
spName
,
productCatName
,
regionName
,
companyFind
)
{
var
self
=
this
clientMobile
=
clientMobile
+
"_"
+
spName
+
"_"
+
regionName
+
"_"
+
productCatName
//按照服务商名字查询到公司,按照公司查询出users,条件是可以接受派单任务,并且技能标签含有,产品类别名称
...
...
@@ -409,14 +409,14 @@ class UserService extends ServiceBase {
}
}
if
(
isGoExec
)
{
let
companyFind
=
await
self
.
companyDao
.
model
.
findOne
({
where
:
{
name
:
spName
},
include
:
[
{
model
:
self
.
db
.
models
.
user
,
as
:
"us"
,
attributes
:
[
'id'
,
'userName'
,
'mobile'
,
'isAllocated'
,
'opath'
,
'skilltags'
,
'regiontags'
,
'isAllArea'
,
'isSalesman'
,
'isDelivery'
],
raw
:
true
}
],
excludes
:
[
'orgJson'
],
transaction
:
t
});
console
.
log
(
companyFind
)
//
let companyFind = await self.companyDao.model.findOne({
//
where: { name: spName }, include: [
//
{
//
model: self.db.models.user, as: "us", attributes: ['id', 'userName', 'mobile', 'isAllocated', 'opath', 'skilltags', 'regiontags', 'isAllArea', 'isSalesman', 'isDelivery'], raw: true
//
}
//
], excludes: ['orgJson'], transaction: t
//
});
//
console.log(companyFind)
let
users
=
companyFind
.
us
let
cansels
=
users
.
filter
(
u
=>
{
if
(
regionName
&&
regionName
!=
""
&&
u
.
regiontags
)
{
...
...
@@ -470,7 +470,7 @@ class UserService extends ServiceBase {
* @param {*} skucode 最小销售货品编码,来自渠道上架的码
* @param {*} regionName 区域
*/
async
getBizUserForDelivery
(
xclientMobile
,
spName
,
productCatName
,
skucode
,
regionName
)
{
async
getBizUserForDelivery
(
xclientMobile
,
spName
,
productCatName
,
skucode
,
regionName
,
companyFind
)
{
let
clientMobile
=
'fordeliver'
+
xclientMobile
+
"_"
+
spName
+
"_"
+
regionName
+
"_"
+
productCatName
var
self
=
this
//按照服务商名字查询到公司,按照公司查询出users,条件是可以接受派单任务,并且技能标签含有,产品类别名称
...
...
@@ -507,13 +507,13 @@ class UserService extends ServiceBase {
}
}
if
(
isGoExec
)
{
let
companyFind
=
await
self
.
companyDao
.
model
.
findOne
({
where
:
{
name
:
spName
},
include
:
[
{
model
:
self
.
db
.
models
.
user
,
as
:
"us"
,
attributes
:
[
'id'
,
'userName'
,
'mobile'
,
'isAllocated'
,
'opath'
,
'skilltags'
,
'regiontags'
,
'isAllArea'
,
'isSalesman'
,
'isDelivery'
],
raw
:
true
}
],
excludes
:
[
'orgJson'
],
transaction
:
t
});
//
let companyFind = await self.companyDao.model.findOne({
//
where: { name: spName }, include: [
//
{
//
model: self.db.models.user, as: "us", attributes: ['id', 'userName', 'mobile', 'isAllocated', 'opath', 'skilltags', 'regiontags', 'isAllArea', 'isSalesman', 'isDelivery'], raw: true
//
}
//
], excludes: ['orgJson'], transaction: t
//
});
let
users
=
companyFind
.
us
let
cansels
=
users
.
filter
(
u
=>
{
if
(
regionName
&&
regionName
!=
""
&&
u
.
regiontags
)
{
...
...
@@ -587,7 +587,7 @@ class UserService extends ServiceBase {
* @param {*} skucode 最小销售货品编码,来自渠道上架的码
* @param {*} regionName 区域
*/
async
getBizUserForAliDelivery
(
xclientMobile
,
spName
,
productCatName
,
skucode
,
regionName
)
{
async
getBizUserForAliDelivery
(
xclientMobile
,
spName
,
productCatName
,
skucode
,
regionName
,
companyFind
)
{
// let clientMobile = 'fordeliver' + xclientMobile + "_" + spName + "_" + regionName
let
self
=
this
//按照服务商名字查询到公司,按照公司查询出users,条件是可以接受派单任务,并且技能标签含有,产品类别名称
...
...
@@ -631,13 +631,13 @@ class UserService extends ServiceBase {
//查询数据库user表来获取交付员信息 需要根据是否是"交付员"字段筛选(派单规则是将交付单派给交付员)
if
(
isGoExec
)
{
let
companyFind
=
await
self
.
companyDao
.
model
.
findOne
({
where
:
{
name
:
spName
},
include
:
[
{
model
:
self
.
db
.
models
.
user
,
as
:
"us"
,
attributes
:
[
'id'
,
'userName'
,
'mobile'
,
'isAllocated'
,
'opath'
,
'skilltags'
,
'regiontags'
,
'isAllArea'
,
'isSalesman'
,
'isDelivery'
],
raw
:
true
}
],
excludes
:
[
'orgJson'
],
transaction
:
t
});
//
let companyFind = await self.companyDao.model.findOne({
//
where: { name: spName }, include: [
//
{
//
model: self.db.models.user, as: "us", attributes: ['id', 'userName', 'mobile', 'isAllocated', 'opath', 'skilltags', 'regiontags', 'isAllArea', 'isSalesman', 'isDelivery'], raw: true
//
}
//
], excludes: ['orgJson'], transaction: t
//
});
let
users
=
companyFind
.
us
;
//按名单筛选
// let deliveryList = ["", "", "", "", ""];
...
...
center-manage/app/base/service/impl/common/channelhandlers/ali.js
deleted
100644 → 0
View file @
47c4680b
This diff is collapsed.
Click to expand it.
center-manage/app/base/service/impl/common/channelhandlers/aliCloud.js
View file @
f373b023
...
...
@@ -5,6 +5,7 @@ class AliHandler {
constructor
()
{
this
.
icUrl
=
settings
.
icUrl
()
+
"/web/bizchance"
;
this
.
userService
=
system
.
getObject
(
"service.auth.userSve"
);
this
.
cmpService
=
system
.
getObject
(
"service.common.companySve"
);
this
.
msgService
=
system
.
getObject
(
"service.msg.msgSve"
)
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
}
...
...
@@ -15,7 +16,7 @@ class AliHandler {
* @param {*} datajson
*/
//新商机处理
async
addChance
(
datajson
)
{
async
addChance
(
datajson
)
{
console
.
log
(
"put in queue [addChance]"
,
datajson
);
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
...
...
@@ -70,7 +71,7 @@ class AliHandler {
}
}
async
updateChanceStatus
(
datajson
)
{
async
updateChanceStatus
(
datajson
)
{
console
.
log
(
"put in queue [updateChanceStatus]"
+
JSON
.
stringify
(
datajson
)
+
"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
);
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
...
...
@@ -120,7 +121,7 @@ class AliHandler {
//退回商机处理
async
needClose
(
datajson
)
{
async
needClose
(
datajson
)
{
console
.
log
(
"put in queue"
+
JSON
.
stringify
(
datajson
)
+
"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
);
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
...
...
@@ -199,7 +200,7 @@ class AliHandler {
}
//交付单处理
async
pushOrderDelivery
(
datajson
,
channelobj
)
{
async
pushOrderDelivery
(
datajson
,
channelobj
)
{
console
.
log
(
"put in queue-----------------------------------------------------------------------------------------------------"
,
datajson
);
try
{
console
.
log
(
"交付单数据:"
+
JSON
.
stringify
(
datajson
));
...
...
@@ -260,7 +261,17 @@ class AliHandler {
ConsultTypeName
=
obj
.
businessName
;
}
try
{
var
deliveryInfo
=
await
this
.
userService
.
getBizUserForAliDelivery
(
obj
.
baseInfo
.
contactsName
,
obj
.
servicerName
,
ConsultTypeName
,
obj
.
skuCode
,
obj
.
serviceName
);
let
companyFind
=
await
this
.
cmpService
.
dao
.
model
.
findOne
({
where
:
{
name
:
obj
.
serviceName
},
include
:
[
{
model
:
this
.
cmpService
.
db
.
models
.
user
,
as
:
"us"
,
attributes
:
[
'id'
,
'userName'
,
'mobile'
,
'isAllocated'
,
'opath'
,
'skilltags'
,
'regiontags'
,
'isAllArea'
,
'isSalesman'
,
'isDelivery'
],
raw
:
true
}
],
excludes
:
[
'orgJson'
]
});
if
(
companyFind
)
{
obj
.
servicerCode
=
companyFind
.
id
;
}
var
deliveryInfo
=
await
this
.
userService
.
getBizUserForAliDelivery
(
obj
.
baseInfo
.
contactsName
,
obj
.
servicerName
,
ConsultTypeName
,
obj
.
skuCode
,
obj
.
serviceName
,
companyFind
);
}
catch
(
error
)
{
console
.
log
(
"分配交付员失败."
,
error
);
}
...
...
@@ -304,7 +315,7 @@ class AliHandler {
}
//客户状态处理
async
deliveryNotify
(
datajson
)
{
async
deliveryNotify
(
datajson
)
{
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
var
cacheInfo
=
await
this
.
cacheManager
[
"AliCache"
].
getCache
(
cachestr
);
...
...
@@ -390,7 +401,7 @@ class AliHandler {
}
}
async
actionBodyHandler
(
actionBody
)
{
async
actionBodyHandler
(
actionBody
)
{
let
data
=
actionBody
;
let
obj
=
{};
obj
.
baseInfo
=
{};
...
...
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