Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/ruoyi-vue-pro
# Conflicts: # yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java # yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java # yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImplTest.java # yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/coupon/vo/template/AppCouponTemplateRespVO.java # yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImplTest.java # yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java # yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java
This commit is contained in:
@@ -6,6 +6,8 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -13,6 +15,9 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface ProductSkuMapper extends BaseMapperX<ProductSkuDO> {
|
||||
|
||||
@Select("SELECT * FROM product_sku WHERE id = #{id}")
|
||||
ProductSkuDO selectByIdIncludeDeleted(@Param("id") Long id);
|
||||
|
||||
default List<ProductSkuDO> selectListBySpuId(Long spuId) {
|
||||
return selectList(ProductSkuDO::getSpuId, spuId);
|
||||
}
|
||||
|
@@ -11,6 +11,8 @@ import cn.iocoder.yudao.module.product.enums.ProductConstants;
|
||||
import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
@@ -18,6 +20,9 @@ import java.util.Set;
|
||||
@Mapper
|
||||
public interface ProductSpuMapper extends BaseMapperX<ProductSpuDO> {
|
||||
|
||||
@Select("SELECT * FROM product_spu WHERE id = #{id}")
|
||||
ProductSpuDO selectByIdIncludeDeleted(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 获取商品 SPU 分页列表数据
|
||||
*
|
||||
|
@@ -91,7 +91,7 @@ public class ProductCommentServiceImpl implements ProductCommentService {
|
||||
}
|
||||
|
||||
private ProductSkuDO validateSku(Long skuId) {
|
||||
ProductSkuDO sku = productSkuService.getSku(skuId);
|
||||
ProductSkuDO sku = productSkuService.getSku(skuId, true);
|
||||
if (sku == null) {
|
||||
throw exception(SKU_NOT_EXISTS);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class ProductCommentServiceImpl implements ProductCommentService {
|
||||
}
|
||||
|
||||
private ProductSpuDO validateSpu(Long spuId) {
|
||||
ProductSpuDO spu = productSpuService.getSpu(spuId);
|
||||
ProductSpuDO spu = productSpuService.getSpu(spuId, true);
|
||||
if (null == spu) {
|
||||
throw exception(SPU_NOT_EXISTS);
|
||||
}
|
||||
|
@@ -29,6 +29,15 @@ public interface ProductSkuService {
|
||||
*/
|
||||
ProductSkuDO getSku(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品 SKU 信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @param includeDeleted 是否包含已删除的
|
||||
* @return 商品 SKU 信息
|
||||
*/
|
||||
ProductSkuDO getSku(Long id, boolean includeDeleted);
|
||||
|
||||
/**
|
||||
* 获得商品 SKU 列表
|
||||
*
|
||||
|
@@ -68,6 +68,14 @@ public class ProductSkuServiceImpl implements ProductSkuService {
|
||||
return productSkuMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductSkuDO getSku(Long id, boolean includeDeleted) {
|
||||
if (includeDeleted) {
|
||||
return productSkuMapper.selectByIdIncludeDeleted(id);
|
||||
}
|
||||
return getSku(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductSkuDO> getSkuList(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
|
@@ -51,6 +51,15 @@ public interface ProductSpuService {
|
||||
*/
|
||||
ProductSpuDO getSpu(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品 SPU
|
||||
*
|
||||
* @param id 编号
|
||||
* @param includeDeleted 是否包含已删除的
|
||||
* @return 商品 SPU
|
||||
*/
|
||||
ProductSpuDO getSpu(Long id, boolean includeDeleted);
|
||||
|
||||
/**
|
||||
* 获得商品 SPU 列表
|
||||
*
|
||||
|
@@ -189,6 +189,14 @@ public class ProductSpuServiceImpl implements ProductSpuService {
|
||||
return productSpuMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductSpuDO getSpu(Long id, boolean includeDeleted) {
|
||||
if (includeDeleted) {
|
||||
return productSpuMapper.selectByIdIncludeDeleted(id);
|
||||
}
|
||||
return getSpu(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductSpuDO> getSpuList(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
|
@@ -1,9 +1,9 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.app.coupon.vo.template;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,6 +20,9 @@ public class AppCouponTemplateRespVO {
|
||||
@Schema(description = "优惠券说明", example = "优惠券使用说明")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "发行总量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") // -1 - 则表示不限制发放数量
|
||||
private Integer totalCount;
|
||||
|
||||
@Schema(description = "每人限领个数", requiredMode = Schema.RequiredMode.REQUIRED, example = "66") // -1 - 则表示不限制
|
||||
private Integer takeLimitCount;
|
||||
|
||||
@@ -62,6 +65,9 @@ public class AppCouponTemplateRespVO {
|
||||
@Schema(description = "折扣上限", example = "100") // 单位:分,仅在 discountType 为 PERCENT 使用
|
||||
private Integer discountLimitPrice;
|
||||
|
||||
@Schema(description = "领取优惠券的数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Integer takeCount;
|
||||
|
||||
// ========== 用户相关字段 ==========
|
||||
|
||||
@Schema(description = "是否可以领取", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
|
Reference in New Issue
Block a user