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
8aad12e8
Commit
8aad12e8
authored
Aug 14, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Plain Diff
fix: 分配
parents
09b2b5fa
da61b274
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
35 deletions
+29
-35
center-manage/app/base/service/impl/auth/userSve.js
+21
-31
center-manage/app/base/service/impl/common/channelhandlers/tx.js
+8
-4
No files found.
center-manage/app/base/service/impl/auth/userSve.js
View file @
8aad12e8
...
@@ -409,8 +409,6 @@ class UserService extends ServiceBase {
...
@@ -409,8 +409,6 @@ class UserService extends ServiceBase {
}
}
}
}
if
(
isGoExec
)
{
if
(
isGoExec
)
{
console
.
log
(
"-------: debug"
)
console
.
log
(
spName
);
let
companyFind
=
await
self
.
companyDao
.
model
.
findOne
({
let
companyFind
=
await
self
.
companyDao
.
model
.
findOne
({
where
:
{
name
:
spName
},
include
:
[
where
:
{
name
:
spName
},
include
:
[
{
{
...
@@ -418,8 +416,6 @@ class UserService extends ServiceBase {
...
@@ -418,8 +416,6 @@ class UserService extends ServiceBase {
}
}
],
excludes
:
[
'orgJson'
],
transaction
:
t
],
excludes
:
[
'orgJson'
],
transaction
:
t
});
});
console
.
log
(
"-------: debug"
)
console
.
log
(
companyFind
);
console
.
log
(
"getBizUserForBizChance获取服务商信息:"
+
JSON
.
stringify
(
companyFind
));
console
.
log
(
"getBizUserForBizChance获取服务商信息:"
+
JSON
.
stringify
(
companyFind
));
let
users
=
companyFind
.
us
let
users
=
companyFind
.
us
let
cansels
=
users
.
filter
(
u
=>
{
let
cansels
=
users
.
filter
(
u
=>
{
...
@@ -471,6 +467,24 @@ class UserService extends ServiceBase {
...
@@ -471,6 +467,24 @@ class UserService extends ServiceBase {
})
})
}
}
async
findCostBySkuCode
(
skucode
)
{
let
productpricetmp
=
await
this
.
db
.
models
.
productprice
.
findOne
({
where
:
{
skucode
:
skucode
,
isEnabled
:
true
},
include
:
[
{
model
:
this
.
db
.
models
.
productcost
,
where
:
{
expensetype
:
'service'
},
as
:
"costs"
,
attributes
:
[
'id'
,
'expensetype'
,
'costamount'
]
}
],
raw
:
true
,
}
)
let
costAmount
=
0
//获取服务费成本
if
(
productpricetmp
&&
productpricetmp
[
'costs.costamount'
])
{
costAmount
=
Number
(
productpricetmp
[
'costs.costamount'
])
}
else
{
console
.
log
(
"skucode not find product:"
,
skucode
)
}
return
costAmount
}
/**
/**
*
*
* @param {*} clientMobile 客户电话
* @param {*} clientMobile 客户电话
...
@@ -484,26 +498,7 @@ class UserService extends ServiceBase {
...
@@ -484,26 +498,7 @@ class UserService extends ServiceBase {
var
self
=
this
var
self
=
this
//按照服务商名字查询到公司,按照公司查询出users,条件是可以接受派单任务,并且技能标签含有,产品类别名称
//按照服务商名字查询到公司,按照公司查询出users,条件是可以接受派单任务,并且技能标签含有,产品类别名称
return
this
.
db
.
transaction
(
async
function
(
t
)
{
return
this
.
db
.
transaction
(
async
function
(
t
)
{
//按照产品简码,查询服务成本
let
productpricetmp
=
await
self
.
db
.
models
.
productprice
.
findOne
({
where
:
{
skucode
:
skucode
},
include
:
[
{
model
:
self
.
db
.
models
.
productcost
,
as
:
"costs"
,
attributes
:
[
'id'
,
'expensetype'
,
'costamount'
]
}
],
transaction
:
t
}
)
let
serviceCost
=
productpricetmp
.
costs
.
filter
(
c
=>
{
if
(
c
.
expensetype
==
"service"
)
{
return
true
}
})
let
costAmount
=
0
let
costAmount
=
0
//获取服务费成本
if
(
serviceCost
.
length
>
0
)
{
costAmount
=
serviceCost
[
0
].
costamount
}
//先检查缓存是否存在bizuser todo key再加个字母d
//先检查缓存是否存在bizuser todo key再加个字母d
var
resultcache
=
await
self
.
cacheManager
[
"ClientBindBizUserCache"
].
getCache
(
clientMobile
)
var
resultcache
=
await
self
.
cacheManager
[
"ClientBindBizUserCache"
].
getCache
(
clientMobile
)
let
isGoExec
=
false
let
isGoExec
=
false
...
@@ -563,7 +558,7 @@ class UserService extends ServiceBase {
...
@@ -563,7 +558,7 @@ class UserService extends ServiceBase {
await
self
.
cacheManager
[
"ClientBindBizUserCache"
].
cache
(
clientMobile
,
tmp
)
await
self
.
cacheManager
[
"ClientBindBizUserCache"
].
cache
(
clientMobile
,
tmp
)
return
{
userInfo
:
tmp
,
comInfo
:
{
cost
:
tmp
.
cost
,
compId
:
tmp
.
compId
}
};
return
{
userInfo
:
tmp
,
comInfo
:
{
cost
:
tmp
.
cost
,
compId
:
tmp
.
compId
}
};
}
else
{
}
else
{
return
{
userInfo
:
null
,
comInfo
:
{
cost
:
tmp
.
cost
,
compId
:
tmp
.
compI
d
}
};
return
{
userInfo
:
null
,
comInfo
:
{
cost
:
costAmount
,
compId
:
companyFind
.
i
d
}
};
}
}
}
else
{
}
else
{
...
@@ -577,9 +572,4 @@ class UserService extends ServiceBase {
...
@@ -577,9 +572,4 @@ class UserService extends ServiceBase {
})
})
}
}
}
}
module
.
exports
=
UserService
;
module
.
exports
=
UserService
;
\ No newline at end of file
// let userS = new UserService()
// userS.getBizUserForBizChance("13381139519", '好生日', '工商注册').then(rtn => {
// console.log(rtn)
// })
\ No newline at end of file
center-manage/app/base/service/impl/common/channelhandlers/tx.js
View file @
8aad12e8
...
@@ -14,7 +14,7 @@ class TxHandler {
...
@@ -14,7 +14,7 @@ class TxHandler {
* @param {*} datajson
* @param {*} datajson
*/
*/
//新商机处理
//新商机处理
async
addChance
(
datajson
)
{
async
addChance
(
datajson
)
{
console
.
log
(
"put in queue"
,
datajson
);
console
.
log
(
"put in queue"
,
datajson
);
try
{
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
...
@@ -101,7 +101,7 @@ class TxHandler {
...
@@ -101,7 +101,7 @@ class TxHandler {
}
}
//退回商机处理
//退回商机处理
async
needClose
(
datajson
)
{
async
needClose
(
datajson
)
{
console
.
log
(
"put in queue"
+
JSON
.
stringify
(
datajson
)
+
"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
);
console
.
log
(
"put in queue"
+
JSON
.
stringify
(
datajson
)
+
"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
);
try
{
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
...
@@ -179,7 +179,7 @@ class TxHandler {
...
@@ -179,7 +179,7 @@ class TxHandler {
}
}
//交付单处理
//交付单处理
async
orderSubmit
(
datajson
)
{
async
orderSubmit
(
datajson
)
{
console
.
log
(
"put in queue-----------------------------------------------------------------------------------------------------"
,
datajson
);
console
.
log
(
"put in queue-----------------------------------------------------------------------------------------------------"
,
datajson
);
try
{
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
...
@@ -246,6 +246,10 @@ class TxHandler {
...
@@ -246,6 +246,10 @@ class TxHandler {
params
.
costPrice
=
salesmanInfo
.
comInfo
.
cost
;
params
.
costPrice
=
salesmanInfo
.
comInfo
.
cost
;
params
.
servicerCode
=
salesmanInfo
.
comInfo
.
compId
;
params
.
servicerCode
=
salesmanInfo
.
comInfo
.
compId
;
}
}
//设置成本 tocheck
let
costprice
=
await
this
.
userService
.
findCostBySkuCode
(
datajson
.
actionBody
.
txPriceCode
)
params
.
costPrice
=
costprice
if
(
salesmanInfo
.
userInfo
&&
salesmanInfo
.
userInfo
!=
'undefined'
)
{
if
(
salesmanInfo
.
userInfo
&&
salesmanInfo
.
userInfo
!=
'undefined'
)
{
params
.
clerkOpcode
=
salesmanInfo
.
userInfo
.
opath
;
params
.
clerkOpcode
=
salesmanInfo
.
userInfo
.
opath
;
params
.
clerkId
=
salesmanInfo
.
userInfo
.
userId
;
params
.
clerkId
=
salesmanInfo
.
userInfo
.
userId
;
...
@@ -464,7 +468,7 @@ class TxHandler {
...
@@ -464,7 +468,7 @@ class TxHandler {
}
}
//关闭交付单处理
//关闭交付单处理
async
orderClose
(
datajson
)
{
async
orderClose
(
datajson
)
{
console
.
log
(
"put in queue"
,
datajson
);
console
.
log
(
"put in queue"
,
datajson
);
try
{
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
...
...
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