Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
469defd3
提交
469defd3
authored
7月 17, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成首页注册量、订单量、支付笔数统计
上级
c2594372
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
201 行增加
和
16 行删除
+201
-16
TbCfOrderController.java
...ain/java/com/platform/controller/TbCfOrderController.java
+15
-0
TbCfOrderDao.java
...rm-admin/src/main/java/com/platform/dao/TbCfOrderDao.java
+6
-0
TbCfOrderListService.java
.../main/java/com/platform/service/TbCfOrderListService.java
+8
-0
TbCfOrderListServiceImpl.java
...a/com/platform/service/impl/TbCfOrderListServiceImpl.java
+13
-0
TbCfOrderDao.xml
...dmin/src/main/resources/com/platform/dao/TbCfOrderDao.xml
+36
-0
main.js
platform-admin/src/main/webapp/js/sys/main.js
+123
-16
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TbCfOrderController.java
浏览文件 @
469defd3
...
...
@@ -13,6 +13,7 @@ import com.platform.utils.R;
import
com.platform.vo.OrderBasicVo
;
import
com.platform.vo.PlatformOrderVo
;
import
com.platform.vo.DeliveryOrderVo
;
import
com.platform.vo.StatisticalVo
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -288,7 +289,21 @@ public class TbCfOrderController extends AbstractController {
return
R
.
ok
().
put
(
"result"
,
res
);
}
@GetMapping
(
"/getOrderByDate"
)
@ResponseBody
public
R
getOrderByDate
(
@RequestParam
(
value
=
"start"
,
required
=
false
)
String
start
,
@RequestParam
(
value
=
"end"
,
required
=
false
)
String
end
)
{
List
<
StatisticalVo
>
orderList
=
tbCfOrderListService
.
getOrderByDate
(
start
,
end
);
return
R
.
ok
().
put
(
"list"
,
orderList
);
}
@GetMapping
(
"/getOrderPaidByDate"
)
@ResponseBody
public
R
getOrderPaidByDate
(
@RequestParam
(
value
=
"start"
,
required
=
false
)
String
start
,
@RequestParam
(
value
=
"end"
,
required
=
false
)
String
end
)
{
List
<
StatisticalVo
>
orderList
=
tbCfOrderListService
.
getOrderPaidByDate
(
start
,
end
);
return
R
.
ok
().
put
(
"list"
,
orderList
);
}
//==========================================================================================================
/**
...
...
platform-admin/src/main/java/com/platform/dao/TbCfOrderDao.java
浏览文件 @
469defd3
...
...
@@ -2,6 +2,8 @@ package com.platform.dao;
import
com.platform.entity.TbCfItemDetailEntity
;
import
com.platform.entity.TbCfOrderEntity
;
import
com.platform.vo.StatisticalVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.math.BigDecimal
;
import
java.util.List
;
...
...
@@ -83,4 +85,8 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
//根据订单付款状态查询订单数量
int
queryPayCount
(
String
payStatus
);
List
<
StatisticalVo
>
getOrderByDate
(
@Param
(
"start"
)
String
start
,
@Param
(
"end"
)
String
end
);
List
<
StatisticalVo
>
getOrderPaidByDate
(
@Param
(
"start"
)
String
start
,
@Param
(
"end"
)
String
end
);
}
platform-admin/src/main/java/com/platform/service/TbCfOrderListService.java
浏览文件 @
469defd3
...
...
@@ -4,6 +4,8 @@ import com.platform.entity.TbCfOrderEntity;
import
com.platform.entity.TbCfOrderListEntity
;
import
com.platform.vo.DeliveryOrderVo
;
import
com.platform.vo.OrderBasicVo
;
import
com.platform.vo.StatisticalVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
...
...
@@ -20,12 +22,14 @@ public interface TbCfOrderListService {
/**
* 订单列表(运营)
*
* @return
*/
List
<
TbCfOrderListEntity
>
queryOrderList
(
Map
<
String
,
Object
>
map
);
/**
* 分页统计条数
*
* @return
*/
...
...
@@ -49,4 +53,8 @@ public interface TbCfOrderListService {
List
<
TbCfOrderEntity
>
queryPayOrderList
(
@RequestParam
(
"payStatus"
)
String
payStatus
);
int
queryPayCount
(
String
payStatus
);
List
<
StatisticalVo
>
getOrderByDate
(
String
start
,
String
end
);
List
<
StatisticalVo
>
getOrderPaidByDate
(
String
start
,
String
end
);
}
platform-admin/src/main/java/com/platform/service/impl/TbCfOrderListServiceImpl.java
浏览文件 @
469defd3
...
...
@@ -7,6 +7,7 @@ import com.platform.entity.TbCfOrderListEntity;
import
com.platform.service.TbCfOrderListService
;
import
com.platform.vo.DeliveryOrderVo
;
import
com.platform.vo.OrderBasicVo
;
import
com.platform.vo.StatisticalVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -102,4 +103,16 @@ public class TbCfOrderListServiceImpl implements TbCfOrderListService {
return
tbCfOrderDao
.
queryPayCount
(
payStatus
);
}
@Override
public
List
<
StatisticalVo
>
getOrderByDate
(
String
start
,
String
end
)
{
return
tbCfOrderDao
.
getOrderByDate
(
start
,
end
);
}
@Override
public
List
<
StatisticalVo
>
getOrderPaidByDate
(
String
start
,
String
end
)
{
return
tbCfOrderDao
.
getOrderPaidByDate
(
start
,
end
);
}
}
platform-admin/src/main/resources/com/platform/dao/TbCfOrderDao.xml
浏览文件 @
469defd3
...
...
@@ -71,6 +71,42 @@
left join tb_cf_item_order_r i on i.order_id=o.order_id
WHERE 1=1 and i.enable_flag=1 and i.order_item_id = #{orderId}
</select>
<select
id=
"getOrderByDate"
resultType=
"com.platform.vo.StatisticalVo"
>
SELECT
DATE_FORMAT( order_time, '%Y-%m-%d' ) date,
count( 1 ) num
FROM
tb_cf_order
WHERE
1=1
<if
test=
"start != null and start.trim() != ''"
>
AND date_format( order_time, '%Y-%m-%d' ) >= #{start}
</if>
<if
test=
"end != null and end.trim() != ''"
>
AND date_format( order_time, '%Y-%m-%d' )
<
= #{end}
</if>
GROUP BY
date
</select>
<select
id=
"getOrderPaidByDate"
resultType=
"com.platform.vo.StatisticalVo"
>
SELECT
DATE_FORMAT( order_time, '%Y-%m-%d' ) date,
count( 1 ) num
FROM
tb_cf_order
WHERE
1=1
<if
test=
"start != null and start.trim() != ''"
>
AND date_format( order_time, '%Y-%m-%d' ) >= #{start}
</if>
<if
test=
"end != null and end.trim() != ''"
>
AND date_format( order_time, '%Y-%m-%d' )
<
= #{end}
</if>
AND pay_status=20
GROUP BY
date
</select>
<select
id=
"queryOrderDetail"
resultType=
"com.platform.entity.TbCfOrderEntity"
>
select
i.order_item_id,
...
...
platform-admin/src/main/webapp/js/sys/main.js
浏览文件 @
469defd3
...
...
@@ -253,26 +253,105 @@ let app = new Vue({
this
.
initEchartsMiddleData
[
0
].
data
=
[]
let
objList
=
JSON
.
parse
(
res
).
list
objList
.
map
(
res
=>
{
console
.
log
(
'date'
,
res
.
date
)
this
.
initEchartsMiddleData
[
0
].
data
.
push
([
res
.
date
,
res
.
num
])
})
this
.
initEchartsMiddle
();
})
},
templateMethod1
(
url
)
{
$
.
get
(
url
,
res
=>
{
this
.
initEchartsMiddleData
[
0
].
data
=
[]
res
.
list
.
map
(
res
=>
{
console
.
log
(
'date'
,
res
.
date
)
this
.
initEchartsMiddleData
[
0
].
data
.
push
([
res
.
date
,
res
.
num
])
})
this
.
initEchartsMiddle
();
})
},
getDayRegistered
()
{
let
url
=
'../tbcfuserinfo/getDayRegistered'
this
.
templateMethod
(
url
);
let
endDate
=
this
.
getEndDate
();
console
.
log
(
endDate
)
if
(
this
.
middleOption
[
0
].
isActive
)
{
let
url
=
'../tbcfuserinfo/getDayRegistered'
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
1
].
isActive
)
{
}
else
if
(
this
.
middleOption
[
2
].
isActive
)
{
let
url
=
'../tbcforder/getOrderByDate?start='
+
endDate
;
this
.
templateMethod1
(
url
);
}
else
if
(
this
.
middleOption
[
3
].
isActive
)
{
let
url
=
'../tbcforder/getOrderPaidByDate?start='
+
endDate
;
this
.
templateMethod1
(
url
);
}
},
getWeekRegistered
()
{
let
url
=
'../tbcfuserinfo/getWeekRegistered'
this
.
templateMethod
(
url
);
const
now
=
new
Date
();
let
start
=
new
Date
();
let
end
=
new
Date
();
let
n
=
now
.
getDay
();
start
.
setDate
(
now
.
getDate
()
-
n
+
1
);
end
.
setDate
(
now
.
getDate
()
-
n
+
7
);
start
=
start
.
getFullYear
()
+
"-"
+
'0'
+
(
start
.
getMonth
()
+
1
)
+
"-"
+
start
.
getDate
();
end
=
end
.
getFullYear
()
+
"-"
+
'0'
+
(
end
.
getMonth
()
+
1
)
+
"-"
+
end
.
getDate
();
console
.
log
(
'start'
,
start
)
console
.
log
(
'end'
,
end
)
if
(
this
.
middleOption
[
0
].
isActive
)
{
let
url
=
'../tbcfuserinfo/getWeekRegistered'
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
1
].
isActive
)
{
}
else
if
(
this
.
middleOption
[
2
].
isActive
)
{
let
url
=
'../tbcforder/getOrderByDate?start='
+
start
+
'&end'
+
end
;
this
.
templateMethod1
(
url
);
}
else
if
(
this
.
middleOption
[
3
].
isActive
)
{
let
url
=
'../tbcforder/getOrderPaidByDate?start='
+
start
+
'&end'
+
end
;
this
.
templateMethod1
(
url
);
}
},
getMonthRegistered
()
{
let
url
=
'../tbcfuserinfo/getMonthRegistered'
this
.
templateMethod
(
url
);
let
end
=
this
.
getEndDate
()
let
start
=
end
.
substr
(
0
,
end
.
lastIndexOf
(
"-"
))
+
'-01'
console
.
log
(
'start'
,
start
)
console
.
log
(
'end'
,
end
)
if
(
this
.
middleOption
[
0
].
isActive
)
{
let
url
=
'../tbcfuserinfo/getMonthRegistered'
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
1
].
isActive
)
{
}
else
if
(
this
.
middleOption
[
2
].
isActive
)
{
let
url
=
'../tbcforder/getOrderByDate?start='
+
start
+
'&end'
+
end
;
this
.
templateMethod1
(
url
);
}
else
if
(
this
.
middleOption
[
3
].
isActive
)
{
let
url
=
'../tbcforder/getOrderPaidByDate?start='
+
start
+
'&end'
+
end
;
this
.
templateMethod1
(
url
);
}
},
getYearRegistered
()
{
let
url
=
'../tbcfuserinfo/getYearRegistered'
this
.
templateMethod
(
url
);
let
end
=
this
.
getEndDate
();
let
start
=
end
.
substr
(
0
,
end
.
indexOf
(
'-'
))
+
'-01-01'
;
console
.
log
(
'start'
,
start
)
console
.
log
(
'end'
,
end
)
if
(
this
.
middleOption
[
0
].
isActive
)
{
let
url
=
'../tbcfuserinfo/getYearRegistered'
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
1
].
isActive
)
{
}
else
if
(
this
.
middleOption
[
2
].
isActive
)
{
let
url
=
'../tbcforder/getOrderByDate?start='
+
start
+
'&end'
+
end
;
this
.
templateMethod1
(
url
);
}
else
if
(
this
.
middleOption
[
3
].
isActive
)
{
let
url
=
'../tbcforder/getOrderPaidByDate?start='
+
start
+
'&end'
+
end
;
this
.
templateMethod1
(
url
);
}
},
getEndDate
()
{
let
date
=
new
Date
();
let
year
=
date
.
getFullYear
();
let
month
=
date
.
getMonth
()
+
1
;
let
day
=
date
.
getDate
();
let
end
=
year
+
"-"
+
'0'
+
month
+
"-"
+
day
return
end
;
},
/* 访问量 */
initEchartsPV
()
{
...
...
@@ -539,14 +618,19 @@ let app = new Vue({
this
.
middleOption
[
index
].
isActive
=
true
;
this
.
$refs
.
middleEachrtsTitle
.
innerText
=
element
.
title
+
'趋势'
;
// this.initEchartsMiddleData[0].data.push(['2019-10-1'+Math.round(Math.random()*100), Math.round(Math.random()*1000)])
$
.
get
(
'../tbcfuserinfo/getDailyRegistered'
,
res
=>
{
this
.
initEchartsMiddleData
.
data
=
[]
let
objList
=
JSON
.
parse
(
res
).
list
objList
.
map
(
res
=>
{
this
.
initEchartsMiddleData
[
0
].
data
.
push
([
res
.
date
,
res
.
num
])
})
this
.
initEchartsMiddle
();
})
console
.
log
(
index
)
if
(
index
===
0
)
{
let
url
=
'../tbcfuserinfo/getDailyRegistered'
;
this
.
templateMethod
(
url
);
}
else
if
(
index
===
1
)
{
this
.
initEchartsMiddleData
[
0
].
data
=
[]
}
else
if
(
index
===
2
)
{
let
url
=
'../tbcforder/getOrderByDate'
;
this
.
templateMethod1
(
url
);
}
else
if
(
index
===
3
)
{
let
url
=
'../tbcforder/getOrderPaidByDate'
;
this
.
templateMethod1
(
url
);
}
},
changeBottomSelect
(
element
,
index
)
{
this
.
bottomOption
.
forEach
(
item
=>
{
...
...
@@ -563,9 +647,32 @@ let app = new Vue({
},
/* 中间模块日期 */
changeDate
(
e
)
{
//注册量
if
(
this
.
middleOption
[
0
].
isActive
)
{
let
url
=
'../tbcfuserinfo/getRegisteredByDate?start='
+
e
[
0
]
+
'&end='
+
e
[
1
];
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
1
].
isActive
)
{
//访问量
}
else
if
(
this
.
middleOption
[
2
].
isActive
)
{
//订单量
let
url
=
'../tbcforder/getOrderByDate?start='
+
e
[
0
]
+
'&end='
+
e
[
1
];
$
.
get
(
url
,
res
=>
{
this
.
initEchartsMiddleData
[
0
].
data
=
[]
res
.
list
.
map
(
res
=>
{
this
.
initEchartsMiddleData
[
0
].
data
.
push
([
res
.
date
,
res
.
num
])
})
this
.
initEchartsMiddle
();
})
}
else
if
(
this
.
middleOption
[
3
].
isActive
)
{
//成交量
let
url
=
'../tbcforder/getOrderPaidByDate?start='
+
e
[
0
]
+
'&end='
+
e
[
1
];
$
.
get
(
url
,
res
=>
{
this
.
initEchartsMiddleData
[
0
].
data
=
[]
res
.
list
.
map
(
res
=>
{
this
.
initEchartsMiddleData
[
0
].
data
.
push
([
res
.
date
,
res
.
num
])
})
this
.
initEchartsMiddle
();
})
}
}
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论