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
616a5d38
Commit
616a5d38
authored
Aug 12, 2020
by
v_vjyjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
70e24bf9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
27 deletions
+27
-27
center-manage/app/base/service/impl/auth/userSve.js
+17
-18
center-manage/app/base/service/impl/common/channelhandlers/aliCloud.js
+10
-9
No files found.
center-manage/app/base/service/impl/auth/userSve.js
View file @
616a5d38
...
...
@@ -559,6 +559,23 @@ class UserService extends ServiceBase {
}
})
}
async
findCostBySkuCode
(
skucode
)
{
let
productpricetmp
=
await
this
.
db
.
models
.
productprice
.
findOne
({
where
:
{
skucode
:
skucode
},
include
:
[
{
model
:
this
.
db
.
models
.
productcost
,
where
:
{
expensetype
:
'service'
},
as
:
"costs"
,
attributes
:
[
'id'
,
'expensetype'
,
'costamount'
]
}
],
raw
:
true
,
}
)
let
costAmount
=
0
//获取服务费成本
if
(
productpricetmp
[
'costs.costamount'
])
{
costAmount
=
Number
(
productpricetmp
[
'costs.costamount'
])
}
return
costAmount
}
/**
* 阿里交付单分配规则-轮循分配(交付单处理业务员和交付员不是一个同一人)
...
...
@@ -573,25 +590,7 @@ class UserService extends ServiceBase {
let
self
=
this
//按照服务商名字查询到公司,按照公司查询出users,条件是可以接受派单任务,并且技能标签含有,产品类别名称
return
this
.
db
.
transaction
(
async
function
(
t
)
{
//按照产品简码,查询服务成本
let
productpricetmp
=
await
self
.
db
.
models
.
productprice
.
findOne
({
where
:
{
skucode
:
skucode
},
include
:
[
{
model
:
self
.
db
.
models
.
productcost
,
where
:
{
expensetype
:
'service'
},
as
:
"costs"
,
attributes
:
[
'id'
,
'expensetype'
,
'costamount'
]
}
],
raw
:
true
,
transaction
:
t
}
)
let
costAmount
=
0
//获取服务费成本
if
(
productpricetmp
[
'costs.costamount'
])
{
costAmount
=
Number
(
productpricetmp
[
'costs.costamount'
])
}
console
.
log
(
"skucode=================="
,
costAmount
,
productpricetmp
)
// console.log('------------1:', JSON.stringify(productpricetmp.costs));
//检查缓存是否存在bizuser
let
resultcache
=
await
self
.
cacheManager
[
"LoopDistributionUserCache"
].
getCache
(
"LoopDistributionUserCache"
);
let
isGoExec
=
false
;
...
...
center-manage/app/base/service/impl/common/channelhandlers/aliCloud.js
View file @
616a5d38
...
...
@@ -15,7 +15,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 +70,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
));
...
...
@@ -114,7 +114,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
));
...
...
@@ -193,7 +193,7 @@ class AliHandler {
}
//交付单处理
async
pushOrderDelivery
(
datajson
,
channelobj
)
{
async
pushOrderDelivery
(
datajson
,
channelobj
)
{
console
.
log
(
"put in queue-----------------------------------------------------------------------------------------------------"
,
datajson
);
try
{
console
.
log
(
"交付单数据:"
+
JSON
.
stringify
(
datajson
));
...
...
@@ -256,18 +256,19 @@ class AliHandler {
try
{
var
deliveryInfo
=
await
this
.
userService
.
getBizUserForAliDelivery
(
obj
.
baseInfo
.
contactsName
,
obj
.
servicerName
,
ConsultTypeName
,
obj
.
skuCode
,
obj
.
serviceName
);
}
catch
(
error
)
{
console
.
log
(
"分配交付员失败."
);
console
.
log
(
"分配交付员失败."
,
error
);
}
if
(
deliveryInfo
&&
deliveryInfo
!=
'undefined'
)
{
obj
.
clerkOpcode
=
deliveryInfo
.
opath
;
//交付员opcode
obj
.
clerkId
=
deliveryInfo
.
userId
;
//交付员id
obj
.
costPrice
=
deliveryInfo
.
cost
;
//成本
//
obj.costPrice = deliveryInfo.cost;//成本
obj
.
clerkName
=
deliveryInfo
.
userName
;
//交付员名称
// obj.clerkPhone = deliveryInfo.mobile;//交付人员电话
// obj.servicerCode = deliveryInfo.compId;
}
//设置成本
obj
.
costPrice
=
await
this
.
userService
.
findCostBySkuCode
(
obj
.
skuCode
)
//异步更新需求状态 channelNeedNo
if
(
datajson
.
actionBody
&&
datajson
.
actionBody
.
channelNeedNo
)
{
var
stau
=
{
...
...
@@ -297,7 +298,7 @@ class AliHandler {
}
//客户状态处理
async
deliveryNotify
(
datajson
)
{
async
deliveryNotify
(
datajson
)
{
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
var
cacheInfo
=
await
this
.
cacheManager
[
"AliCache"
].
getCache
(
cachestr
);
...
...
@@ -383,7 +384,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