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
29f57380
Commit
29f57380
authored
Aug 21, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加 跟进统计
parent
efece65b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
ic-deliver/app/base/service/impl/bizchance/bizoptSve.js
+6
-2
No files found.
ic-deliver/app/base/service/impl/bizchance/bizoptSve.js
View file @
29f57380
...
@@ -44,8 +44,10 @@ class BizOptService extends ServiceBase {
...
@@ -44,8 +44,10 @@ class BizOptService extends ServiceBase {
let
handlingCount
=
0
let
handlingCount
=
0
let
finishedCount
=
0
let
finishedCount
=
0
let
closedCount
=
0
let
closedCount
=
0
let
followingUpCount
=
0
;
if
(
companyId
==
1
)
{
if
(
companyId
==
1
)
{
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeSubmission'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeSubmission'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
followingUpCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'followingUp'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeConfirmation'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeConfirmation'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isFinished'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isFinished'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isClosed'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isClosed'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
...
@@ -54,11 +56,13 @@ class BizOptService extends ServiceBase {
...
@@ -54,11 +56,13 @@ class BizOptService extends ServiceBase {
if
(
opath
)
{
if
(
opath
)
{
opathstr
=
opath
opathstr
=
opath
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeSubmission'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeSubmission'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
followingUpCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'followingUp'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeConfirmation'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeConfirmation'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isFinished'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isFinished'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isClosed'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isClosed'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
}
else
{
}
else
{
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeSubmission'
,
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeSubmission'
,
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
followingUpCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'followingUp'
,
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeConfirmation'
,
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeConfirmation'
,
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isFinished'
,
'facilitator_id'
:
companyId
},
[
this
.
db
.
Op
.
and
]:
andWhere
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isFinished'
,
'facilitator_id'
:
companyId
},
[
this
.
db
.
Op
.
and
]:
andWhere
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isClosed'
,
'facilitator_id'
:
companyId
},
[
this
.
db
.
Op
.
and
]:
andWhere
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isClosed'
,
'facilitator_id'
:
companyId
},
[
this
.
db
.
Op
.
and
]:
andWhere
})
...
@@ -69,7 +73,7 @@ class BizOptService extends ServiceBase {
...
@@ -69,7 +73,7 @@ class BizOptService extends ServiceBase {
let
allChance
=
waittoHandledCount
+
handlingCount
+
finishedCount
+
closedCount
let
allChance
=
waittoHandledCount
+
handlingCount
+
finishedCount
+
closedCount
let
successRadio
=
Math
.
ceil
((
finishedCount
/
allChance
)
*
100
)
let
successRadio
=
Math
.
ceil
((
finishedCount
/
allChance
)
*
100
)
//如果当前登录人不是平台,那么需要按照opath查询
//如果当前登录人不是平台,那么需要按照opath查询
return
{
waittoHandledCount
:
waittoHandledCount
,
handlingCount
:
handlingCount
,
finishedCount
:
finishedCount
,
closedCount
:
closedCount
,
successRadio
:
successRadio
}
return
{
waittoHandledCount
:
waittoHandledCount
,
followingUpCount
,
handlingCount
:
handlingCount
,
finishedCount
:
finishedCount
,
closedCount
:
closedCount
,
successRadio
:
successRadio
}
}
}
async
findAndCountAll
(
obj
)
{
async
findAndCountAll
(
obj
)
{
var
self
=
this
;
var
self
=
this
;
...
@@ -91,7 +95,7 @@ class BizOptService extends ServiceBase {
...
@@ -91,7 +95,7 @@ class BizOptService extends ServiceBase {
}
}
/*更新业务员信息*/
/*更新业务员信息*/
async
updateSalesmanInfoByDemandCode
(
qobj
){
async
updateSalesmanInfoByDemandCode
(
qobj
)
{
var
self
=
this
;
var
self
=
this
;
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
updateSalesmanInfoByDemandCode
(
qobj
,
t
);
return
await
self
.
dao
.
updateSalesmanInfoByDemandCode
(
qobj
,
t
);
...
...
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