Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
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
吴迪
gs1-office-web-sit
Commits
f65970d9
Commit
f65970d9
authored
Dec 13, 2023
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】统计
parent
4ddb8a4b
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
408 additions
and
10 deletions
+408
-10
LogLoginController.java
.../office/modules/manage/controller/LogLoginController.java
+2
-0
WebsiteHitCountDetailController.java
...es/manage/controller/WebsiteHitCountDetailController.java
+109
-0
WebsiteHitCountDetailDao.java
...o/office/modules/manage/dao/WebsiteHitCountDetailDao.java
+27
-0
WebsiteHitCountDetailEntity.java
...ce/modules/manage/entity/WebsiteHitCountDetailEntity.java
+45
-0
WebsiteHitCountDetailForm.java
...office/modules/manage/form/WebsiteHitCountDetailForm.java
+46
-0
WebsiteHitCountDetailService.java
.../modules/manage/service/WebsiteHitCountDetailService.java
+37
-0
WebsiteHitCountDetailServiceImpl.java
...manage/service/impl/WebsiteHitCountDetailServiceImpl.java
+74
-0
application-dev.yml
src/main/resources/application-dev.yml
+9
-9
application-test.yml
src/main/resources/application-test.yml
+1
-1
WebsiteHitCountDetailDao.xml
...main/resources/mapper/manage/WebsiteHitCountDetailDao.xml
+58
-0
No files found.
src/main/java/io/office/modules/manage/controller/LogLoginController.java
View file @
f65970d9
...
...
@@ -115,6 +115,8 @@ public class LogLoginController {
if
(!
captcha
){
return
R
.
error
(
"验证码不正确"
);
}
return
R
.
ok
();
}
...
...
src/main/java/io/office/modules/manage/controller/WebsiteHitCountDetailController.java
0 → 100644
View file @
f65970d9
package
io
.
office
.
modules
.
manage
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.annotation.SysLog
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.common.validator.ValidatorUtils
;
import
io.office.common.validator.group.UpdateGroup
;
import
io.office.modules.manage.entity.WebsiteHitCountDetailEntity
;
import
io.office.modules.manage.form.WebsiteHitCountDetailForm
;
import
io.office.modules.manage.service.WebsiteHitCountDetailService
;
import
io.office.modules.sys.controller.AbstractController
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Arrays
;
/**
* 网站点击量统计表
*
* @author wudi
* @email 632132852@qq.com
* @date 2023-12-10 14:58:04
*/
@RestController
@RequestMapping
(
"/websitehitcountdetail"
)
public
class
WebsiteHitCountDetailController
extends
AbstractController
{
@Autowired
private
WebsiteHitCountDetailService
websiteHitCountDetailService
;
/**
* 列表
*/
/**
* 信息
*/
@RequestMapping
(
"/info/{id}"
)
//@RequiresPermissions("manage:websitehitcountdetail:info")
public
R
info
(
@PathVariable
(
"id"
)
Long
id
)
{
WebsiteHitCountDetailEntity
websiteHitCountDetail
=
websiteHitCountDetailService
.
getById
(
id
);
return
R
.
ok
().
put
(
"data"
,
websiteHitCountDetail
);
}
/**
* 保存
*/
@RequestMapping
(
"/api/save"
)
//@RequiresPermissions("manage:websitehitcountdetail:save")
public
R
save
(
@RequestBody
WebsiteHitCountDetailEntity
websiteHitCountDetail
,
HttpServletRequest
request
)
{
websiteHitCountDetailService
.
saveWebsiteHitCountDetail
(
websiteHitCountDetail
,
getUser
(),
request
);
return
R
.
ok
();
}
/**
* 修改
*/
@SysLog
(
"修改XXXX"
)
@RequestMapping
(
"/update"
)
//@RequiresPermissions("manage:websitehitcountdetail:update")
public
R
update
(
@RequestBody
WebsiteHitCountDetailForm
websiteHitCountDetail
)
{
ValidatorUtils
.
validateEntity
(
websiteHitCountDetail
,
UpdateGroup
.
class
);
//转化实体对象
WebsiteHitCountDetailEntity
websiteHitCountDetailEntity
=
new
WebsiteHitCountDetailEntity
();
BeanUtil
.
copyProperties
(
websiteHitCountDetail
,
websiteHitCountDetailEntity
);
websiteHitCountDetailService
.
updateWebsiteHitCountDetailById
(
websiteHitCountDetailEntity
,
getUser
());
return
R
.
ok
();
}
/**
* 删除
*/
@SysLog
(
"删除XXXX"
)
@RequestMapping
(
"/delete"
)
//@RequiresPermissions("manage:websitehitcountdetail:delete")
public
R
delete
(
@RequestBody
Long
[]
ids
)
{
websiteHitCountDetailService
.
removeByIds
(
Arrays
.
asList
(
ids
));
return
R
.
ok
();
}
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:websitehitcountdetail:list")
public
R
list
(
@RequestBody
WebsiteHitCountDetailForm
websiteHitCountDetailForm
)
{
Page
<
WebsiteHitCountDetailForm
>
page
=
websiteHitCountDetailService
.
getListPage
(
websiteHitCountDetailForm
,
new
Page
(
websiteHitCountDetailForm
.
getPage
(),
websiteHitCountDetailForm
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
@RequestMapping
(
"/getTotalCount"
)
// @RequiresPermissions("manage:websitehitcountdetail:list")
public
R
getTotalCount
(
@RequestBody
WebsiteHitCountDetailForm
websiteHitCountDetailForm
)
{
return
R
.
ok
().
put
(
"data"
,
websiteHitCountDetailService
.
getTotalCount
(
websiteHitCountDetailForm
));
}
}
src/main/java/io/office/modules/manage/dao/WebsiteHitCountDetailDao.java
0 → 100644
View file @
f65970d9
package
io
.
office
.
modules
.
manage
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.WebsiteHitCountDetailEntity
;
import
io.office.modules.manage.form.WebsiteHitCountDetailForm
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 网站点击量统计表
*
* @author wudi
* @email 632132852@qq.com
* @date 2023-12-10 14:58:04
*/
@Mapper
public
interface
WebsiteHitCountDetailDao
extends
BaseMapper
<
WebsiteHitCountDetailEntity
>
{
List
<
WebsiteHitCountDetailForm
>
getListPage
(
@Param
(
"websiteHitCountDetailForm"
)
WebsiteHitCountDetailForm
websiteHitCountDetailForm
,
Page
page
);
int
getTotalCount
(
@Param
(
"websiteHitCountDetailForm"
)
WebsiteHitCountDetailForm
websiteHitCountDetailForm
);
}
src/main/java/io/office/modules/manage/entity/WebsiteHitCountDetailEntity.java
0 → 100644
View file @
f65970d9
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 网站点击量统计表
*
* @author wudi
* @email 632132852@qq.com
* @date 2023-12-10 14:58:04
*/
@Data
@TableName
(
"website_hit_count_detail"
)
public
class
WebsiteHitCountDetailEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
type
=
IdType
.
INPUT
)
private
String
id
;
/**
* ip地址
*/
private
String
ip
;
/**
* 点击时间
*/
private
Date
createTime
;
/**
* 路由地址
*/
private
String
route
;
/**
* 访问具体路径
*/
private
String
path
;
}
src/main/java/io/office/modules/manage/form/WebsiteHitCountDetailForm.java
0 → 100644
View file @
f65970d9
package
io
.
office
.
modules
.
manage
.
form
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 网站点击量统计表
*
* @author wudi
* @email 632132852@qq.com
* @date 2023-12-10 14:58:04
*/
@Data
public
class
WebsiteHitCountDetailForm
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* ip地址
*/
private
String
ip
;
/**
* 点击时间
*/
private
String
createStartTime
;
private
String
createEndTime
;
/**
* 路由地址
*/
private
String
route
;
/**
* 访问具体路径
*/
private
String
path
;
private
int
hitCount
;
private
int
page
;
private
int
limit
;
private
String
orderFlag
;
}
src/main/java/io/office/modules/manage/service/WebsiteHitCountDetailService.java
0 → 100644
View file @
f65970d9
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.modules.manage.entity.WebsiteHitCountDetailEntity
;
import
io.office.modules.manage.form.WebsiteHitCountDetailForm
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Map
;
/**
* 网站点击量统计表
*
* @author wudi
* @email 632132852@qq.com
* @date 2023-12-10 14:58:04
*/
public
interface
WebsiteHitCountDetailService
extends
IService
<
WebsiteHitCountDetailEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
@Transactional
void
saveWebsiteHitCountDetail
(
WebsiteHitCountDetailEntity
websiteHitCountDetailEntity
,
SysUserEntity
loginUser
,
HttpServletRequest
request
);
@Transactional
void
updateWebsiteHitCountDetailById
(
WebsiteHitCountDetailEntity
websiteHitCountDetailEntity
,
SysUserEntity
loginUser
);
Page
<
WebsiteHitCountDetailForm
>
getListPage
(
WebsiteHitCountDetailForm
websiteHitCountDetailForm
,
Page
page
);
int
getTotalCount
(
WebsiteHitCountDetailForm
websiteHitCountDetailForm
);
}
src/main/java/io/office/modules/manage/service/impl/WebsiteHitCountDetailServiceImpl.java
0 → 100644
View file @
f65970d9
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.sitech.idworkstarter.IdWorkService
;
import
io.office.common.utils.IPUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.WebsiteHitCountDetailDao
;
import
io.office.modules.manage.entity.WebsiteHitCountDetailEntity
;
import
io.office.modules.manage.form.WebsiteHitCountDetailForm
;
import
io.office.modules.manage.service.WebsiteHitCountDetailService
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
@Service
(
"websiteHitCountDetailService"
)
public
class
WebsiteHitCountDetailServiceImpl
extends
ServiceImpl
<
WebsiteHitCountDetailDao
,
WebsiteHitCountDetailEntity
>
implements
WebsiteHitCountDetailService
{
@Autowired
IdWorkService
idWorkService
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
WebsiteHitCountDetailEntity
>
page
=
this
.
page
(
new
Query
<
WebsiteHitCountDetailEntity
>().
getPage
(
params
),
new
QueryWrapper
<
WebsiteHitCountDetailEntity
>().
between
(
params
.
get
(
"createStartTime"
)!=
null
&&
params
.
get
(
"createEndTime"
)!=
null
&&
StringUtils
.
isNotBlank
(
params
.
get
(
"createStartTime"
).
toString
())&&
StringUtils
.
isNotBlank
(
params
.
get
(
"createEndTime"
).
toString
()),
"create_time"
,
params
.
get
(
"createStartTime"
).
toString
(),
params
.
get
(
"createEndTime"
).
toString
())
);
return
new
PageUtils
(
page
);
}
@Override
public
void
updateWebsiteHitCountDetailById
(
WebsiteHitCountDetailEntity
websiteHitCountDetailEntity
,
SysUserEntity
loginUser
)
{
//websiteHitCountDetailEntity.setUpdateTime(new Date());
//websiteHitCountDetailEntity.setUpdateUserName(loginUser.getUsername());
//websiteHitCountDetailEntity.setUpdateUserId(loginUser.getUserId());
//baseMapper.updateById(websiteHitCountDetailEntity);
}
@Override
public
Page
<
WebsiteHitCountDetailForm
>
getListPage
(
WebsiteHitCountDetailForm
websiteHitCountDetailForm
,
Page
page
)
{
//page.setTotal(baseMapper.getListPageCount(websiteHitCountDetailForm));
List
<
WebsiteHitCountDetailForm
>
newsList
=
baseMapper
.
getListPage
(
websiteHitCountDetailForm
,
page
);
page
.
setRecords
(
newsList
);
return
page
;
}
@Override
public
int
getTotalCount
(
WebsiteHitCountDetailForm
websiteHitCountDetailForm
)
{
return
baseMapper
.
getTotalCount
(
websiteHitCountDetailForm
);
}
@Override
public
void
saveWebsiteHitCountDetail
(
WebsiteHitCountDetailEntity
websiteHitCountDetailEntity
,
SysUserEntity
loginUser
,
HttpServletRequest
request
)
{
websiteHitCountDetailEntity
.
setId
(
idWorkService
.
getSEQByKey
(
"id_seq"
));
websiteHitCountDetailEntity
.
setIp
(
IPUtils
.
getIpAddr
(
request
));
websiteHitCountDetailEntity
.
setCreateTime
(
new
Date
());
baseMapper
.
insert
(
websiteHitCountDetailEntity
);
}
}
src/main/resources/application-dev.yml
View file @
f65970d9
...
...
@@ -18,9 +18,9 @@ spring:
type
:
com.alibaba.druid.pool.DruidDataSource
druid
:
driver-class-name
:
com.microsoft.sqlserver.jdbc.SQLServerDriver
url
:
jdbc:sqlserver://
118.190.181.128:51433
;DatabaseName=gs108
username
:
sa
password
:
1234.abcd
url
:
jdbc:sqlserver://
mssql.dev2.wangtiansoft.com:30022
;DatabaseName=gs108
username
:
gs108
password
:
V0ZR5nqHLop4W9UG
initial-size
:
10
max-active
:
100
min-idle
:
10
...
...
@@ -52,14 +52,14 @@ dynamic:
datasource
:
slave1
:
driver-class-name
:
com.microsoft.sqlserver.jdbc.SQLServerDriver
url
:
jdbc:sqlserver://
118.190.181.128:51433
;DatabaseName=gs108
username
:
sa
password
:
1234.abcd
url
:
jdbc:sqlserver://
mssql.dev2.wangtiansoft.com:30022
;DatabaseName=gs108
username
:
gs108
password
:
V0ZR5nqHLop4W9UG
slave2
:
driver-class-name
:
com.microsoft.sqlserver.jdbc.SQLServerDriver
url
:
jdbc:sqlserver://
118.190.181.128:51433
;DatabaseName=gs108
username
:
sa
password
:
1234.abcd
url
:
jdbc:sqlserver://
mssql.dev2.wangtiansoft.com:30022
;DatabaseName=gs108
username
:
gs108
password
:
V0ZR5nqHLop4W9UG
##多数据源的配置
#dynamic:
...
...
src/main/resources/application-test.yml
View file @
f65970d9
...
...
@@ -92,7 +92,7 @@ searchDayCountLimitSwitch: 100
#域名
#域名
gs1
:
domain
:
http://
www.gs1cn.org
domain
:
http://
192.168.0.77
directory
:
...
...
src/main/resources/mapper/manage/WebsiteHitCountDetailDao.xml
0 → 100644
View file @
f65970d9
<?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=
"io.office.modules.manage.dao.WebsiteHitCountDetailDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.WebsiteHitCountDetailEntity"
id=
"websiteHitCountDetailMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"ip"
column=
"ip"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"route"
column=
"route"
/>
<result
property=
"path"
column=
"path"
/>
</resultMap>
<select
id=
"getListPage"
parameterType=
"io.office.modules.manage.form.WebsiteHitCountDetailForm"
resultType=
"io.office.modules.manage.form.WebsiteHitCountDetailForm"
>
select a.route,a.hit_count from (SELECT route, COUNT(1) AS hit_count
FROM website_hit_count_detail
<where>
<if
test=
"websiteHitCountDetailForm.ip!=null and websiteHitCountDetailForm.ip!=''"
>
ip =#{websiteHitCountDetailForm.ip}
</if>
<if
test=
"websiteHitCountDetailForm.createStartTime!=null and websiteHitCountDetailForm.createStartTime!=''"
>
and create_time
>
= #{websiteHitCountDetailForm.createStartTime}
</if>
<if
test=
"websiteHitCountDetailForm.createEndTime!=null and websiteHitCountDetailForm.createEndTime!=''"
>
and create_time
<
= #{websiteHitCountDetailForm.createEndTime}
</if>
<if
test=
"websiteHitCountDetailForm.route!=null and websiteHitCountDetailForm.route!=''"
>
and route = #{websiteHitCountDetailForm.route}
</if>
</where>
GROUP BY route ) a
<if
test=
"websiteHitCountDetailForm.orderFlag==null || websiteHitCountDetailForm.orderFlag=='' ||websiteHitCountDetailForm.orderFlag=='1'"
>
order by hit_count desc
</if>
<if
test=
"websiteHitCountDetailForm.orderFlag!=null and websiteHitCountDetailForm.orderFlag!='' and websiteHitCountDetailForm.orderFlag=='2'"
>
order by hit_count asc
</if>
</select>
<select
id=
"getTotalCount"
parameterType=
"io.office.modules.manage.form.WebsiteHitCountDetailForm"
resultType=
"int"
>
SELECT COUNT(1) AS hit_count
FROM website_hit_count_detail
<where>
<if
test=
"websiteHitCountDetailForm.createStartTime!=null and websiteHitCountDetailForm.createStartTime!=''"
>
and create_time
>
= #{websiteHitCountDetailForm.createStartTime}
</if>
<if
test=
"websiteHitCountDetailForm.createEndTime!=null and websiteHitCountDetailForm.createEndTime!=''"
>
and create_time
<
= #{websiteHitCountDetailForm.createEndTime}
</if>
</where>
</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