Commit 493b1395908346170032d2cccdc9b9d58baee6e6
1 parent
204a5ba2
重命名增加Product前缀
Showing
17 changed files
with
100 additions
and
250 deletions
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyCreateReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.product.controller.admin.property.vo; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.PropertyValueCreateReqVO; | |
| 3 | +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueCreateReqVO; | |
| 4 | 4 | import lombok.*; |
| 5 | 5 | import io.swagger.annotations.*; |
| 6 | 6 | |
| ... | ... | @@ -15,6 +15,6 @@ public class ProductPropertyCreateReqVO extends ProductPropertyBaseVO { |
| 15 | 15 | |
| 16 | 16 | @ApiModelProperty(value = "属性值") |
| 17 | 17 | @NotNull(message = "属性值不能为空") |
| 18 | - List<PropertyValueCreateReqVO> propertyValueList; | |
| 18 | + List<ProductPropertyValueCreateReqVO> propertyValueList; | |
| 19 | 19 | |
| 20 | 20 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyRespVO.java
| 1 | 1 | package cn.iocoder.yudao.module.product.controller.admin.property.vo; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.PropertyValueRespVO; | |
| 3 | +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueRespVO; | |
| 4 | 4 | import lombok.*; |
| 5 | 5 | import java.util.*; |
| 6 | 6 | import io.swagger.annotations.*; |
| ... | ... | @@ -18,6 +18,6 @@ public class ProductPropertyRespVO extends ProductPropertyBaseVO { |
| 18 | 18 | private Date createTime; |
| 19 | 19 | |
| 20 | 20 | @ApiModelProperty(value = "属性值") |
| 21 | - private List<PropertyValueRespVO> propertyValueList; | |
| 21 | + private List<ProductPropertyValueRespVO> propertyValueList; | |
| 22 | 22 | |
| 23 | 23 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyUpdateReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.product.controller.admin.property.vo; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.PropertyValueCreateReqVO; | |
| 3 | +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueCreateReqVO; | |
| 4 | 4 | import lombok.*; |
| 5 | 5 | import io.swagger.annotations.*; |
| 6 | 6 | import javax.validation.constraints.*; |
| ... | ... | @@ -18,6 +18,6 @@ public class ProductPropertyUpdateReqVO extends ProductPropertyBaseVO { |
| 18 | 18 | |
| 19 | 19 | @ApiModelProperty(value = "属性值") |
| 20 | 20 | @NotNull(message = "属性值不能为空") |
| 21 | - List<PropertyValueCreateReqVO> propertyValueList; | |
| 21 | + List<ProductPropertyValueCreateReqVO> propertyValueList; | |
| 22 | 22 | |
| 23 | 23 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueBaseVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueBaseVO.java
100755 → 100644
| ... | ... | @@ -10,7 +10,7 @@ import javax.validation.constraints.*; |
| 10 | 10 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 11 | 11 | */ |
| 12 | 12 | @Data |
| 13 | -public class PropertyValueBaseVO { | |
| 13 | +public class ProductPropertyValueBaseVO { | |
| 14 | 14 | |
| 15 | 15 | @ApiModelProperty(value = "规格键id") |
| 16 | 16 | private Long propertyId; | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueCreateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueCreateReqVO.java
100755 → 100644
| 1 | 1 | package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | -import java.util.*; | |
| 5 | 4 | import io.swagger.annotations.*; |
| 6 | -import javax.validation.constraints.*; | |
| 7 | 5 | |
| 8 | 6 | @ApiModel("管理后台 - 规格值创建 Request VO") |
| 9 | 7 | @Data |
| 10 | 8 | @EqualsAndHashCode(callSuper = true) |
| 11 | 9 | @ToString(callSuper = true) |
| 12 | -public class PropertyValueCreateReqVO extends PropertyValueBaseVO { | |
| 10 | +public class ProductPropertyValueCreateReqVO extends ProductPropertyValueBaseVO { | |
| 13 | 11 | |
| 14 | 12 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueRespVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueRespVO.java
100755 → 100644
| ... | ... | @@ -8,7 +8,7 @@ import io.swagger.annotations.*; |
| 8 | 8 | @Data |
| 9 | 9 | @EqualsAndHashCode(callSuper = true) |
| 10 | 10 | @ToString(callSuper = true) |
| 11 | -public class PropertyValueRespVO extends PropertyValueBaseVO { | |
| 11 | +public class ProductPropertyValueRespVO extends ProductPropertyValueBaseVO { | |
| 12 | 12 | |
| 13 | 13 | @ApiModelProperty(value = "主键", required = true) |
| 14 | 14 | private Integer id; | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueUpdateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueUpdateReqVO.java
100755 → 100644
| 1 | 1 | package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | -import java.util.*; | |
| 5 | 4 | import io.swagger.annotations.*; |
| 6 | 5 | import javax.validation.constraints.*; |
| 7 | 6 | |
| ... | ... | @@ -9,7 +8,7 @@ import javax.validation.constraints.*; |
| 9 | 8 | @Data |
| 10 | 9 | @EqualsAndHashCode(callSuper = true) |
| 11 | 10 | @ToString(callSuper = true) |
| 12 | -public class PropertyValueUpdateReqVO extends PropertyValueBaseVO { | |
| 11 | +public class ProductPropertyValueUpdateReqVO extends ProductPropertyValueBaseVO { | |
| 13 | 12 | |
| 14 | 13 | @ApiModelProperty(value = "主键", required = true) |
| 15 | 14 | @NotNull(message = "主键不能为空") | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueExcelVO.java deleted
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | |
| 2 | - | |
| 3 | -import lombok.*; | |
| 4 | -import java.util.*; | |
| 5 | -import io.swagger.annotations.*; | |
| 6 | - | |
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | |
| 8 | - | |
| 9 | -/** | |
| 10 | - * 规格值 Excel VO | |
| 11 | - * | |
| 12 | - * @author 芋道源码 | |
| 13 | - */ | |
| 14 | -@Data | |
| 15 | -public class PropertyValueExcelVO { | |
| 16 | - | |
| 17 | - @ExcelProperty("主键") | |
| 18 | - private Integer id; | |
| 19 | - | |
| 20 | - @ExcelProperty("规格键id") | |
| 21 | - private Long propertyId; | |
| 22 | - | |
| 23 | - @ExcelProperty("规格值名字") | |
| 24 | - private String name; | |
| 25 | - | |
| 26 | - @ExcelProperty("状态: 1 开启 ,2 禁用") | |
| 27 | - private Integer status; | |
| 28 | - | |
| 29 | - @ExcelProperty("创建时间") | |
| 30 | - private Date createTime; | |
| 31 | - | |
| 32 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueExportReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | |
| 2 | - | |
| 3 | -import lombok.*; | |
| 4 | -import java.util.*; | |
| 5 | -import io.swagger.annotations.*; | |
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 7 | -import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | - | |
| 9 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 10 | - | |
| 11 | -@ApiModel(value = "管理后台 - 规格值 Excel 导出 Request VO", description = "参数和 PropertyValuePageReqVO 是一致的") | |
| 12 | -@Data | |
| 13 | -public class PropertyValueExportReqVO { | |
| 14 | - | |
| 15 | - @ApiModelProperty(value = "规格键id") | |
| 16 | - private Long propertyId; | |
| 17 | - | |
| 18 | - @ApiModelProperty(value = "规格值名字") | |
| 19 | - private String name; | |
| 20 | - | |
| 21 | - @ApiModelProperty(value = "状态: 1 开启 ,2 禁用") | |
| 22 | - private Integer status; | |
| 23 | - | |
| 24 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 25 | - @ApiModelProperty(value = "开始创建时间") | |
| 26 | - private Date beginCreateTime; | |
| 27 | - | |
| 28 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 29 | - @ApiModelProperty(value = "结束创建时间") | |
| 30 | - private Date endCreateTime; | |
| 31 | - | |
| 32 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValuePageReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | |
| 2 | - | |
| 3 | -import lombok.*; | |
| 4 | -import java.util.*; | |
| 5 | -import io.swagger.annotations.*; | |
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 7 | -import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | - | |
| 9 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 10 | - | |
| 11 | -@ApiModel("管理后台 - 规格值分页 Request VO") | |
| 12 | -@Data | |
| 13 | -@EqualsAndHashCode(callSuper = true) | |
| 14 | -@ToString(callSuper = true) | |
| 15 | -public class PropertyValuePageReqVO extends PageParam { | |
| 16 | - | |
| 17 | - @ApiModelProperty(value = "规格键id") | |
| 18 | - private Long propertyId; | |
| 19 | - | |
| 20 | - @ApiModelProperty(value = "规格值名字") | |
| 21 | - private String name; | |
| 22 | - | |
| 23 | - @ApiModelProperty(value = "状态: 1 开启 ,2 禁用") | |
| 24 | - private Integer status; | |
| 25 | - | |
| 26 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 27 | - @ApiModelProperty(value = "开始创建时间") | |
| 28 | - private Date beginCreateTime; | |
| 29 | - | |
| 30 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 31 | - @ApiModelProperty(value = "结束创建时间") | |
| 32 | - private Date endCreateTime; | |
| 33 | - | |
| 34 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/propertyvalue/PropertyValueConvert.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/propertyvalue/ProductPropertyValueConvert.java
100755 → 100644
| ... | ... | @@ -4,10 +4,10 @@ import java.util.*; |
| 4 | 4 | |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | |
| 7 | +import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.ProductPropertyValueDO; | |
| 7 | 8 | import org.mapstruct.Mapper; |
| 8 | 9 | import org.mapstruct.factory.Mappers; |
| 9 | 10 | import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.*; |
| 10 | -import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.PropertyValueDO; | |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * 规格值 Convert |
| ... | ... | @@ -15,22 +15,20 @@ import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.PropertyValu |
| 15 | 15 | * @author 芋道源码 |
| 16 | 16 | */ |
| 17 | 17 | @Mapper |
| 18 | -public interface PropertyValueConvert { | |
| 18 | +public interface ProductPropertyValueConvert { | |
| 19 | 19 | |
| 20 | - PropertyValueConvert INSTANCE = Mappers.getMapper(PropertyValueConvert.class); | |
| 20 | + ProductPropertyValueConvert INSTANCE = Mappers.getMapper(ProductPropertyValueConvert.class); | |
| 21 | 21 | |
| 22 | - PropertyValueDO convert(PropertyValueCreateReqVO bean); | |
| 22 | + ProductPropertyValueDO convert(ProductPropertyValueCreateReqVO bean); | |
| 23 | 23 | |
| 24 | - PropertyValueDO convert(PropertyValueUpdateReqVO bean); | |
| 24 | + ProductPropertyValueDO convert(ProductPropertyValueUpdateReqVO bean); | |
| 25 | 25 | |
| 26 | - PropertyValueRespVO convert(PropertyValueDO bean); | |
| 26 | + ProductPropertyValueRespVO convert(ProductPropertyValueDO bean); | |
| 27 | 27 | |
| 28 | - List<PropertyValueRespVO> convertList(List<PropertyValueDO> list); | |
| 28 | + List<ProductPropertyValueRespVO> convertList(List<ProductPropertyValueDO> list); | |
| 29 | 29 | |
| 30 | - PageResult<PropertyValueRespVO> convertPage(PageResult<PropertyValueDO> page); | |
| 30 | + PageResult<ProductPropertyValueRespVO> convertPage(PageResult<ProductPropertyValueDO> page); | |
| 31 | 31 | |
| 32 | - List<PropertyValueExcelVO> convertList02(List<PropertyValueDO> list); | |
| 33 | - | |
| 34 | - List<PropertyValueDO> convertList03(List<PropertyValueCreateReqVO> list); | |
| 32 | + List<ProductPropertyValueDO> convertList03(List<ProductPropertyValueCreateReqVO> list); | |
| 35 | 33 | |
| 36 | 34 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/propertyvalue/PropertyValueDO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/propertyvalue/ProductPropertyValueDO.java
100755 → 100644
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/propertyvalue/ProductPropertyValueMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.product.dal.mysql.propertyvalue; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 7 | +import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.ProductPropertyValueDO; | |
| 8 | +import org.apache.ibatis.annotations.Mapper; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 规格值 Mapper | |
| 12 | + * | |
| 13 | + * @author 芋道源码 | |
| 14 | + */ | |
| 15 | +@Mapper | |
| 16 | +public interface ProductPropertyValueMapper extends BaseMapperX<ProductPropertyValueDO> { | |
| 17 | + | |
| 18 | + default List<ProductPropertyValueDO> getPropertyValueListByPropertyId(List<Long> propertyIds){ | |
| 19 | + return selectList(new LambdaQueryWrapperX<ProductPropertyValueDO>() | |
| 20 | + .inIfPresent(ProductPropertyValueDO::getPropertyId, propertyIds)); | |
| 21 | + } | |
| 22 | + | |
| 23 | + default void deletePropertyValueByPropertyId(Long propertyId){ | |
| 24 | + LambdaQueryWrapperX<ProductPropertyValueDO> queryWrapperX = new LambdaQueryWrapperX<>(); | |
| 25 | + queryWrapperX.eq(ProductPropertyValueDO::getPropertyId, propertyId) | |
| 26 | + .eq(ProductPropertyValueDO::getDeleted, false); | |
| 27 | + delete(queryWrapperX); | |
| 28 | + } | |
| 29 | +} | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/propertyvalue/PropertyValueMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.product.dal.mysql.propertyvalue; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | -import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.PropertyValueDO; | |
| 9 | -import org.apache.ibatis.annotations.Mapper; | |
| 10 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.*; | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * 规格值 Mapper | |
| 14 | - * | |
| 15 | - * @author 芋道源码 | |
| 16 | - */ | |
| 17 | -@Mapper | |
| 18 | -public interface PropertyValueMapper extends BaseMapperX<PropertyValueDO> { | |
| 19 | - | |
| 20 | - default PageResult<PropertyValueDO> selectPage(PropertyValuePageReqVO reqVO) { | |
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<PropertyValueDO>() | |
| 22 | - .eqIfPresent(PropertyValueDO::getPropertyId, reqVO.getPropertyId()) | |
| 23 | - .likeIfPresent(PropertyValueDO::getName, reqVO.getName()) | |
| 24 | - .eqIfPresent(PropertyValueDO::getStatus, reqVO.getStatus()) | |
| 25 | - .betweenIfPresent(PropertyValueDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 26 | - .orderByDesc(PropertyValueDO::getId)); | |
| 27 | - } | |
| 28 | - | |
| 29 | - default List<PropertyValueDO> selectList(PropertyValueExportReqVO reqVO) { | |
| 30 | - return selectList(new LambdaQueryWrapperX<PropertyValueDO>() | |
| 31 | - .eqIfPresent(PropertyValueDO::getPropertyId, reqVO.getPropertyId()) | |
| 32 | - .likeIfPresent(PropertyValueDO::getName, reqVO.getName()) | |
| 33 | - .eqIfPresent(PropertyValueDO::getStatus, reqVO.getStatus()) | |
| 34 | - .betweenIfPresent(PropertyValueDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 35 | - .orderByDesc(PropertyValueDO::getId)); | |
| 36 | - } | |
| 37 | - | |
| 38 | - default List<PropertyValueDO> getPropertyValueListByPropertyId(List<Long> propertyIds){ | |
| 39 | - return selectList(new LambdaQueryWrapperX<PropertyValueDO>() | |
| 40 | - .inIfPresent(PropertyValueDO::getPropertyId, propertyIds)); | |
| 41 | - } | |
| 42 | - | |
| 43 | - default void deletePropertyValueByPropertyId(Long propertyId){ | |
| 44 | - LambdaQueryWrapperX<PropertyValueDO> queryWrapperX = new LambdaQueryWrapperX<>(); | |
| 45 | - queryWrapperX.eq(PropertyValueDO::getPropertyId, propertyId).eq(PropertyValueDO::getDeleted, false); | |
| 46 | - delete(queryWrapperX); | |
| 47 | - } | |
| 48 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyServiceImpl.java
| ... | ... | @@ -4,14 +4,14 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; |
| 5 | 5 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyCreateReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyUpdateReqVO; |
| 7 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.PropertyValueCreateReqVO; | |
| 8 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.PropertyValueRespVO; | |
| 7 | +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueCreateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueRespVO; | |
| 9 | 9 | import cn.iocoder.yudao.module.product.convert.property.ProductPropertyConvert; |
| 10 | -import cn.iocoder.yudao.module.product.convert.propertyvalue.PropertyValueConvert; | |
| 10 | +import cn.iocoder.yudao.module.product.convert.propertyvalue.ProductPropertyValueConvert; | |
| 11 | 11 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; |
| 12 | -import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.PropertyValueDO; | |
| 12 | +import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.ProductPropertyValueDO; | |
| 13 | 13 | import cn.iocoder.yudao.module.product.dal.mysql.property.ProductPropertyMapper; |
| 14 | -import cn.iocoder.yudao.module.product.service.propertyvalue.PropertyValueService; | |
| 14 | +import cn.iocoder.yudao.module.product.service.propertyvalue.ProductPropertyValueService; | |
| 15 | 15 | import org.springframework.stereotype.Service; |
| 16 | 16 | import org.springframework.transaction.annotation.Transactional; |
| 17 | 17 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -38,7 +38,7 @@ public class ProductPropertyServiceImpl implements ProductPropertyService { |
| 38 | 38 | private ProductPropertyMapper productPropertyMapper; |
| 39 | 39 | |
| 40 | 40 | @Resource |
| 41 | - private PropertyValueService propertyValueService; | |
| 41 | + private ProductPropertyValueService productPropertyValueService; | |
| 42 | 42 | |
| 43 | 43 | @Override |
| 44 | 44 | @Transactional(rollbackFor = Exception.class) |
| ... | ... | @@ -48,10 +48,10 @@ public class ProductPropertyServiceImpl implements ProductPropertyService { |
| 48 | 48 | productPropertyMapper.insert(property); |
| 49 | 49 | |
| 50 | 50 | //插入属性值 |
| 51 | - List<PropertyValueCreateReqVO> propertyValueList = createReqVO.getPropertyValueList(); | |
| 52 | - List<PropertyValueDO> propertyValueDOList = PropertyValueConvert.INSTANCE.convertList03(propertyValueList); | |
| 53 | - propertyValueDOList.stream().forEach(x-> x.setPropertyId(property.getId())); | |
| 54 | - propertyValueService.batchInsert(propertyValueDOList); | |
| 51 | + List<ProductPropertyValueCreateReqVO> propertyValueList = createReqVO.getPropertyValueList(); | |
| 52 | + List<ProductPropertyValueDO> productPropertyValueDOList = ProductPropertyValueConvert.INSTANCE.convertList03(propertyValueList); | |
| 53 | + productPropertyValueDOList.stream().forEach(x-> x.setPropertyId(property.getId())); | |
| 54 | + productPropertyValueService.batchInsert(productPropertyValueDOList); | |
| 55 | 55 | // 返回 |
| 56 | 56 | return property.getId(); |
| 57 | 57 | } |
| ... | ... | @@ -65,11 +65,11 @@ public class ProductPropertyServiceImpl implements ProductPropertyService { |
| 65 | 65 | ProductPropertyDO updateObj = ProductPropertyConvert.INSTANCE.convert(updateReqVO); |
| 66 | 66 | productPropertyMapper.updateById(updateObj); |
| 67 | 67 | //更新属性值,先删后加 |
| 68 | - propertyValueService.deletePropertyValueByPropertyId(updateReqVO.getId()); | |
| 69 | - List<PropertyValueCreateReqVO> propertyValueList = updateReqVO.getPropertyValueList(); | |
| 70 | - List<PropertyValueDO> propertyValueDOList = PropertyValueConvert.INSTANCE.convertList03(propertyValueList); | |
| 71 | - propertyValueDOList.stream().forEach(x-> x.setPropertyId(updateReqVO.getId())); | |
| 72 | - propertyValueService.batchInsert(propertyValueDOList); | |
| 68 | + productPropertyValueService.deletePropertyValueByPropertyId(updateReqVO.getId()); | |
| 69 | + List<ProductPropertyValueCreateReqVO> propertyValueList = updateReqVO.getPropertyValueList(); | |
| 70 | + List<ProductPropertyValueDO> productPropertyValueDOList = ProductPropertyValueConvert.INSTANCE.convertList03(propertyValueList); | |
| 71 | + productPropertyValueDOList.stream().forEach(x-> x.setPropertyId(updateReqVO.getId())); | |
| 72 | + productPropertyValueService.batchInsert(productPropertyValueDOList); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | @Override |
| ... | ... | @@ -79,7 +79,7 @@ public class ProductPropertyServiceImpl implements ProductPropertyService { |
| 79 | 79 | // 删除 |
| 80 | 80 | productPropertyMapper.deleteById(id); |
| 81 | 81 | //同步删除属性值 |
| 82 | - propertyValueService.deletePropertyValueByPropertyId(id); | |
| 82 | + productPropertyValueService.deletePropertyValueByPropertyId(id); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | private void validatePropertyExists(Long id) { |
| ... | ... | @@ -116,12 +116,12 @@ public class ProductPropertyServiceImpl implements ProductPropertyService { |
| 116 | 116 | List<Long> propertyIds = propertyRespVOPageResult.getList().stream().map(x -> x.getId()).collect(Collectors.toList()); |
| 117 | 117 | |
| 118 | 118 | //获取属性值列表 |
| 119 | - List<PropertyValueDO> propertyValueDOList = propertyValueService.getPropertyValueListByPropertyId(propertyIds); | |
| 120 | - List<PropertyValueRespVO> propertyValueRespVOList = PropertyValueConvert.INSTANCE.convertList(propertyValueDOList); | |
| 119 | + List<ProductPropertyValueDO> productPropertyValueDOList = productPropertyValueService.getPropertyValueListByPropertyId(propertyIds); | |
| 120 | + List<ProductPropertyValueRespVO> propertyValueRespVOList = ProductPropertyValueConvert.INSTANCE.convertList(productPropertyValueDOList); | |
| 121 | 121 | //组装一对多 |
| 122 | 122 | propertyRespVOPageResult.getList().stream().forEach(x->{ |
| 123 | 123 | Long propertyId = x.getId(); |
| 124 | - List<PropertyValueRespVO> valueDOList = propertyValueRespVOList.stream().filter(v -> v.getPropertyId().equals(propertyId)).collect(Collectors.toList()); | |
| 124 | + List<ProductPropertyValueRespVO> valueDOList = propertyValueRespVOList.stream().filter(v -> v.getPropertyId().equals(propertyId)).collect(Collectors.toList()); | |
| 125 | 125 | x.setPropertyValueList(valueDOList); |
| 126 | 126 | }); |
| 127 | 127 | return propertyRespVOPageResult; |
| ... | ... | @@ -133,8 +133,8 @@ public class ProductPropertyServiceImpl implements ProductPropertyService { |
| 133 | 133 | ProductPropertyDO property = getProperty(id); |
| 134 | 134 | ProductPropertyRespVO propertyRespVO = ProductPropertyConvert.INSTANCE.convert(property); |
| 135 | 135 | //查询属性值 |
| 136 | - List<PropertyValueDO> valueDOList = propertyValueService.getPropertyValueListByPropertyId(Arrays.asList(id)); | |
| 137 | - List<PropertyValueRespVO> propertyValueRespVOS = PropertyValueConvert.INSTANCE.convertList(valueDOList); | |
| 136 | + List<ProductPropertyValueDO> valueDOList = productPropertyValueService.getPropertyValueListByPropertyId(Arrays.asList(id)); | |
| 137 | + List<ProductPropertyValueRespVO> propertyValueRespVOS = ProductPropertyValueConvert.INSTANCE.convertList(valueDOList); | |
| 138 | 138 | //组装 |
| 139 | 139 | propertyRespVO.setPropertyValueList(propertyValueRespVOS); |
| 140 | 140 | return propertyRespVO; | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/propertyvalue/PropertyValueServiceImpl.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/propertyvalue/ProductProductPropertyValueServiceImpl.java
100755 → 100644
| 1 | 1 | package cn.iocoder.yudao.module.product.service.propertyvalue; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | 3 | import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.*; |
| 5 | -import cn.iocoder.yudao.module.product.convert.propertyvalue.PropertyValueConvert; | |
| 6 | -import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.PropertyValueDO; | |
| 7 | -import cn.iocoder.yudao.module.product.dal.mysql.propertyvalue.PropertyValueMapper; | |
| 4 | +import cn.iocoder.yudao.module.product.convert.propertyvalue.ProductPropertyValueConvert; | |
| 5 | +import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.ProductPropertyValueDO; | |
| 6 | +import cn.iocoder.yudao.module.product.dal.mysql.propertyvalue.ProductPropertyValueMapper; | |
| 8 | 7 | import org.springframework.stereotype.Service; |
| 9 | 8 | import org.springframework.validation.annotation.Validated; |
| 10 | 9 | |
| ... | ... | @@ -22,29 +21,29 @@ import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.PROPERTY_ |
| 22 | 21 | */ |
| 23 | 22 | @Service |
| 24 | 23 | @Validated |
| 25 | -public class PropertyValueServiceImpl implements PropertyValueService { | |
| 24 | +public class ProductProductPropertyValueServiceImpl implements ProductPropertyValueService { | |
| 26 | 25 | |
| 27 | 26 | @Resource |
| 28 | - private PropertyValueMapper propertyValueMapper; | |
| 27 | + private ProductPropertyValueMapper productPropertyValueMapper; | |
| 29 | 28 | |
| 30 | 29 | // TODO @franky:这个合并到 property 中。他们本身是在一起的哈。基本不存在只查询规格,而不查询规格值。 |
| 31 | 30 | |
| 32 | 31 | @Override |
| 33 | - public Integer createPropertyValue(PropertyValueCreateReqVO createReqVO) { | |
| 32 | + public Integer createPropertyValue(ProductPropertyValueCreateReqVO createReqVO) { | |
| 34 | 33 | // 插入 |
| 35 | - PropertyValueDO propertyValue = PropertyValueConvert.INSTANCE.convert(createReqVO); | |
| 36 | - propertyValueMapper.insert(propertyValue); | |
| 34 | + ProductPropertyValueDO propertyValue = ProductPropertyValueConvert.INSTANCE.convert(createReqVO); | |
| 35 | + productPropertyValueMapper.insert(propertyValue); | |
| 37 | 36 | // 返回 |
| 38 | 37 | return propertyValue.getId(); |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | @Override |
| 42 | - public void updatePropertyValue(PropertyValueUpdateReqVO updateReqVO) { | |
| 41 | + public void updatePropertyValue(ProductPropertyValueUpdateReqVO updateReqVO) { | |
| 43 | 42 | // 校验存在 |
| 44 | 43 | this.validatePropertyValueExists(updateReqVO.getId()); |
| 45 | 44 | // 更新 |
| 46 | - PropertyValueDO updateObj = PropertyValueConvert.INSTANCE.convert(updateReqVO); | |
| 47 | - propertyValueMapper.updateById(updateObj); | |
| 45 | + ProductPropertyValueDO updateObj = ProductPropertyValueConvert.INSTANCE.convert(updateReqVO); | |
| 46 | + productPropertyValueMapper.updateById(updateObj); | |
| 48 | 47 | } |
| 49 | 48 | |
| 50 | 49 | @Override |
| ... | ... | @@ -52,48 +51,38 @@ public class PropertyValueServiceImpl implements PropertyValueService { |
| 52 | 51 | // 校验存在 |
| 53 | 52 | this.validatePropertyValueExists(id); |
| 54 | 53 | // 删除 |
| 55 | - propertyValueMapper.deleteById(id); | |
| 54 | + productPropertyValueMapper.deleteById(id); | |
| 56 | 55 | } |
| 57 | 56 | |
| 58 | 57 | private void validatePropertyValueExists(Integer id) { |
| 59 | - if (propertyValueMapper.selectById(id) == null) { | |
| 58 | + if (productPropertyValueMapper.selectById(id) == null) { | |
| 60 | 59 | throw exception(PROPERTY_VALUE_NOT_EXISTS); |
| 61 | 60 | } |
| 62 | 61 | } |
| 63 | 62 | |
| 64 | 63 | @Override |
| 65 | - public PropertyValueDO getPropertyValue(Integer id) { | |
| 66 | - return propertyValueMapper.selectById(id); | |
| 64 | + public ProductPropertyValueDO getPropertyValue(Integer id) { | |
| 65 | + return productPropertyValueMapper.selectById(id); | |
| 67 | 66 | } |
| 68 | 67 | |
| 69 | 68 | @Override |
| 70 | - public List<PropertyValueDO> getPropertyValueList(Collection<Integer> ids) { | |
| 71 | - return propertyValueMapper.selectBatchIds(ids); | |
| 69 | + public List<ProductPropertyValueDO> getPropertyValueList(Collection<Integer> ids) { | |
| 70 | + return productPropertyValueMapper.selectBatchIds(ids); | |
| 72 | 71 | } |
| 73 | 72 | |
| 74 | 73 | @Override |
| 75 | - public PageResult<PropertyValueDO> getPropertyValuePage(PropertyValuePageReqVO pageReqVO) { | |
| 76 | - return propertyValueMapper.selectPage(pageReqVO); | |
| 74 | + public void batchInsert(List<ProductPropertyValueDO> propertyValues) { | |
| 75 | + productPropertyValueMapper.insertBatch(propertyValues); | |
| 77 | 76 | } |
| 78 | 77 | |
| 79 | 78 | @Override |
| 80 | - public List<PropertyValueDO> getPropertyValueList(PropertyValueExportReqVO exportReqVO) { | |
| 81 | - return propertyValueMapper.selectList(exportReqVO); | |
| 82 | - } | |
| 83 | - | |
| 84 | - @Override | |
| 85 | - public void batchInsert(List<PropertyValueDO> propertyValues) { | |
| 86 | - propertyValueMapper.insertBatch(propertyValues); | |
| 87 | - } | |
| 88 | - | |
| 89 | - @Override | |
| 90 | - public List<PropertyValueDO> getPropertyValueListByPropertyId(List<Long> propertyIds) { | |
| 91 | - return propertyValueMapper.getPropertyValueListByPropertyId(propertyIds); | |
| 79 | + public List<ProductPropertyValueDO> getPropertyValueListByPropertyId(List<Long> propertyIds) { | |
| 80 | + return productPropertyValueMapper.getPropertyValueListByPropertyId(propertyIds); | |
| 92 | 81 | } |
| 93 | 82 | |
| 94 | 83 | @Override |
| 95 | 84 | public void deletePropertyValueByPropertyId(Long propertyId) { |
| 96 | - propertyValueMapper.deletePropertyValueByPropertyId(propertyId); | |
| 85 | + productPropertyValueMapper.deletePropertyValueByPropertyId(propertyId); | |
| 97 | 86 | } |
| 98 | 87 | |
| 99 | 88 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/propertyvalue/PropertyValueService.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/propertyvalue/ProductPropertyValueService.java
100755 → 100644
| ... | ... | @@ -3,15 +3,14 @@ package cn.iocoder.yudao.module.product.service.propertyvalue; |
| 3 | 3 | import java.util.*; |
| 4 | 4 | import javax.validation.*; |
| 5 | 5 | import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.*; |
| 6 | -import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.PropertyValueDO; | |
| 7 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.ProductPropertyValueDO; | |
| 8 | 7 | |
| 9 | 8 | /** |
| 10 | 9 | * 规格值 Service 接口 |
| 11 | 10 | * |
| 12 | 11 | * @author 芋道源码 |
| 13 | 12 | */ |
| 14 | -public interface PropertyValueService { | |
| 13 | +public interface ProductPropertyValueService { | |
| 15 | 14 | |
| 16 | 15 | /** |
| 17 | 16 | * 创建规格值 |
| ... | ... | @@ -19,14 +18,14 @@ public interface PropertyValueService { |
| 19 | 18 | * @param createReqVO 创建信息 |
| 20 | 19 | * @return 编号 |
| 21 | 20 | */ |
| 22 | - Integer createPropertyValue(@Valid PropertyValueCreateReqVO createReqVO); | |
| 21 | + Integer createPropertyValue(@Valid ProductPropertyValueCreateReqVO createReqVO); | |
| 23 | 22 | |
| 24 | 23 | /** |
| 25 | 24 | * 更新规格值 |
| 26 | 25 | * |
| 27 | 26 | * @param updateReqVO 更新信息 |
| 28 | 27 | */ |
| 29 | - void updatePropertyValue(@Valid PropertyValueUpdateReqVO updateReqVO); | |
| 28 | + void updatePropertyValue(@Valid ProductPropertyValueUpdateReqVO updateReqVO); | |
| 30 | 29 | |
| 31 | 30 | /** |
| 32 | 31 | * 删除规格值 |
| ... | ... | @@ -41,7 +40,7 @@ public interface PropertyValueService { |
| 41 | 40 | * @param id 编号 |
| 42 | 41 | * @return 规格值 |
| 43 | 42 | */ |
| 44 | - PropertyValueDO getPropertyValue(Integer id); | |
| 43 | + ProductPropertyValueDO getPropertyValue(Integer id); | |
| 45 | 44 | |
| 46 | 45 | /** |
| 47 | 46 | * 获得规格值列表 |
| ... | ... | @@ -49,36 +48,20 @@ public interface PropertyValueService { |
| 49 | 48 | * @param ids 编号 |
| 50 | 49 | * @return 规格值列表 |
| 51 | 50 | */ |
| 52 | - List<PropertyValueDO> getPropertyValueList(Collection<Integer> ids); | |
| 53 | - | |
| 54 | - /** | |
| 55 | - * 获得规格值分页 | |
| 56 | - * | |
| 57 | - * @param pageReqVO 分页查询 | |
| 58 | - * @return 规格值分页 | |
| 59 | - */ | |
| 60 | - PageResult<PropertyValueDO> getPropertyValuePage(PropertyValuePageReqVO pageReqVO); | |
| 61 | - | |
| 62 | - /** | |
| 63 | - * 获得规格值列表, 用于 Excel 导出 | |
| 64 | - * | |
| 65 | - * @param exportReqVO 查询条件 | |
| 66 | - * @return 规格值列表 | |
| 67 | - */ | |
| 68 | - List<PropertyValueDO> getPropertyValueList(PropertyValueExportReqVO exportReqVO); | |
| 51 | + List<ProductPropertyValueDO> getPropertyValueList(Collection<Integer> ids); | |
| 69 | 52 | |
| 70 | 53 | /** |
| 71 | 54 | * 批量插入属性值 |
| 72 | 55 | * @param propertyValues |
| 73 | 56 | */ |
| 74 | - void batchInsert(List<PropertyValueDO> propertyValues); | |
| 57 | + void batchInsert(List<ProductPropertyValueDO> propertyValues); | |
| 75 | 58 | |
| 76 | 59 | /** |
| 77 | 60 | * 根据属性id查询 |
| 78 | 61 | * @param propertyIds |
| 79 | 62 | * @return |
| 80 | 63 | */ |
| 81 | - List<PropertyValueDO> getPropertyValueListByPropertyId(List<Long> propertyIds); | |
| 64 | + List<ProductPropertyValueDO> getPropertyValueListByPropertyId(List<Long> propertyIds); | |
| 82 | 65 | |
| 83 | 66 | /** |
| 84 | 67 | * 根据属性id 删除 | ... | ... |