|
@@ -1,12 +1,14 @@
|
|
package com.yonge.cooleshow.admin.io.request.coupon;
|
|
package com.yonge.cooleshow.admin.io.request.coupon;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
import com.yonge.cooleshow.biz.dal.enums.coupon.CouponCategoryEnum;
|
|
import com.yonge.cooleshow.biz.dal.enums.coupon.CouponCategoryEnum;
|
|
import com.yonge.cooleshow.biz.dal.enums.coupon.CouponUseStateEnum;
|
|
import com.yonge.cooleshow.biz.dal.enums.coupon.CouponUseStateEnum;
|
|
import io.swagger.annotations.ApiModel;
|
|
import io.swagger.annotations.ApiModel;
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
+import lombok.Builder;
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
import lombok.NoArgsConstructor;
|
|
import lombok.NoArgsConstructor;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
@@ -91,6 +93,7 @@ public class CouponOrderVO {
|
|
* 优惠券详情信息
|
|
* 优惠券详情信息
|
|
*/
|
|
*/
|
|
@Data
|
|
@Data
|
|
|
|
+ @Builder
|
|
@NoArgsConstructor
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public static class CouponInfo implements Serializable {
|
|
public static class CouponInfo implements Serializable {
|
|
@@ -125,7 +128,10 @@ public class CouponOrderVO {
|
|
@ApiModelProperty("用户ID")
|
|
@ApiModelProperty("用户ID")
|
|
private Long userId;
|
|
private Long userId;
|
|
|
|
|
|
- @ApiModelProperty("优惠券信息")
|
|
|
|
|
|
+ @ApiModelProperty(value = "优惠券发放ID")
|
|
|
|
+ private List<Long> issueIds;
|
|
|
|
+
|
|
|
|
+ @ApiModelProperty(value = "优惠券信息", hidden = true)
|
|
private List<CouponInfo> couponInfos;
|
|
private List<CouponInfo> couponInfos;
|
|
|
|
|
|
@ApiModelProperty("优惠券状态重置标识")
|
|
@ApiModelProperty("优惠券状态重置标识")
|
|
@@ -146,7 +152,7 @@ public class CouponOrderVO {
|
|
} else {
|
|
} else {
|
|
|
|
|
|
// 更新优惠券使用状态
|
|
// 更新优惠券使用状态
|
|
- if (CollectionUtils.isEmpty(getCouponInfos())) {
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(getIssueIds())) {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -157,5 +163,21 @@ public class CouponOrderVO {
|
|
public String jsonString() {
|
|
public String jsonString() {
|
|
return JSON.toJSONString(this);
|
|
return JSON.toJSONString(this);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public List<CouponInfo> getCouponInfos() {
|
|
|
|
+
|
|
|
|
+ List<CouponInfo> retlist = Lists.newArrayList();
|
|
|
|
+
|
|
|
|
+ if (CollectionUtils.isNotEmpty(getIssueIds())) {
|
|
|
|
+
|
|
|
|
+ for (Long item : getIssueIds()) {
|
|
|
|
+
|
|
|
|
+ retlist.add(CouponInfo.builder().issueId(item).selected(true).build());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return retlist;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|