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
4bd3a612
Commit
4bd3a612
authored
Oct 10, 2023
by
sdif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
机构品牌数据统计区分
parent
2eb5cf75
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
7 deletions
+46
-7
pz-admin/src/main/java/com/pz/web/controller/system/DataViewController.java
+14
-2
pz-system/src/main/java/com/pz/system/domain/bo/DataViewBo.java
+3
-0
pz-system/src/main/java/com/pz/system/mapper/TotalOrderMapper.java
+2
-0
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
+3
-0
pz-system/src/main/resources/mapper/merchant/EmployeesMapper.xml
+9
-5
pz-system/src/main/resources/mapper/system/TotalOrderMapper.xml
+15
-0
No files found.
pz-admin/src/main/java/com/pz/web/controller/system/DataViewController.java
View file @
4bd3a612
...
...
@@ -74,6 +74,10 @@ public class DataViewController extends BaseController {
*/
@GetMapping
(
"/dataEmployees"
)
public
R
<
DataViewVo
>
dataEmployees
(
DataViewBo
dataViewBo
)
{
Long
roleId
=
getLoginUser
().
getRoleId
();
if
(
null
!=
roleId
&&
roleId
==
3
){
dataViewBo
.
setUserId
(
getUserId
());
}
return
R
.
ok
(
iEmployeesService
.
dataEmployees
(
dataViewBo
));
}
...
...
@@ -102,18 +106,26 @@ public class DataViewController extends BaseController {
}
/**
* 平台收益
* 平台收益
/机构收益
*/
@GetMapping
(
"/platformRevenue"
)
public
R
<
DataOrderVo
>
platformRevenue
(
DataViewBo
dataViewBo
)
{
Long
roleId
=
getLoginUser
().
getRoleId
();
if
(
null
!=
roleId
&&
roleId
==
3
){
dataViewBo
.
setUserId
(
getUserId
());
}
return
R
.
ok
(
iTotalOrderService
.
platformRevenue
(
dataViewBo
));
}
/**
* 订单量
*
总后台订单量/机构
订单量
*/
@GetMapping
(
"/orderQuantity"
)
public
R
<
DataViewVo
>
orderQuantity
(
DataViewBo
dataViewBo
)
{
Long
roleId
=
getLoginUser
().
getRoleId
();
if
(
null
!=
roleId
&&
roleId
==
3
){
dataViewBo
.
setUserId
(
getUserId
());
}
DataOrderVo
dataOrderVo
=
iTotalOrderService
.
orderQuantity
(
dataViewBo
);
DataViewVo
dataViewVo
=
new
DataViewVo
();
dataViewVo
.
setDataSum
((
int
)
dataOrderVo
.
getDataSum
());
...
...
pz-system/src/main/java/com/pz/system/domain/bo/DataViewBo.java
View file @
4bd3a612
...
...
@@ -13,4 +13,7 @@ public class DataViewBo extends BaseEntity {
* 最近1年 3
*/
private
Integer
condition
;
private
Long
userId
;
}
pz-system/src/main/java/com/pz/system/mapper/TotalOrderMapper.java
View file @
4bd3a612
...
...
@@ -64,6 +64,8 @@ public interface TotalOrderMapper extends BaseMapperPlus<TotalOrderMapper, Total
DataOrderVo
selectPlatformRevenue
(
@Param
(
"dataViewBo"
)
DataViewBo
dataViewBo
);
DataOrderVo
selectPlatformCom
(
@Param
(
"dataViewBo"
)
DataViewBo
dataViewBo
);
DataOrderVo
selectOrderQuantity
(
@Param
(
"dataViewBo"
)
DataViewBo
dataViewBo
);
/**
...
...
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
View file @
4bd3a612
...
...
@@ -1429,6 +1429,9 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
@Override
public
DataOrderVo
platformRevenue
(
DataViewBo
dataViewBo
)
{
if
(
null
!=
dataViewBo
.
getUserId
()){
return
baseMapper
.
selectPlatformCom
(
dataViewBo
);
}
return
baseMapper
.
selectPlatformRevenue
(
dataViewBo
);
}
...
...
pz-system/src/main/resources/mapper/merchant/EmployeesMapper.xml
View file @
4bd3a612
...
...
@@ -143,17 +143,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select
id=
"selectDataView"
resultType=
"com.pz.system.domain.vo.DataViewVo"
>
SELECT count(id) as dataSum
SELECT count(
employees.
id) as dataSum
FROM employees
WHERE `status` = 1
left join company on company.id = employees.company_id
WHERE employees.`status` = 1 or employees.`status` = 2
<if
test=
"dataViewBo.userId != null"
>
and company.id = #{dataViewBo.userId}
</if>
<if
test=
"dataViewBo.condition == 2"
>
and create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) -- 近7天
and
employees.
create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) -- 近7天
</if>
<if
test=
"dataViewBo.condition == 3"
>
and create_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) -- 近30天
and
employees.
create_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) -- 近30天
</if>
<if
test=
"dataViewBo.condition == 1"
>
and DATE(create_time) = CURDATE()
and DATE(
employees.
create_time) = CURDATE()
</if>
</select>
...
...
pz-system/src/main/resources/mapper/system/TotalOrderMapper.xml
View file @
4bd3a612
...
...
@@ -141,4 +141,19 @@
AND em_id IN(emIds)
</if>
</select>
<select
id=
"selectPlatformCom"
resultType=
"com.pz.system.domain.vo.DataOrderVo"
>
SELECT IFNULL(ROUND(SUM(employees_divide.divide_price), 2),0) as dataSum FROM
employees_divide
left join total_order on total_order.order_sn = employees_divide.order_id WHERE total_order.`status` = 2 and
refund_amount = 0
<if
test=
"dataViewBo.condition == 2"
>
and employees_divide.create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) -- 近7天
</if>
<if
test=
"dataViewBo.condition == 3"
>
and employees_divide.create_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) -- 近30天
</if>
<if
test=
"dataViewBo.condition == 1"
>
and DATE(employees_divide.create_time) = CURDATE()
</if>
</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