Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
a0de74b0
Commit
a0de74b0
authored
Nov 29, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'order_received_statistics' into dev
parents
aee93870
2ac7e565
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
9 deletions
+51
-9
CompanyPerformanceFindDTO.java
...fc/platform/order/pojo/dto/CompanyPerformanceFindDTO.java
+11
-0
CompanyPerformanceBiz.java
...va/com/xxfc/platform/order/biz/CompanyPerformanceBiz.java
+13
-0
OrderReceivedStatisticsBiz.java
...m/xxfc/platform/order/biz/OrderReceivedStatisticsBiz.java
+18
-6
OrderReceivedStatisticsMapper.xml
...c/main/resources/mapper/OrderReceivedStatisticsMapper.xml
+9
-3
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/dto/CompanyPerformanceFindDTO.java
View file @
a0de74b0
...
@@ -32,4 +32,15 @@ public class CompanyPerformanceFindDTO extends PageParam {
...
@@ -32,4 +32,15 @@ public class CompanyPerformanceFindDTO extends PageParam {
private
String
companyName
;
private
String
companyName
;
private
Integer
companyId
;
private
Integer
companyId
;
private
long
startIndex
;
private
long
endInex
;
public
long
getStartIndex
()
{
return
getPage
()==
null
?
0
:
getPage
()==
0
?
0
:(
getPage
()-
1
)*
getLimit
();
}
public
long
getEndInex
()
{
return
getLimit
()==
null
?
20
:
getLimit
()==
0
?
20
:(
getStartIndex
()+
getLimit
());
}
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/CompanyPerformanceBiz.java
View file @
a0de74b0
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.order.bo.CompanyPerformanceBo
;
import
com.xxfc.platform.order.bo.CompanyPerformanceBo
;
import
com.xxfc.platform.order.contant.enumerate.ReceivedStatisticsEnum
;
import
com.xxfc.platform.order.contant.enumerate.ReceivedStatisticsEnum
;
import
com.xxfc.platform.order.entity.OrderReceivedStatistics
;
import
com.xxfc.platform.order.pojo.dto.CompanyPerformanceFindDTO
;
import
com.xxfc.platform.order.pojo.dto.CompanyPerformanceFindDTO
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
...
@@ -204,6 +205,18 @@ public class CompanyPerformanceBiz {
...
@@ -204,6 +205,18 @@ public class CompanyPerformanceBiz {
}
}
List
<
CompanyPerformanceBo
>
companyPerformanceBos
=
wrapCompanyPermanceBo
(
data
,
companyMap
,
companyPerformanceFindDTO
.
getStatisticalWay
());
List
<
CompanyPerformanceBo
>
companyPerformanceBos
=
wrapCompanyPermanceBo
(
data
,
companyMap
,
companyPerformanceFindDTO
.
getStatisticalWay
());
pageDataVO
.
setData
(
companyPerformanceBos
);
pageDataVO
.
setData
(
companyPerformanceBos
);
if
(
companyPerformanceFindDTO
.
getPage
()
==
1
)
{
OrderReceivedStatistics
orderReceivedStatistics
=
new
OrderReceivedStatistics
();
if
(
Objects
.
nonNull
(
companyPerformanceFindDTO
.
getCompanyId
()))
{
orderReceivedStatistics
.
setCompanyId
(
companyPerformanceFindDTO
.
getCompanyId
());
}
Long
totlCount
=
orderReceivedStatisticsBiz
.
selectCount
(
orderReceivedStatistics
);
long
isZero
=
totlCount
%
companyPerformanceFindDTO
.
getLimit
();
long
totalPage
=
isZero
==
0
?
totlCount
/
companyPerformanceFindDTO
.
getLimit
()
:
totlCount
/
companyPerformanceFindDTO
.
getLimit
()
+
1
;
pageDataVO
.
setTotalCount
(
totlCount
);
pageDataVO
.
setTotalPage
(
Integer
.
valueOf
(
String
.
valueOf
(
totalPage
)));
}
return
pageDataVO
;
return
pageDataVO
;
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderReceivedStatisticsBiz.java
View file @
a0de74b0
...
@@ -60,8 +60,12 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
...
@@ -60,8 +60,12 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
* @return
* @return
*/
*/
public
PageDataVO
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithDayPage
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
public
PageDataVO
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithDayPage
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
return
PageDataVO
.
pageInfo
(
companyPerformanceFindDTO
.
getPage
(),
companyPerformanceFindDTO
.
getLimit
(),
List
<
CompanyPerformanceBo
>
companyPerformanceBos
=
mapper
.
selectCompanyPerformanceWithDay
(
companyPerformanceFindDTO
);
()
->
mapper
.
selectCompanyPerformanceWithDay
(
companyPerformanceFindDTO
));
PageDataVO
<
CompanyPerformanceBo
>
pageDataVO
=
new
PageDataVO
<>();
pageDataVO
.
setData
(
companyPerformanceBos
);
return
pageDataVO
;
/* return PageDataVO.pageInfo(companyPerformanceFindDTO.getPage(), companyPerformanceFindDTO.getLimit(),
() -> mapper.selectCompanyPerformanceWithDay(companyPerformanceFindDTO));*/
}
}
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithDay
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithDay
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
...
@@ -76,8 +80,12 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
...
@@ -76,8 +80,12 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
* @return
* @return
*/
*/
public
PageDataVO
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithMonthPage
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
public
PageDataVO
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithMonthPage
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
return
PageDataVO
.
pageInfo
(
companyPerformanceFindDTO
.
getPage
(),
companyPerformanceFindDTO
.
getLimit
(),
/* return PageDataVO.pageInfo(companyPerformanceFindDTO.getPage(), companyPerformanceFindDTO.getLimit(),
()
->
mapper
.
selectCompanyPerformanceWithMonth
(
companyPerformanceFindDTO
));
() -> mapper.selectCompanyPerformanceWithMonth(companyPerformanceFindDTO));*/
List
<
CompanyPerformanceBo
>
companyPerformanceBos
=
mapper
.
selectCompanyPerformanceWithMonth
(
companyPerformanceFindDTO
);
PageDataVO
<
CompanyPerformanceBo
>
pageDataVO
=
new
PageDataVO
<>();
pageDataVO
.
setData
(
companyPerformanceBos
);
return
pageDataVO
;
}
}
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithMonth
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithMonth
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
...
@@ -91,8 +99,12 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
...
@@ -91,8 +99,12 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
* @return
* @return
*/
*/
public
PageDataVO
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithWeekPage
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
public
PageDataVO
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithWeekPage
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
return
PageDataVO
.
pageInfo
(
companyPerformanceFindDTO
.
getPage
(),
companyPerformanceFindDTO
.
getLimit
(),
/*return PageDataVO.pageInfo(companyPerformanceFindDTO.getPage(), companyPerformanceFindDTO.getLimit(),
()
->
mapper
.
selectCompanyPerformanceWithWeek
(
companyPerformanceFindDTO
));
() -> mapper.selectCompanyPerformanceWithWeek(companyPerformanceFindDTO));*/
List
<
CompanyPerformanceBo
>
companyPerformanceBos
=
mapper
.
selectCompanyPerformanceWithWeek
(
companyPerformanceFindDTO
);
PageDataVO
<
CompanyPerformanceBo
>
pageDataVO
=
new
PageDataVO
<>();
pageDataVO
.
setData
(
companyPerformanceBos
);
return
pageDataVO
;
}
}
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithWeek
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithWeek
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
...
...
xx-order/xx-order-server/src/main/resources/mapper/OrderReceivedStatisticsMapper.xml
View file @
a0de74b0
...
@@ -103,6 +103,7 @@
...
@@ -103,6 +103,7 @@
`company_id` ,
`company_id` ,
`year`,
`year`,
`date`
`date`
limit #{startIndex},#{endInex}
) AS `ors`
) AS `ors`
LEFT JOIN (
LEFT JOIN (
SELECT
SELECT
...
@@ -134,9 +135,10 @@
...
@@ -134,9 +135,10 @@
`company_id`,
`company_id`,
`count_year`,
`count_year`,
`count_date`
`count_date`
limit #{startIndex},#{endInex}
) AS `ovss` ON ovss.cyid = ors.companyId
) AS `ovss` ON ovss.cyid = ors.companyId
AND ovss.count_date = ors.date
AND ovss.count_date = ors.date
order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc
<!-- order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc-->
</select>
</select>
<!--按月统计-->
<!--按月统计-->
...
@@ -185,6 +187,7 @@
...
@@ -185,6 +187,7 @@
company_id,
company_id,
`year`,
`year`,
`month`
`month`
limit #{startIndex},#{endInex}
) AS `ors`
) AS `ors`
LEFT JOIN (
LEFT JOIN (
SELECT
SELECT
...
@@ -216,9 +219,10 @@
...
@@ -216,9 +219,10 @@
`company_id`,
`company_id`,
`count_year`,
`count_year`,
`count_month`
`count_month`
limit #{startIndex},#{endInex}
) AS `ovss` ON ovss.cyid = ors.companyId
) AS `ovss` ON ovss.cyid = ors.companyId
AND ovss.count_month = ors.month
AND ovss.count_month = ors.month
order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc
<!--order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc-->
</select>
</select>
<!--按周统计-->
<!--按周统计-->
...
@@ -266,6 +270,7 @@
...
@@ -266,6 +270,7 @@
company_id,
company_id,
`year`,
`year`,
`week_of_year`
`week_of_year`
limit #{startIndex},#{endInex}
) AS `ors`
) AS `ors`
LEFT JOIN (
LEFT JOIN (
SELECT
SELECT
...
@@ -298,9 +303,10 @@
...
@@ -298,9 +303,10 @@
`company_id`,
`company_id`,
`count_year`,
`count_year`,
`count_week`
`count_week`
limit #{startIndex},#{endInex}
) AS `ovss` ON ovss.cyid = ors.companyId
) AS `ovss` ON ovss.cyid = ors.companyId
AND ovss.count_week = ors.weekOfYear
AND ovss.count_week = ors.weekOfYear
order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc
<!-- order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc-->
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
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