Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
git test
Lilishop
Commits
0dd8488e
Commit
0dd8488e
authored
3 years ago
by
pikachu
Browse files
Options
Download
Plain Diff
Merge branch 'master' into pipi
parents
a7f26ff1
cd1b67ba
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
buyer-api/src/main/java/cn/lili/controller/store/StoreBuyerController.java
+0
-3
...n/java/cn/lili/controller/store/StoreBuyerController.java
consumer/src/main/java/cn/lili/timetask/handler/impl/hotwords/HotWordsEveryDayTaskExecute.java
+30
-0
...sk/handler/impl/hotwords/HotWordsEveryDayTaskExecute.java
framework/src/main/java/cn/lili/cache/Cache.java
+18
-9
framework/src/main/java/cn/lili/cache/Cache.java
framework/src/main/java/cn/lili/cache/impl/RedisCache.java
+7
-3
framework/src/main/java/cn/lili/cache/impl/RedisCache.java
framework/src/main/java/cn/lili/modules/member/entity/vo/MemberEvaluationListVO.java
+8
-1
...lili/modules/member/entity/vo/MemberEvaluationListVO.java
framework/src/main/java/cn/lili/modules/message/serviceimpl/WechatMessageServiceImpl.java
+15
-2
...modules/message/serviceimpl/WechatMessageServiceImpl.java
framework/src/main/java/cn/lili/modules/message/util/WechatAccessTokenUtil.java
+1
-1
...a/cn/lili/modules/message/util/WechatAccessTokenUtil.java
framework/src/main/java/cn/lili/modules/message/util/WechatMessageUtil.java
+6
-6
.../java/cn/lili/modules/message/util/WechatMessageUtil.java
framework/src/main/java/cn/lili/modules/permission/entity/dos/Menu.java
+6
-12
...main/java/cn/lili/modules/permission/entity/dos/Menu.java
framework/src/main/java/cn/lili/modules/permission/entity/vo/UserMenuVO.java
+6
-0
...java/cn/lili/modules/permission/entity/vo/UserMenuVO.java
framework/src/main/java/cn/lili/modules/search/entity/dto/HotWordsDTO.java
+24
-0
...n/java/cn/lili/modules/search/entity/dto/HotWordsDTO.java
framework/src/main/java/cn/lili/modules/search/entity/enums/HotWordsRedisKeyEnum.java
+0
-24
...ili/modules/search/entity/enums/HotWordsRedisKeyEnum.java
framework/src/main/java/cn/lili/modules/search/service/EsGoodsSearchService.java
+7
-0
.../cn/lili/modules/search/service/EsGoodsSearchService.java
framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java
+13
-4
.../modules/search/serviceimpl/EsGoodsSearchServiceImpl.java
framework/src/main/java/cn/lili/modules/system/token/ManagerTokenGenerate.java
+21
-14
...va/cn/lili/modules/system/token/ManagerTokenGenerate.java
manager-api/src/main/java/cn/lili/controller/member/MemberManagerController.java
+1
-0
...va/cn/lili/controller/member/MemberManagerController.java
manager-api/src/main/java/cn/lili/controller/other/PageDataManagerController.java
+1
-0
...a/cn/lili/controller/other/PageDataManagerController.java
manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java
+1
-0
.../lili/controller/passport/AdminUserManagerController.java
manager-api/src/main/java/cn/lili/controller/permission/MenuManagerController.java
+1
-0
.../cn/lili/controller/permission/MenuManagerController.java
manager-api/src/main/java/cn/lili/controller/setting/HotWordsManagerController.java
+44
-0
...cn/lili/controller/setting/HotWordsManagerController.java
with
210 additions
and
79 deletions
+210
-79
buyer-api/src/main/java/cn/lili/controller/store/StoreBuyerController.java
+
0
-
3
View file @
0dd8488e
...
...
@@ -4,8 +4,6 @@ import cn.lili.common.enums.ResultUtil;
import
cn.lili.common.security.context.UserContext
;
import
cn.lili.common.vo.PageVO
;
import
cn.lili.common.vo.ResultMessage
;
import
cn.lili.modules.statistics.aop.PageViewPoint
;
import
cn.lili.modules.statistics.aop.enums.PageViewEnum
;
import
cn.lili.modules.store.entity.dto.StoreBankDTO
;
import
cn.lili.modules.store.entity.dto.StoreCompanyDTO
;
import
cn.lili.modules.store.entity.dto.StoreOtherInfoDTO
;
...
...
@@ -61,7 +59,6 @@ public class StoreBuyerController {
@ApiOperation
(
value
=
"通过id获取店铺信息"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"店铺ID"
,
required
=
true
,
paramType
=
"path"
)
@GetMapping
(
value
=
"/get/detail/{id}"
)
@PageViewPoint
(
type
=
PageViewEnum
.
STORE
,
id
=
"#id"
)
public
ResultMessage
<
StoreBasicInfoVO
>
detail
(
@NotNull
@PathVariable
String
id
)
{
return
ResultUtil
.
data
(
storeDetailService
.
getStoreBasicInfoDTO
(
id
));
}
...
...
This diff is collapsed.
Click to expand it.
consumer/src/main/java/cn/lili/timetask/handler/impl/hotwords/HotWordsEveryDayTaskExecute.java
0 → 100644
+
30
-
0
View file @
0dd8488e
package
cn.lili.timetask.handler.impl.hotwords
;
import
cn.lili.cache.Cache
;
import
cn.lili.cache.CachePrefix
;
import
cn.lili.timetask.handler.EveryDayExecute
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
* @author paulG
* @since 2021/3/11
**/
@Slf4j
@Component
public
class
HotWordsEveryDayTaskExecute
implements
EveryDayExecute
{
@Autowired
private
Cache
cache
;
/**
* 执行每日任务
*/
@Override
public
void
execute
()
{
//移除昨日的热搜词
cache
.
remove
(
CachePrefix
.
HOT_WORD
.
getPrefix
());
}
}
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/cache/Cache.java
+
18
-
9
View file @
0dd8488e
...
...
@@ -60,7 +60,7 @@ public interface Cache<T> {
* Add an item to the cache, nontransactionally, with
* failfast semantics
*
* @param key 缓存key
* @param key
缓存key
* @param value 缓存value
*/
void
put
(
Object
key
,
T
value
);
...
...
@@ -68,7 +68,7 @@ public interface Cache<T> {
/**
* 往缓存中写入内容
*
* @param key 缓存key
* @param key
缓存key
* @param value 缓存value
* @param exp 超时时间,单位为秒
*/
...
...
@@ -77,9 +77,9 @@ public interface Cache<T> {
/**
* 往缓存中写入内容
*
* @param key 缓存key
* @param value 缓存value
* @param exp 过期时间
* @param key
缓存key
* @param value
缓存value
* @param exp
过期时间
* @param timeUnit 过期单位
*/
void
put
(
Object
key
,
T
value
,
Long
exp
,
TimeUnit
timeUnit
);
...
...
@@ -124,7 +124,7 @@ public interface Cache<T> {
/**
* 读取缓存值
*
* @param key 缓存key
* @param key
缓存key
* @param hashKey map value
* @return 返回缓存中的数据
*/
...
...
@@ -142,8 +142,7 @@ public interface Cache<T> {
* 是否包含
*
* @param key 缓存key
* @return 缓存中的数据
*
* @return 缓存中的数据
*/
boolean
hasKey
(
Object
key
);
...
...
@@ -164,7 +163,7 @@ public interface Cache<T> {
* 效率较高的 计数器
* 如需清零,按照普通key 移除即可
*
* @param key key值
* @param key
key值
* @param value 去重统计值
* @return 计数器结果
*/
...
...
@@ -223,6 +222,16 @@ public interface Cache<T> {
*/
void
incrementScore
(
String
sortedSetName
,
String
keyword
);
/**
* 使用Sorted Set记录keyword
* zincrby命令,对于一个Sorted Set,存在的就把分数加x(x可自行设定),不存在就创建一个分数为1的成员
*
* @param sortedSetName sortedSetName的Sorted Set不用预先创建,不存在会自动创建,存在则向里添加数据
* @param keyword 关键词
* @param score 分数
*/
void
incrementScore
(
String
sortedSetName
,
String
keyword
,
Integer
score
);
/**
* zrevrange命令, 查询Sorted Set中指定范围的值
* 返回的有序集合中,score大的在前面
...
...
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/cache/impl/RedisCache.java
+
7
-
3
View file @
0dd8488e
...
...
@@ -223,9 +223,13 @@ public class RedisCache implements Cache {
*/
@Override
public
void
incrementScore
(
String
sortedSetName
,
String
keyword
)
{
//x 的含义请见本方法的注释
double
x
=
1.0
;
this
.
redisTemplate
.
opsForZSet
().
incrementScore
(
sortedSetName
,
keyword
,
x
);
//指向key名为KEY的zset元素
redisTemplate
.
opsForZSet
().
incrementScore
(
sortedSetName
,
keyword
,
1
);
}
@Override
public
void
incrementScore
(
String
sortedSetName
,
String
keyword
,
Integer
score
)
{
redisTemplate
.
opsForZSet
().
incrementScore
(
sortedSetName
,
keyword
,
score
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/modules/member/entity/vo/MemberEvaluationListVO.java
+
8
-
1
View file @
0dd8488e
...
...
@@ -39,8 +39,15 @@ public class MemberEvaluationListVO {
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"物流评分"
)
private
Integer
deliveryScore
;
@ApiModelProperty
(
value
=
"服务评分"
)
private
Integer
serviceScore
;
@ApiModelProperty
(
value
=
"描述评分"
)
private
Integer
descriptionScore
;
}
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/modules/message/serviceimpl/WechatMessageServiceImpl.java
+
15
-
2
View file @
0dd8488e
...
...
@@ -39,6 +39,10 @@ public class WechatMessageServiceImpl extends ServiceImpl<WechatMessageMapper, W
@Autowired
private
WechatAccessTokenUtil
wechatAccessTokenUtil
;
/**
* 设置行业
*/
private
final
String
setIndustry
=
"https://api.weixin.qq.com/cgi-bin/template/api_set_industry?access_token="
;
/**
* get 获取所有的模版
*/
...
...
@@ -54,9 +58,18 @@ public class WechatMessageServiceImpl extends ServiceImpl<WechatMessageMapper, W
try
{
this
.
baseMapper
.
deleteAll
();
//获取token
String
accessToken
=
wechatAccessTokenUtil
.
cgiAccessToken
(
ClientTypeEnum
.
H5
);
//设置行业
Map
<
String
,
Object
>
setIndustryParams
=
new
HashMap
<>();
setIndustryParams
.
put
(
"industry_id1"
,
1
);
//互联网/电子商务
setIndustryParams
.
put
(
"industry_id2"
,
5
);
//通信与运营商
String
context
=
HttpUtils
.
doPostWithJson
(
setIndustry
+
accessToken
,
setIndustryParams
);
//获取已有模版,删除
String
context
=
HttpUtil
.
get
(
allMsgTpl
+
accessToken
);
context
=
HttpUtil
.
get
(
allMsgTpl
+
accessToken
);
JSONObject
jsonObject
=
new
JSONObject
(
context
);
WechatMessageUtil
.
wechatHandler
(
jsonObject
);
List
<
String
>
oldList
=
new
ArrayList
<>();
...
...
@@ -77,7 +90,7 @@ public class WechatMessageServiceImpl extends ServiceImpl<WechatMessageMapper, W
List
<
WechatMessageData
>
tmpList
=
initData
();
tmpList
.
forEach
(
tplData
->
{
WechatMessage
wechatMessage
=
new
WechatMessage
();
Map
params
=
new
HashMap
<>(
1
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>(
1
);
params
.
put
(
"template_id_short"
,
tplData
.
getMsgId
());
String
content
=
HttpUtils
.
doPostWithJson
(
addTpl
+
accessToken
,
params
);
JSONObject
tplContent
=
new
JSONObject
(
content
);
...
...
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/modules/message/util/WechatAccessTokenUtil.java
+
1
-
1
View file @
0dd8488e
...
...
@@ -68,7 +68,7 @@ public class WechatAccessTokenUtil {
}
//获取token
String
content
=
HttpUtil
.
get
(
"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential"
+
"&appid=
"
+
item
.
getAppId
()
+
"&secret="
+
item
.
getAppSecret
()
);
"&appid=
wx6cfbe6e0ace12ce8&secret=6dfbe0c72380dce5d49d65b3c91059b1"
);
JSONObject
object
=
new
JSONObject
(
content
);
log
.
info
(
"token获取【"
+
clientTypeEnum
.
name
()
+
"】返回"
+
object
.
toString
());
...
...
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/modules/message/util/WechatMessageUtil.java
+
6
-
6
View file @
0dd8488e
...
...
@@ -93,7 +93,7 @@ public class WechatMessageUtil {
return
;
}
log
.
info
(
"微信消息发送消息:"
,
order
.
getMemberId
()
+
"-"
+
sn
);
log
.
info
(
"微信消息发送消息:
{}
"
,
order
.
getMemberId
()
+
"-"
+
sn
);
//获取token
String
token
=
wechatAccessTokenUtil
.
cgiAccessToken
(
ClientTypeEnum
.
H5
);
...
...
@@ -137,7 +137,7 @@ public class WechatMessageUtil {
wechatMPMessageQueryWrapper
.
eq
(
WechatMPMessage:
:
getOrderStatus
,
order
.
getOrderStatus
());
WechatMPMessage
wechatMPMessage
=
wechatMPMessageService
.
getOne
(
wechatMPMessageQueryWrapper
);
if
(
wechatMPMessage
==
null
)
{
log
.
error
(
"未配置微信消息订阅"
);
log
.
info
(
"未配置微信消息订阅"
);
return
;
}
...
...
@@ -150,7 +150,7 @@ public class WechatMessageUtil {
return
;
}
log
.
info
(
"微信消息订阅消息发送:"
,
order
.
getMemberId
()
+
"-"
+
sn
);
log
.
info
(
"微信消息订阅消息发送:
{}
"
,
order
.
getMemberId
()
+
"-"
+
sn
);
//获取token
String
token
=
wechatAccessTokenUtil
.
cgiAccessToken
(
ClientTypeEnum
.
WECHAT_MP
);
...
...
@@ -270,7 +270,7 @@ public class WechatMessageUtil {
/**
* 如果返回信息有错误
*
* @param jsonObject
* @param jsonObject
返回消息
*/
public
static
void
wechatHandler
(
JSONObject
jsonObject
)
{
if
(
jsonObject
.
containsKey
(
"errmsg"
))
{
...
...
@@ -283,9 +283,9 @@ public class WechatMessageUtil {
}
/**
* 如果返回信息有错误
....................................................................................................................................................................................333333333333333333
* 如果返回信息有错误
*
* @param string
* @param string
返回消息
*/
public
static
String
wechatHandler
(
String
string
)
{
JSONObject
jsonObject
=
new
JSONObject
();
...
...
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/modules/permission/entity/dos/Menu.java
+
6
-
12
View file @
0dd8488e
...
...
@@ -26,36 +26,30 @@ public class Menu extends BaseEntity {
private
static
final
long
serialVersionUID
=
7050744476203495207L
;
@ApiModelProperty
(
value
=
"菜单
/权限
名称"
)
@ApiModelProperty
(
value
=
"菜单名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"层级"
)
@ApiModelProperty
(
value
=
"
菜单
层级"
)
private
Integer
level
;
@ApiModelProperty
(
value
=
"菜单标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"
赋权API地址,正则表达式
"
)
@ApiModelProperty
(
value
=
"
路径
"
)
private
String
path
;
@ApiModelProperty
(
value
=
"前端
路由
"
)
@ApiModelProperty
(
value
=
"前端
目录文件
"
)
private
String
frontRoute
;
@ApiModelProperty
(
value
=
"图标"
)
private
String
icon
;
@ApiModelProperty
(
value
=
"父id"
)
private
String
parentId
=
"0"
;
@ApiModelProperty
(
value
=
"说明备注"
)
private
String
description
;
@ApiModelProperty
(
value
=
"排序值"
)
@Column
(
precision
=
10
,
scale
=
2
)
private
BigDecimal
sortOrder
;
@ApiModelProperty
(
value
=
"
文件地址
"
)
private
String
frontComponent
;
@ApiModelProperty
(
value
=
"
权限URL,*号模糊匹配,逗号分割
"
)
private
String
permission
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/modules/permission/entity/vo/UserMenuVO.java
+
6
-
0
View file @
0dd8488e
...
...
@@ -19,4 +19,10 @@ public class UserMenuVO extends Menu {
*/
private
Boolean
isSupper
;
public
Boolean
getSupper
()
{
if
(
this
.
isSupper
==
null
)
{
return
false
;
}
return
isSupper
;
}
}
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/modules/search/entity/dto/HotWordsDTO.java
0 → 100644
+
24
-
0
View file @
0dd8488e
package
cn.lili.modules.search.entity.dto
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
/**
* 搜索热词
*
* @author Chopper
* @version v1.0
* 2021-07-26 15:46
*/
@Data
public
class
HotWordsDTO
{
@NotBlank
(
message
=
"搜索热词不能为空"
)
private
String
keywords
;
@NotNull
(
message
=
"分数不能为空"
)
private
Integer
point
;
}
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/modules/search/entity/enums/HotWordsRedisKeyEnum.java
deleted
100644 → 0
+
0
-
24
View file @
a7f26ff1
package
cn.lili.modules.search.entity.enums
;
/**
* @author paulG
* @since 2021/1/20
**/
public
enum
HotWordsRedisKeyEnum
{
/**
* "搜索热词"
*/
SEARCH_HOT_WORD
(
"搜索热词"
);
private
final
String
description
;
HotWordsRedisKeyEnum
(
String
description
)
{
this
.
description
=
description
;
}
public
String
description
()
{
return
description
;
}
}
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/modules/search/service/EsGoodsSearchService.java
+
7
-
0
View file @
0dd8488e
...
...
@@ -4,6 +4,7 @@ import cn.lili.common.vo.PageVO;
import
cn.lili.modules.search.entity.dos.EsGoodsIndex
;
import
cn.lili.modules.search.entity.dos.EsGoodsRelatedInfo
;
import
cn.lili.modules.search.entity.dto.EsGoodsSearchDTO
;
import
cn.lili.modules.search.entity.dto.HotWordsDTO
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
...
...
@@ -34,6 +35,12 @@ public interface EsGoodsSearchService {
*/
List
<
String
>
getHotWords
(
Integer
start
,
Integer
end
);
/**
* 设置热门关键词
* @param hotWords 热词分数
*/
void
setHotWords
(
HotWordsDTO
hotWords
);
/**
* 获取筛选器
*
...
...
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java
+
13
-
4
View file @
0dd8488e
...
...
@@ -3,6 +3,7 @@ package cn.lili.modules.search.serviceimpl;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.text.CharSequenceUtil
;
import
cn.lili.cache.Cache
;
import
cn.lili.cache.CachePrefix
;
import
cn.lili.common.utils.StringUtils
;
import
cn.lili.common.vo.PageVO
;
import
cn.lili.modules.goods.entity.dos.Brand
;
...
...
@@ -14,9 +15,9 @@ import cn.lili.modules.goods.service.CategoryService;
import
cn.lili.modules.search.entity.dos.EsGoodsIndex
;
import
cn.lili.modules.search.entity.dos.EsGoodsRelatedInfo
;
import
cn.lili.modules.search.entity.dto.EsGoodsSearchDTO
;
import
cn.lili.modules.search.entity.dto.HotWordsDTO
;
import
cn.lili.modules.search.entity.dto.ParamOptions
;
import
cn.lili.modules.search.entity.dto.SelectorOptions
;
import
cn.lili.modules.search.entity.enums.HotWordsRedisKeyEnum
;
import
cn.lili.modules.search.repository.EsGoodsIndexRepository
;
import
cn.lili.modules.search.service.EsGoodsSearchService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -51,6 +52,7 @@ import java.util.*;
/**
* ES商品搜索业务层实现
*
* @author paulG
* @since 2020/10/16
**/
...
...
@@ -90,7 +92,7 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService {
@Override
public
Page
<
EsGoodsIndex
>
searchGoods
(
EsGoodsSearchDTO
searchDTO
,
PageVO
pageVo
)
{
if
(
CharSequenceUtil
.
isNotEmpty
(
searchDTO
.
getKeyword
()))
{
cache
.
incrementScore
(
HotWordsRedisKeyEnum
.
SEARCH_HOT_WORD
.
name
(),
searchDTO
.
getKeyword
());
cache
.
incrementScore
(
CachePrefix
.
HOT_WORD
.
getPrefix
(),
searchDTO
.
getKeyword
());
}
NativeSearchQueryBuilder
searchQueryBuilder
=
createSearchQueryBuilder
(
searchDTO
,
pageVo
,
true
);
NativeSearchQuery
searchQuery
=
searchQueryBuilder
.
build
();
...
...
@@ -102,13 +104,18 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService {
@Override
public
List
<
String
>
getHotWords
(
Integer
start
,
Integer
end
)
{
List
<
String
>
hotWords
=
new
ArrayList
<>();
Set
<
DefaultTypedTuple
>
set
=
cache
.
reverseRangeWithScores
(
HotWordsRedisKeyEnum
.
SEARCH_HOT_WORD
.
name
(),
start
,
end
);
Set
<
DefaultTypedTuple
>
set
=
cache
.
reverseRangeWithScores
(
CachePrefix
.
HOT_WORD
.
getPrefix
(),
start
,
end
);
for
(
DefaultTypedTuple
defaultTypedTuple
:
set
)
{
hotWords
.
add
(
Objects
.
requireNonNull
(
defaultTypedTuple
.
getValue
()).
toString
());
}
return
hotWords
;
}
@Override
public
void
setHotWords
(
HotWordsDTO
hotWords
)
{
cache
.
incrementScore
(
CachePrefix
.
HOT_WORD
.
getPrefix
(),
hotWords
.
getKeywords
(),
hotWords
.
getPoint
());
}
@Override
public
EsGoodsRelatedInfo
getSelector
(
EsGoodsSearchDTO
goodsSearch
,
PageVO
pageVo
)
{
NativeSearchQueryBuilder
builder
=
createSearchQueryBuilder
(
goodsSearch
,
null
,
true
);
...
...
@@ -318,6 +325,7 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService {
/**
* 查询属性处理
*
* @param filterBuilder
* @param queryBuilder
* @param searchDTO
...
...
@@ -391,7 +399,7 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService {
//价格区间判定
if
(
CharSequenceUtil
.
isNotEmpty
(
searchDTO
.
getPrice
()))
{
String
[]
prices
=
searchDTO
.
getPrice
().
split
(
"_"
);
if
(
prices
.
length
==
0
){
if
(
prices
.
length
==
0
)
{
return
;
}
double
min
=
Convert
.
toDouble
(
prices
[
0
],
0.0
);
...
...
@@ -406,6 +414,7 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService {
/**
* 关键字查询处理
*
* @param filterBuilder
* @param queryBuilder
* @param keyword
...
...
This diff is collapsed.
Click to expand it.
framework/src/main/java/cn/lili/modules/system/token/ManagerTokenGenerate.java
+
21
-
14
View file @
0dd8488e
...
...
@@ -3,8 +3,8 @@ package cn.lili.modules.system.token;
import
cn.lili.cache.Cache
;
import
cn.lili.cache.CachePrefix
;
import
cn.lili.common.security.AuthUser
;
import
cn.lili.common.security.enums.UserEnums
;
import
cn.lili.common.security.enums.PermissionEnum
;
import
cn.lili.common.security.enums.UserEnums
;
import
cn.lili.common.security.token.Token
;
import
cn.lili.common.security.token.TokenUtil
;
import
cn.lili.common.security.token.base.AbstractTokenGenerate
;
...
...
@@ -77,28 +77,27 @@ public class ManagerTokenGenerate extends AbstractTokenGenerate {
//循环权限菜单
userMenuVOList
.
forEach
(
menu
->
{
//循环菜单,赋予用户权限
if
(
menu
.
getP
ath
()
!=
null
)
{
if
(
menu
.
getP
ermission
()
!=
null
)
{
//获取路径集合
String
[]
p
aths
=
menu
.
getP
ath
().
split
(
"
\\|
"
);
String
[]
p
ermissionUrl
=
menu
.
getP
ermission
().
split
(
"
,
"
);
//for循环路径集合
for
(
String
path
:
paths
)
{
for
(
String
url
:
permissionUrl
)
{
//如果是超级权限 则计入超级权限
if
(
menu
.
get
IsSupper
()
!=
null
&&
menu
.
getIs
Supper
())
{
if
(
menu
.
getSupper
())
{
//如果已有超级权限,则这里就不做权限的累加
if
(!
superPermissions
.
contains
(
path
))
{
superPermissions
.
add
(
path
);
if
(!
superPermissions
.
contains
(
url
))
{
superPermissions
.
add
(
url
);
}
}
//否则计入浏览权限
else
{
//
如果已有超级权限,或者已有普通查看权限,则这里就不做权限的
累加
if
(!
sup
erPermissions
.
contains
(
path
)
&&
!
queryPermissions
.
contains
(
path
))
{
queryPermissions
.
add
(
path
);
//
没有权限,则
累加
。
if
(!
qu
er
y
Permissions
.
contains
(
url
))
{
queryPermissions
.
add
(
url
);
}
}
}
}
//去除无效的权限
superPermissions
.
forEach
(
queryPermissions:
:
remove
);
});
...
...
@@ -116,11 +115,19 @@ public class ManagerTokenGenerate extends AbstractTokenGenerate {
*/
void
initPermission
(
List
<
String
>
superPermissions
,
List
<
String
>
queryPermissions
)
{
//用户信息维护
superPermissions
.
add
(
"/manager/user/info"
);
superPermissions
.
add
(
"/manager/user/edit"
);
superPermissions
.
add
(
"/manager/user/info
*
"
);
superPermissions
.
add
(
"/manager/user/edit
*
"
);
superPermissions
.
add
(
"/manager/user/editPassword*"
);
//统计查看
//统计查看权限
queryPermissions
.
add
(
"/manager/statistics*"
);
//菜单查看权限
queryPermissions
.
add
(
"/manager/menu*"
);
//商品分类查看权限
queryPermissions
.
add
(
"/manager/goods/category*"
);
//查看地区接口
queryPermissions
.
add
(
"/manager/region*"
);
}
}
This diff is collapsed.
Click to expand it.
manager-api/src/main/java/cn/lili/controller/member/MemberManagerController.java
+
1
-
0
View file @
0dd8488e
...
...
@@ -3,6 +3,7 @@ package cn.lili.controller.member;
import
cn.lili.common.enums.ResultUtil
;
import
cn.lili.common.vo.PageVO
;
import
cn.lili.common.vo.ResultMessage
;
import
cn.lili.modules.system.aspect.annotation.DemoSite
;
import
cn.lili.modules.member.entity.dos.Member
;
import
cn.lili.modules.member.entity.dto.ManagerMemberEditDTO
;
import
cn.lili.modules.member.entity.dto.MemberAddDTO
;
...
...
This diff is collapsed.
Click to expand it.
manager-api/src/main/java/cn/lili/controller/other/PageDataManagerController.java
+
1
-
0
View file @
0dd8488e
...
...
@@ -3,6 +3,7 @@ package cn.lili.controller.other;
import
cn.lili.common.enums.ResultUtil
;
import
cn.lili.common.vo.PageVO
;
import
cn.lili.common.vo.ResultMessage
;
import
cn.lili.modules.system.aspect.annotation.DemoSite
;
import
cn.lili.modules.page.entity.dos.PageData
;
import
cn.lili.modules.page.entity.dto.PageDataDTO
;
import
cn.lili.modules.page.entity.vos.PageDataListVO
;
...
...
This diff is collapsed.
Click to expand it.
manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java
+
1
-
0
View file @
0dd8488e
...
...
@@ -10,6 +10,7 @@ import cn.lili.common.utils.StringUtils;
import
cn.lili.common.vo.PageVO
;
import
cn.lili.common.vo.ResultMessage
;
import
cn.lili.common.vo.SearchVO
;
import
cn.lili.modules.system.aspect.annotation.DemoSite
;
import
cn.lili.modules.permission.entity.dos.AdminUser
;
import
cn.lili.modules.permission.entity.dto.AdminUserDTO
;
import
cn.lili.modules.permission.entity.vo.AdminUserVO
;
...
...
This diff is collapsed.
Click to expand it.
manager-api/src/main/java/cn/lili/controller/permission/MenuManagerController.java
+
1
-
0
View file @
0dd8488e
...
...
@@ -2,6 +2,7 @@ package cn.lili.controller.permission;
import
cn.lili.common.enums.ResultUtil
;
import
cn.lili.common.vo.ResultMessage
;
import
cn.lili.modules.system.aspect.annotation.DemoSite
;
import
cn.lili.modules.permission.entity.dos.Menu
;
import
cn.lili.modules.permission.entity.dto.MenuSearchParams
;
import
cn.lili.modules.permission.entity.vo.MenuVO
;
...
...
This diff is collapsed.
Click to expand it.
manager-api/src/main/java/cn/lili/controller/setting/HotWordsManagerController.java
0 → 100755
+
44
-
0
View file @
0dd8488e
package
cn.lili.controller.setting
;
import
cn.lili.common.enums.ResultUtil
;
import
cn.lili.common.vo.ResultMessage
;
import
cn.lili.modules.search.entity.dto.HotWordsDTO
;
import
cn.lili.modules.search.service.EsGoodsSearchService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 管理端,app版本控制器
*
* @author Chopper
* @since 2018-07-04 21:50:52
*/
@RestController
@Api
(
tags
=
"管理端,系统设置扩展接口"
)
@RequestMapping
(
"/manager/hotwords"
)
public
class
HotWordsManagerController
{
@Autowired
private
EsGoodsSearchService
esGoodsSearchService
;
@ApiOperation
(
value
=
"获取热词"
)
@GetMapping
public
ResultMessage
getHotWords
()
{
return
ResultUtil
.
data
(
esGoodsSearchService
.
getHotWords
(
0
,
99
));
}
@ApiOperation
(
value
=
"设置热词"
)
@PostMapping
public
ResultMessage
paymentForm
(
@Validated
HotWordsDTO
hotWords
)
{
esGoodsSearchService
.
setHotWords
(
hotWords
);
return
ResultUtil
.
success
();
}
}
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Write
Preview
Supports
Markdown
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