记得上下班打卡 | 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
019cd14f
Commit
019cd14f
authored
Jan 10, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
魔方和金刚位修改
parent
d293d9ea
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
394 additions
and
16 deletions
+394
-16
GoblinFrontCubeParam.java
.../liquidnet/service/goblin/param/GoblinFrontCubeParam.java
+91
-0
GoblinFrontCubeController.java
...controller/zhengzai/goblin/GoblinFrontCubeController.java
+64
-0
GoblinFrontNavigationController.java
...ller/zhengzai/goblin/GoblinFrontNavigationController.java
+25
-11
IGoblinFrontCubeService.java
...dmin/zhengzai/goblin/service/IGoblinFrontCubeService.java
+16
-0
GoblinFrontCubeServiceImpl.java
...ngzai/goblin/service/impl/GoblinFrontCubeServiceImpl.java
+81
-0
GoblinFrontNavigationServiceImpl.java
...goblin/service/impl/GoblinFrontNavigationServiceImpl.java
+28
-5
GoblinFrontCube.java
.../com/liquidnet/service/goblin/entity/GoblinFrontCube.java
+73
-0
GoblinFrontCubeMapper.java
...iquidnet/service/goblin/mapper/GoblinFrontCubeMapper.java
+16
-0
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinFrontCubeParam.java
0 → 100644
View file @
019cd14f
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.service.goblin.entity.GoblinGoods
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
*
* </p>
*
* @author liquidnet
* @since 2022-01-07
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
GoblinFrontCubeParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"mid"
,
type
=
IdType
.
AUTO
)
private
Long
mid
;
/**
* 魔方id
*/
@ApiModelProperty
(
value
=
"魔方id"
)
private
String
cubeId
;
/**
* 1、一行一个2一行二个3一行三个4上一下三
*/
@ApiModelProperty
(
value
=
"1、一行一个2一行二个3一行三个4上一下三"
)
private
Integer
rowType
;
/**
* 1、单商品2、合集
*/
@ApiModelProperty
(
value
=
"1、单商品2、合集"
)
private
Integer
pageType
;
/**
* 商品名称
*/
@ApiModelProperty
(
value
=
"商品名称"
)
private
String
spuName
;
/**
* 商品id
*/
@ApiModelProperty
(
value
=
"商品id"
)
private
String
spuId
;
/**
* 推荐文案
*/
@ApiModelProperty
(
value
=
"推荐文案1"
)
private
String
informationA
;
@ApiModelProperty
(
value
=
"推荐文案2"
)
private
String
informationB
;
@ApiModelProperty
(
value
=
"推荐文案3"
)
private
String
informationC
;
@ApiModelProperty
(
value
=
"推荐文案4"
)
private
String
informationD
;
/**
* 合集id
*/
@ApiModelProperty
(
value
=
"合集ids"
)
private
String
compilationsId
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
createTime
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
updateTime
;
/**
* spu
*/
@ApiModelProperty
(
value
=
"spu信息"
)
private
GoblinGoods
goblinGoods
;
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinFrontCubeController.java
0 → 100644
View file @
019cd14f
package
com
.
liquidnet
.
client
.
admin
.
web
.
controller
.
zhengzai
.
goblin
;
import
com.liquidnet.client.admin.common.core.controller.BaseController
;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.impl.GoblinFrontCubeServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 前端控制器
* </p>
*
* @author liquidnet
* @since 2022-01-07
*/
@Api
(
tags
=
"魔方管理"
)
@RestController
@RequestMapping
(
"/goblin-front-cube"
)
public
class
GoblinFrontCubeController
extends
BaseController
{
@Autowired
GoblinFrontCubeServiceImpl
goblinFrontCubeService
;
/**
* 获取魔方列表
*/
@PostMapping
(
"list"
)
@ApiOperation
(
value
=
"list"
)
@ResponseBody
public
AjaxResult
list
()
{
return
AjaxResult
.
success
(
goblinFrontCubeService
.
listGoblinFrontCubeParam
());
}
/* *//***
* @author zhangfuxin
* @Description: 修改或者删除魔方
* @date 2022/1/7 下午6:30
*//*
@PostMapping("updateOrCreate")
@ApiOperation(value = "修改或者删除魔方")
@ResponseBody
public AjaxResult updateOrCreate(@RequestBody List<GoblinFrontBannerBuildParam> list) {
List<GoblinFrontBanner> goblinFrontBannerList=new ArrayList<>();
for(GoblinFrontBannerBuildParam goblinFrontBannerBuildParam1:list){
GoblinFrontBanner goblinFrontBanner=new GoblinFrontBanner();
BeanUtils.copyProperties(goblinFrontBannerBuildParam1,goblinFrontBanner);
goblinFrontBannerList.add(goblinFrontBanner);
}
logger.info("修改banner{}", JSON.toJSONString(list));
boolean result=goblinFrontBannerService.update(goblinFrontBannerList);
if (result ) {
return success("操作成功");
} else {
return error("操作失败");
}
}
*/
}
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 @
019cd14f
...
...
@@ -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>
* 首页导航栏
...
...
@@ -36,23 +39,28 @@ public class GoblinFrontNavigationController extends BaseController {
@PostMapping
(
"create"
)
@ApiOperation
(
value
=
"增加金刚位"
)
@ResponseBody
public
AjaxResult
create
(
@RequestBody
GoblinFrontNavigationBuildParam
goblinFrontNavigationBuildParam
)
{
GoblinFrontNavigation
goblinFrontNavigation
=
new
GoblinFrontNavigation
();
BeanUtils
.
copyProperties
(
goblinFrontNavigationBuildParam
,
goblinFrontNavigation
);
logger
.
info
(
"增加金刚位{}"
,
JSON
.
toJSONString
(
goblinFrontNavigation
));
boolean
result
=
goblinFrontNavigationService
.
create
(
goblinFrontNavigation
);
public
AjaxResult
create
(
@RequestBody
List
<
GoblinFrontNavigationBuildParam
>
list
)
{
ArrayList
<
GoblinFrontNavigation
>
arrayList
=
new
ArrayList
();
for
(
GoblinFrontNavigationBuildParam
goblinFrontNavigationBuildParam1:
list
){
GoblinFrontNavigation
goblinFrontNavigation
=
new
GoblinFrontNavigation
();
BeanUtils
.
copyProperties
(
goblinFrontNavigationBuildParam1
,
goblinFrontNavigation
);
arrayList
.
add
(
goblinFrontNavigation
);
}
logger
.
info
(
"增加金刚位{}"
,
JSON
.
toJSONString
(
list
));
boolean
result
=
goblinFrontNavigationService
.
createOrUpdate
(
arrayList
);
if
(
result
)
{
return
success
(
"操作成功"
);
}
else
{
return
error
(
"操作失败"
);
}
}
/**
/*
*/
/**
* @author zhangfuxin
* @Description:修改金刚位
* @date 2021/12/28 上午11:23
*/
*/
/*
@PostMapping("update")
@ApiOperation(value = "修改金刚位")
@ResponseBody
...
...
@@ -66,7 +74,7 @@ public class GoblinFrontNavigationController extends BaseController {
} else {
return error("操作失败");
}
}
}
*/
/**
* 删除金刚位
*/
...
...
@@ -87,7 +95,7 @@ public class GoblinFrontNavigationController extends BaseController {
/**
* 分页金刚位
*/
*/
/*
@PostMapping("page")
@ApiOperation(value = "分页")
@ResponseBody
...
...
@@ -96,8 +104,14 @@ public class GoblinFrontNavigationController extends BaseController {
BeanUtils.copyProperties(goblinFrontNavigationBuildParam,goblinFrontNavigation);
logger.info("分页金刚位{}", JSON.toJSONString(goblinFrontNavigation));
return AjaxResult.success(goblinFrontNavigationService.page(pageSize,pageNumber,null));
}*/
@PostMapping
(
"list"
)
@ApiOperation
(
value
=
"list"
)
@ResponseBody
public
AjaxResult
list
(
)
{
return
AjaxResult
.
success
(
goblinFrontNavigationService
.
listGoblinFrontNavigation
());
}
/**
* @author zhangfuxin
* @Description:查看金刚位
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/IGoblinFrontCubeService.java
0 → 100644
View file @
019cd14f
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
;
import
com.liquidnet.service.goblin.entity.GoblinFrontCube
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 服务类
* </p>
*
* @author liquidnet
* @since 2022-01-07
*/
public
interface
IGoblinFrontCubeService
extends
IService
<
GoblinFrontCube
>
{
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/impl/GoblinFrontCubeServiceImpl.java
0 → 100644
View file @
019cd14f
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
.
impl
;
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.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontCubeService
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.goblin.entity.GoblinFrontCube
;
import
com.liquidnet.service.goblin.entity.GoblinGoods
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontCubeMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinGoodsMapper
;
import
com.liquidnet.service.goblin.param.GoblinFrontCubeParam
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <p>
* 服务实现类
* </p>
*
* @author liquidnet
* @since 2022-01-07
*/
@Service
public
class
GoblinFrontCubeServiceImpl
extends
ServiceImpl
<
GoblinFrontCubeMapper
,
GoblinFrontCube
>
implements
IGoblinFrontCubeService
{
@Autowired
private
MongoTemplate
mongoTemplate
;
@Autowired
GoblinFrontCubeMapper
goblinFrontCubeMapper
;
@Autowired
private
RedisDataSourceUtil
redisDataSourceUtil
;
@Autowired
GoblinGoodsMapper
goblinGoodsMapper
;
public
boolean
create
(
GoblinFrontCube
goblinFrontCube
){
goblinFrontCube
.
setCreateTime
(
LocalDateTime
.
now
());
//设置bannerid
goblinFrontCube
.
setCubeId
(
IDGenerator
.
nextSnowId
());
//增加 banner
goblinFrontCubeMapper
.
insert
(
goblinFrontCube
);
return
true
;
}
public
boolean
updateOrCreate
(
GoblinFrontCube
goblinFrontCube
)
{
if
(
goblinFrontCube
.
getMid
()
==
0
)
{
this
.
create
(
goblinFrontCube
);
}
else
{
goblinFrontCube
.
setUpdateTime
(
LocalDateTime
.
now
());
//数据库修改
goblinFrontCubeMapper
.
updateById
(
goblinFrontCube
);
}
return
true
;
}
public
List
<
GoblinFrontCubeParam
>
listGoblinFrontCubeParam
(){
LambdaQueryWrapper
<
GoblinFrontCube
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontCube
.
class
);
queryWrapper
.
ne
(
GoblinFrontCube:
:
getDelTag
,
1
);
List
<
GoblinFrontCube
>
list
=
goblinFrontCubeMapper
.
selectList
(
queryWrapper
);
List
<
GoblinFrontCubeParam
>
list1
=
new
ArrayList
<>();
for
(
GoblinFrontCube
goblinFrontCube:
list
){
//找到 spu详情
LambdaQueryWrapper
<
GoblinGoods
>
queryWrappers
=
Wrappers
.
lambdaQuery
(
GoblinGoods
.
class
);
queryWrappers
.
ne
(
GoblinGoods:
:
getDelFlg
,
"1"
);
queryWrappers
.
eq
(
GoblinGoods:
:
getSpuId
,
goblinFrontCube
.
getSpuId
());
List
<
GoblinGoods
>
goodsList
=
goblinGoodsMapper
.
selectList
(
queryWrappers
);
GoblinFrontCubeParam
goblinFrontCubeParam
=
new
GoblinFrontCubeParam
();
BeanUtils
.
copyProperties
(
goblinFrontCube
,
goblinFrontCubeParam
);
goblinFrontCubeParam
.
setGoblinGoods
(
goodsList
.
get
(
0
));
list1
.
add
(
goblinFrontCubeParam
);
}
return
list1
;
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/impl/GoblinFrontNavigationServiceImpl.java
View file @
019cd14f
...
...
@@ -13,7 +13,9 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.entity.GoblinFrontNavigation
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontNavigationMapper
;
import
com.liquidnet.service.goblin.param.GoblinFrontNavigationBuildParam
;
import
com.mongodb.BasicDBObject
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
...
...
@@ -21,6 +23,7 @@ import org.springframework.data.mongodb.core.query.Query;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -57,10 +60,17 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_NAVIGATION,list);*/
return
true
;
}
public
boolean
update
(
GoblinFrontNavigation
goblinFrontNavigation
){
goblinFrontNavigation
.
setUpdateTime
(
LocalDateTime
.
now
());
//数据库修改
goblinFrontNavigationMapper
.
updateById
(
goblinFrontNavigation
);
public
boolean
createOrUpdate
(
List
<
GoblinFrontNavigation
>
list
){
for
(
GoblinFrontNavigation
goblinFrontNavigation:
list
){
if
(
goblinFrontNavigation
.
getMid
()>
0
){
goblinFrontNavigation
.
setUpdateTime
(
LocalDateTime
.
now
());
//数据库修改
goblinFrontNavigationMapper
.
updateById
(
goblinFrontNavigation
);
}
else
{
this
.
create
(
goblinFrontNavigation
);
}
}
/*//mongodb修改
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontNavigation)));
mongoTemplate.getCollection(GoblinFrontNavigation.class.getSimpleName()).updateOne(
...
...
@@ -82,7 +92,7 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
public
boolean
delete
(
Long
id
){
GoblinFrontNavigation
goblinFrontNavigation
=
goblinFrontNavigationMapper
.
selectById
(
id
);
goblinFrontNavigation
.
setDelTag
(
1
);
this
.
update
(
goblinFrontNavigation
);
//
this.update(goblinFrontNavigation);
return
true
;
}
public
PageInfo
<
GoblinFrontNavigation
>
page
(
int
pageSize
,
int
pageNumber
,
GoblinFrontNavigation
goblinFrontNavigation
)
{
...
...
@@ -98,6 +108,19 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
}
return
pageInfoTmp
;
}
public
List
<
GoblinFrontNavigationBuildParam
>
listGoblinFrontNavigation
()
{
LambdaQueryWrapper
<
GoblinFrontNavigation
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontNavigation
.
class
);
queryWrapper
.
ne
(
GoblinFrontNavigation:
:
getDelTag
,
1
);
queryWrapper
.
orderByDesc
(
GoblinFrontNavigation:
:
getCreateTime
);
List
<
GoblinFrontNavigation
>
list
=
goblinFrontNavigationMapper
.
selectList
(
queryWrapper
);
ArrayList
<
GoblinFrontNavigationBuildParam
>
list1
=
new
ArrayList
<>();
for
(
GoblinFrontNavigation
goblinFrontNavigation:
list
){
GoblinFrontNavigationBuildParam
goblinFrontNavigationBuildParam
=
new
GoblinFrontNavigationBuildParam
();
BeanUtils
.
copyProperties
(
goblinFrontNavigation
,
goblinFrontNavigationBuildParam
);
list1
.
add
(
goblinFrontNavigationBuildParam
);
}
return
list1
;
}
public
boolean
online
(){
LambdaQueryWrapper
<
GoblinFrontNavigation
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontNavigation
.
class
);
...
...
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinFrontCube.java
0 → 100644
View file @
019cd14f
package
com
.
liquidnet
.
service
.
goblin
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
*
* </p>
*
* @author liquidnet
* @since 2022-01-07
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
GoblinFrontCube
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"mid"
,
type
=
IdType
.
AUTO
)
private
Long
mid
;
/**
* 魔方id
*/
private
String
cubeId
;
/**
* 1、一行一个2一行二个3一行三个4上一下三
*/
private
Integer
rowType
;
/**
* 1、单商品2、合集
*/
private
Integer
pageType
;
/**
* 商品名称
*/
private
String
spuName
;
/**
* 商品id
*/
private
String
spuId
;
/**
* 推荐文案
*/
private
String
information
;
/**
* 合集id
*/
private
String
compilationsId
;
private
LocalDateTime
createTime
;
private
LocalDateTime
updateTime
;
/**
* 0未删除1已删除
*/
private
Integer
delTag
;
}
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/mapper/GoblinFrontCubeMapper.java
0 → 100644
View file @
019cd14f
package
com
.
liquidnet
.
service
.
goblin
.
mapper
;
import
com.liquidnet.service.goblin.entity.GoblinFrontCube
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author liquidnet
* @since 2022-01-07
*/
public
interface
GoblinFrontCubeMapper
extends
BaseMapper
<
GoblinFrontCube
>
{
}
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