属性属性组
parent
7310116a85
commit
02c5be6c3d
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
@ -28,12 +28,12 @@ spring:
|
|||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 127.0.0.1:8718
|
||||
dashboard: 101.34.248.9:8718
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
dataId: sentinel-muyu-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -44,7 +44,7 @@ public class BrandInfo extends BaseEntity {
|
|||
*/
|
||||
@Excel(name = "品牌名称")
|
||||
@ApiModelProperty(name = "品牌名称", value = "品牌名称", required = true)
|
||||
private String nam;
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* LOGO
|
||||
|
@ -72,7 +72,7 @@ public class BrandInfo extends BaseEntity {
|
|||
*/
|
||||
public static BrandInfo queryBuild(BrandInfoQueryReq brandInfoQueryReq) {
|
||||
return BrandInfo.builder()
|
||||
.nam(brandInfoQueryReq.getNam())
|
||||
.name(brandInfoQueryReq.getName())
|
||||
.logo(brandInfoQueryReq.getLogo())
|
||||
.start(brandInfoQueryReq.getStart())
|
||||
.introduction(brandInfoQueryReq.getIntroduction())
|
||||
|
@ -84,7 +84,7 @@ public class BrandInfo extends BaseEntity {
|
|||
*/
|
||||
public static BrandInfo saveBuild(BrandInfoSaveReq brandInfoSaveReq) {
|
||||
return BrandInfo.builder()
|
||||
.nam(brandInfoSaveReq.getNam())
|
||||
.name(brandInfoSaveReq.getName())
|
||||
.logo(brandInfoSaveReq.getLogo())
|
||||
.start(brandInfoSaveReq.getStart())
|
||||
.introduction(brandInfoSaveReq.getIntroduction())
|
||||
|
@ -98,7 +98,7 @@ public class BrandInfo extends BaseEntity {
|
|||
public static BrandInfo editBuild(Long id, BrandInfoEditReq brandInfoEditReq) {
|
||||
return BrandInfo.builder()
|
||||
.id(id)
|
||||
.nam(brandInfoEditReq.getNam())
|
||||
.name(brandInfoEditReq.getName())
|
||||
.logo(brandInfoEditReq.getLogo())
|
||||
.start(brandInfoEditReq.getStart())
|
||||
.introduction(brandInfoEditReq.getIntroduction())
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ProjectInfo extends BaseEntity {
|
|||
/** 主类型 */
|
||||
@Excel(name = "主类型")
|
||||
@ApiModelProperty(name = "主类型", value = "主类型")
|
||||
private String mianType;
|
||||
private String mainType;
|
||||
|
||||
/** 父类型 */
|
||||
@Excel(name = "父类型")
|
||||
|
@ -94,7 +94,7 @@ public class ProjectInfo extends BaseEntity {
|
|||
return ProjectInfo.builder()
|
||||
.name(projectInfoQueryReq.getName())
|
||||
.introduction(projectInfoQueryReq.getIntroduction())
|
||||
.mianType(projectInfoQueryReq.getMianType())
|
||||
.mainType(projectInfoQueryReq.getMainType())
|
||||
.parentType(projectInfoQueryReq.getParentType())
|
||||
.type(projectInfoQueryReq.getType())
|
||||
.image(projectInfoQueryReq.getImage())
|
||||
|
@ -112,7 +112,7 @@ public class ProjectInfo extends BaseEntity {
|
|||
return ProjectInfo.builder()
|
||||
.name(projectInfoSaveReq.getName())
|
||||
.introduction(projectInfoSaveReq.getIntroduction())
|
||||
.mianType(projectInfoSaveReq.getMianType())
|
||||
.mainType(projectInfoSaveReq.getMainType())
|
||||
.parentType(projectInfoSaveReq.getParentType())
|
||||
.type(projectInfoSaveReq.getType())
|
||||
.image(projectInfoSaveReq.getImage())
|
||||
|
@ -131,7 +131,7 @@ public class ProjectInfo extends BaseEntity {
|
|||
.id(id)
|
||||
.name(projectInfoEditReq.getName())
|
||||
.introduction(projectInfoEditReq.getIntroduction())
|
||||
.mianType(projectInfoEditReq.getMianType())
|
||||
.mainType(projectInfoEditReq.getMainType())
|
||||
.parentType(projectInfoEditReq.getParentType())
|
||||
.type(projectInfoEditReq.getType())
|
||||
.image(projectInfoEditReq.getImage())
|
||||
|
|
|
@ -25,7 +25,7 @@ public class BrandInfoEditReq extends BaseEntity {
|
|||
|
||||
/** 品牌名称 */
|
||||
@ApiModelProperty(name = "品牌名称", value = "品牌名称", required = true)
|
||||
private String nam;
|
||||
private String name;
|
||||
|
||||
/** LOGO */
|
||||
@ApiModelProperty(name = "LOGO", value = "LOGO", required = true)
|
||||
|
|
|
@ -25,7 +25,7 @@ public class BrandInfoQueryReq extends BaseEntity {
|
|||
|
||||
/** 品牌名称 */
|
||||
@ApiModelProperty(name = "品牌名称", value = "品牌名称")
|
||||
private String nam;
|
||||
private String name;
|
||||
|
||||
/** LOGO */
|
||||
@ApiModelProperty(name = "LOGO", value = "LOGO")
|
||||
|
|
|
@ -31,7 +31,7 @@ public class BrandInfoSaveReq extends BaseEntity {
|
|||
/** 品牌名称 */
|
||||
|
||||
@ApiModelProperty(name = "品牌名称", value = "品牌名称", required = true)
|
||||
private String nam;
|
||||
private String name;
|
||||
|
||||
/** LOGO */
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public class ProjectInfoEditReq extends BaseEntity {
|
|||
|
||||
/** 主类型 */
|
||||
@ApiModelProperty(name = "主类型", value = "主类型")
|
||||
private String mianType;
|
||||
private String mainType;
|
||||
|
||||
/** 父类型 */
|
||||
@ApiModelProperty(name = "父类型", value = "父类型")
|
||||
|
|
|
@ -33,7 +33,7 @@ public class ProjectInfoQueryReq extends BaseEntity {
|
|||
|
||||
/** 主类型 */
|
||||
@ApiModelProperty(name = "主类型", value = "主类型")
|
||||
private String mianType;
|
||||
private String mainType;
|
||||
|
||||
/** 父类型 */
|
||||
@ApiModelProperty(name = "父类型", value = "父类型")
|
||||
|
|
|
@ -41,7 +41,7 @@ public class ProjectInfoSaveReq extends BaseEntity {
|
|||
/** 主类型 */
|
||||
|
||||
@ApiModelProperty(name = "主类型", value = "主类型")
|
||||
private String mianType;
|
||||
private String mainType;
|
||||
|
||||
/** 父类型 */
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ public class AttributeInfoController extends BaseController {
|
|||
return toAjax(attributeInfoService.updateById(AttributeInfo.editBuild(id,attributeInfoEditReq)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除商品属性
|
||||
*/
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.apache.ibatis.annotations.Param;
|
|||
*/
|
||||
@Mapper
|
||||
public interface AsAttributeGroupMapper extends BaseMapper<AsAttributeGroup> {
|
||||
|
||||
void deleteAsAttributeGroup(@Param("attributeIds") List<Long> attributeIds);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,21 +4,10 @@ import java.util.List;
|
|||
import com.muyu.product.domain.AsAttributeGroup;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 属性与组中间Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsAttributeGroupService extends IService<AsAttributeGroup> {
|
||||
/**
|
||||
* 查询属性与组中间列表
|
||||
*
|
||||
* @param asAttributeGroup 属性与组中间
|
||||
* @return 属性与组中间集合
|
||||
* 查询属性组列表
|
||||
*/
|
||||
public List<AsAttributeGroup> list(AsAttributeGroup asAttributeGroup);
|
||||
|
||||
void deleteAsAttributeGroup(List<Long> attributeId);
|
||||
|
||||
}
|
||||
|
|
|
@ -20,25 +20,16 @@ public interface AttributeGroupService extends IService<AttributeGroup> {
|
|||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param attributeGroup 分组对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
public TableDataInfo<AttributeGroupPageResp> page(AttributeGroup attributeGroup);
|
||||
|
||||
/**
|
||||
* 查询属性组列表
|
||||
*
|
||||
* @param attributeGroup 属性组
|
||||
* @return 属性组集合
|
||||
*/
|
||||
public List<AttributeGroup> list(AttributeGroup attributeGroup);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
* @param attributeGroupSaveModel 属性组保存模型
|
||||
* @return 是否成功
|
||||
*/
|
||||
public Boolean save(AttributeGroupSaveModel attributeGroupSaveModel);
|
||||
|
||||
void updateAsAttributeGrop(AttributeGroupEditReq attributeGroupEditReq,Long groupId);
|
||||
|
||||
}
|
||||
|
|
|
@ -11,18 +11,14 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AttributeInfoService extends IService<AttributeInfo> {
|
||||
|
||||
/**
|
||||
* 查询商品属性列表
|
||||
*
|
||||
* @param attributeInfo 商品属性
|
||||
* @return 商品属性集合
|
||||
*/
|
||||
public List<AttributeInfo> list(AttributeInfo attributeInfo);
|
||||
|
||||
/**
|
||||
* 通过groupId查询属性集合
|
||||
* @param groupId 属性组Id
|
||||
* @return 属性集合
|
||||
*/
|
||||
public List<AttributeInfo> attributeListByGroupId(Long groupId);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AsAttributeGroupServiceImpl extends ServiceImpl<AsAttributeGroupMapper, AsAttributeGroup> implements AsAttributeGroupService {
|
||||
public class AsAttributeGroupServiceImpl extends ServiceImpl<AsAttributeGroupMapper, AsAttributeGroup> implements AsAttributeGroupService
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private AsAttributeGroupMapper asAttributeGroupMapper;
|
||||
|
@ -34,20 +35,12 @@ public class AsAttributeGroupServiceImpl extends ServiceImpl<AsAttributeGroupMap
|
|||
@Override
|
||||
public List<AsAttributeGroup> list(AsAttributeGroup asAttributeGroup) {
|
||||
LambdaQueryWrapper<AsAttributeGroup> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
||||
if (ObjUtils.notNull(asAttributeGroup.getGroupId())){
|
||||
queryWrapper.eq(AsAttributeGroup::getGroupId, asAttributeGroup.getGroupId());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(asAttributeGroup.getAttributeId())){
|
||||
queryWrapper.eq(AsAttributeGroup::getAttributeId, asAttributeGroup.getAttributeId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,11 +68,7 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询属性组列表
|
||||
*
|
||||
* @param attributeGroup 属性组
|
||||
*
|
||||
* @return 属性组
|
||||
* 属性组
|
||||
*/
|
||||
@Override
|
||||
public List<AttributeGroup> list(AttributeGroup attributeGroup) {
|
||||
|
@ -85,10 +81,10 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
|||
if(ObjUtils.notNull(attributeGroup.getStates())){
|
||||
queryWrapper.eq(AttributeGroup::getStates,attributeGroup.getStates());
|
||||
}
|
||||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.product.service.impl;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
|
@ -26,24 +27,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
@Service
|
||||
public class AttributeInfoServiceImpl extends ServiceImpl<AttributeInfoMapper, AttributeInfo> implements AttributeInfoService {
|
||||
|
||||
// @Autowired
|
||||
// private AsAttributeGroupService asAttributeGroupService;
|
||||
|
||||
@Autowired
|
||||
private AsAttributeGroupService asAttributeGroupService;
|
||||
|
||||
/**
|
||||
* 查询商品属性列表
|
||||
*
|
||||
* @param attributeInfo 商品属性
|
||||
* @return 商品属性
|
||||
*/
|
||||
@Override
|
||||
public List<AttributeInfo> list(AttributeInfo attributeInfo) {
|
||||
LambdaQueryWrapper<AttributeInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
||||
if(ObjUtils.notNull(attributeInfo.getName())){
|
||||
queryWrapper.like(AttributeInfo::getName,attributeInfo.getName());
|
||||
}
|
||||
|
||||
if(ObjUtils.notNull(attributeInfo.getCode())){
|
||||
queryWrapper.like(AttributeInfo::getCode,attributeInfo.getCode());
|
||||
}
|
||||
|
@ -53,10 +48,6 @@ public class AttributeInfoServiceImpl extends ServiceImpl<AttributeInfoMapper, A
|
|||
|
||||
/**
|
||||
* 通过groupId查询属性集合
|
||||
*
|
||||
* @param groupId 属性组Id
|
||||
*
|
||||
* @return 属性集合
|
||||
*/
|
||||
@Override
|
||||
public List<AttributeInfo> attributeListByGroupId(Long groupId) {
|
||||
|
@ -68,12 +59,14 @@ public class AttributeInfoServiceImpl extends ServiceImpl<AttributeInfoMapper, A
|
|||
List<Long> longs = asAttributeGroupService.list(queryWrapper).stream()
|
||||
.map(AsAttributeGroup::getAttributeId)
|
||||
.toList();
|
||||
System.out.println("====="+longs.toString());
|
||||
System.out.println("===="+longs.toString());
|
||||
List<Long> longs1 = new ArrayList<>();
|
||||
return this.listByIds(
|
||||
asAttributeGroupService.list(queryWrapper).stream()
|
||||
.map(AsAttributeGroup::getAttributeId)
|
||||
.toList()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,8 +34,8 @@ public class BrandInfoServiceImpl extends ServiceImpl<BrandInfoMapper, BrandInfo
|
|||
LambdaQueryWrapper<BrandInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
||||
if (ObjUtils.notNull(brandInfo.getNam())){
|
||||
queryWrapper.eq(BrandInfo::getNam, brandInfo.getNam());
|
||||
if (ObjUtils.notNull(brandInfo.getName())){
|
||||
queryWrapper.eq(BrandInfo::getName, brandInfo.getName());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(brandInfo.getLogo())){
|
||||
|
|
|
@ -40,8 +40,8 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
|
|||
queryWrapper.eq(ProjectInfo::getIntroduction, projectInfo.getIntroduction());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(projectInfo.getMianType())){
|
||||
queryWrapper.eq(ProjectInfo::getMianType, projectInfo.getMianType());
|
||||
if (ObjUtils.notNull(projectInfo.getMainType())){
|
||||
queryWrapper.eq(ProjectInfo::getMainType, projectInfo.getMainType());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(projectInfo.getParentType())){
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 43.142.44.217
|
||||
server-addr: 101.34.248.9
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<resultMap type="com.muyu.product.domain.BrandInfo" id="BrandInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="nam" column="nam" />
|
||||
<result property="name" column="name" />
|
||||
<result property="logo" column="logo" />
|
||||
<result property="start" column="start" />
|
||||
<result property="introduction" column="introduction" />
|
||||
|
@ -18,6 +18,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectBrandInfoVo">
|
||||
select id, nam, logo, start, introduction, remark, create_by, create_time, update_by, update_time from brand_info
|
||||
select id, name, logo, start, introduction, remark, create_by, create_time, update_by, update_time from brand_info
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
|
@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="introduction" column="introduction" />
|
||||
<result property="mianType" column="mian_type" />
|
||||
<result property="mainType" column="main_type" />
|
||||
<result property="parentType" column="parent_type" />
|
||||
<result property="type" column="type" />
|
||||
<result property="image" column="image" />
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
server-addr: 101.34.248.9:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue