Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
peizhen-java
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
PeiZhen-Java
peizhen-java
Commits
c78b8d8a
Commit
c78b8d8a
authored
Oct 09, 2023
by
邹磊浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
633e6dcd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
39 deletions
+103
-39
pz-admin/src/main/java/com/pz/web/controller/system/DataViewController.java
+23
-0
pz-system/src/main/java/com/pz/system/domain/vo/OrderColumnarVo.java
+19
-0
pz-system/src/main/java/com/pz/system/mapper/TotalOrderMapper.java
+8
-0
pz-system/src/main/resources/mapper/system/TotalOrderMapper.xml
+53
-39
No files found.
pz-admin/src/main/java/com/pz/web/controller/system/DataViewController.java
View file @
c78b8d8a
package
com
.
pz
.
web
.
controller
.
system
;
import
cn.dev33.satoken.annotation.SaCheckPermission
;
import
com.pz.common.core.controller.BaseController
;
import
com.pz.common.core.domain.PageQuery
;
import
com.pz.common.core.domain.R
;
import
com.pz.common.core.page.TableDataInfo
;
import
com.pz.system.domain.bo.DbghOrderBo
;
import
com.pz.system.domain.vo.DbghOrderVo
;
import
com.pz.system.domain.vo.OrderColumnarVo
;
import
com.pz.system.mapper.TotalOrderMapper
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.validation.constraints.NotEmpty
;
import
java.util.List
;
/**
* 数据总览
*
...
...
@@ -17,4 +30,14 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping
(
"/system/data"
)
public
class
DataViewController
extends
BaseController
{
private
final
TotalOrderMapper
totalOrderMapper
;
/**
* 数据总览柱状图
*/
@GetMapping
(
"/findOrderColumnarVoList/{type}"
)
public
R
<
List
<
OrderColumnarVo
>>
findOrderColumnarVoList
(
@PathVariable
Integer
type
)
{
return
R
.
ok
(
totalOrderMapper
.
findOrderColumnarVoList
(
type
));
}
}
pz-system/src/main/java/com/pz/system/domain/vo/OrderColumnarVo.java
0 → 100644
View file @
c78b8d8a
package
com
.
pz
.
system
.
domain
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
OrderColumnarVo
implements
Serializable
{
/**
* 业务名称
*/
private
String
name
;
/**
* 数量
*/
private
Long
num
;
}
pz-system/src/main/java/com/pz/system/mapper/TotalOrderMapper.java
View file @
c78b8d8a
...
...
@@ -9,6 +9,7 @@ import com.pz.system.domain.OrderMessage;
import
com.pz.system.domain.TotalOrder
;
import
com.pz.system.domain.vo.AccompanyDemandVo
;
import
com.pz.system.domain.vo.AppOrderVo
;
import
com.pz.system.domain.vo.OrderColumnarVo
;
import
com.pz.system.domain.vo.TotalOrderVo
;
import
com.pz.common.core.mapper.BaseMapperPlus
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
@@ -60,4 +61,11 @@ public interface TotalOrderMapper extends BaseMapperPlus<TotalOrderMapper, Total
* @return 主订单数据转订单消息
*/
OrderMessage
selectDataToMessageById
(
Long
id
);
/**
* 数据总览
* @param type
* @return
*/
List
<
OrderColumnarVo
>
findOrderColumnarVoList
(
@Param
(
"type"
)
Integer
type
);
}
pz-system/src/main/resources/mapper/system/TotalOrderMapper.xml
View file @
c78b8d8a
...
...
@@ -5,17 +5,17 @@
<mapper
namespace=
"com.pz.system.mapper.TotalOrderMapper"
>
<sql
id=
"OrderCommon"
>
select total_order.id as orderId,
services.name as project,
business.name as businessName,
CONVERT((1 - services.fenmo / 100), decimal(10, 2)) *
CONVERT(services.price, decimal(10, 2)) as commission,
select total_order.id
as orderId,
services.name
as project,
business.name
as businessName,
CONVERT((1 - services.fenmo / 100), decimal
(10, 2)) *
CONVERT(services.price, decimal
(10, 2)) as commission,
total_order.business_id,
total_order.remark as description,
total_order.remark
as description,
total_order.evaluation_content,
total_order.is_satisfaction as evaluation_flag,
total_order.uid as uid,
total_order.status as orderStatus
total_order.is_satisfaction
as evaluation_flag,
total_order.uid
as uid,
total_order.status
as orderStatus
from total_order
left join services on total_order.service_id = services.id
left join business on total_order.business_id = business.id
...
...
@@ -39,36 +39,35 @@
</select>
<select
id=
"selectByOrderId"
resultType=
"com.pz.system.domain.vo.TotalOrderVo"
>
select
t.id,
t.order_sn,
t.uid,
t.em_id,
t.city_id,
t.business_id,
t.service_id,
t.pay_money,
t.status,
t.lng,
t.lat,
t.is_satisfaction,
t.evaluation_content,
t.refund_reason,
t.refund_amount,
t.pay_cs,
t.del_flag,
t.create_by,
t.create_time,
t.update_by,
t.update_time,
t.remark,
e.name as emName,
b.name as business,
s.name as service
select t.id,
t.order_sn,
t.uid,
t.em_id,
t.city_id,
t.business_id,
t.service_id,
t.pay_money,
t.status,
t.lng,
t.lat,
t.is_satisfaction,
t.evaluation_content,
t.refund_reason,
t.refund_amount,
t.pay_cs,
t.del_flag,
t.create_by,
t.create_time,
t.update_by,
t.update_time,
t.remark,
e.name as emName,
b.name as business,
s.name as service
from total_order t
left join business b on b.id = t.business_id
left join services s on s.id = t.service_id
left join employees e on e.id = t.em_id
left join business b on b.id = t.business_id
left join services s on s.id = t.service_id
left join employees e on e.id = t.em_id
where t.id = #{id}
</select>
...
...
@@ -84,5 +83,20 @@
left join sys_user on sys_user.user_id = total_order.uid
where total_order.id = #{id}
</select>
<select
id=
"findOrderColumnarVoList"
resultType=
"com.pz.system.domain.vo.OrderColumnarVo"
>
SELECT b.`name` name, COUNT(t.business_id) AS num
FROM business b
LEFT JOIN total_order t ON t.business_id = b.id
AND t.`status` = 2
<if
test=
"type == 1"
>
AND DATE(t.create_time) = CURDATE()
</if>
<if
test=
"type == 2"
>
AND DATE(t.create_time) BETWEEN DATE_SUB(CURDATE(), INTERVAL 6 DAY) AND CURDATE()
</if>
<if
test=
"type == 3"
>
AND DATE(t.create_time) BETWEEN DATE_SUB(CURDATE(), INTERVAL 29 DAY) AND CURDATE()
</if>
GROUP BY b.id;
</select>
</mapper>
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