记得上下班打卡 | 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
6c7d1c1f
Commit
6c7d1c1f
authored
Jan 07, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改banner问题
parent
66c67dd2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
15 deletions
+44
-15
GoblinFrontBannerController.java
...ntroller/zhengzai/goblin/GoblinFrontBannerController.java
+20
-7
GoblinFrontBannerServiceImpl.java
...zai/goblin/service/impl/GoblinFrontBannerServiceImpl.java
+24
-8
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinFrontBannerController.java
View file @
6c7d1c1f
...
...
@@ -13,6 +13,9 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <p>
* 轮播图 前端控制器
...
...
@@ -61,14 +64,18 @@ public class GoblinFrontBannerController extends BaseController {
}
}
@PostMapping
(
"update"
)
@ApiOperation
(
value
=
"修改banner"
)
@PostMapping
(
"update
OrCreate
"
)
@ApiOperation
(
value
=
"修改
或者增加
banner"
)
@ResponseBody
public
AjaxResult
update
(
@RequestBody
GoblinFrontBannerBuildParam
goblinFrontBannerBuildParam
)
{
public
AjaxResult
updateOrCreate
(
@RequestBody
List
<
GoblinFrontBannerBuildParam
>
list
)
{
List
<
GoblinFrontBanner
>
goblinFrontBannerList
=
new
ArrayList
<>();
for
(
GoblinFrontBannerBuildParam
goblinFrontBannerBuildParam1:
list
){
GoblinFrontBanner
goblinFrontBanner
=
new
GoblinFrontBanner
();
BeanUtils
.
copyProperties
(
goblinFrontBannerBuildParam
,
goblinFrontBanner
);
logger
.
info
(
"修改banner{}"
,
JSON
.
toJSONString
(
goblinFrontBanner
));
boolean
result
=
goblinFrontBannerService
.
update
(
goblinFrontBanner
);
BeanUtils
.
copyProperties
(
goblinFrontBannerBuildParam1
,
goblinFrontBanner
);
goblinFrontBannerList
.
add
(
goblinFrontBanner
);
}
logger
.
info
(
"修改banner{}"
,
JSON
.
toJSONString
(
list
));
boolean
result
=
goblinFrontBannerService
.
update
(
goblinFrontBannerList
);
if
(
result
)
{
return
success
(
"操作成功"
);
}
else
{
...
...
@@ -108,6 +115,12 @@ public class GoblinFrontBannerController extends BaseController {
logger
.
info
(
"分页banner{}"
,
JSON
.
toJSONString
(
goblinFrontBanner
));
return
AjaxResult
.
success
(
goblinFrontBannerService
.
bannerPage
(
pageSize
,
pageNumber
,
null
));
}
@PostMapping
(
"list"
)
@ApiOperation
(
value
=
"list"
)
@ResponseBody
public
AjaxResult
page
(
@RequestParam
(
name
=
"type"
,
required
=
true
)
String
type
)
{
return
AjaxResult
.
success
(
goblinFrontBannerService
.
listGoblinFrontBanner
(
type
));
}
@PostMapping
(
"online"
)
@ApiOperation
(
value
=
"上线"
)
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/impl/GoblinFrontBannerServiceImpl.java
View file @
6c7d1c1f
...
...
@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontBannerService
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
...
...
@@ -61,10 +60,18 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
* @Description: 修改
* @date 2021/12/27 下午4:03
*/
public
boolean
update
(
GoblinFrontBanner
goblinFrontBanner
){
public
boolean
update
(
List
<
GoblinFrontBanner
>
list
){
for
(
GoblinFrontBanner
goblinFrontBanner:
list
){
if
(
goblinFrontBanner
.
getMid
()==
0
){
this
.
create
(
goblinFrontBanner
);
}
else
{
goblinFrontBanner
.
setUpdateTime
(
LocalDateTime
.
now
());
//数据库修改
goblinFrontBannerMapper
.
updateById
(
goblinFrontBanner
);
}
}
/* //mongodb修改
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontBanner)));
mongoTemplate.getCollection(GoblinFrontBanner.class.getSimpleName()).updateOne(
...
...
@@ -96,7 +103,7 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
public
boolean
delte
(
Long
id
){
GoblinFrontBanner
goblinFrontBanner
=
goblinFrontBannerMapper
.
selectById
(
id
);
goblinFrontBanner
.
setDelTag
(
1
);
this
.
update
(
goblinFrontBanner
);
//
this.update(goblinFrontBanner);
return
true
;
}
/**
...
...
@@ -107,9 +114,9 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
public
PageInfo
<
GoblinFrontBanner
>
bannerPage
(
int
pageSize
,
int
pageNumber
,
GoblinFrontBanner
goblinFrontBanner
)
{
PageInfo
<
GoblinFrontBanner
>
pageInfoTmp
=
null
;
try
{
PageHelper
.
startPage
(
pageNumber
,
pageSize
);
//
PageHelper.startPage(pageNumber, pageSize);
LambdaQueryWrapper
<
GoblinFrontBanner
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontBanner
.
class
);
queryWrapper
.
orderByDesc
(
GoblinFrontBanner:
:
get
CreateTime
);
queryWrapper
.
orderByDesc
(
GoblinFrontBanner:
:
get
Indexs
);
List
<
GoblinFrontBanner
>
list
=
goblinFrontBannerMapper
.
selectList
(
queryWrapper
);
pageInfoTmp
=
new
PageInfo
(
list
);
}
catch
(
Exception
e
)
{
...
...
@@ -117,6 +124,15 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
}
return
pageInfoTmp
;
}
public
List
<
GoblinFrontBanner
>
listGoblinFrontBanner
(
String
type
)
{
//banner_type 1、首页顶部位置2、首页中部位置
// PageHelper.startPage(pageNumber, pageSize);
LambdaQueryWrapper
<
GoblinFrontBanner
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontBanner
.
class
);
queryWrapper
.
eq
(
GoblinFrontBanner:
:
getBannerType
,
type
);
queryWrapper
.
orderByAsc
(
GoblinFrontBanner:
:
getIndexs
);
List
<
GoblinFrontBanner
>
list
=
goblinFrontBannerMapper
.
selectList
(
queryWrapper
);
return
list
;
}
public
boolean
online
(){
//banner
LambdaQueryWrapper
<
GoblinFrontBanner
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontBanner
.
class
);
...
...
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