Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
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
AutogeneralShanghai
yd-backend
Commits
9d8faaf1
Commit
9d8faaf1
authored
Jul 21, 2020
by
Water Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dashboard sales all
parent
10b70a35
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
3 deletions
+42
-3
yd-api/src/main/java/com/yd/api/agms/AgmsController.java
+1
-0
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsDashboardServiceImpl.java
+40
-2
yd-api/src/main/java/com/yd/api/agms/vo/dashboard/StatisticsSalesRequestVO.java
+1
-1
No files found.
yd-api/src/main/java/com/yd/api/agms/AgmsController.java
View file @
9d8faaf1
...
@@ -106,4 +106,5 @@ public class AgmsController {
...
@@ -106,4 +106,5 @@ public class AgmsController {
result
.
setData
(
responseVO
);
result
.
setData
(
responseVO
);
return
result
;
return
result
;
}
}
}
}
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsDashboardServiceImpl.java
View file @
9d8faaf1
...
@@ -14,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -14,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
@Service
(
"agmsDashboardService"
)
@Service
(
"agmsDashboardService"
)
...
@@ -93,20 +95,56 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
...
@@ -93,20 +95,56 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
String
category
=
requestVO
.
getCategory
();
String
category
=
requestVO
.
getCategory
();
String
time
=
requestVO
.
getTime
();
String
time
=
requestVO
.
getTime
();
String
type
=
requestVO
.
getType
();
String
type
=
requestVO
.
getType
();
category
=
Strings
.
isNullOrEmpty
(
category
)
?
"
PC
"
:
category
;
category
=
Strings
.
isNullOrEmpty
(
category
)
?
"
all
"
:
category
;
time
=
Strings
.
isNullOrEmpty
(
time
)
?
"m"
:
time
;
time
=
Strings
.
isNullOrEmpty
(
time
)
?
"m"
:
time
;
type
=
Strings
.
isNullOrEmpty
(
type
)
?
"b"
:
type
;
type
=
Strings
.
isNullOrEmpty
(
type
)
?
"b"
:
type
;
List
<
StatisticsSalesInfo
>
statisticsSalesInfos
;
List
<
StatisticsSalesInfo
>
statisticsSalesInfos
;
if
(
"life"
.
equals
(
category
)){
//寿险
if
(
"life"
.
equals
(
category
)){
//寿险
statisticsSalesInfos
=
agmsDashboardDALService
.
statisticsSalesEG
(
type
,
time
);
statisticsSalesInfos
=
agmsDashboardDALService
.
statisticsSalesEG
(
type
,
time
);
}
else
{
//产险
}
else
if
(
"pc"
.
equals
(
category
))
{
//产险
statisticsSalesInfos
=
agmsDashboardDALService
.
statisticsSalesYD
(
type
,
time
);
statisticsSalesInfos
=
agmsDashboardDALService
.
statisticsSalesYD
(
type
,
time
);
}
else
{
statisticsSalesInfos
=
getAll
(
type
,
time
);
}
}
responseVO
.
setStatisticsSalesInfos
(
statisticsSalesInfos
);
responseVO
.
setStatisticsSalesInfos
(
statisticsSalesInfos
);
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
return
responseVO
;
return
responseVO
;
}
}
/**
* dashBoard -- 寿险+产险销售统计
* @param type 类型
* @param time 时间
* @return 数据
*/
private
List
<
StatisticsSalesInfo
>
getAll
(
String
type
,
String
time
)
{
StatisticsSalesInfo
statisticsSalesInfo
=
new
StatisticsSalesInfo
();
List
<
StatisticsSalesInfo
>
statisticsSalesInfos
=
new
ArrayList
<>();
String
unitPremium
=
"0"
;
double
fyp
=
0
D
,
fyc
=
0
D
;
Integer
pieces
=
0
;
List
<
StatisticsSalesInfo
>
statisticsSalesInfosLife
=
agmsDashboardDALService
.
statisticsSalesEG
(
type
,
time
);
List
<
StatisticsSalesInfo
>
statisticsSalesInfosPC
=
agmsDashboardDALService
.
statisticsSalesYD
(
type
,
time
);
statisticsSalesInfosLife
.
addAll
(
statisticsSalesInfosPC
);
if
(
statisticsSalesInfosLife
.
size
()
>
0
){
for
(
StatisticsSalesInfo
item
:
statisticsSalesInfosLife
){
fyp
+=
Double
.
parseDouble
(
item
.
getFyp
());
fyc
+=
Double
.
parseDouble
(
item
.
getFyc
());
pieces
+=
item
.
getPieces
();
}
if
(
pieces
!=
0
){
unitPremium
=
BigDecimal
.
valueOf
(
fyp
/
pieces
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
toString
();
}
}
statisticsSalesInfo
.
setFyc
(
new
DecimalFormat
(
"0.00"
).
format
(
fyc
));
statisticsSalesInfo
.
setFyp
(
new
DecimalFormat
(
"0.00"
).
format
(
fyp
));
statisticsSalesInfo
.
setPieces
(
pieces
);
statisticsSalesInfo
.
setUnitPremium
(
unitPremium
);
statisticsSalesInfo
.
setTypeName
(
"寿险+财险"
);
statisticsSalesInfos
.
add
(
statisticsSalesInfo
);
return
statisticsSalesInfos
;
}
@Override
@Override
public
StatisticsPractitionerResponseVO
statisticsPractitioner
(
StatisticsPractitionerRequestVO
requestVO
)
{
public
StatisticsPractitionerResponseVO
statisticsPractitioner
(
StatisticsPractitionerRequestVO
requestVO
)
{
StatisticsPractitionerResponseVO
responseVO
=
new
StatisticsPractitionerResponseVO
();
StatisticsPractitionerResponseVO
responseVO
=
new
StatisticsPractitionerResponseVO
();
...
...
yd-api/src/main/java/com/yd/api/agms/vo/dashboard/StatisticsSalesRequestVO.java
View file @
9d8faaf1
...
@@ -3,7 +3,7 @@ package com.yd.api.agms.vo.dashboard;
...
@@ -3,7 +3,7 @@ package com.yd.api.agms.vo.dashboard;
public
class
StatisticsSalesRequestVO
{
public
class
StatisticsSalesRequestVO
{
private
String
type
;
// d:整体,t:团体
private
String
type
;
// d:整体,t:团体
private
String
time
;
//d:天,w:周,m:月,q:季,y:年
private
String
time
;
//d:天,w:周,m:月,q:季,y:年
private
String
category
;
//life:寿险,pc:财险
private
String
category
;
//life:寿险,pc:财险
,all:全部
public
String
getType
()
{
public
String
getType
()
{
return
type
;
return
type
;
...
...
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