Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
9ad267bc
Commit
9ad267bc
authored
Jan 10, 2024
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理系统首页统计
parent
24e39ea8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
211 additions
and
1 deletions
+211
-1
HomeController.java
...main/java/share/web/controller/system/HomeController.java
+33
-0
DeviceParamVo.java
...m/src/main/java/share/system/domain/vo/DeviceParamVo.java
+0
-1
HomeStatistics.java
.../src/main/java/share/system/domain/vo/HomeStatistics.java
+84
-0
StatisticsMapper.java
...m/src/main/java/share/system/mapper/StatisticsMapper.java
+17
-0
StatisticsService.java
...src/main/java/share/system/service/StatisticsService.java
+16
-0
StatisticsServiceImpl.java
...java/share/system/service/impl/StatisticsServiceImpl.java
+27
-0
StatisticsMapper.xml
...tem/src/main/resources/mapper/system/StatisticsMapper.xml
+34
-0
No files found.
share-admin/src/main/java/share/web/controller/system/HomeController.java
0 → 100644
View file @
9ad267bc
package
share
.
web
.
controller
.
system
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.system.service.StatisticsService
;
/**
* @className: share.web.controller.system.HomeController
* @description: 首页
* @author: lwj
* @create: 2024-01-09 15:13
*/
@Api
(
tags
=
"首页"
)
@RestController
@RequestMapping
(
"/system/home"
)
public
class
HomeController
extends
BaseController
{
@Autowired
private
StatisticsService
statisticsService
;
@ApiOperation
(
value
=
"首页数据统计"
)
@GetMapping
(
value
=
"/statistics"
)
public
AjaxResult
statistics
()
{
return
success
(
statisticsService
.
homeStatistics
());
}
}
share-system/src/main/java/share/system/domain/vo/DeviceParamVo.java
View file @
9ad267bc
...
...
@@ -10,7 +10,6 @@ import share.common.core.domain.BaseEntity;
* @create: 2023-11-07 16:10
*/
@Data
public
class
DeviceParamVo
extends
BaseEntity
{
/** 设备mac */
...
...
share-system/src/main/java/share/system/domain/vo/HomeStatistics.java
0 → 100644
View file @
9ad267bc
package
share
.
system
.
domain
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* @className: share.system.domain.vo.HomeStatistics
* @description: 首页统计
* @author: lwj
* @create: 2024-01-10 10:00
*/
@Data
public
class
HomeStatistics
implements
Serializable
{
@ApiModelProperty
(
value
=
"门店id"
)
private
Long
storeId
;
@ApiModelProperty
(
value
=
"门店名称"
)
private
String
storeName
;
@ApiModelProperty
(
value
=
"订单总数"
)
private
Integer
orderNum
;
@ApiModelProperty
(
value
=
"待使用/使用中订单数"
)
private
Integer
orderNumWait
;
@ApiModelProperty
(
value
=
"已完成订单数"
)
private
Integer
orderNumFinish
;
@ApiModelProperty
(
value
=
"退款订单数"
)
private
Integer
orderNumRefund
;
@ApiModelProperty
(
value
=
"套餐金额-全部订单"
)
private
BigDecimal
packPrice
;
@ApiModelProperty
(
value
=
"套餐金额-待使用/使用中"
)
private
BigDecimal
packPriceWait
;
@ApiModelProperty
(
value
=
"套餐金额-已完成订单"
)
private
BigDecimal
packPriceFinish
;
@ApiModelProperty
(
value
=
"套餐金额-退款订单"
)
private
BigDecimal
packPriceRefund
;
@ApiModelProperty
(
name
=
"优惠券金额-全部订单"
)
private
BigDecimal
couponPrice
;
@ApiModelProperty
(
value
=
"优惠券金额-待使用/使用中"
)
private
BigDecimal
couponPriceWait
;
@ApiModelProperty
(
value
=
"优惠券金额-已完成订单"
)
private
BigDecimal
couponPriceFinish
;
@ApiModelProperty
(
value
=
"优惠券金额-退款订单"
)
private
BigDecimal
couponPriceRefund
;
@ApiModelProperty
(
name
=
"订单总价-全部订单"
)
private
BigDecimal
totalPrice
;
@ApiModelProperty
(
value
=
"订单总价-待使用/使用中"
)
private
BigDecimal
totalPriceWait
;
@ApiModelProperty
(
value
=
"订单总价-已完成订单"
)
private
BigDecimal
totalPriceFinish
;
@ApiModelProperty
(
value
=
"订单总价-退款订单"
)
private
BigDecimal
totalPriceRefund
;
@ApiModelProperty
(
name
=
"实际支付金额-全部订单"
)
private
BigDecimal
payPrice
;
@ApiModelProperty
(
value
=
"实际支付金额-待使用/使用中"
)
private
BigDecimal
payPriceWait
;
@ApiModelProperty
(
value
=
"实际支付金额-已完成订单"
)
private
BigDecimal
payPriceFinish
;
@ApiModelProperty
(
value
=
"实际支付金额-退款订单"
)
private
BigDecimal
payPriceRefund
;
}
share-system/src/main/java/share/system/mapper/StatisticsMapper.java
0 → 100644
View file @
9ad267bc
package
share
.
system
.
mapper
;
import
share.system.domain.vo.HomeStatistics
;
import
java.util.List
;
/**
* @className: share.system.mapper.StatisticsMapper
* @description: 数据统计
* @author: lwj
* @create: 2024-01-10 10:37
*/
public
interface
StatisticsMapper
{
List
<
HomeStatistics
>
homeStatistics
();
}
share-system/src/main/java/share/system/service/StatisticsService.java
0 → 100644
View file @
9ad267bc
package
share
.
system
.
service
;
import
share.system.domain.vo.HomeStatistics
;
import
java.util.List
;
/**
* @className: share.system.service.StatisticsService
* @description: 报表统计
* @author: lwj
* @create: 2024-01-10 10:32
*/
public
interface
StatisticsService
{
List
<
HomeStatistics
>
homeStatistics
();
}
share-system/src/main/java/share/system/service/impl/StatisticsServiceImpl.java
0 → 100644
View file @
9ad267bc
package
share
.
system
.
service
.
impl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.system.domain.vo.HomeStatistics
;
import
share.system.mapper.StatisticsMapper
;
import
share.system.service.StatisticsService
;
import
java.util.List
;
/**
* @className: share.system.service.impl.StatisticsServiceImpl
* @description: 报表统计
* @author: lwj
* @create: 2024-01-10 10:33
*/
@Service
public
class
StatisticsServiceImpl
implements
StatisticsService
{
@Autowired
private
StatisticsMapper
statisticsMapper
;
@Override
public
List
<
HomeStatistics
>
homeStatistics
()
{
return
statisticsMapper
.
homeStatistics
();
}
}
share-system/src/main/resources/mapper/system/StatisticsMapper.xml
0 → 100644
View file @
9ad267bc
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"share.system.mapper.StatisticsMapper"
>
<select
id=
"homeStatistics"
resultType=
"share.system.domain.vo.HomeStatistics"
>
select so.store_id as storeId, ss.name as storeName,
count(0) as orderNum,
sum(case when so.status in (0,1) then 1 else 0 end) as orderNumWait,
sum(case when so.status in (2) then 1 else 0 end) as orderNumFinish,
sum(case when so.status in (3) then 1 else 0 end) as orderNumRefund,
sum(so.pay_price) as payPrice,
sum(case when so.status in (0,1) then so.pay_price else 0 end) as payPriceWait,
sum(case when so.status in (2) then so.pay_price else 0 end) as payPriceFinish,
sum(case when so.status in (3) then so.pay_price else 0 end) as payPriceRefund,
sum(so.pack_price) as packPrice,
sum(case when so.status in (0,1) then so.pack_price else 0 end) as packPriceWait,
sum(case when so.status in (2) then so.pack_price else 0 end) as packPriceFinish,
sum(case when so.status in (3) then so.pack_price else 0 end) as packPriceRefund,
sum(so.coupon_price) as couponPrice,
sum(case when so.status in (0,1) then so.coupon_price else 0 end) as couponPriceWait,
sum(case when so.status in (2) then so.coupon_price else 0 end) as couponPriceFinish,
sum(case when so.status in (3) then so.coupon_price else 0 end) as couponPriceRefund,
sum(so.total_price) as totalPrice,
sum(case when so.status in (0,1) then so.total_price else 0 end) as totalPriceWait,
sum(case when so.status in (2) then so.total_price else 0 end) as totalPriceFinish,
sum(case when so.status in (3) then so.total_price else 0 end) as totalPriceRefund
from s_order so inner join s_store ss on so.store_id = ss.id
where pay_status in (1) group by so.store_id, ss.name
</select>
</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