mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	mall+order: 完善部分 TODO 提到的问题
This commit is contained in:
		| @@ -0,0 +1,20 @@ | ||||
| package cn.iocoder.yudao.module.promotion.api.combination; | ||||
|  | ||||
| /** | ||||
|  * 拼团活动 Api 接口 | ||||
|  * | ||||
|  * @author HUIHUI | ||||
|  */ | ||||
| public interface CombinationActivityApi { | ||||
|  | ||||
|     /** | ||||
|      * 校验是否满足拼团条件 | ||||
|      * | ||||
|      * @param activityId 活动编号 | ||||
|      * @param userId 用户编号 | ||||
|      * @param skuId sku 编号 | ||||
|      * @param count 数量 | ||||
|      */ | ||||
|     void validateCombination(Long activityId, Long userId, Long skuId, Integer count); | ||||
|  | ||||
| } | ||||
| @@ -1,21 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.promotion.api.combination; | ||||
|  | ||||
| import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationActivityUpdateStockReqDTO; | ||||
|  | ||||
| // TODO @puhui999:是不是改成 CombinationActivityApi | ||||
| /** | ||||
|  * 拼团活动 Api 接口 | ||||
|  * | ||||
|  * @author HUIHUI | ||||
|  */ | ||||
| public interface CombinationApi { | ||||
|  | ||||
|     /** | ||||
|      * 更新活动库存 | ||||
|      * | ||||
|      * @param reqDTO 请求 | ||||
|      */ | ||||
|     // TODO @puhui999:应该是更新哇?还是校验哈; | ||||
|     void validateCombination(CombinationActivityUpdateStockReqDTO reqDTO); | ||||
|  | ||||
| } | ||||
| @@ -1,11 +1,9 @@ | ||||
| package cn.iocoder.yudao.module.promotion.api.combination; | ||||
|  | ||||
| import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateReqDTO; | ||||
| import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordRespDTO; | ||||
|  | ||||
| import javax.validation.Valid; | ||||
| import java.time.LocalDateTime; | ||||
| import java.util.List; | ||||
|  | ||||
| // TODO @芋艿:后面也再撸撸这几个接口 | ||||
|  | ||||
| @@ -33,26 +31,7 @@ public interface CombinationRecordApi { | ||||
|     boolean isCombinationRecordSuccess(Long userId, Long orderId); | ||||
|  | ||||
|     /** | ||||
|      * 获取拼团记录 | ||||
|      * | ||||
|      * @param userId     用户编号 | ||||
|      * @param activityId 活动编号 | ||||
|      * @return 拼团记录列表 | ||||
|      */ | ||||
|     List<CombinationRecordRespDTO> getRecordListByUserIdAndActivityId(Long userId, Long activityId); | ||||
|  | ||||
|     /** | ||||
|      * 验证组合限制数 | ||||
|      * 校验是否满足限购要求 | ||||
|      * | ||||
|      * @param count      本次购买数量 | ||||
|      * @param sumCount   已购买数量合计 | ||||
|      * @param activityId 活动编号 | ||||
|      */ | ||||
|     void validateCombinationLimitCount(Long activityId, Integer count, Integer sumCount); | ||||
|  | ||||
|     /** | ||||
|      * 更新拼团状态为成功 | ||||
|      * 更新拼团状态为 成功 | ||||
|      * | ||||
|      * @param userId  用户编号 | ||||
|      * @param orderId 订单编号 | ||||
| @@ -60,7 +39,7 @@ public interface CombinationRecordApi { | ||||
|     void updateRecordStatusToSuccess(Long userId, Long orderId); | ||||
|  | ||||
|     /** | ||||
|      * 更新拼团状态为失败 | ||||
|      * 更新拼团状态为 失败 | ||||
|      * | ||||
|      * @param userId  用户编号 | ||||
|      * @param orderId 订单编号 | ||||
|   | ||||
| @@ -1,42 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.promotion.api.combination.dto; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import javax.validation.Valid; | ||||
| import javax.validation.constraints.NotNull; | ||||
|  | ||||
| /** | ||||
|  * 拼团活动更新活动库存 Request DTO | ||||
|  * | ||||
|  * @author HUIHUI | ||||
|  */ | ||||
| @Data | ||||
| public class CombinationActivityUpdateStockReqDTO { | ||||
|  | ||||
|     // TODO @puhui999:是不是一个 activityId、count、skuId 参数就完事啦。 | ||||
|  | ||||
|     @NotNull(message = "活动编号不能为空") | ||||
|     private Long activityId; | ||||
|  | ||||
|     @NotNull(message = "购买数量不能为空") | ||||
|     private Integer count; | ||||
|  | ||||
|     @NotNull(message = "活动商品不能为空") | ||||
|     private Item item; | ||||
|  | ||||
|     @Data | ||||
|     @Valid | ||||
|     public static class Item { | ||||
|  | ||||
|         @NotNull(message = "SPU 编号不能为空") | ||||
|         private Long spuId; | ||||
|  | ||||
|         @NotNull(message = "SKU 编号活动商品不能为空") | ||||
|         private Long skuId; | ||||
|  | ||||
|         @NotNull(message = "购买数量不能为空") | ||||
|         private Integer count; | ||||
|  | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -13,26 +13,39 @@ import javax.validation.constraints.NotNull; | ||||
| @Data | ||||
| public class CombinationRecordCreateReqDTO { | ||||
|  | ||||
|     // TODO @puhui999:注释还是要的哈 | ||||
|  | ||||
|     /** | ||||
|      * 拼团活动编号 | ||||
|      */ | ||||
|     @NotNull(message = "拼团活动编号不能为空") | ||||
|     private Long activityId; | ||||
|  | ||||
|     /** | ||||
|      * spu 编号 | ||||
|      */ | ||||
|     @NotNull(message = "spu 编号不能为空") | ||||
|     private Long spuId; | ||||
|  | ||||
|     /** | ||||
|      * sku 编号 | ||||
|      */ | ||||
|     @NotNull(message = "sku 编号不能为空") | ||||
|     private Long skuId; | ||||
|  | ||||
|     /** | ||||
|      * 订单编号 | ||||
|      */ | ||||
|     @NotNull(message = "订单编号不能为空") | ||||
|     private Long orderId; | ||||
|  | ||||
|     /** | ||||
|      * 用户编号 | ||||
|      */ | ||||
|     @NotNull(message = "用户编号不能为空") | ||||
|     private Long userId; | ||||
|  | ||||
|     /** | ||||
|      * 团长编号 | ||||
|      */ | ||||
|     @NotNull(message = "团长编号不能为空") | ||||
|     private Long headId; | ||||
|  | ||||
|     /** | ||||
|      * 拼团商品单价 | ||||
|      */ | ||||
|     @NotNull(message = "拼团商品单价不能为空") | ||||
|     private Integer combinationPrice; | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,5 @@ | ||||
| package cn.iocoder.yudao.module.promotion.api.seckill; | ||||
|  | ||||
| import cn.iocoder.yudao.module.promotion.api.seckill.dto.SeckillActivityUpdateStockReqDTO; | ||||
|  | ||||
| /** | ||||
|  * 秒杀活动 API 接口 | ||||
|  * | ||||
| @@ -12,8 +10,10 @@ public interface SeckillActivityApi { | ||||
|     /** | ||||
|      * 更新秒杀库存 | ||||
|      * | ||||
|      * @param updateStockReqDTO 请求 | ||||
|      * @param activityId 活动编号 | ||||
|      * @param skuId      sku 编号 | ||||
|      * @param count      数量 | ||||
|      */ | ||||
|     void updateSeckillStock(SeckillActivityUpdateStockReqDTO updateStockReqDTO); | ||||
|     void updateSeckillStock(Long activityId, Long skuId, Integer count); | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1,42 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.promotion.api.seckill.dto; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import javax.validation.Valid; | ||||
| import javax.validation.constraints.NotNull; | ||||
|  | ||||
| /** | ||||
|  * 更新秒杀库存 request DTO | ||||
|  * | ||||
|  * @author HUIHUI | ||||
|  */ | ||||
| @Data | ||||
| public class SeckillActivityUpdateStockReqDTO { | ||||
|  | ||||
|     // TODO @puhui999:可以不用 dto,直接 activityId、skuId、count 即可 | ||||
|  | ||||
|     @NotNull(message = "活动编号不能为空") | ||||
|     private Long activityId; | ||||
|  | ||||
|     @NotNull(message = "购买数量不能为空") | ||||
|     private Integer count; | ||||
|  | ||||
|     @NotNull(message = "活动商品不能为空") | ||||
|     private Item item; | ||||
|  | ||||
|     @Data | ||||
|     @Valid | ||||
|     public static class Item { | ||||
|  | ||||
|         @NotNull(message = "SPU 编号不能为空") | ||||
|         private Long spuId; | ||||
|  | ||||
|         @NotNull(message = "SKU 编号活动商品不能为空") | ||||
|         private Long skuId; | ||||
|  | ||||
|         @NotNull(message = "购买数量不能为空") | ||||
|         private Integer count; | ||||
|  | ||||
|     } | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 puhui999
					puhui999