Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
eae44a16
提交
eae44a16
authored
7月 23, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
首页统计
上级
cd97652d
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
543 行增加
和
5 行删除
+543
-5
TbCfSearchController.java
...in/java/com/platform/controller/TbCfSearchController.java
+137
-0
TbCfSearchDao.java
...m-admin/src/main/java/com/platform/dao/TbCfSearchDao.java
+20
-0
TbCfSearchEntity.java
...n/src/main/java/com/platform/entity/TbCfSearchEntity.java
+68
-0
TbCfSearchService.java
...src/main/java/com/platform/service/TbCfSearchService.java
+77
-0
TbCfSearchServiceImpl.java
...java/com/platform/service/impl/TbCfSearchServiceImpl.java
+71
-0
SearchKeywords.java
...m-admin/src/main/java/com/platform/vo/SearchKeywords.java
+29
-0
TopSearch.java
platform-admin/src/main/java/com/platform/vo/TopSearch.java
+28
-0
TbCfSearchDao.xml
...min/src/main/resources/com/platform/dao/TbCfSearchDao.xml
+99
-0
main.html
platform-admin/src/main/webapp/WEB-INF/page/sys/main.html
+5
-5
main.js
platform-admin/src/main/webapp/js/sys/main.js
+9
-0
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TbCfSearchController.java
0 → 100644
浏览文件 @
eae44a16
package
com
.
platform
.
controller
;
import
com.platform.entity.TbCfSearchEntity
;
import
com.platform.service.TbCfSearchService
;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.Query
;
import
com.platform.utils.R
;
import
com.platform.vo.SearchKeywords
;
import
com.platform.vo.TopSearch
;
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
java.util.List
;
import
java.util.Map
;
/**
* Controller
*
* @author lipengjun
* @date 2020-07-22 10:54:07
*/
@Controller
@RequestMapping
(
"tbcfsearch"
)
public
class
TbCfSearchController
{
@Autowired
private
TbCfSearchService
tbCfSearchService
;
/**
* 查看列表
*/
@RequestMapping
(
"/list"
)
@RequiresPermissions
(
"tbcfsearch:list"
)
@ResponseBody
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
//查询列表数据
Query
query
=
new
Query
(
params
);
List
<
TbCfSearchEntity
>
tbCfSearchList
=
tbCfSearchService
.
queryList
(
query
);
int
total
=
tbCfSearchService
.
queryTotal
(
query
);
PageUtils
pageUtil
=
new
PageUtils
(
tbCfSearchList
,
total
,
query
.
getLimit
(),
query
.
getPage
());
return
R
.
ok
().
put
(
"page"
,
pageUtil
);
}
/**
* 查看信息
*/
@RequestMapping
(
"/info/{id}"
)
@RequiresPermissions
(
"tbcfsearch:info"
)
@ResponseBody
public
R
info
(
@PathVariable
(
"id"
)
String
id
)
{
TbCfSearchEntity
tbCfSearch
=
tbCfSearchService
.
queryObject
(
id
);
return
R
.
ok
().
put
(
"tbCfSearch"
,
tbCfSearch
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"tbcfsearch:save"
)
@ResponseBody
public
R
save
(
@RequestBody
TbCfSearchEntity
tbCfSearch
)
{
tbCfSearchService
.
save
(
tbCfSearch
);
return
R
.
ok
();
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"tbcfsearch:update"
)
@ResponseBody
public
R
update
(
@RequestBody
TbCfSearchEntity
tbCfSearch
)
{
tbCfSearchService
.
update
(
tbCfSearch
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
@RequiresPermissions
(
"tbcfsearch:delete"
)
@ResponseBody
public
R
delete
(
@RequestBody
String
[]
ids
)
{
tbCfSearchService
.
deleteBatch
(
ids
);
return
R
.
ok
();
}
/**
* 查看所有列表
*/
@RequestMapping
(
"/queryAll"
)
@ResponseBody
public
R
queryAll
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
List
<
TbCfSearchEntity
>
list
=
tbCfSearchService
.
queryList
(
params
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
/**
* 搜索关键字统计
*/
@RequestMapping
(
"/getSearchKeywords"
)
@ResponseBody
public
R
getSearchKeywords
()
{
List
<
SearchKeywords
>
searchList
=
tbCfSearchService
.
getSearchKeywords
();
return
R
.
ok
().
put
(
"list"
,
searchList
);
}
/**
* 热门搜索
*
* @return
*/
@RequestMapping
(
"/getTopSearch"
)
@ResponseBody
public
R
getTopSearch
()
{
TopSearch
topSearch
=
tbCfSearchService
.
getTopSearch
();
return
R
.
ok
().
put
(
"topSearch"
,
topSearch
);
}
}
platform-admin/src/main/java/com/platform/dao/TbCfSearchDao.java
0 → 100644
浏览文件 @
eae44a16
package
com
.
platform
.
dao
;
import
com.platform.entity.TbCfSearchEntity
;
import
com.platform.vo.SearchKeywords
;
import
com.platform.vo.TopSearch
;
import
java.util.List
;
/**
* Dao
*
* @author lipengjun
* @date 2020-07-22 10:54:07
*/
public
interface
TbCfSearchDao
extends
BaseDao
<
TbCfSearchEntity
>
{
List
<
SearchKeywords
>
getSearchKeywords
();
TopSearch
getTopSearch
();
}
platform-admin/src/main/java/com/platform/entity/TbCfSearchEntity.java
0 → 100644
浏览文件 @
eae44a16
package
com
.
platform
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 实体
* 表名 tb_cf_search
*
* @author lipengjun
* @date 2020-07-22 10:54:07
*/
public
class
TbCfSearchEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 搜索ID
*/
private
String
id
;
/**
* 搜索关键字
*/
private
String
searchKeywords
;
/**
* 用户ID
*/
private
String
userId
;
/**
* 设置:搜索ID
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 获取:搜索ID
*/
public
String
getId
()
{
return
id
;
}
/**
* 设置:搜索关键字
*/
public
void
setSearchKeywords
(
String
searchKeywords
)
{
this
.
searchKeywords
=
searchKeywords
;
}
/**
* 获取:搜索关键字
*/
public
String
getSearchKeywords
()
{
return
searchKeywords
;
}
/**
* 设置:用户ID
*/
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
/**
* 获取:用户ID
*/
public
String
getUserId
()
{
return
userId
;
}
}
platform-admin/src/main/java/com/platform/service/TbCfSearchService.java
0 → 100644
浏览文件 @
eae44a16
package
com
.
platform
.
service
;
import
com.platform.entity.TbCfSearchEntity
;
import
com.platform.vo.SearchKeywords
;
import
com.platform.vo.TopSearch
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service接口
*
* @author lipengjun
* @date 2020-07-22 10:54:07
*/
public
interface
TbCfSearchService
{
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCfSearchEntity
queryObject
(
String
id
);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List
<
TbCfSearchEntity
>
queryList
(
Map
<
String
,
Object
>
map
);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int
queryTotal
(
Map
<
String
,
Object
>
map
);
/**
* 保存实体
*
* @param tbCfSearch 实体
* @return 保存条数
*/
int
save
(
TbCfSearchEntity
tbCfSearch
);
/**
* 根据主键更新实体
*
* @param tbCfSearch 实体
* @return 更新条数
*/
int
update
(
TbCfSearchEntity
tbCfSearch
);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int
delete
(
String
id
);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int
deleteBatch
(
String
[]
ids
);
List
<
SearchKeywords
>
getSearchKeywords
();
TopSearch
getTopSearch
();
}
platform-admin/src/main/java/com/platform/service/impl/TbCfSearchServiceImpl.java
0 → 100644
浏览文件 @
eae44a16
package
com
.
platform
.
service
.
impl
;
import
com.platform.dao.TbCfSearchDao
;
import
com.platform.entity.TbCfSearchEntity
;
import
com.platform.service.TbCfSearchService
;
import
com.platform.utils.IdUtil
;
import
com.platform.vo.SearchKeywords
;
import
com.platform.vo.TopSearch
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service实现类
*
* @author lipengjun
* @date 2020-07-22 10:54:07
*/
@Service
(
"tbCfSearchService"
)
public
class
TbCfSearchServiceImpl
implements
TbCfSearchService
{
@Autowired
private
TbCfSearchDao
tbCfSearchDao
;
@Override
public
TbCfSearchEntity
queryObject
(
String
id
)
{
return
tbCfSearchDao
.
queryObject
(
id
);
}
@Override
public
List
<
TbCfSearchEntity
>
queryList
(
Map
<
String
,
Object
>
map
)
{
return
tbCfSearchDao
.
queryList
(
map
);
}
@Override
public
int
queryTotal
(
Map
<
String
,
Object
>
map
)
{
return
tbCfSearchDao
.
queryTotal
(
map
);
}
@Override
public
int
save
(
TbCfSearchEntity
tbCfSearch
)
{
tbCfSearch
.
setId
(
IdUtil
.
createIdbyUUID
());
return
tbCfSearchDao
.
save
(
tbCfSearch
);
}
@Override
public
int
update
(
TbCfSearchEntity
tbCfSearch
)
{
return
tbCfSearchDao
.
update
(
tbCfSearch
);
}
@Override
public
int
delete
(
String
id
)
{
return
tbCfSearchDao
.
delete
(
id
);
}
@Override
public
int
deleteBatch
(
String
[]
ids
)
{
return
tbCfSearchDao
.
deleteBatch
(
ids
);
}
@Override
public
List
<
SearchKeywords
>
getSearchKeywords
()
{
return
tbCfSearchDao
.
getSearchKeywords
();
}
@Override
public
TopSearch
getTopSearch
()
{
return
tbCfSearchDao
.
getTopSearch
();
}
}
platform-admin/src/main/java/com/platform/vo/SearchKeywords.java
0 → 100644
浏览文件 @
eae44a16
package
com
.
platform
.
vo
;
/**
* @Auther: wudepeng
* @Date: 2020/07/22
* @Description:搜索关键字
*/
public
class
SearchKeywords
{
//搜索关键字
private
String
searchKeywords
;
//搜索次数
private
Long
count
;
public
String
getSearchKeywords
()
{
return
searchKeywords
;
}
public
void
setSearchKeywords
(
String
searchKeywords
)
{
this
.
searchKeywords
=
searchKeywords
;
}
public
Long
getCount
()
{
return
count
;
}
public
void
setCount
(
Long
count
)
{
this
.
count
=
count
;
}
}
platform-admin/src/main/java/com/platform/vo/TopSearch.java
0 → 100644
浏览文件 @
eae44a16
package
com
.
platform
.
vo
;
/**
* @Auther: wudepeng
* @Date: 2020/07/23
* @Description:热门搜索
*/
public
class
TopSearch
{
private
Long
total
;
private
Long
average
;
public
Long
getTotal
()
{
return
total
;
}
public
void
setTotal
(
Long
total
)
{
this
.
total
=
total
;
}
public
Long
getAverage
()
{
return
average
;
}
public
void
setAverage
(
Long
average
)
{
this
.
average
=
average
;
}
}
platform-admin/src/main/resources/com/platform/dao/TbCfSearchDao.xml
0 → 100644
浏览文件 @
eae44a16
<?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=
"com.platform.dao.TbCfSearchDao"
>
<resultMap
type=
"com.platform.entity.TbCfSearchEntity"
id=
"tbCfSearchMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"searchKeywords"
column=
"search_keywords"
/>
<result
property=
"userId"
column=
"user_id"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.TbCfSearchEntity"
>
select
`id`,
`search_keywords`,
`user_id`
from tb_cf_search
where id = #{id}
</select>
<select
id=
"getSearchKeywords"
resultType=
"com.platform.vo.SearchKeywords"
>
SELECT
search_keywords,
count( DISTINCT user_id ) count
FROM
tb_cf_search
GROUP BY
search_keywords
ORDER BY
count DESC
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfSearchEntity"
>
select
`id`,
`search_keywords`,
`user_id`
from tb_cf_search
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>
order by id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"getTopSearch"
resultType=
"com.platform.vo.TopSearch"
>
SELECT
count( DISTINCT user_id ) total,
count( 1 ) / count( DISTINCT user_id ) average
FROM
tb_cf_search
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_search
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.TbCfSearchEntity"
>
insert into tb_cf_search(
`id`,
`search_keywords`,
`user_id`)
values(
#{id},
#{searchKeywords},
#{userId})
</insert>
<update
id=
"update"
parameterType=
"com.platform.entity.TbCfSearchEntity"
>
update tb_cf_search
<set>
<if
test=
"searchKeywords != null"
>
`search_keywords` = #{searchKeywords},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete from tb_cf_search where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_search 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
浏览文件 @
eae44a16
...
@@ -624,14 +624,14 @@
...
@@ -624,14 +624,14 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
v-for=
'
el in 8
'
>
<tr
v-for=
'
(s,i) in searchList
'
>
<td>
1
</td>
<td>
{{i+1}}
</td>
<td
class=
"active-color"
>
新款连衣裙
</td>
<td
class=
"active-color"
>
{{s.searchKeywords}}
</td>
<td>
2233
</td>
<td>
{{s.count}}
</td>
<td>
<td>
<span>
128%
</span>
<span>
128%
</span>
<!-- 升 -->
<!-- 升 -->
<svg
v-if=
'
el
%2===0'
xmlns=
"http://www.w3.org/2000/svg"
<svg
v-if=
'
s
%2===0'
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"8"
height=
"9"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"8"
height=
"9"
viewBox=
"0 0 30 33"
>
viewBox=
"0 0 30 33"
>
<metadata>
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<metadata>
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
...
...
platform-admin/src/main/webapp/js/sys/main.js
浏览文件 @
eae44a16
...
@@ -10,6 +10,7 @@ let app = new Vue({
...
@@ -10,6 +10,7 @@ let app = new Vue({
newNum
:
0
,
newNum
:
0
,
PVNumber
:
0
,
PVNumber
:
0
,
FrequencyOfPaymentNumber
:
0
,
FrequencyOfPaymentNumber
:
0
,
searchList
:
[],
datePicker
:
{
datePicker
:
{
shortcuts
:
[
shortcuts
:
[
{
{
...
@@ -748,6 +749,13 @@ let app = new Vue({
...
@@ -748,6 +749,13 @@ let app = new Vue({
})
})
})
})
},
},
getSearchKeywords
()
{
$
.
get
(
'../tbcfsearch/getSearchKeywords'
,
res
=>
{
let
list
=
JSON
.
parse
(
res
).
list
;
console
.
log
(
'123455'
,
list
)
this
.
searchList
=
list
;
})
},
Percentage
(
num
,
total
)
{
Percentage
(
num
,
total
)
{
if
(
num
==
0
||
total
==
0
)
{
if
(
num
==
0
||
total
==
0
)
{
return
0
;
return
0
;
...
@@ -770,6 +778,7 @@ let app = new Vue({
...
@@ -770,6 +778,7 @@ let app = new Vue({
this
.
getCategory
();
this
.
getCategory
();
},
},
mounted
()
{
mounted
()
{
this
.
getSearchKeywords
();
this
.
initEchartsPV
();
this
.
initEchartsPV
();
this
.
initEchartsPayTheAmount
();
this
.
initEchartsPayTheAmount
();
this
.
initEchartsMiddle
();
this
.
initEchartsMiddle
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论