列表优化,拼团添加
parent
7063e0f6c6
commit
1b75139b17
|
@ -7,9 +7,18 @@ import javax.validation.constraints.NotNull;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
import ch.qos.logback.core.joran.spi.RuleStore;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
import com.muyu.marketing.domain.resp.RuleInfo;
|
||||||
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;
|
||||||
|
@ -18,6 +27,7 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品拼团信息
|
* 商品拼团信息
|
||||||
|
@ -28,13 +38,14 @@ import org.hibernate.validator.constraints.Length;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@TableName("activity_team_info")
|
@TableName("activity_team_info")
|
||||||
@ApiModel(value = "ProjectInfo", description = "商品拼团信息")
|
@ApiModel(value = "ProjectInfo", description = "拼团活动信息")
|
||||||
public class ActivityTeamInfo extends BaseEntity {
|
public class ActivityTeamInfo extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
@ApiModelProperty("主键")
|
@ApiModelProperty("主键")
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
|
@ -82,6 +93,8 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ApiModelProperty("活动结束时间")
|
@ApiModelProperty("活动结束时间")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
|
@ -116,13 +129,8 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
|
|
||||||
@ApiModelProperty("策略ID")
|
@ApiModelProperty("策略ID")
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
|
|
||||||
@ApiModelProperty("备注")
|
|
||||||
|
|
||||||
private String remark;
|
|
||||||
/**
|
/**
|
||||||
* 创建人
|
* 创建人
|
||||||
*/
|
*/
|
||||||
|
@ -149,5 +157,28 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加构造器
|
||||||
|
*/
|
||||||
|
public static ActivityTeamInfo saveBuildModel(ActivityTeamInfoSaveReq activityTeamInfoAddModel, Supplier<String> createBy){
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.name(activityTeamInfoAddModel.getName())
|
||||||
|
.productId(activityTeamInfoAddModel.getProductId())
|
||||||
|
.productImage(activityTeamInfoAddModel.getProductImage())
|
||||||
|
.introduction(activityTeamInfoAddModel.getIntroduction())
|
||||||
|
.unit(activityTeamInfoAddModel.getUnit())
|
||||||
|
.imageList(activityTeamInfoAddModel.getImageList() )
|
||||||
|
.endTime(activityTeamInfoAddModel.getEndTime())
|
||||||
|
.sort(activityTeamInfoAddModel.getSort())
|
||||||
|
.content(activityTeamInfoAddModel.getContent())
|
||||||
|
.strategyType(activityTeamInfoAddModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
||||||
|
.content(activityTeamInfoAddModel.getContent())
|
||||||
|
.status(activityTeamInfoAddModel.getStatus())
|
||||||
|
.createBy(createBy.get())
|
||||||
|
.createTime(new Date())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,11 +8,19 @@ import java.io.Serializable;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
import com.muyu.marketing.domain.resp.RuleInfo;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,13 +30,16 @@ import org.hibernate.validator.constraints.Length;
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@SuperBuilder
|
||||||
public class ActivityTeamProductSkuInfo implements Serializable {
|
public class ActivityTeamProductSkuInfo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
@ApiModelProperty("主键")
|
@ApiModelProperty("主键")
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
|
@ -103,5 +114,16 @@ public class ActivityTeamProductSkuInfo implements Serializable {
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
// public static ActivityTeamProductSkuInfo saveBuildModelSkuInfo(ActivityTeamInfoSaveReq activityTeamInfoSaveReq, RuleInfo ruleInfo,Supplier<String> createBy){
|
||||||
|
// return ActivityTeamProductSkuInfo.builder()
|
||||||
|
// .teamId(activityTeamInfoSaveReq.getId())
|
||||||
|
// .productSku(ruleInfo.getRuleSku())
|
||||||
|
// .teamStock(ruleInfo.getTeamStock())
|
||||||
|
// .teamPrice(ruleInfo.getTeamPrice())
|
||||||
|
// .productId(activityTeamInfoSaveReq.getProductId())
|
||||||
|
// .createTime(new Date())
|
||||||
|
// .createBy(createBy)
|
||||||
|
// .build();
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.muyu.marketing.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName("team_info")
|
||||||
|
@ApiModel(value = "TeamInfo", description = "拼团信息表")
|
||||||
|
public class TeamInfo {
|
||||||
|
/**
|
||||||
|
* 拼团活动Id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 拼团商品图片
|
||||||
|
*/
|
||||||
|
private String productimage;
|
||||||
|
/**
|
||||||
|
* 商品价格
|
||||||
|
*/
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
/**
|
||||||
|
* 拼团人数
|
||||||
|
*/
|
||||||
|
private Long openTeamNumber;
|
||||||
|
/**
|
||||||
|
* 开团人数
|
||||||
|
*/
|
||||||
|
private Long addTeamBumber;
|
||||||
|
/**
|
||||||
|
* 参团人数
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
/**
|
||||||
|
* 剩余库存
|
||||||
|
*/
|
||||||
|
private Long remainStock;
|
||||||
|
/**
|
||||||
|
* 团购结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 团购状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
private Long attendNumber;
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.marketing.domain.resp.RuleInfo;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel(value = "ActivityTeamInfo", description = "拼团活动表")
|
||||||
|
public class ActivityTeamInfoAddModel extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品图片
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String intro;
|
||||||
|
/**
|
||||||
|
* 商品单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 商品的轮播图
|
||||||
|
*/
|
||||||
|
private List<String> introduction;
|
||||||
|
/**
|
||||||
|
* 活动时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 商品规格List
|
||||||
|
*/
|
||||||
|
private List<RuleInfo> ruleInfo ;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -8,7 +8,6 @@ import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.function.Consumer;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@ -70,15 +69,8 @@ public class ActivityTeamInfoListModel {
|
||||||
ActivityTeamInfoListModel builder = ActivityTeamInfoListModel.builder()
|
ActivityTeamInfoListModel builder = ActivityTeamInfoListModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
.id(activityTeamInfo.getId())
|
||||||
.name(activityTeamInfo.getName())
|
.name(activityTeamInfo.getName())
|
||||||
// .addTeamNumber("00")
|
|
||||||
// .openTeamNumber("00")
|
|
||||||
// .attendNumber("00")
|
|
||||||
.endTime(activityTeamInfo.getEndTime())
|
.endTime(activityTeamInfo.getEndTime())
|
||||||
.productImage(activityTeamInfo.getProductImage())
|
.productImage(activityTeamInfo.getProductImage())
|
||||||
// .teamPrice("0")
|
|
||||||
// .productPrice("0")
|
|
||||||
// .remainStock("0")
|
|
||||||
// .teamStock("0")
|
|
||||||
.status(activityTeamInfo.getStatus())
|
.status(activityTeamInfo.getStatus())
|
||||||
.build();
|
.build();
|
||||||
return function.apply(
|
return function.apply(
|
||||||
|
|
|
@ -27,13 +27,13 @@ public class TeamProductDiscountPriceModel {
|
||||||
private Double disCount;
|
private Double disCount;
|
||||||
|
|
||||||
|
|
||||||
public static TeamProductStockModel of(BigDecimal productPrice,BigDecimal teamPrice){
|
public static TeamProductDiscountPriceModel of(BigDecimal productPrice,BigDecimal teamPrice){
|
||||||
TeamProductDiscountPriceModel.builder()
|
return TeamProductDiscountPriceModel.builder()
|
||||||
.productPrice(productPrice)
|
.productPrice(productPrice)
|
||||||
.teamPrice(teamPrice)
|
.teamPrice(teamPrice)
|
||||||
.disCount(productPrice.subtract(teamPrice).divide(productPrice,2, RoundingMode.HALF_UP).doubleValue())
|
.disCount(productPrice.subtract(teamPrice).divide(productPrice,2, RoundingMode.HALF_UP).doubleValue())
|
||||||
.build();
|
.build();
|
||||||
return of(productPrice, teamPrice);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,5 +12,6 @@ import lombok.NoArgsConstructor;
|
||||||
public class TeamProductStockModel {
|
public class TeamProductStockModel {
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
private Long remainStock;
|
private Long remainStock;
|
||||||
|
private Double discount;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
package com.muyu.marketing.domain.req;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.resp.RuleInfo;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@ApiModel(value = "AttributeInfo", description = "商品属性")
|
||||||
|
public class ActivityTeamInfoSaveReq {
|
||||||
|
|
||||||
|
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
@ApiModelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品图片
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 商品单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 商品的轮播图
|
||||||
|
*/
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动时间
|
||||||
|
*/
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 商品规格List
|
||||||
|
*/
|
||||||
|
private List<RuleInfo> ruleInfo ;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName(value = "activity_team_product_sku_info")
|
||||||
|
public class RuleInfo {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
@ApiModelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
*规格Sku
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
/**
|
||||||
|
*拼团库存
|
||||||
|
*/
|
||||||
|
private Long stock;
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||||
|
@ -8,6 +9,7 @@ import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -57,14 +59,18 @@ public class TeamInfoListResp {
|
||||||
/**
|
/**
|
||||||
* 团购结束时间
|
* 团购结束时间
|
||||||
*/
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 团购状态
|
* 团购状态
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
private Long attendNumber;
|
private Long attendNumber;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static TeamInfoListResp listModelBuild(ActivityTeamInfoListModel activityTeamInfoListModel){
|
public static TeamInfoListResp listModelBuild(ActivityTeamInfoListModel activityTeamInfoListModel){
|
||||||
return TeamInfoListResp.builder()
|
return TeamInfoListResp.builder()
|
||||||
.id(activityTeamInfoListModel.getId())
|
.id(activityTeamInfoListModel.getId())
|
||||||
|
|
|
@ -3,10 +3,11 @@ package com.muyu.marketing.controller;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
|
||||||
import com.muyu.marketing.domain.req.TeamInfoReqListReq;
|
import com.muyu.marketing.domain.req.TeamInfoReqListReq;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||||
import com.muyu.marketing.service.ActivityTeamInfoService;
|
import com.muyu.marketing.service.ActivityTeamInfoService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
@ -14,12 +15,17 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@Api(tags = "商品拼团信息")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/team")
|
@RequestMapping("/team")
|
||||||
public class ActivityTeamController {
|
public class ActivityTeamController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamInfoService activityTeamInfoService;
|
private ActivityTeamInfoService activityTeamInfoService;
|
||||||
|
/**
|
||||||
|
* 商品拼团列表
|
||||||
|
* @param teamInfoReqListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@PostMapping("list")
|
@PostMapping("list")
|
||||||
public Result<TableDataInfo<TeamInfoListResp>> list(@RequestBody TeamInfoReqListReq teamInfoReqListReq){
|
public Result<TableDataInfo<TeamInfoListResp>> list(@RequestBody TeamInfoReqListReq teamInfoReqListReq){
|
||||||
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = activityTeamInfoService.query(teamInfoReqListReq.buildQueryModel());
|
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = activityTeamInfoService.query(teamInfoReqListReq.buildQueryModel());
|
||||||
|
@ -32,4 +38,15 @@ public class ActivityTeamController {
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团添加
|
||||||
|
* @param teamInfoSaveReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("add")
|
||||||
|
public Result add(@RequestBody ActivityTeamInfoSaveReq teamInfoSaveReq){
|
||||||
|
Result addActivityTeamInfo = activityTeamInfoService.add(teamInfoSaveReq);
|
||||||
|
return addActivityTeamInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,29 @@
|
||||||
package com.muyu.marketing.service;
|
package com.muyu.marketing.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团订单列表
|
* 拼团活动列表
|
||||||
* @param activityTeamInfoListQueryModel
|
* @param activityTeamInfoListQueryModel
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动添加
|
||||||
|
* @param teamInfoSaveReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result add(ActivityTeamInfoSaveReq teamInfoSaveReq);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,5 +18,6 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
}
|
}
|
||||||
|
|
||||||
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId);
|
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId);
|
||||||
|
|
||||||
public TeamProductStockModel getStock(Long teamId);
|
public TeamProductStockModel getStock(Long teamId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,30 @@
|
||||||
package com.muyu.marketing.service.impl;
|
package com.muyu.marketing.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
import com.muyu.marketing.domain.resp.RuleInfo;
|
||||||
import com.muyu.marketing.mapper.ActivityInfoMapper;
|
|
||||||
import com.muyu.marketing.mapper.ActivityTeamInfoMapper;
|
import com.muyu.marketing.mapper.ActivityTeamInfoMapper;
|
||||||
import com.muyu.marketing.service.ActivityOpenInfoService;
|
import com.muyu.marketing.service.ActivityOpenInfoService;
|
||||||
import com.muyu.marketing.service.ActivityTeamInfoService;
|
import com.muyu.marketing.service.ActivityTeamInfoService;
|
||||||
import com.muyu.marketing.service.ActivityTeamProductSkuInfoService;
|
import com.muyu.marketing.service.ActivityTeamProductSkuInfoService;
|
||||||
|
import com.muyu.product.domain.ProjectInfo;
|
||||||
|
import com.muyu.product.domain.model.ProjectAddModel;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.math.BigDecimal;
|
||||||
import java.util.Arrays;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper,ActivityTeamInfo> implements ActivityTeamInfoService {
|
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper,ActivityTeamInfo> implements ActivityTeamInfoService {
|
||||||
|
@ -35,6 +35,11 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityOpenInfoService activityOpenInfoService;
|
private ActivityOpenInfoService activityOpenInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动列表
|
||||||
|
* @param activityTeamInfoListQueryModel
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> query (ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
public TableDataInfo<ActivityTeamInfoListModel> query (ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
@ -47,15 +52,15 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
(activityTeamInfoListModelBuilder) -> {
|
(activityTeamInfoListModelBuilder) -> {
|
||||||
Long openNumberByTeamIdAndType = activityOpenInfoService.getTeamOpenNumberByTeamIdAndType(activityTeamInfo.getId());
|
Long openNumberByTeamIdAndType = activityOpenInfoService.getTeamOpenNumberByTeamIdAndType(activityTeamInfo.getId());
|
||||||
Long inNumberByTeamIdAndType = activityOpenInfoService.getTeamInNumberByTeamIdAndType(activityTeamInfo.getId());
|
Long inNumberByTeamIdAndType = activityOpenInfoService.getTeamInNumberByTeamIdAndType(activityTeamInfo.getId());
|
||||||
TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
|
// TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
|
||||||
TeamProductStockModel teamProductStockModel = activityTeamProductSkuInfoService.getStock(activityTeamInfo.getId());
|
TeamProductStockModel teamProductStockModel = activityTeamProductSkuInfoService.getStock(activityTeamInfo.getId());
|
||||||
|
|
||||||
return activityTeamInfoListModelBuilder
|
return activityTeamInfoListModelBuilder
|
||||||
.openTeamNumber(openNumberByTeamIdAndType)
|
.openTeamNumber(openNumberByTeamIdAndType)
|
||||||
.addTeamNumber(inNumberByTeamIdAndType)
|
.addTeamNumber(inNumberByTeamIdAndType)
|
||||||
.attendNumber(openNumberByTeamIdAndType + inNumberByTeamIdAndType)
|
.attendNumber(openNumberByTeamIdAndType + inNumberByTeamIdAndType)
|
||||||
.teamPrice(discountPrice.getTeamPrice())
|
.teamPrice(BigDecimal.valueOf(1))
|
||||||
.productPrice(discountPrice.getProductPrice())
|
.productPrice(BigDecimal.valueOf(1))
|
||||||
.teamStock(teamProductStockModel.getTeamStock())
|
.teamStock(teamProductStockModel.getTeamStock())
|
||||||
.remainStock(teamProductStockModel.getRemainStock())
|
.remainStock(teamProductStockModel.getRemainStock())
|
||||||
.build();
|
.build();
|
||||||
|
@ -68,4 +73,30 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
return tableDataInfo;
|
return tableDataInfo;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动添加
|
||||||
|
* @param teamInfoSaveReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public Result add(ActivityTeamInfoSaveReq teamInfoSaveReq) {
|
||||||
|
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.saveBuildModel(teamInfoSaveReq, SecurityUtils::getUsername);
|
||||||
|
this.save(activityTeamInfo);
|
||||||
|
List<RuleInfo> ruleInfoList = teamInfoSaveReq.getRuleInfo();
|
||||||
|
List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfos = ruleInfoList.stream().map(ruleInfo -> {
|
||||||
|
ActivityTeamProductSkuInfo productSkuInfo = ActivityTeamProductSkuInfo.builder()
|
||||||
|
.teamId(activityTeamInfo.getId())
|
||||||
|
.productSku(ruleInfo.getSku())
|
||||||
|
.teamStock(ruleInfo.getStock())
|
||||||
|
.teamPrice(ruleInfo.getPrice())
|
||||||
|
.productId(teamInfoSaveReq.getProductId())
|
||||||
|
.createTime(new Date())
|
||||||
|
.build();
|
||||||
|
return productSkuInfo;
|
||||||
|
}).toList();
|
||||||
|
activityTeamProductSkuInfoService.saveBatch(activityTeamProductSkuInfos);
|
||||||
|
return Result.success(0,"添加成功");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,22 +2,23 @@ package com.muyu.marketing.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
||||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||||
import com.muyu.marketing.mapper.ActivityTeamOpenInfoMapper;
|
|
||||||
import com.muyu.marketing.mapper.ActivityTeamProductSkuInfoMapper;
|
import com.muyu.marketing.mapper.ActivityTeamProductSkuInfoMapper;
|
||||||
import com.muyu.marketing.service.ActivityTeamProductSkuInfoService;
|
import com.muyu.marketing.service.ActivityTeamProductSkuInfoService;
|
||||||
import com.muyu.product.cache.ProjectSkuCache;
|
import com.muyu.product.cache.ProjectSkuCache;
|
||||||
import com.muyu.product.cache.datasource.ProjectSkuData;
|
|
||||||
import com.muyu.product.domain.ProjectSkuInfo;
|
import com.muyu.product.domain.ProjectSkuInfo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper,ActivityTeamProductSkuInfo> implements ActivityTeamProductSkuInfoService {
|
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper,ActivityTeamProductSkuInfo> implements ActivityTeamProductSkuInfoService {
|
||||||
|
|
||||||
|
@ -26,30 +27,44 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId) {
|
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId) {
|
||||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||||
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,teamId);
|
//用stream把teamProductSkuInfoList集合里的数据转换给teamProductDiscountPriceModelArrayList
|
||||||
List<ActivityTeamProductSkuInfo> productSkuInfos = this.list(queryWrapper);
|
Optional<TeamProductDiscountPriceModel> min = teamProductSkuInfoList.stream()
|
||||||
ArrayList<TeamProductDiscountPriceModel> teamProductDiscountPriceModels = new ArrayList<>();
|
.map(activityTeamProductSkuInfo -> {
|
||||||
for (ActivityTeamProductSkuInfo productSkuInfo : productSkuInfos) {
|
ProjectSkuInfo projectSkuInfo = projectSkuCache.getData(Long.valueOf(activityTeamProductSkuInfo.getProductId()),activityTeamProductSkuInfo.getProductSku());
|
||||||
ProjectSkuInfo skuInfo = projectSkuCache.get(productSkuInfo.getProductId(), productSkuInfo.getProductSku());
|
return TeamProductDiscountPriceModel.of(projectSkuInfo.getPrice(), activityTeamProductSkuInfo.getTeamPrice());
|
||||||
BigDecimal price = skuInfo.getPrice();
|
}).min((o1, o2) -> Double.valueOf(o1.getDisCount() * 100 - o2.getDisCount() * 100).intValue());
|
||||||
BigDecimal teamPrice = productSkuInfo.getTeamPrice();
|
|
||||||
TeamProductDiscountPriceModel priceModel = new TeamProductDiscountPriceModel();
|
|
||||||
priceModel.setProductPrice(price);
|
|
||||||
priceModel.setTeamPrice(teamPrice);
|
|
||||||
priceModel.setDisCount(price.subtract(teamPrice).divide(price,2, RoundingMode.HALF_UP).doubleValue());
|
|
||||||
|
|
||||||
teamProductDiscountPriceModels.add(priceModel);
|
if(min.isEmpty()){
|
||||||
|
throw new ServiceException("团购活动下没有商品了");
|
||||||
}
|
}
|
||||||
TeamProductDiscountPriceModel teamProductDiscountPriceModel = teamProductDiscountPriceModels.get(0);
|
return min.get();
|
||||||
for (TeamProductDiscountPriceModel productDiscountPriceModel : teamProductDiscountPriceModels) {
|
|
||||||
if(teamProductDiscountPriceModel.getDisCount() < productDiscountPriceModel.getDisCount()){
|
|
||||||
teamProductDiscountPriceModel = productDiscountPriceModel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return teamProductDiscountPriceModel;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
// LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
// queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,teamId);
|
||||||
|
// List<ActivityTeamProductSkuInfo> productSkuInfos = this.list(queryWrapper);
|
||||||
|
// ArrayList<TeamProductDiscountPriceModel> teamProductDiscountPriceModels = new ArrayList<>();
|
||||||
|
// for (ActivityTeamProductSkuInfo productSkuInfo : productSkuInfos) {
|
||||||
|
// ProjectSkuInfo skuInfo = projectSkuCache.getData(productSkuInfo.getProductId(), productSkuInfo.getProductSku());
|
||||||
|
// BigDecimal price = skuInfo.getPrice();
|
||||||
|
// BigDecimal teamPrice = productSkuInfo.getTeamPrice();
|
||||||
|
// TeamProductDiscountPriceModel priceModel = new TeamProductDiscountPriceModel();
|
||||||
|
// priceModel.setProductPrice(price);
|
||||||
|
// priceModel.setTeamPrice(teamPrice);
|
||||||
|
// priceModel.setDisCount(price.subtract(teamPrice).divide(price,2, RoundingMode.HALF_UP).doubleValue());
|
||||||
|
//
|
||||||
|
// teamProductDiscountPriceModels.add(priceModel);
|
||||||
|
// }
|
||||||
|
// TeamProductDiscountPriceModel teamProductDiscountPriceModel = teamProductDiscountPriceModels.get(0);
|
||||||
|
// for (TeamProductDiscountPriceModel productDiscountPriceModel : teamProductDiscountPriceModels) {
|
||||||
|
// if(teamProductDiscountPriceModel.getDisCount() > productDiscountPriceModel.getDisCount()){
|
||||||
|
// teamProductDiscountPriceModel = productDiscountPriceModel;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return teamProductDiscountPriceModel;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TeamProductStockModel getStock(Long teamId) {
|
public TeamProductStockModel getStock(Long teamId) {
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"商品id":"Long",
|
||||||
|
"商品图片":"String",
|
||||||
|
"拼团活动名称":"String",
|
||||||
|
"拼团活动简介":"String",
|
||||||
|
"商品单位":"String",
|
||||||
|
"商品轮播图":List<String>,
|
||||||
|
"活动时间":"Date",
|
||||||
|
"拼团时效":"Integer",
|
||||||
|
"拼团人数":"Integer",
|
||||||
|
"购买总量限制":"Integer",
|
||||||
|
"单词总量限制":"Integer",
|
||||||
|
"补齐人数":"Integer",
|
||||||
|
"商品规格id":[
|
||||||
|
"商品Sku":"属性名称"
|
||||||
|
|
||||||
|
],
|
||||||
|
"排序":"Integer",
|
||||||
|
"详情":"Text"
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue