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
da61b274
Commit
da61b274
authored
Aug 14, 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
18085c01
7a6c9f6f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
20 deletions
+26
-20
center-manage/app/base/service/impl/auth/userSve.js
+18
-16
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 @
da61b274
...
...
@@ -467,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 客户电话
...
...
@@ -480,23 +498,7 @@ class UserService extends ServiceBase {
var
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'
])
}
//先检查缓存是否存在bizuser todo key再加个字母d
var
resultcache
=
await
self
.
cacheManager
[
"ClientBindBizUserCache"
].
getCache
(
clientMobile
)
let
isGoExec
=
false
...
...
center-manage/app/base/service/impl/common/channelhandlers/tx.js
View file @
da61b274
...
...
@@ -14,7 +14,7 @@ class TxHandler {
* @param {*} datajson
*/
//新商机处理
async
addChance
(
datajson
)
{
async
addChance
(
datajson
)
{
console
.
log
(
"put in queue"
,
datajson
);
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
...
...
@@ -101,7 +101,7 @@ class TxHandler {
}
//退回商机处理
async
needClose
(
datajson
)
{
async
needClose
(
datajson
)
{
console
.
log
(
"put in queue"
+
JSON
.
stringify
(
datajson
)
+
"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
);
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
...
...
@@ -179,7 +179,7 @@ class TxHandler {
}
//交付单处理
async
orderSubmit
(
datajson
)
{
async
orderSubmit
(
datajson
)
{
console
.
log
(
"put in queue-----------------------------------------------------------------------------------------------------"
,
datajson
);
try
{
var
cachestr
=
sha235
(
JSON
.
stringify
(
datajson
));
...
...
@@ -246,6 +246,10 @@ class TxHandler {
params
.
costPrice
=
salesmanInfo
.
comInfo
.
cost
;
params
.
servicerCode
=
salesmanInfo
.
comInfo
.
compId
;
}
//设置成本 tocheck
let
costprice
=
await
this
.
userService
.
findCostBySkuCode
(
datajson
.
actionBody
.
txPriceCode
)
params
.
costPrice
=
costprice
if
(
salesmanInfo
.
userInfo
&&
salesmanInfo
.
userInfo
!=
'undefined'
)
{
params
.
clerkOpcode
=
salesmanInfo
.
userInfo
.
opath
;
params
.
clerkId
=
salesmanInfo
.
userInfo
.
userId
;
...
...
@@ -464,7 +468,7 @@ class TxHandler {
}
//关闭交付单处理
async
orderClose
(
datajson
)
{
async
orderClose
(
datajson
)
{
console
.
log
(
"put in queue"
,
datajson
);
try
{
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