From 8ec373388250cf26b16094de895e5a414490ed3b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 16 Jun 2023 20:32:03 +0800 Subject: [PATCH] =?UTF-8?q?mall=20+=20trade=EF=BC=9Amock=20=E6=8B=BC?= =?UTF-8?q?=E5=9B=A2=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/common/util/date/DateUtils.java | 1 - .../AppCombinationRecordController.java | 29 ++++++++++++++----- .../AppCombinationRecordDetailRespVO.java | 4 +-- ...O.java => AppCombinationRecordRespVO.java} | 21 ++++++++++++-- .../vo/AppTradeOrderSettlementReqVO.java | 12 ++++++++ 5 files changed, 54 insertions(+), 13 deletions(-) rename yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/{AppCombinationRecordSimpleRespVO.java => AppCombinationRecordRespVO.java} (50%) diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java index a329fb1777..c2d069a593 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java @@ -55,7 +55,6 @@ public class DateUtils { return LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); } - @Deprecated public static Date addTime(Duration duration) { return new Date(System.currentTimeMillis() + duration.toMillis()); } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java index 1e32111f14..b9086f3626 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java @@ -1,8 +1,9 @@ package cn.iocoder.yudao.module.promotion.controller.app.combination; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordDetailRespVO; -import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordSimpleRespVO; +import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordRespVO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.validation.constraints.Max; +import java.time.Duration; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -27,18 +29,23 @@ public class AppCombinationRecordController { @GetMapping("/get-head-list") @Operation(summary = "获得最近 n 条拼团记录(团长发起的)") - public CommonResult> getHeadCombinationRecordList( + // TODO @芋艿:注解要补全 + public CommonResult> getHeadCombinationRecordList( + @RequestParam(value = "activityId", required = false) Long activityId, @RequestParam("status") Integer status, @RequestParam(value = "count", defaultValue = "20") @Max(20) Integer count) { - List list = new ArrayList<>(); + List list = new ArrayList<>(); for (int i = 1; i <= count; i++) { - AppCombinationRecordSimpleRespVO record = new AppCombinationRecordSimpleRespVO(); + AppCombinationRecordRespVO record = new AppCombinationRecordRespVO(); record.setId((long) i); record.setNickname("用户" + i); record.setAvatar("头像" + i); record.setExpireTime(new Date()); record.setUserSize(10); record.setUserCount(i); + record.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); + record.setActivityId(1L); + record.setActivityName("活动:" + i); list.add(record); } return success(list); @@ -50,23 +57,29 @@ public class AppCombinationRecordController { public CommonResult getCombinationRecordDetail(@RequestParam("id") Long id) { AppCombinationRecordDetailRespVO detail = new AppCombinationRecordDetailRespVO(); // 团长 - AppCombinationRecordSimpleRespVO headRecord = new AppCombinationRecordSimpleRespVO(); + AppCombinationRecordRespVO headRecord = new AppCombinationRecordRespVO(); headRecord.setId(1L); headRecord.setNickname("用户" + 1); headRecord.setAvatar("头像" + 1); - headRecord.setExpireTime(new Date()); + headRecord.setExpireTime(DateUtils.addTime(Duration.ofDays(1))); headRecord.setUserSize(10); headRecord.setUserCount(3); + headRecord.setStatus(1); + headRecord.setActivityId(10L); + headRecord.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); + headRecord.setCombinationPrice(100); + detail.setHeadRecord(headRecord); // 团员 - List list = new ArrayList<>(); + List list = new ArrayList<>(); for (int i = 1; i <= 2; i++) { - AppCombinationRecordSimpleRespVO record = new AppCombinationRecordSimpleRespVO(); + AppCombinationRecordRespVO record = new AppCombinationRecordRespVO(); record.setId((long) i); record.setNickname("用户" + i); record.setAvatar("头像" + i); record.setExpireTime(new Date()); record.setUserSize(10); record.setUserCount(i); + record.setStatus(1); list.add(record); } detail.setMemberRecords(list); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordDetailRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordDetailRespVO.java index 120926ad6a..dae83ea9c9 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordDetailRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordDetailRespVO.java @@ -10,10 +10,10 @@ import java.util.List; public class AppCombinationRecordDetailRespVO { @Schema(description = "团长的拼团记录", required = true) - private AppCombinationRecordSimpleRespVO headRecord; + private AppCombinationRecordRespVO headRecord; @Schema(description = "成员的拼团记录", required = true) - private List memberRecords; + private List memberRecords; @Schema(description = "当前用户参团记录对应的订单编号", required = true, example = "1024") // 如果没参团,返回 null private Long orderId; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordSimpleRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordRespVO.java similarity index 50% rename from yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordSimpleRespVO.java rename to yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordRespVO.java index 54177aeb80..0f591bcff1 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordSimpleRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordRespVO.java @@ -5,13 +5,16 @@ import lombok.Data; import java.util.Date; -@Schema(description = "用户 App - 拼团记录精简 Response VO") +@Schema(description = "用户 App - 拼团记录 Response VO") @Data -public class AppCombinationRecordSimpleRespVO { +public class AppCombinationRecordRespVO { @Schema(description = "拼团记录编号", required = true, example = "1024") private Long id; + @Schema(description = "拼团活动编号", required = true, example = "1024") + private Long activityId; + @Schema(description = "用户昵称", required = true, example = "1024") private String nickname; @@ -27,4 +30,18 @@ public class AppCombinationRecordSimpleRespVO { @Schema(description = "已参团人数", required = true, example = "5") private Integer userCount; + @Schema(description = "拼团状态", required = true, example = "1") + private Integer status; + + @Schema(description = "商品图片", required = true, example = "https://www.iocoder.cn/1.png") + private String picUrl; + + @Schema(description = "拼团金额,单位:分", required = true, example = "100") + private Integer combinationPrice; + + // ========== 获得最近 n 条拼团记录(团长发起的)返回的字段 ========== + + @Schema(description = "拼团活动名字", required = true, example = "1024") + private String activityName; + } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderSettlementReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderSettlementReqVO.java index 0324b492bb..4a21bbc63b 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderSettlementReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderSettlementReqVO.java @@ -18,6 +18,7 @@ public class AppTradeOrderSettlementReqVO { @NotNull(message = "交易类型不能为空") @InEnum(value = TradeOrderTypeEnum.class, message = "交易类型必须是 {value}") + @Deprecated // TODO 芋艿:后续干掉这个字段,对于前端不需要关注这个 private Integer type; @Schema(description = "商品项数组", required = true) @@ -30,6 +31,17 @@ public class AppTradeOrderSettlementReqVO { @Schema(description = "优惠劵编号", example = "1024") private Long couponId; + // ========== 秒杀活动相关字段 ========== + @Schema(description = "秒杀活动编号", example = "1024") + private Long seckillActivityId; + + // ========== 拼团活动相关字段 ========== + @Schema(description = "拼团活动编号", example = "1024") + private Long combinationActivityId; + + @Schema(description = "拼团团长编号", example = "2048") + private Long combinationHeadId; + @Data @Schema(description = "用户 App - 商品项") @Valid