master
parent
cd50dc7d85
commit
208868788b
|
@ -1,69 +0,0 @@
|
|||
package com.muyu.common.core.web;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.muyu.common.core.web.page.PageDomain;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 列表查询模型
|
||||
*
|
||||
* @author AmAg
|
||||
* @create 2024-11-21 16:40
|
||||
**/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class QueryModel<T> {
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
private Integer pageNum;
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
private String orderByColumn;
|
||||
|
||||
/**
|
||||
* 排序的方向desc或者asc
|
||||
*/
|
||||
private boolean isAsc = true;
|
||||
|
||||
/**
|
||||
* 构建模型分页对象
|
||||
* @param pageDomain
|
||||
* @return 模型分页对象
|
||||
*/
|
||||
public T domainBuild(PageDomain pageDomain){
|
||||
this.pageNum = pageDomain.getPageNum();
|
||||
this.pageSize = pageDomain.getPageSize();
|
||||
this.orderByColumn = pageDomain.getOrderByColumn();
|
||||
this.isAsc = "asc".equals(pageDomain.getIsAsc());
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建查询分页弄对象
|
||||
* @return 查询分页对象
|
||||
*/
|
||||
public <I> Page<I> buildPage(){
|
||||
Page<I> page = Page.of(this.getPageNum(), this.getPageSize());
|
||||
page.setOrders(List.of(this.isAsc()
|
||||
? OrderItem.asc(this.getOrderByColumn()) : OrderItem.desc(this.getOrderByColumn())));
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.common.core.web.model;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.muyu.common.core.web.page.PageDomain;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
||||
@AllArgsConstructor
|
||||
public class QueryModel<T> {
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
private String orderByColumn;
|
||||
private boolean isAsc=true;
|
||||
private Boolean reasonable=true;
|
||||
public T domainBuild(PageDomain pageDomain){
|
||||
this.pageNum=pageDomain.getPageNum();
|
||||
this.pageSize=pageDomain.getPageSize();
|
||||
this.orderByColumn=pageDomain.getOrderByColumn();
|
||||
this.isAsc= "asc".equals(pageDomain.getIsAsc());
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
public <I> Page<I> buildPage(){
|
||||
Page<I> page= Page.of(this.getPageNum(),this.getPageSize());
|
||||
page.setOrders(List.of(this.isAsc()? OrderItem.asc(this.getOrderByColumn()) :
|
||||
OrderItem.desc(this.getOrderByColumn())));
|
||||
return page;
|
||||
}
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品拼团信息
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "activity_team_info",autoResultMap = true)
|
||||
public class ActivityTeamInfo extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 团购活动执行表
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "activity_team_open_info",autoResultMap = true)
|
||||
public class ActivityTeamOpenInfo extends BaseEntity{
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 团购活动ID
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
* 团购类型
|
||||
*/
|
||||
private String teamType;
|
||||
/**
|
||||
* 团购策略
|
||||
*/
|
||||
private String teamStrategyId;
|
||||
/**
|
||||
* 参团类型
|
||||
*/
|
||||
private String executiveType;
|
||||
/**
|
||||
* 结束团购时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private String productSku;
|
||||
/**
|
||||
* 开团标识
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 开团状态
|
||||
*/
|
||||
private String status;
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
||||
/**
|
||||
* 商品拼团规格信息表
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "activity_team_product_sku_info",autoResultMap = true)
|
||||
public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
/**
|
||||
* 商品SKU
|
||||
*/
|
||||
private String productSku;
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private String teamStock;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private String teamPrice;
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.NonNull;
|
||||
import org.apache.xmlbeans.impl.soap.Text;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 营销拼团活动实体类
|
||||
*
|
||||
* @author AmAg
|
||||
* @create: 2024-11-22 20:37
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MarketingGroupInfo extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "商品id不能为空")
|
||||
private Long id;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@NotNull(message = "商品名称不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
@NotNull(message = "一个有效的图片")
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
@NotNull(message = "商品简介不能为空")
|
||||
@Size(min = 5,max = 500,message = "商品简介内容必须在5-500字符之间")
|
||||
private Text introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@NotNull(message = "商品单位不能为空")
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
private List<String> productImages;
|
||||
/**
|
||||
* 活动时间
|
||||
*/
|
||||
@NotNull(message = "活动时间不能为空")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
@NotNull(message = "策略类型不能为空不能为空")
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
@NotNull(message = "策略Id不能为空")
|
||||
private Long strategyId;
|
||||
/**
|
||||
* 商品Sku信息
|
||||
*/
|
||||
private List<ActivityTeamProductSkuInfo> productSkuInfo;
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private String sortOrder;
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
||||
/**
|
||||
* 拼团免单策略
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "team_strategy_exemption",autoResultMap = true)
|
||||
public class TeamStrategyExemption extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private Long duration;
|
||||
/**
|
||||
* 免单人数
|
||||
*/
|
||||
private Long exemptionNumber;
|
||||
/**
|
||||
* 最大购买量
|
||||
*/
|
||||
private Long maxBuy;
|
||||
/**
|
||||
* 单次购买量
|
||||
*/
|
||||
private Long oneBuy;
|
||||
/**
|
||||
* 虚拟人数
|
||||
*/
|
||||
private Long virtualNumber;
|
||||
/**
|
||||
* 面单类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 返款阶梯
|
||||
*/
|
||||
private String ruleInfo;
|
||||
/**
|
||||
* 策略状态
|
||||
*/
|
||||
private String status;
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
||||
/**
|
||||
* 百人策略
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "team_strategy_exemption_hundred",autoResultMap = true)
|
||||
public class TeamStrategyExemptionHundred extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private Long duration;
|
||||
/**
|
||||
* 最大购买量
|
||||
*/
|
||||
private Long maxBuy;
|
||||
/**
|
||||
* 单次购买量
|
||||
*/
|
||||
private Long oneBuy;
|
||||
/**
|
||||
* 虚拟人数
|
||||
*/
|
||||
private Long virtualNumber;
|
||||
/**
|
||||
* 策略状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 规则信息
|
||||
*/
|
||||
private String ruleInfo;
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
||||
/**
|
||||
* 普通策略
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "team_strategy_exemption_ordinary",autoResultMap = true)
|
||||
public class TeamStrategyExemptionOrdinary extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private Long duration;
|
||||
/**
|
||||
* 成团人数
|
||||
*/
|
||||
private Long teamNumber;
|
||||
/**
|
||||
* 最大购买量
|
||||
*/
|
||||
private Long maxBuy;
|
||||
/**
|
||||
* 单次购买量
|
||||
*/
|
||||
private Long oneBuy;
|
||||
/**
|
||||
* 虚拟人数
|
||||
*/
|
||||
private Long virtualNumber;
|
||||
/**
|
||||
* 策略状态
|
||||
*/
|
||||
private String status;
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.common.core.web.QueryModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 团购活动列表查询结果模型
|
||||
*
|
||||
* @author: AmAg
|
||||
* @create: 2024-11-21 16:38
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ActivityTeamInfoListModel {
|
||||
/**
|
||||
* 拼团活动ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 拼团商品图片
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private Double productPrice;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private Double teamPrice;
|
||||
/**
|
||||
* 拼团人数
|
||||
*/
|
||||
private Long attendNumber;
|
||||
/**
|
||||
* 开团人数
|
||||
*/
|
||||
private Long openTeamNumber;
|
||||
/**
|
||||
* 参团人数
|
||||
*/
|
||||
private Long addTeamNumber;
|
||||
/**
|
||||
* 商品库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
/**
|
||||
* 剩余库存
|
||||
*/
|
||||
private Long remainStock;
|
||||
/**
|
||||
* 团购结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.common.core.web.QueryModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 团购活动列表查询模型
|
||||
*
|
||||
* @author: AmAg
|
||||
* @create: 2024-11-21 16:38
|
||||
**/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ActivityTeamInfoListQueryModel extends QueryModel<ActivityTeamInfoListQueryModel> {
|
||||
|
||||
/**
|
||||
* 搜索关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.xmlbeans.impl.xb.xsdschema.All;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 团购活动添加结果模型
|
||||
*
|
||||
* @author AmAg
|
||||
* @create: 2024-11-22 11:50
|
||||
// **/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoSaveModel {
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
//
|
||||
//// private List<>
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
/** 营销拼团活动对象
|
||||
* @author AmAg
|
||||
* @create: 2024-11-22 21:08
|
||||
**/
|
||||
public class MarketingGroupInfoListReq {
|
||||
/**
|
||||
* 搜索关键字
|
||||
*
|
||||
*/
|
||||
private String keyWord;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.muyu.common.core.web.page.PageDomain;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
||||
/**
|
||||
* 拼团团购对象 team_info 列表
|
||||
*
|
||||
* @author AmAg
|
||||
* @create: 2024-11-22 11:34
|
||||
**/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TeamInfoListReq extends PageDomain {
|
||||
|
||||
/**
|
||||
* 搜索关键字
|
||||
*
|
||||
*/
|
||||
private String keyWord;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 通过当前对象构建业务查询模型
|
||||
* @return 业务查询模型
|
||||
*/
|
||||
public ActivityTeamInfoListQueryModel buildQueryModel() {
|
||||
|
||||
return ActivityTeamInfoListQueryModel.builder()
|
||||
.keyWord(this.keyWord)
|
||||
.status(this.status)
|
||||
.build()
|
||||
.domainBuild(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
||||
|
||||
/**
|
||||
* 拼团团购对象 team_info 列表
|
||||
*
|
||||
* @author AmAg
|
||||
* @create: 2024-11-22 11:34
|
||||
**/
|
||||
public class TeamInfoSaveReq {
|
||||
|
||||
// /**
|
||||
// * 搜索关键字
|
||||
// *
|
||||
// */
|
||||
// private String keyWord;
|
||||
// /**
|
||||
// * 活动状态
|
||||
// */
|
||||
// private String status;
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 通过当前对象构建业务添加模型
|
||||
// * @return 业务添加模型
|
||||
// */
|
||||
// public ActivityTeamInfoSaveModel buildAddModel() {
|
||||
//
|
||||
// return ActivityTeamInfoSaveModel.builder()
|
||||
// .keyWord(this.keyWord)
|
||||
// .status(this.status)
|
||||
// .build()
|
||||
// .domainBuild(this);
|
||||
// }
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author AmAg
|
||||
* @create: 2024-11-22 21:10
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MarketingGroupInfoResp {
|
||||
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TeamInfoResp{
|
||||
/**
|
||||
* 拼团活动ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 拼团商品图片
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private Double productPrice;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private Double teamPrice;
|
||||
/**
|
||||
* 拼团人数
|
||||
*/
|
||||
private Long attendNumber;
|
||||
/**
|
||||
* 开团人数
|
||||
*/
|
||||
private Long openTeamNumber;
|
||||
/**
|
||||
* 参团人数
|
||||
*/
|
||||
private Long addTeamNumber;
|
||||
/**
|
||||
* 商品库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
/**
|
||||
* 剩余库存
|
||||
*/
|
||||
private Long remainStock;
|
||||
/**
|
||||
* 团购结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package com.muyu.markteing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
import com.muyu.markteing.domain.model.ActivityTeamInfoAddModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品拼团信息
|
||||
* @TableName activity_team_info
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "activity_team_info",autoResultMap = true)
|
||||
public class ActivityTeamInfo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static ActivityTeamInfo saveModelBuild(ActivityTeamInfoAddModel activityTeamInfoAddModel){
|
||||
return ActivityTeamInfo.builder()
|
||||
.name(activityTeamInfoAddModel.getName())
|
||||
.productId(activityTeamInfoAddModel.getProductId())
|
||||
.productImage(activityTeamInfoAddModel.getProductImage())
|
||||
.introduction(activityTeamInfoAddModel.getIntroduction())
|
||||
.unit(activityTeamInfoAddModel.getUnit())
|
||||
.imageList(activityTeamInfoAddModel.getProductImage())
|
||||
.endTime(activityTeamInfoAddModel.getEndTime())
|
||||
.sort(activityTeamInfoAddModel.getSort())
|
||||
.content(activityTeamInfoAddModel.getContent())
|
||||
.strategyType(activityTeamInfoAddModel.getStrategyType())
|
||||
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package com.muyu.markteing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 团购活动执行表
|
||||
* @TableName activity_team_open_info
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "activity_team_open_info",autoResultMap = true)
|
||||
public class ActivityTeamOpenInfo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 团购活动ID
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
* 团购类型
|
||||
*/
|
||||
private String teamType;
|
||||
/**
|
||||
* 团购策略
|
||||
*/
|
||||
private String teamStrategyId;
|
||||
/**
|
||||
* 参团类型
|
||||
*/
|
||||
private String executiveType;
|
||||
/**
|
||||
* 结束团购时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private String productSku;
|
||||
/**
|
||||
* 开团标识
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 开团状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.muyu.markteing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品拼团规格信息表
|
||||
* @TableName activity_team_product_sku_info
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "activity_team_product_sku_info",autoResultMap = true)
|
||||
public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
|
||||
private Long teamId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品SKU
|
||||
*/
|
||||
|
||||
private String productSku;
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
|
||||
private Long teamStock;
|
||||
|
||||
/**
|
||||
* 剩余库存
|
||||
*/
|
||||
|
||||
private Long remainStock;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.markteing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 拼团免单策略
|
||||
* @TableName team_strategy_exemption
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "team_strategy_exemption",autoResultMap = true)
|
||||
public class TeamStrategyExemption extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private Integer duration;
|
||||
/**
|
||||
* 免单人数
|
||||
*/
|
||||
private Integer exemptionNumber;
|
||||
/**
|
||||
* 最大购买量
|
||||
*/
|
||||
private Integer maxBuy;
|
||||
/**
|
||||
* 单次购买量
|
||||
*/
|
||||
private Integer oneBuy;
|
||||
/**
|
||||
* 虚拟人数
|
||||
*/
|
||||
private Integer virtualNumber;
|
||||
/**
|
||||
* 面单类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 返款阶梯
|
||||
*/
|
||||
private String ruleInfo;
|
||||
/**
|
||||
* 策略状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.muyu.markteing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 百人策略
|
||||
* @TableName team_strategy_exemption_hundred
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "team_strategy_exemption_hundred",autoResultMap = true)
|
||||
public class TeamStrategyExemptionHundred extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private Integer duration;
|
||||
/**
|
||||
* 最大购买量
|
||||
*/
|
||||
private Integer maxBuy;
|
||||
/**
|
||||
* 单次购买量
|
||||
*/
|
||||
private Integer oneBuy;
|
||||
/**
|
||||
* 虚拟人数
|
||||
*/
|
||||
private Integer virtualNumber;
|
||||
/**
|
||||
* 策略状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 规则信息
|
||||
*/
|
||||
private String ruleInfo;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.muyu.markteing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 普通策略
|
||||
* @TableName team_strategy_exemption_ordinary
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "team_strategy_exemption_ordinary",autoResultMap = true)
|
||||
public class TeamStrategyExemptionOrdinary extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
|
||||
private Integer duration;
|
||||
/**
|
||||
* 成团人数
|
||||
*/
|
||||
|
||||
private Integer teamNumber;
|
||||
/**
|
||||
* 最大购买量
|
||||
*/
|
||||
|
||||
private Integer maxBuy;
|
||||
/**
|
||||
* 单次购买量
|
||||
*/
|
||||
|
||||
private Integer oneBuy;
|
||||
/**
|
||||
* 虚拟人数
|
||||
*/
|
||||
|
||||
private Integer virtualNumber;
|
||||
/**
|
||||
* 策略状态
|
||||
*/
|
||||
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,170 @@
|
|||
package com.muyu.markteing.domain.model;
|
||||
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@SuperBuilder
|
||||
public class ActivityTeamInfoAddModel extends BaseEntity {
|
||||
/**
|
||||
* 商品Id
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
private String productImage;
|
||||
|
||||
/**
|
||||
* 拼团活动名称
|
||||
*/
|
||||
@NotNull(message = "不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
@NotNull(message = "不能为空")
|
||||
private String introduction;
|
||||
|
||||
/**
|
||||
* 商品单位
|
||||
*/
|
||||
@NotNull(message = "不能为空")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
*商品轮播图
|
||||
*/
|
||||
private List<String> imageList;
|
||||
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
// /**
|
||||
// * 商品规格
|
||||
// */
|
||||
// private List<ProjectSkuInfoAddReq> projectSkuInfoAddReqList;
|
||||
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
public Long getProductId() {
|
||||
return productId;
|
||||
}
|
||||
|
||||
public String getProductImage() {
|
||||
return productImage;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getIntroduction() {
|
||||
return introduction;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public List<String> getImageList() {
|
||||
return imageList;
|
||||
}
|
||||
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public String getStrategyType() {
|
||||
return strategyType;
|
||||
}
|
||||
|
||||
public Long getStrategyId() {
|
||||
return strategyId;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setProductId(Long productId) {
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public void setProductImage(String productImage) {
|
||||
this.productImage = productImage;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setIntroduction(String introduction) {
|
||||
this.introduction = introduction;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public void setImageList(List<String> imageList) {
|
||||
this.imageList = imageList;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public void setStrategyType(String strategyType) {
|
||||
this.strategyType = strategyType;
|
||||
}
|
||||
|
||||
public void setStrategyId(Long strategyId) {
|
||||
this.strategyId = strategyId;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.muyu.markteing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.common.core.web.model.QueryModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ActivityTeamInfoListModel extends QueryModel<ActivityTeamInfoListModel> {
|
||||
private String keyWord;
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
package com.muyu.markteing.domain.model;
|
||||
|
||||
import com.muyu.common.core.web.model.QueryModel;
|
||||
|
||||
import com.muyu.markteing.domain.ActivityTeamInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.function.Function;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ActivityTeamInfoListQueryModel extends QueryModel<ActivityTeamInfoListQueryModel> {
|
||||
/** 拼团活动ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 拼团商品图片
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private BigDecimal productPrice;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
/**
|
||||
* 拼团人数
|
||||
*/
|
||||
private Long attendNumber;
|
||||
/**
|
||||
* 开团人数
|
||||
*/
|
||||
private Long openTeamNumber;
|
||||
/**
|
||||
* 参团人数
|
||||
*/
|
||||
private Long addTeamNumber;
|
||||
/**
|
||||
* 商品库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
/**
|
||||
* 剩余库存
|
||||
*/
|
||||
private Long remainStock;
|
||||
/**
|
||||
* 团购结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
public static ActivityTeamInfoListQueryModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListQueryModelBuilder,ActivityTeamInfoListQueryModel> function){
|
||||
ActivityTeamInfoListQueryModel build = ActivityTeamInfoListQueryModel.builder()
|
||||
.id(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
||||
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
|
||||
.status(activityTeamInfo.getStatus())
|
||||
.build();
|
||||
return function.apply(
|
||||
ActivityTeamInfoListQueryModel.builder()
|
||||
.id(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
.status(activityTeamInfo.getStatus())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.muyu.markteing.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
/**
|
||||
* 团购优惠力度模型
|
||||
*/
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class TeamProductDiscountPriceModel {
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private BigDecimal productPrice;
|
||||
/**
|
||||
* 团购优惠价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
/**
|
||||
* 优惠力度
|
||||
*/
|
||||
private Double discount;
|
||||
|
||||
/**
|
||||
* 通过商品价格和团购价格 生成优惠力度
|
||||
* @param productPrice
|
||||
* @param teamPrice
|
||||
* @return
|
||||
*/
|
||||
public static TeamProductDiscountPriceModel of(BigDecimal productPrice,BigDecimal teamPrice){
|
||||
return TeamProductDiscountPriceModel.builder()
|
||||
.productPrice(productPrice)
|
||||
.teamPrice(teamPrice)
|
||||
.discount(productPrice.subtract(teamPrice).divide(productPrice, 2, RoundingMode.HALF_UP).doubleValue())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.muyu.markteing.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 团购商品库存模型
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TeamProductStockModel {
|
||||
/**
|
||||
* 拼团总库存
|
||||
*/
|
||||
private Long reamStock;
|
||||
/**
|
||||
* 拼团剩余库存
|
||||
*/
|
||||
private Long remainStock;
|
||||
|
||||
private Long teamStock;
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.markteing.domain.req;
|
||||
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
import com.muyu.markteing.domain.model.ActivityTeamInfoAddModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
//@ApiModel(value = "ActivityTeamInfoSaveReq", description = "拼团商品信息")
|
||||
public class ActivityTeamInfoSaveReq extends BaseEntity {
|
||||
private Long id;
|
||||
/**
|
||||
* 商品添加基本属性
|
||||
*/
|
||||
private ActivityTeamInfoAddModel activityTeamInfoAddModel;
|
||||
|
||||
|
||||
/**
|
||||
* 商品SKuProductSkuModel
|
||||
*/
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public ActivityTeamInfoAddModel getActivityTeamInfoAddModel() {
|
||||
return activityTeamInfoAddModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setActivityTeamInfoAddModel(ActivityTeamInfoAddModel activityTeamInfoAddModel) {
|
||||
this.activityTeamInfoAddModel = activityTeamInfoAddModel;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.markteing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ProjectSkuInfoAddReq {
|
||||
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Integer teamStock;
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.muyu.markteing.domain.req;
|
||||
|
||||
import com.muyu.common.core.web.page.PageDomain;
|
||||
|
||||
import com.muyu.markteing.domain.model.ActivityTeamInfoListModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@SuperBuilder
|
||||
public class TeamInfoListReq extends PageDomain {
|
||||
private String keyWord;
|
||||
private String status;
|
||||
|
||||
public ActivityTeamInfoListModel buildQueryModel(){
|
||||
|
||||
return ActivityTeamInfoListModel.builder()
|
||||
.keyWord(this.keyWord)
|
||||
.status(this.status)
|
||||
.build()
|
||||
.domainBuild(this);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
package com.muyu.markteing.domain.resp;
|
||||
|
||||
|
||||
import com.muyu.markteing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
|
||||
@SuperBuilder
|
||||
public class ActivityTeamInfoResp {
|
||||
/**
|
||||
* 拼团活动ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 拼团商品图片
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private BigDecimal productPrice;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
/**
|
||||
* 拼团人数
|
||||
*/
|
||||
private Long attendNumber;
|
||||
/**
|
||||
* 开团人数
|
||||
*/
|
||||
private Long openTeamNumber;
|
||||
/**
|
||||
* 参团人数
|
||||
*/
|
||||
private Long addTeamNumber;
|
||||
/**
|
||||
* 商品库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
/**
|
||||
* 剩余库存
|
||||
*/
|
||||
private Long remainStock;
|
||||
/**
|
||||
* 团购结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 列表查询结果 构建为响应对象
|
||||
* @param activityTeamInfoListQueryModel 列表数据查询结果
|
||||
* @return 响应对象
|
||||
*/
|
||||
public static ActivityTeamInfoResp listModelBuild(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||
return ActivityTeamInfoResp.builder()
|
||||
.id(activityTeamInfoListQueryModel.getId())
|
||||
.name(activityTeamInfoListQueryModel.getName())
|
||||
.openTeamNumber(activityTeamInfoListQueryModel.getOpenTeamNumber())
|
||||
.addTeamNumber(activityTeamInfoListQueryModel.getAddTeamNumber())
|
||||
.attendNumber(activityTeamInfoListQueryModel.getAttendNumber())
|
||||
.endTime(activityTeamInfoListQueryModel.getEndTime())
|
||||
.teamPrice(activityTeamInfoListQueryModel.getTeamPrice())
|
||||
.productPrice(activityTeamInfoListQueryModel.getProductPrice())
|
||||
.productImage(activityTeamInfoListQueryModel.getProductImage())
|
||||
.remainStock(activityTeamInfoListQueryModel.getRemainStock())
|
||||
.status(activityTeamInfoListQueryModel.getStatus())
|
||||
.teamStock(activityTeamInfoListQueryModel.getTeamStock())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package com.muyu.marketing.team.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.req.TeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoResp;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 营销团购活动控制层
|
||||
*
|
||||
* @author AmAg
|
||||
* @create: 2024-11-21 17:00
|
||||
**/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("team")
|
||||
public class ActivityTeamController {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamInfoService activityTeamInfoService;
|
||||
|
||||
@PostMapping("/list")
|
||||
public Result<TableDataInfo<TeamInfoResp>> list(@RequestBody TeamInfoListReq teamInfoListReq) {
|
||||
activityTeamInfoService.query(teamInfoListReq.buildQueryModel());
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
// @PostMapping("add")
|
||||
// public Result<String> add(@RequestBody TeamInfoSaveReq teamInfoSaveReq){
|
||||
// activityTeamInfoService.add(teamInfoSaveReq.buildAddModel());
|
||||
// return Result.success();
|
||||
// }
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.muyu.marketing.team.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import com.muyu.markteing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import com.muyu.markteing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.markteing.domain.resp.ActivityTeamInfoResp;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@Api(tags = "拼团活动")
|
||||
@RestController
|
||||
@RequestMapping("/team")
|
||||
public class ActivityTeamInfoController {
|
||||
|
||||
@Autowired(required=true)
|
||||
private ActivityTeamInfoService activityTeamInfoService;
|
||||
|
||||
/**
|
||||
* 查询营销团购活动列表
|
||||
* @param teamInfoListReq
|
||||
* @return 活动响应对象
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
// @RequiresPermissions("marketing:team:list")
|
||||
@ApiOperation("获取属性组列表")
|
||||
public Result<TableDataInfo<ActivityTeamInfoResp>> list (@RequestBody TeamInfoListReq teamInfoListReq){
|
||||
TableDataInfo<ActivityTeamInfoListQueryModel> tableDataInfo = activityTeamInfoService.query(teamInfoListReq.buildQueryModel());
|
||||
List<ActivityTeamInfoResp> respList = tableDataInfo.getRows().stream().map(ActivityTeamInfoResp::listModelBuild).toList();
|
||||
|
||||
return Result.success(
|
||||
new TableDataInfo<ActivityTeamInfoResp>(){{
|
||||
setRows(respList);
|
||||
setTotal(tableDataInfo.getTotal());
|
||||
}}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.muyu.marketing.team.controller;
|
||||
|
||||
/**
|
||||
* 营销拼团活动控制层
|
||||
*
|
||||
* @author AmAg
|
||||
* @create: 2024-11-22 21:07
|
||||
**/
|
||||
public class MarketingGroupInfoController {
|
||||
|
||||
}
|
|
@ -1,16 +1,10 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
|
||||
import com.muyu.markteing.domain.ActivityTeamInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 代码生成 操作处理
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
@Mapper
|
||||
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo> {
|
||||
|
||||
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo>{
|
||||
}
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
|
||||
import com.muyu.markteing.domain.ActivityTeamOpenInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 代码生成 操作处理
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
@Mapper
|
||||
public interface ActivityTeamOpenInfoMapper extends BaseMapper<ActivityTeamOpenInfo> {
|
||||
}
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
|
||||
import com.muyu.markteing.domain.ActivityTeamProductSkuInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 代码生成 操作处理
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
@Mapper
|
||||
public interface ActivityTeamProductSkuInfoMapper extends BaseMapper<ActivityTeamProductSkuInfo> {
|
||||
}
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
|
||||
import com.muyu.markteing.domain.TeamStrategyExemptionHundred;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 代码生成 操作处理
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
@Mapper
|
||||
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyExemptionHundred> {
|
||||
}
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
|
||||
import com.muyu.markteing.domain.TeamStrategyExemption;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 代码生成 操作处理
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
@Mapper
|
||||
public interface TeamStrategyExemptionMapper extends BaseMapper<TeamStrategyExemption> {
|
||||
}
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||
|
||||
import com.muyu.markteing.domain.TeamStrategyExemptionOrdinary;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 代码生成 操作处理
|
||||
*
|
||||
* @author AmAg
|
||||
*/
|
||||
@Mapper
|
||||
public interface TeamStrategyExemptionOrdinaryMapper extends BaseMapper<TeamStrategyExemptionOrdinary> {
|
||||
}
|
||||
|
|
|
@ -1,23 +1,17 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
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.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import com.muyu.markteing.domain.ActivityTeamInfo;
|
||||
import com.muyu.markteing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.markteing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||
|
||||
/**
|
||||
* 通过查询模型查询团购活动列表
|
||||
* @param activityTeamInfoListQueryModel 团购活动查询模型
|
||||
* @return 团购活动列表
|
||||
*/
|
||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
||||
public TableDataInfo<ActivityTeamInfoListQueryModel> query(ActivityTeamInfoListModel activityTeamInfoListModel);
|
||||
|
||||
|
||||
|
||||
//void add(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,35 +2,23 @@ package com.muyu.marketing.team.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import com.muyu.markteing.domain.ActivityTeamOpenInfo;
|
||||
|
||||
|
||||
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
||||
|
||||
|
||||
/**
|
||||
* 通过活动Id和开团类型查询开团人数数量
|
||||
* @param teamId 活动ID
|
||||
* @param teamOpenType 开团类型
|
||||
* @return 开团数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Long getTeamOpenNumberByTeamIdAndType(@RequestParam Long teamId, TeamOpenTypeEnum teamOpenType);
|
||||
public Long getTeamOpenNumberByTeamIdAndType(Long teamId, TeamOpenTypeEnum teamOpenEnum);
|
||||
|
||||
|
||||
/**
|
||||
* 根据活动Id获取开团数量
|
||||
* @param teamId 团购活动ID
|
||||
* @return 开团数量
|
||||
*/
|
||||
public default Long getTeamOpenNumberByTeamId(Long teamId){
|
||||
return this.getTeamOpenNumberByTeamIdAndType(teamId,TeamOpenTypeEnum.OPEN_TEAM);
|
||||
return this.getTeamOpenNumberByTeamIdAndType(teamId, TeamOpenTypeEnum.OPEN_TEAM);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据活动Id获取参团数量
|
||||
* @param teamId 团购活动ID
|
||||
* @return 参团数量
|
||||
*/
|
||||
public default Long getTeamInNumberByTeamId(Long teamId){
|
||||
|
||||
public default Long getTeamInTypeNumberByTeamId(Long teamId){
|
||||
return this.getTeamOpenNumberByTeamIdAndType(teamId,TeamOpenTypeEnum.IN_TEAM);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,35 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.markteing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.markteing.domain.model.TeamProductDiscountPriceModel;
|
||||
import com.muyu.markteing.domain.model.TeamProductStockModel;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
||||
public default List<ActivityTeamProductSkuInfo> getActivityTeamProductSkuInfoByTeamId(Long teamId){
|
||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,teamId);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过团购活动ID获取团购中最优惠的价格
|
||||
* /通过团购活动ID获取团购种最优惠的价格
|
||||
*/
|
||||
|
||||
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId);
|
||||
|
||||
/**
|
||||
* 通过活动ID获取 剩余库存
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
public ActivityTeamProductSkuInfo getDiscountPrice(Long teamId);
|
||||
public TeamProductStockModel getStock(Long teamId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
/**
|
||||
* @author AmAg
|
||||
* @create: 2024-11-22 21:08
|
||||
**/
|
||||
public interface MarketingGroupInfoService {
|
||||
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.markteing.domain.TeamStrategyExemptionHundred;
|
||||
|
||||
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred> {
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||
import com.muyu.markteing.domain.TeamStrategyExemptionOrdinary;
|
||||
|
||||
public interface TeamStrategyExemptionOrdinaryService extends IService<TeamStrategyExemptionOrdinary> {
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import com.muyu.markteing.domain.TeamStrategyExemption;
|
||||
|
||||
public interface TeamStrategyExemptionService extends IService<TeamStrategyExemption> {
|
||||
}
|
||||
|
|
|
@ -1,83 +1,76 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
|
||||
import com.muyu.markteing.domain.ActivityTeamInfo;
|
||||
import com.muyu.markteing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.markteing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import com.muyu.markteing.domain.model.TeamProductDiscountPriceModel;
|
||||
import com.muyu.markteing.domain.model.TeamProductStockModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
||||
implements ActivityTeamInfoService {
|
||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo> implements ActivityTeamInfoService {
|
||||
|
||||
@Autowired
|
||||
@Autowired(required=true)
|
||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||
|
||||
@Autowired(required=true)
|
||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||
public TableDataInfo<ActivityTeamInfoListQueryModel> query(ActivityTeamInfoListModel activityTeamInfoListModel) {
|
||||
|
||||
|
||||
|
||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getKeyWord()),ActivityTeamInfo::getName,activityTeamInfoListQueryModel.getKeyWord());
|
||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getStatus()),ActivityTeamInfo::getStatus,activityTeamInfoListQueryModel.getStatus());
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建 对象的时候进行的占用
|
||||
* 以方法返回值占用
|
||||
*/
|
||||
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(activityTeamInfoListQueryModel.buildPage(),queryWrapper);
|
||||
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
||||
List<ActivityTeamInfoListModel> activityTeamInfoListModels =new ArrayList<>();
|
||||
for (ActivityTeamInfo activityTeamInfo : activityTeamInfoList) {
|
||||
ActivityTeamInfoListModel activityTeamInfoListModel = new ActivityTeamInfoListModel();
|
||||
activityTeamInfoListModel.setId(activityTeamInfo.getId());
|
||||
activityTeamInfoListModel.setName(activityTeamInfo.getName());
|
||||
activityTeamInfoListModel.setStatus(activityTeamInfo.getStatus());
|
||||
activityTeamInfoListModel.setOpenTeamNumber(activityTeamOpenInfoService.getTeamOpenNumberByTeamId(activityTeamInfo.getId()));
|
||||
activityTeamInfoListModel.setAddTeamNumber(activityTeamOpenInfoService.getTeamInNumberByTeamId(activityTeamInfo.getId()));
|
||||
activityTeamInfoListModel.setAttendNumber(activityTeamInfoListModel.getAttendNumber()+activityTeamInfoListModel.getAttendNumber());
|
||||
activityTeamInfoListModel.setEndTime(activityTeamInfo.getEndTime());
|
||||
activityTeamInfoListModel.setProductImage(activityTeamInfo.getProductImage());
|
||||
activityTeamInfoListModel.setProductPrice(0.00);
|
||||
activityTeamInfoListModel.setRemainStock(0L);
|
||||
activityTeamInfoListModel.setTeamPrice(0.00);
|
||||
activityTeamInfoListModel.setTeamStock(0L);
|
||||
activityTeamInfoListModels.add(activityTeamInfoListModel);
|
||||
}
|
||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListModel.getKeyWord()),ActivityTeamInfo::getName,activityTeamInfoListModel.getKeyWord());
|
||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListModel.getStatus()),ActivityTeamInfo::getStatus,activityTeamInfoListModel.getStatus());
|
||||
|
||||
|
||||
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>();
|
||||
tableDataInfo.setTotal(activityTeamInfoPage.getTotal());
|
||||
tableDataInfo.setRows(activityTeamInfoListModels);
|
||||
Page<ActivityTeamInfo> activityTeamInfoPage1 = this.page(activityTeamInfoListModel.buildPage(), queryWrapper);
|
||||
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage1.getRecords();
|
||||
List<ActivityTeamInfoListQueryModel> activityTeamInfoListQueryModels = activityTeamInfoList.stream()
|
||||
.map(activityTeamInfo -> ActivityTeamInfoListQueryModel.infoBuild(
|
||||
activityTeamInfo, (activityTeamInfoListQueryModelBuilder)-> {
|
||||
TeamProductStockModel teamProductStockModel = activityTeamProductSkuInfoService.getStock(activityTeamInfo.getId());
|
||||
TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
|
||||
Long teamOpenNumber = activityTeamOpenInfoService.getTeamOpenNumberByTeamId(activityTeamInfo.getId());
|
||||
Long teamInTypeNumber = activityTeamOpenInfoService.getTeamInTypeNumberByTeamId(activityTeamInfo.getId());
|
||||
return activityTeamInfoListQueryModelBuilder
|
||||
.openTeamNumber(teamOpenNumber)
|
||||
.addTeamNumber(teamInTypeNumber)
|
||||
.attendNumber(teamOpenNumber + teamInTypeNumber)
|
||||
.teamPrice(discountPrice.getTeamPrice())
|
||||
.productPrice(discountPrice.getProductPrice())
|
||||
.teamStock(teamProductStockModel.getTeamStock())
|
||||
.remainStock(teamProductStockModel.getRemainStock())
|
||||
.build();
|
||||
})).toList();
|
||||
|
||||
TableDataInfo<ActivityTeamInfoListQueryModel> tableDataInfo = new TableDataInfo<>();
|
||||
tableDataInfo.setTotal(activityTeamInfoPage1.getTotal());
|
||||
tableDataInfo.setRows(activityTeamInfoListQueryModels);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void add(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||
// LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
//
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public void add(ActivityTeamInfo activityTeamInfo) {
|
||||
// LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// List<ActivityTeamInfo> activityTeamInfos = new ArrayList<>();
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,30 +3,29 @@ package com.muyu.marketing.team.service.impl;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamOpenInfoMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||
import com.muyu.markteing.domain.ActivityTeamOpenInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
|
||||
implements ActivityTeamOpenInfoService {
|
||||
|
||||
|
||||
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo> implements ActivityTeamOpenInfoService {
|
||||
/**
|
||||
* 通过活动Id和开团类型查询开团人数数量
|
||||
*
|
||||
* @param TeamId 活动ID
|
||||
* @param teamOpenType 开团类型
|
||||
* 通过活动d和开发类型查询开团梳理
|
||||
* @param teamId
|
||||
* @param teamOpenEnum
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Override
|
||||
public Long getTeamOpenNumberByTeamIdAndType(Long TeamId, TeamOpenTypeEnum teamOpenType) {
|
||||
public Long getTeamOpenNumberByTeamIdAndType(Long teamId, TeamOpenTypeEnum teamOpenEnum) {
|
||||
|
||||
LambdaQueryWrapper<ActivityTeamOpenInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActivityTeamOpenInfo::getTeamId, TeamId);
|
||||
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType,teamOpenType.code());
|
||||
return this.count(queryWrapper);
|
||||
queryWrapper.eq(ActivityTeamOpenInfo::getTeamId,teamId);
|
||||
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType,teamOpenEnum.code());
|
||||
|
||||
return this.count(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,38 +1,50 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||
import com.muyu.markteing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.markteing.domain.model.TeamProductDiscountPriceModel;
|
||||
import com.muyu.markteing.domain.model.TeamProductStockModel;
|
||||
import com.muyu.product.cache.ProjectSkuCache;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||
implements ActivityTeamProductSkuInfoService {
|
||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo> implements ActivityTeamProductSkuInfoService {
|
||||
|
||||
@Autowired
|
||||
private ProjectSkuCache projectSkuCache;
|
||||
|
||||
/**
|
||||
* 通过团购活动ID获取团购中最优惠的价格
|
||||
*
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
@Autowired
|
||||
private ProjectSkuCache projectSkuCache;
|
||||
@Override
|
||||
public ActivityTeamProductSkuInfo getDiscountPrice(Long teamId) {
|
||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId, teamId);
|
||||
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.list(queryWrapper);
|
||||
// projectSkuCache.get
|
||||
return null;
|
||||
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId) {
|
||||
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||
|
||||
Optional<TeamProductDiscountPriceModel> discountPriceModelOptional = teamProductSkuInfoList.stream().map(activityTeamProductSkuInfo -> {
|
||||
ProjectSkuInfo projectSkuInfo = projectSkuCache.get(activityTeamProductSkuInfo.getProductId(), activityTeamProductSkuInfo.getProductSku());
|
||||
return TeamProductDiscountPriceModel.of(projectSkuInfo.getPrice(), activityTeamProductSkuInfo.getTeamPrice());
|
||||
}).min((o1, o2) -> Double.valueOf(o1.getDiscount() * 100 - o2.getDiscount() * 100).intValue());
|
||||
|
||||
|
||||
if (discountPriceModelOptional.isEmpty()){
|
||||
throw new ServiceException("团购活动下没有商品绑定");
|
||||
}
|
||||
|
||||
return discountPriceModelOptional.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TeamProductStockModel getStock(Long teamId) {
|
||||
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||
|
||||
return TeamProductStockModel.builder()
|
||||
.teamStock(teamProductSkuInfoList.stream().map(ActivityTeamProductSkuInfo::getTeamStock).reduce(0L,Long::sum))
|
||||
.remainStock(teamProductSkuInfoList.stream().map(ActivityTeamProductSkuInfo::getRemainStock).reduce(0L,Long::sum))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author AmAg
|
||||
* @create: 2024-11-22 21:08
|
||||
**/
|
||||
@Service
|
||||
public class MarketingGroupInfoServiceImpl {
|
||||
|
||||
}
|
|
@ -1,11 +1,12 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionHundredService;
|
||||
import com.muyu.markteing.domain.TeamStrategyExemptionHundred;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred> implements TeamStrategyExemptionHundredService {
|
||||
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred> implements TeamStrategyExemptionHundredService {
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionOrdinaryMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionOrdinaryService;
|
||||
import com.muyu.markteing.domain.TeamStrategyExemptionOrdinary;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary> implements TeamStrategyExemptionOrdinaryService {
|
||||
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary> implements TeamStrategyExemptionOrdinaryService {
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||
import com.muyu.markteing.domain.TeamStrategyExemption;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption> implements TeamStrategyExemptionService {
|
||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption> implements TeamStrategyExemptionService {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue