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
7a6c9f6f
Commit
7a6c9f6f
authored
Aug 13, 2020
by
v_vjyjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
75d36e4a
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 @
7a6c9f6f
...
@@ -467,6 +467,24 @@ class UserService extends ServiceBase {
...
@@ -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 客户电话
* @param {*} clientMobile 客户电话
...
@@ -480,23 +498,7 @@ class UserService extends ServiceBase {
...
@@ -480,23 +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
,
where
:
{
expensetype
:
'service'
},
as
:
"costs"
,
attributes
:
[
'id'
,
'expensetype'
,
'costamount'
]
}
],
raw
:
true
,
transaction
:
t
}
)
let
costAmount
=
0
let
costAmount
=
0
//获取服务费成本
if
(
productpricetmp
[
'costs.costamount'
])
{
costAmount
=
Number
(
productpricetmp
[
'costs.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
...
...
center-manage/app/base/service/impl/common/channelhandlers/tx.js
View file @
7a6c9f6f
...
@@ -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