Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
e0c3d57a
提交
e0c3d57a
authored
8月 12, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成访问量统计
上级
525c873a
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
121 行增加
和
60 行删除
+121
-60
TbCfVisitController.java
...ain/java/com/platform/controller/TbCfVisitController.java
+11
-5
TbCfVisitDao.java
...rm-admin/src/main/java/com/platform/dao/TbCfVisitDao.java
+6
-0
TbCfVisitService.java
.../src/main/java/com/platform/service/TbCfVisitService.java
+3
-0
TbCfVisitServiceImpl.java
.../java/com/platform/service/impl/TbCfVisitServiceImpl.java
+7
-0
TbCfVisitDao.xml
...dmin/src/main/resources/com/platform/dao/TbCfVisitDao.xml
+69
-44
main.html
platform-admin/src/main/webapp/WEB-INF/page/sys/main.html
+1
-1
main.js
platform-admin/src/main/webapp/js/sys/main.js
+24
-10
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TbCfVisitController.java
浏览文件 @
e0c3d57a
...
...
@@ -5,14 +5,11 @@ import com.platform.service.TbCfVisitService;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.Query
;
import
com.platform.utils.R
;
import
com.platform.vo.StatisticalVo
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -113,4 +110,13 @@ public class TbCfVisitController {
long
dayVisit
=
tbCfVisitService
.
getDayVisit
();
return
R
.
ok
().
put
(
"dayVisit"
,
dayVisit
);
}
@GetMapping
(
"/getVisitByDate"
)
@ResponseBody
public
R
getOrderByDate
(
@RequestParam
(
value
=
"start"
,
required
=
false
)
String
start
,
@RequestParam
(
value
=
"end"
,
required
=
false
)
String
end
,
@RequestParam
(
value
=
"flag"
,
required
=
false
)
String
flag
)
{
List
<
StatisticalVo
>
visitList
=
tbCfVisitService
.
getVisitByDate
(
start
,
end
,
flag
);
return
R
.
ok
().
put
(
"list"
,
visitList
);
}
}
platform-admin/src/main/java/com/platform/dao/TbCfVisitDao.java
浏览文件 @
e0c3d57a
package
com
.
platform
.
dao
;
import
com.platform.entity.TbCfVisitEntity
;
import
com.platform.vo.StatisticalVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* Dao
...
...
@@ -12,4 +16,6 @@ public interface TbCfVisitDao extends BaseDao<TbCfVisitEntity> {
long
getDayVisit
();
List
<
StatisticalVo
>
getVisitByDate
(
@Param
(
"start"
)
String
start
,
@Param
(
"end"
)
String
end
,
@Param
(
"flag"
)
String
flag
);
}
platform-admin/src/main/java/com/platform/service/TbCfVisitService.java
浏览文件 @
e0c3d57a
package
com
.
platform
.
service
;
import
com.platform.entity.TbCfVisitEntity
;
import
com.platform.vo.StatisticalVo
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -70,4 +71,6 @@ public interface TbCfVisitService {
int
deleteBatch
(
String
[]
ids
);
long
getDayVisit
();
List
<
StatisticalVo
>
getVisitByDate
(
String
start
,
String
end
,
String
flag
);
}
platform-admin/src/main/java/com/platform/service/impl/TbCfVisitServiceImpl.java
浏览文件 @
e0c3d57a
...
...
@@ -4,6 +4,7 @@ import com.platform.dao.TbCfVisitDao;
import
com.platform.entity.TbCfVisitEntity
;
import
com.platform.service.TbCfVisitService
;
import
com.platform.utils.IdUtil
;
import
com.platform.vo.StatisticalVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -61,4 +62,10 @@ public class TbCfVisitServiceImpl implements TbCfVisitService {
public
long
getDayVisit
()
{
return
tbCfVisitDao
.
getDayVisit
();
}
@Override
public
List
<
StatisticalVo
>
getVisitByDate
(
String
start
,
String
end
,
String
flag
)
{
return
tbCfVisitDao
.
getVisitByDate
(
start
,
end
,
flag
);
}
}
platform-admin/src/main/resources/com/platform/dao/TbCfVisitDao.xml
浏览文件 @
e0c3d57a
...
...
@@ -10,7 +10,7 @@
<result
property=
"visitTime"
column=
"visit_time"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.TbCfVisitEntity"
>
<select
id=
"queryObject"
resultType=
"com.platform.entity.TbCfVisitEntity"
>
select
`id`,
`source`,
...
...
@@ -20,39 +20,64 @@
where id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfVisitEntity"
>
select
`id`,
`source`,
`user_id`,
`visit_time`
from tb_cf_visit
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfVisitEntity"
>
select
`id`,
`source`,
`user_id`,
`visit_time`
from tb_cf_visit
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
<otherwise>
order by id desc
</otherwise>
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_visit
WHERE 1=1
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"getVisitByDate"
resultType=
"com.platform.vo.StatisticalVo"
>
SELECT
<choose>
<when
test=
"flag != null and flag.trim() != ''"
>
DATE_FORMAT( visit_time, '%Y-%m' ) date,
</when>
<otherwise>
DATE_FORMAT( visit_time, '%Y-%m-%d' ) date,
</otherwise>
</choose>
count( 1 ) num
FROM
tb_cf_visit
WHERE
1=1
<if
test=
"start != null and start.trim() != ''"
>
AND date_format( visit_time, '%Y-%m-%d' ) >= #{start}
</if>
<if
test=
"end != null and end.trim() != ''"
>
AND date_format( visit_time, '%Y-%m-%d' )
<
= #{end}
</if>
GROUP BY
date
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_visit
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.TbCfVisitEntity"
>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.TbCfVisitEntity"
>
insert into tb_cf_visit(
`id`,
`source`,
...
...
@@ -65,29 +90,29 @@
#{visitTime})
</insert>
<select
id=
"getDayVisit"
resultType=
"long"
>
<select
id=
"getDayVisit"
resultType=
"long"
>
SELECT count(1) from tb_cf_visit WHERE DATE_FORMAT(visit_time,'%Y-%m-%d')=CURDATE()
</select>
<update
id=
"update"
parameterType=
"com.platform.entity.TbCfVisitEntity"
>
update tb_cf_visit
<set>
<if
test=
"source != null"
>
`source` = #{source},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"visitTime != null"
>
`visit_time` = #{visitTime}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
<update
id=
"update"
parameterType=
"com.platform.entity.TbCfVisitEntity"
>
update tb_cf_visit
<set>
<if
test=
"source != null"
>
`source` = #{source},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"visitTime != null"
>
`visit_time` = #{visitTime}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete from tb_cf_visit where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_visit where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_visit where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
platform-admin/src/main/webapp/WEB-INF/page/sys/main.html
浏览文件 @
e0c3d57a
...
...
@@ -473,7 +473,7 @@
<div
class=
"m-card-functionzone"
id=
'echartsPV'
>
</div>
<div
class=
"m-card-bottom"
>
<span>
日访问量
<i>
127230
</i></span>
<span>
日访问量
<i>
{{dayVisit}}
</i></span>
</div>
</div>
<!-- 支付笔数 -->
...
...
platform-admin/src/main/webapp/js/sys/main.js
浏览文件 @
e0c3d57a
...
...
@@ -2,6 +2,7 @@ let app = new Vue({
el
:
'#app'
,
data
()
{
return
{
dayVisit
:
0
,
rate
:
0
,
dayRate
:
0
,
flag
:
false
,
...
...
@@ -314,7 +315,7 @@ let app = new Vue({
this
.
initEchartsMiddleData
[
0
].
data
=
[]
let
objList
=
JSON
.
parse
(
res
).
list
objList
.
map
(
res
=>
{
//
console.log('date', res.date)
console
.
log
(
'date'
,
res
.
date
)
this
.
initEchartsMiddleData
[
0
].
data
.
push
([
res
.
date
,
res
.
num
])
})
this
.
initEchartsMiddle
();
...
...
@@ -324,7 +325,7 @@ let app = new Vue({
$
.
get
(
url
,
res
=>
{
this
.
initEchartsMiddleData
[
0
].
data
=
[]
res
.
list
.
map
(
res
=>
{
//
console.log('date', res.date)
console
.
log
(
'date'
,
res
.
date
)
this
.
initEchartsMiddleData
[
0
].
data
.
push
([
res
.
date
,
res
.
num
])
})
this
.
initEchartsMiddle
();
...
...
@@ -338,7 +339,8 @@ let app = new Vue({
let
url
=
'../tbcfuserinfo/getDayRegistered'
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
1
].
isActive
)
{
let
url
=
'../tbcfvisit/getVisitByDate?start='
+
endDate
;
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
2
].
isActive
)
{
let
url
=
'../tbcforder/getOrderByDate?start='
+
endDate
;
this
.
templateMethod1
(
url
);
...
...
@@ -363,7 +365,8 @@ let app = new Vue({
let
url
=
'../tbcfuserinfo/getWeekRegistered'
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
1
].
isActive
)
{
let
url
=
'../tbcfvisit/getVisitByDate?start='
+
start
+
'&end'
+
end
;
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
2
].
isActive
)
{
let
url
=
'../tbcforder/getOrderByDate?start='
+
start
+
'&end'
+
end
;
this
.
templateMethod1
(
url
);
...
...
@@ -382,7 +385,8 @@ let app = new Vue({
let
url
=
'../tbcfuserinfo/getMonthRegistered'
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
1
].
isActive
)
{
let
url
=
'../tbcfvisit/getVisitByDate?start='
+
start
+
'&end'
+
end
;
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
2
].
isActive
)
{
let
url
=
'../tbcforder/getOrderByDate?start='
+
start
+
'&end'
+
end
;
this
.
templateMethod1
(
url
);
...
...
@@ -401,7 +405,8 @@ let app = new Vue({
let
url
=
'../tbcfuserinfo/getYearRegistered'
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
1
].
isActive
)
{
let
url
=
'../tbcfvisit/getVisitByDate?start='
+
start
+
'&end'
+
end
+
'&flag=y'
;
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
2
].
isActive
)
{
let
url
=
'../tbcforder/getOrderByDate?start='
+
start
+
'&end'
+
end
+
'&flag=y'
;
this
.
templateMethod1
(
url
);
...
...
@@ -709,7 +714,8 @@ let app = new Vue({
this
.
templateMethod
(
url
);
}
else
if
(
index
===
1
)
{
this
.
initEchartsMiddleData
[
0
].
name
=
'访问量'
this
.
initEchartsMiddleData
[
0
].
data
=
[]
let
url
=
'../tbcfvisit/getVisitByDate'
;
this
.
templateMethod
(
url
);
}
else
if
(
index
===
2
)
{
this
.
initEchartsMiddleData
[
0
].
name
=
'订单笔数'
let
url
=
'../tbcforder/getOrderByDate'
;
...
...
@@ -744,6 +750,8 @@ let app = new Vue({
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
1
].
isActive
)
{
//访问量
let
url
=
'../tbcfvisit/getVisitByDate?start='
+
e
[
0
]
+
'&end='
+
e
[
1
];
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
2
].
isActive
)
{
//订单量
let
url
=
'../tbcforder/getOrderByDate?start='
+
e
[
0
]
+
'&end='
+
e
[
1
];
...
...
@@ -774,11 +782,11 @@ let app = new Vue({
}
let
endDate
=
this
.
getEndDate
();
if
(
this
.
middleOption
[
0
].
isActive
)
{
this
.
initEchartsMiddleData
[
0
].
name
=
'注册量'
let
url
=
'../tbcfuserinfo/getDailyRegistered?flag='
+
flag
;
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
1
].
isActive
)
{
let
url
=
'../tbcfvisit/getVisitByDate?flag='
+
flag
;
this
.
templateMethod
(
url
);
}
else
if
(
this
.
middleOption
[
2
].
isActive
)
{
let
url
=
'../tbcforder/getOrderByDate?flag='
+
flag
;
this
.
templateMethod1
(
url
);
...
...
@@ -814,6 +822,12 @@ let app = new Vue({
this
.
total
=
res
.
dayOrderNum
;
})
},
getDayVisit
()
{
$
.
get
(
'../tbcfvisit/getDayVisit'
,
res
=>
{
this
.
dayVisit
=
JSON
.
parse
(
res
).
dayVisit
;
TweenLite
.
to
(
this
.
$data
,
1
,
{
PVNumber
:
this
.
dayVisit
});
})
},
getSearchKeywords
()
{
$
.
get
(
'../tbcfsearch/getSearchKeywords?page=1&limit=10&sidx=&order='
,
res
=>
{
let
list
=
JSON
.
parse
(
res
);
...
...
@@ -865,6 +879,7 @@ let app = new Vue({
this
.
getCategory
();
},
mounted
()
{
this
.
getDayVisit
();
this
.
getDayRate
();
this
.
getUserDayRate
();
this
.
getSearchKeywords
();
...
...
@@ -884,7 +899,6 @@ let app = new Vue({
this
.
newNum
=
objList
[
0
].
num
;
})
// this.orderRate = orderPaidNum / orderNum
TweenLite
.
to
(
this
.
$data
,
1
,
{
PVNumber
:
135245554
});
this
.
changeMiddelActive
({
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论