记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
39c4ad8c
Commit
39c4ad8c
authored
Dec 28, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_goblin' into dev_goblin
parents
fd4a0fd5
467d3f8d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
34 deletions
+68
-34
GoblinFrontNavigationController.java
...ller/zhengzai/goblin/GoblinFrontNavigationController.java
+1
-1
GoblinFrontBannerServiceImpl.java
...gzai/goblin/service/imp/GoblinFrontBannerServiceImpl.java
+19
-16
GoblinFrontNavigationServiceImpl.java
.../goblin/service/imp/GoblinFrontNavigationServiceImpl.java
+48
-17
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinFrontNavigationController.java
View file @
39c4ad8c
...
@@ -70,7 +70,7 @@ public class GoblinFrontNavigationController extends BaseController {
...
@@ -70,7 +70,7 @@ public class GoblinFrontNavigationController extends BaseController {
@ResponseBody
@ResponseBody
public
AjaxResult
delete
(
@RequestBody
GoblinFrontNavigation
goblinFrontNavigation
)
{
public
AjaxResult
delete
(
@RequestBody
GoblinFrontNavigation
goblinFrontNavigation
)
{
logger
.
info
(
"删除金刚位{}"
,
JSON
.
toJSONString
(
goblinFrontNavigation
));
logger
.
info
(
"删除金刚位{}"
,
JSON
.
toJSONString
(
goblinFrontNavigation
));
boolean
result
=
goblinFrontNavigationService
.
delte
(
goblinFrontNavigation
.
getMid
());
boolean
result
=
goblinFrontNavigationService
.
del
e
te
(
goblinFrontNavigation
.
getMid
());
if
(
result
)
{
if
(
result
)
{
return
success
(
"操作成功"
);
return
success
(
"操作成功"
);
}
else
{
}
else
{
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/imp/GoblinFrontBannerServiceImpl.java
View file @
39c4ad8c
...
@@ -16,6 +16,7 @@ import com.liquidnet.commons.lang.util.IDGenerator;
...
@@ -16,6 +16,7 @@ import com.liquidnet.commons.lang.util.IDGenerator;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.liquidnet.service.goblin.entity.GoblinFrontNavigation
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontBannerMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontBannerMapper
;
import
com.liquidnet.service.kylin.dao.BannerDetailsListDao
;
import
com.liquidnet.service.kylin.dao.BannerDetailsListDao
;
import
com.liquidnet.service.kylin.dto.param.BannersSearchParam
;
import
com.liquidnet.service.kylin.dto.param.BannersSearchParam
;
...
@@ -58,18 +59,11 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
...
@@ -58,18 +59,11 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
//mongo db增加
//mongo db增加
mongoTemplate
.
save
(
goblinFrontBanner
,
GoblinFrontBanner
.
class
.
getSimpleName
());
mongoTemplate
.
save
(
goblinFrontBanner
,
GoblinFrontBanner
.
class
.
getSimpleName
());
//redis 增加
//redis 增加
if
(
redisDataSourceUtil
.
getRedisGoblinUtil
().
hasKey
(
GoblinRedisConst
.
FRONT_BANNER
)){
LambdaQueryWrapper
<
GoblinFrontBanner
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontBanner
.
class
);
//从redis里面取出
queryWrapper
.
ne
(
GoblinFrontBanner:
:
getDelTag
,
1
);
ArrayList
<
GoblinFrontBanner
>
list
=
(
ArrayList
<
GoblinFrontBanner
>)
redisDataSourceUtil
.
getRedisGoblinUtil
().
get
(
GoblinRedisConst
.
FRONT_BANNER
);
queryWrapper
.
orderByDesc
(
GoblinFrontBanner:
:
getIndexs
);
list
.
add
(
goblinFrontBanner
);
List
<
GoblinFrontBanner
>
list
=
goblinFrontBannerMapper
.
selectList
(
queryWrapper
);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_BANNER
,
list
);
}
else
{
//创建一个list
ArrayList
<
Object
>
list
=
CollectionUtil
.
arrayListObject
();
list
.
add
(
goblinFrontBanner
);
//redis 没有这个键
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_BANNER
,
list
);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_BANNER
,
list
);
}
return
true
;
return
true
;
}
}
/***
/***
...
@@ -87,7 +81,13 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
...
@@ -87,7 +81,13 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
orderObject
orderObject
);
);
//redis 修改
//redis 修改
if
(
redisDataSourceUtil
.
getRedisGoblinUtil
().
hasKey
(
GoblinRedisConst
.
FRONT_BANNER
+
"0"
)){
//从数据库中查出来,从新塞进去
LambdaQueryWrapper
<
GoblinFrontBanner
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontBanner
.
class
);
queryWrapper
.
ne
(
GoblinFrontBanner:
:
getDelTag
,
1
);
queryWrapper
.
orderByDesc
(
GoblinFrontBanner:
:
getIndexs
);
List
<
GoblinFrontBanner
>
list
=
goblinFrontBannerMapper
.
selectList
(
queryWrapper
);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_BANNER
,
list
);
/* if(redisDataSourceUtil.getRedisGoblinUtil().hasKey(GoblinRedisConst.FRONT_BANNER+"0")){
ArrayList<GoblinFrontBanner> list = (ArrayList<GoblinFrontBanner>) redisDataSourceUtil.getRedisGoblinUtil().get(GoblinRedisConst.FRONT_BANNER+0);
ArrayList<GoblinFrontBanner> list = (ArrayList<GoblinFrontBanner>) redisDataSourceUtil.getRedisGoblinUtil().get(GoblinRedisConst.FRONT_BANNER+0);
list= (ArrayList<GoblinFrontBanner>) list.stream().map(goblinFrontBanner1->{
list= (ArrayList<GoblinFrontBanner>) list.stream().map(goblinFrontBanner1->{
if(goblinFrontBanner1.getBannerId().equals(goblinFrontBanner.getBannerId())){
if(goblinFrontBanner1.getBannerId().equals(goblinFrontBanner.getBannerId())){
...
@@ -96,7 +96,7 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
...
@@ -96,7 +96,7 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
return goblinFrontBanner1;
return goblinFrontBanner1;
}).collect(Collectors.toList());
}).collect(Collectors.toList());
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_BANNER+"0",list);
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_BANNER+"0",list);
}
}
*/
return
true
;
return
true
;
}
}
/**
/**
...
@@ -113,7 +113,10 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
...
@@ -113,7 +113,10 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
* @date 2021/12/27 下午4:36
* @date 2021/12/27 下午4:36
*/
*/
public
boolean
delte
(
Long
id
){
public
boolean
delte
(
Long
id
){
//数据库
GoblinFrontBanner
goblinFrontBanner
=
goblinFrontBannerMapper
.
selectById
(
id
);
goblinFrontBanner
.
setDelTag
(
1
);
this
.
update
(
goblinFrontBanner
);
/* //数据库
goblinFrontBannerMapper.deleteById(id);
goblinFrontBannerMapper.deleteById(id);
//mongodb 删除
//mongodb 删除
mongoTemplate.remove(Query.query(Criteria.where("mid").is(id)), GoblinFrontBanner.class, GoblinFrontBanner.class.getSimpleName());
mongoTemplate.remove(Query.query(Criteria.where("mid").is(id)), GoblinFrontBanner.class, GoblinFrontBanner.class.getSimpleName());
...
@@ -127,7 +130,7 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
...
@@ -127,7 +130,7 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
return goblinFrontBanner1;
return goblinFrontBanner1;
}).collect(Collectors.toList());
}).collect(Collectors.toList());
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_BANNER+"0",list);
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_BANNER+"0",list);
}
}
*/
return
true
;
return
true
;
}
}
/**
/**
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/imp/GoblinFrontNavigationServiceImpl.java
View file @
39c4ad8c
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
.
imp
;
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
.
imp
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontNavigationService
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontNavigationService
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.liquidnet.service.goblin.entity.GoblinFrontNavigation
;
import
com.liquidnet.service.goblin.entity.GoblinFrontNavigation
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontBannerMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontBannerMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontNavigationMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontNavigationMapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.mongodb.BasicDBObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* <p>
* <p>
...
@@ -31,7 +40,7 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
...
@@ -31,7 +40,7 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
@Autowired
@Autowired
private
MongoTemplate
mongoTemplate
;
private
MongoTemplate
mongoTemplate
;
@Autowired
@Autowired
GoblinFrontNavigationMapper
goblinFrontNavigationMapper
;
private
GoblinFrontNavigationMapper
goblinFrontNavigationMapper
;
@Autowired
@Autowired
private
RedisDataSourceUtil
redisDataSourceUtil
;
private
RedisDataSourceUtil
redisDataSourceUtil
;
...
@@ -43,30 +52,52 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
...
@@ -43,30 +52,52 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
//mongo db增加
//mongo db增加
mongoTemplate
.
save
(
goblinFrontNavigation
,
GoblinFrontNavigation
.
class
.
getSimpleName
());
mongoTemplate
.
save
(
goblinFrontNavigation
,
GoblinFrontNavigation
.
class
.
getSimpleName
());
//redis增加
//redis增加
if
(
redisDataSourceUtil
.
getRedisGoblinUtil
().
hasKey
(
GoblinRedisConst
.
FRONT_NAVIGATION
)){
LambdaQueryWrapper
<
GoblinFrontNavigation
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontNavigation
.
class
);
//从redis里面取出
queryWrapper
.
ne
(
GoblinFrontNavigation:
:
getDelTag
,
1
);
ArrayList
<
GoblinFrontNavigation
>
list
=
(
ArrayList
<
GoblinFrontNavigation
>)
redisDataSourceUtil
.
getRedisGoblinUtil
().
get
(
GoblinRedisConst
.
FRONT_BANNER
);
queryWrapper
.
orderByDesc
(
GoblinFrontNavigation:
:
getIndexs
);
list
.
add
(
goblinFrontNavigation
);
List
<
GoblinFrontNavigation
>
list
=
goblinFrontNavigationMapper
.
selectList
(
queryWrapper
);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_NAVIGATION
,
list
);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_NAVIGATION
,
list
);
}
else
{
//创建一个list
ArrayList
<
Object
>
list
=
CollectionUtil
.
arrayListObject
();
list
.
add
(
goblinFrontNavigation
);
//redis 没有这个键
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_NAVIGATION
,
list
);
}
return
true
;
return
true
;
}
}
public
boolean
update
(
GoblinFrontNavigation
goblinFrontBanner
){
public
boolean
update
(
GoblinFrontNavigation
goblinFrontNavigation
){
//数据库修改
goblinFrontNavigationMapper
.
updateById
(
goblinFrontNavigation
);
//mongodb修改
BasicDBObject
orderObject
=
new
BasicDBObject
(
"$set"
,
JSON
.
parse
(
JsonUtils
.
toJson
(
goblinFrontNavigation
)));
mongoTemplate
.
getCollection
(
GoblinFrontNavigation
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"navigationId"
).
is
(
goblinFrontNavigation
.
getNavigationId
())).
getQueryObject
(),
orderObject
);
//redis 修改
//从数据库中查出来,从新塞进去
LambdaQueryWrapper
<
GoblinFrontNavigation
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontNavigation
.
class
);
queryWrapper
.
ne
(
GoblinFrontNavigation:
:
getDelTag
,
1
);
queryWrapper
.
orderByDesc
(
GoblinFrontNavigation:
:
getIndexs
);
List
<
GoblinFrontNavigation
>
list
=
goblinFrontNavigationMapper
.
selectList
(
queryWrapper
);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_NAVIGATION
,
list
);
return
true
;
return
true
;
}
}
public
GoblinFrontNavigation
getOne
(
Long
id
){
public
GoblinFrontNavigation
getOne
(
Long
id
){
return
null
;
return
goblinFrontNavigationMapper
.
selectById
(
id
)
;
}
}
public
boolean
delte
(
Long
id
){
public
boolean
delete
(
Long
id
){
GoblinFrontNavigation
goblinFrontNavigation
=
goblinFrontNavigationMapper
.
selectById
(
id
);
goblinFrontNavigation
.
setDelTag
(
1
);
this
.
update
(
goblinFrontNavigation
);
return
true
;
return
true
;
}
}
public
PageInfo
<
GoblinFrontNavigation
>
page
(
int
pageSize
,
int
pageNumber
,
GoblinFrontNavigation
goblinFrontNavigation
)
{
public
PageInfo
<
GoblinFrontNavigation
>
page
(
int
pageSize
,
int
pageNumber
,
GoblinFrontNavigation
goblinFrontNavigation
)
{
return
null
;
PageInfo
<
GoblinFrontNavigation
>
pageInfoTmp
=
null
;
try
{
PageHelper
.
startPage
(
pageNumber
,
pageSize
);
LambdaQueryWrapper
<
GoblinFrontNavigation
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontNavigation
.
class
);
queryWrapper
.
orderByDesc
(
GoblinFrontNavigation:
:
getCreateTime
);
List
<
GoblinFrontNavigation
>
list
=
goblinFrontNavigationMapper
.
selectList
(
queryWrapper
);
pageInfoTmp
=
new
PageInfo
(
list
);
}
catch
(
Exception
e
)
{
return
new
PageInfo
();
}
}
return
pageInfoTmp
;
}
}
}
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