Compare commits
No commits in common. "main" and "1127/cloud-server" have entirely different histories.
main
...
1127/cloud
|
@ -1,29 +0,0 @@
|
||||||
{
|
|
||||||
"拼团活动Id": "Long",
|
|
||||||
"商品ID": "Long",
|
|
||||||
"商品图片": "String",
|
|
||||||
"活动名称": "String",
|
|
||||||
"活动简介": "String",
|
|
||||||
"商品单位": "String",
|
|
||||||
"商品的轮播图": [
|
|
||||||
"String", "String"
|
|
||||||
],
|
|
||||||
"活动时间": "date",
|
|
||||||
"策略类型": "String",
|
|
||||||
"策略ID": "Long",
|
|
||||||
"商品规格List": [{
|
|
||||||
"规格SKUid": "Long",
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
}],
|
|
||||||
"商品规格List": [{
|
|
||||||
"规格SKUid": "Long"
|
|
||||||
}],
|
|
||||||
"商品规格List": [{
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
}],
|
|
||||||
"排序": "Integer",
|
|
||||||
"详情": "String",
|
|
||||||
"活动状态":"Long"
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
$.{
|
|
||||||
"活动ID": "Long",
|
|
||||||
"商品ID": "Long", //activity_team_info.product_id
|
|
||||||
"商品图片": "String",
|
|
||||||
"活动名称": "String",
|
|
||||||
"活动简介": "String",
|
|
||||||
"商品单位": "String",
|
|
||||||
"商品的轮播图": [
|
|
||||||
"String", "String"
|
|
||||||
],
|
|
||||||
"活动时间": "date",
|
|
||||||
"策略类型": "String",
|
|
||||||
"策略ID": "Long",
|
|
||||||
"商品规格List": [ // activity_team_product_sku_info
|
|
||||||
{
|
|
||||||
"活动商品规格ID": "Long",
|
|
||||||
"规格SKU": "String", // activity_team_product_sku_info.product_sku
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"排序": "Integer",
|
|
||||||
"详情": "String"
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
{
|
|
||||||
"拼团ID": "Long",
|
|
||||||
"商品ID": "Long",
|
|
||||||
"商品图片": "String",
|
|
||||||
"活动名称": "String",
|
|
||||||
"活动简介": "String",
|
|
||||||
"商品单位": "String",
|
|
||||||
"商品的轮播图": [
|
|
||||||
"String", "String"
|
|
||||||
],
|
|
||||||
"活动时间": "date",
|
|
||||||
"策略类型": "String",
|
|
||||||
"策略ID": "Long",
|
|
||||||
"商品规格List": [
|
|
||||||
{
|
|
||||||
"规格Id": "Long",
|
|
||||||
"规格SKU": "String",
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"排序": "Integer",
|
|
||||||
"详情": "String"
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
{
|
|
||||||
"活动ID": "Long",
|
|
||||||
"商品ID": "Long",
|
|
||||||
"活动名称": "String",
|
|
||||||
"商品名称": "String",
|
|
||||||
"商品图片": "String",
|
|
||||||
"活动简介": "String",
|
|
||||||
"商品单位": "String",
|
|
||||||
"商品的轮播图": [
|
|
||||||
"String", "String"
|
|
||||||
],
|
|
||||||
"活动时间": "date",
|
|
||||||
"策略类型": "String",
|
|
||||||
"商品规格": {
|
|
||||||
"修改商品规格List": [ // 修改
|
|
||||||
{
|
|
||||||
"团购规格ID": "Long",
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"删除商品规格IdList" : ["Long", "Long"],
|
|
||||||
"添加商品规格List": [
|
|
||||||
"商品SKU": "String",
|
|
||||||
"商品价格": "BigDecimal",
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
"详情": "String"
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
$.{
|
|
||||||
"商品ID": "Long", //activity_team_info.product_id
|
|
||||||
"商品图片": "String",
|
|
||||||
"活动名称": "String",
|
|
||||||
"活动简介": "String",
|
|
||||||
"商品单位": "String",
|
|
||||||
"商品的轮播图": [
|
|
||||||
"String", "String"
|
|
||||||
],
|
|
||||||
"活动时间": "date",
|
|
||||||
"策略类型": "String",
|
|
||||||
"策略ID": "Long",
|
|
||||||
"商品规格List": [ // activity_team_product_sku_info
|
|
||||||
{
|
|
||||||
"规格SKU": "String", // activity_team_product_sku_info.product_sku
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"排序": "Integer",
|
|
||||||
"详情": "String"
|
|
||||||
}
|
|
||||||
|
|
||||||
activity_team_info 团购活动表 -> ActivityTeamInfo(实体类)
|
|
||||||
activity_team_info.id(主键) -> 自增 -> 回填 -> ActivityTeamInfo.id
|
|
||||||
activity_team_info.name(拼团名称) <- ActivityTeamInfo.name <- $.活动名称
|
|
||||||
activity_team_info.product_id(商品ID) <- ActivityTeamInfo.productId <- $.商品ID
|
|
||||||
activity_team_info.product_image(商品活动图) <- ActivityTeamInfo.productImage <- $.商品图片
|
|
||||||
activity_team_info.introduction(活动简介) <- ActivityTeamInfo.introduction <- $.活动简介
|
|
||||||
activity_team_info.unit(单位) <- ActivityTeamInfo.unit <- $.商品单位
|
|
||||||
activity_team_info.image_list(轮播图) <- ActivityTeamInfo.imageList <- 商品的轮播图.toString(","拼接) <- $.商品的轮播图
|
|
||||||
activity_team_info.end_time(活动结束时间) <- ActivityTeamInfo.endTime <- $.活动时间
|
|
||||||
activity_team_info.sort(活动排序) <- ActivityTeamInfo.sort <- $.排序
|
|
||||||
activity_team_info.content(活动详情) <- ActivityTeamInfo.content <- $.详情
|
|
||||||
activity_team_info.status(活动状态) <- _sys_normal_disable.1(停用)
|
|
||||||
activity_team_info.strategy_type(策略类型) <- ActivityTeamInfo.strategy_type <- $.策略类型
|
|
||||||
activity_team_info.strategy_id(策略ID) <- ActivityTeamInfo.strategy_id <- $.策略ID
|
|
||||||
|
|
||||||
for(@商品规格 in 商品规格List)
|
|
||||||
activity_team_product_sku_info 商品拼团规格信息表 -> ActivityTeamProductSkuInfo(实体类)
|
|
||||||
activity_team_product_sku_info.id(主键) -> 自增 -> 回填 -> ActivityTeamProductSkuInfo.id
|
|
||||||
activity_team_product_sku_info.team_id(活动ID) <- ActivityTeamProductSkuInfo.teamId <- ActivityTeamInfo.id
|
|
||||||
activity_team_product_sku_info.product_id(商品ID) <- ActivityTeamProductSkuInfo.productId < $.商品ID
|
|
||||||
activity_team_product_sku_info.product_sku(商品SKU) <- ActivityTeamProductSkuInfo.productSku <- @商品规格.规格SKU
|
|
||||||
activity_team_product_sku_info.team_stock(拼团库存) <- ActivityTeamProductSkuInfo.teamStock <- @商品规格.拼团库存
|
|
||||||
activity_team_product_sku_info.remain_stock(剩余库存) <- ActivityTeamProductSkuInfo.remainStock <- @商品规格.拼团库存
|
|
||||||
activity_team_product_sku_info.team_price(拼团价格) <- ActivityTeamProductSkuInfo.teamPrice <- @商品规格.拼团价格
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"team": {
|
||||||
|
"商品Id":"Long",
|
||||||
|
"商品图片":"String",
|
||||||
|
"拼团活动名称":"String",
|
||||||
|
"拼团活动简介":"String",
|
||||||
|
"商品单位":"String",
|
||||||
|
"商品轮播图":[
|
||||||
|
"图片路径":"String",
|
||||||
|
],
|
||||||
|
"活动时间":"Date",
|
||||||
|
"策略类型":"String",
|
||||||
|
"策略ID":"Long",
|
||||||
|
"规格":[{
|
||||||
|
规格SKU:"String",
|
||||||
|
"拼团价格":"BigDecimal",
|
||||||
|
"拼团库存":"Long"
|
||||||
|
}],
|
||||||
|
"排序":"Integer",
|
||||||
|
"商品详情":"text"
|
||||||
|
}
|
||||||
|
}
|
24
doc/策略.md
24
doc/策略.md
|
@ -1,24 +0,0 @@
|
||||||
# 功能划分
|
|
||||||
# 普通团
|
|
||||||
商品列表
|
|
||||||
商品详情
|
|
||||||
去参团
|
|
||||||
开团列表
|
|
||||||
参团成功
|
|
||||||
邀请参团
|
|
||||||
拼团成功 查看订单
|
|
||||||
拼团失败 重新开团
|
|
||||||
开团成功
|
|
||||||
邀请参团
|
|
||||||
拼团成功 查看订单
|
|
||||||
拼团失败 重新开团
|
|
||||||
|
|
||||||
# 百人团
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1.商品详情
|
|
||||||
2.评价接口
|
|
||||||
3.拼团人数
|
|
||||||
4.开团列表
|
|
||||||
5.收藏接口
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.muyu.common.core.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: cloud-server
|
||||||
|
* @description: 参团类型
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-21 15:12
|
||||||
|
**/
|
||||||
|
|
||||||
|
public enum TeamOpenTypeEnums {
|
||||||
|
|
||||||
|
|
||||||
|
OPEN_TEAM("open_team","开团"),
|
||||||
|
IN_TEAM("in_team","参团");
|
||||||
|
private final String code;
|
||||||
|
|
||||||
|
private final String label;
|
||||||
|
|
||||||
|
public String code() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String label() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
TeamOpenTypeEnums(String code, String label) {
|
||||||
|
this.code = code;
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
package com.muyu.common.core.enums.market.team;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团类型枚举类
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-21 11:20
|
|
||||||
*/
|
|
||||||
public enum TeamOpenTypeEnum {
|
|
||||||
// 开团
|
|
||||||
OPEN_TEAM("open_team", "开团"),
|
|
||||||
// 参团
|
|
||||||
IN_TEAM("in_team", "参团")
|
|
||||||
;
|
|
||||||
|
|
||||||
private final String code;
|
|
||||||
|
|
||||||
private final String label;
|
|
||||||
|
|
||||||
TeamOpenTypeEnum(String code, String label) {
|
|
||||||
this.code = code;
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String code() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String label() {
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.muyu.common.core.web.model;
|
package com.muyu.common.core.web.model;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
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.muyu.common.core.web.page.PageDomain;
|
import com.muyu.common.core.web.page.PageDomain;
|
||||||
|
@ -12,17 +11,17 @@ import lombok.experimental.SuperBuilder;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询模型
|
* @program: cloud-server
|
||||||
*
|
* @description: 列表查询模型
|
||||||
* @author DongZeLiang
|
* @author: CuiFu Bo
|
||||||
* @date 2024-11-20 14:18
|
* @create: 2024-11-20 20:27
|
||||||
*/
|
**/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class QueryModel<T> {
|
public class QueryModel<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前记录起始索引
|
* 当前记录起始索引
|
||||||
*/
|
*/
|
||||||
|
@ -41,18 +40,18 @@ public class QueryModel<T> {
|
||||||
/**
|
/**
|
||||||
* 排序的方向desc或者asc
|
* 排序的方向desc或者asc
|
||||||
*/
|
*/
|
||||||
private boolean isAsc = true;
|
private Boolean isAsc = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建模型分页对象
|
* 构建模型分页对象
|
||||||
* @param pageDomain 分页参数
|
* @param pageDomain 分页参数
|
||||||
* @return 模型分页对象
|
* @return 返回模型分页参数
|
||||||
*/
|
*/
|
||||||
public T domainBuild(PageDomain pageDomain) {
|
public T domainBuild(PageDomain pageDomain){
|
||||||
this.pageNum = pageDomain.getPageNum();
|
this.pageNum = pageDomain.getPageNum();
|
||||||
this.pageSize = pageDomain.getPageSize();
|
this.pageSize = pageDomain.getPageSize();
|
||||||
this.orderByColumn = pageDomain.getOrderByColumn();
|
this.orderByColumn = pageDomain.getOrderByColumn();
|
||||||
this.isAsc = "asc".equals(pageDomain.getIsAsc());
|
this.isAsc = "ase".equals(pageDomain.getIsAsc());
|
||||||
return (T) this;
|
return (T) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,10 +59,12 @@ public class QueryModel<T> {
|
||||||
* 构建查询分页对象
|
* 构建查询分页对象
|
||||||
* @return 查询分页对象
|
* @return 查询分页对象
|
||||||
*/
|
*/
|
||||||
public <I> Page<I> buildPage(){
|
public <I> Page<I> bulidPage(){
|
||||||
Page<I> page = Page.of(this.getPageNum(), this.getPageSize());
|
Page<I> page = Page.of(this.getPageNum(), this.getPageSize());
|
||||||
page.setOrders(List.of(this.isAsc()
|
page.setOrders(List.of(this.isAsc
|
||||||
? OrderItem.asc(this.getOrderByColumn()) : OrderItem.desc(this.getOrderByColumn())));
|
? OrderItem.asc(this.getOrderByColumn()):OrderItem.desc(this.getOrderByColumn())));
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package com.muyu.common.core.web.page;
|
package com.muyu.common.core.web.page;
|
||||||
|
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import lombok.AllArgsConstructor;
|
import com.muyu.common.core.web.model.QueryModel;
|
||||||
import lombok.Data;
|
import lombok.*;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,8 +12,8 @@ import lombok.experimental.SuperBuilder;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class PageDomain {
|
public class PageDomain {
|
||||||
/**
|
/**
|
||||||
* 当前记录起始索引
|
* 当前记录起始索引
|
||||||
|
@ -48,6 +47,9 @@ public class PageDomain {
|
||||||
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getIsAsc () {
|
||||||
|
return isAsc;
|
||||||
|
}
|
||||||
|
|
||||||
public void setIsAsc (String isAsc) {
|
public void setIsAsc (String isAsc) {
|
||||||
if (StringUtils.isNotEmpty(isAsc)) {
|
if (StringUtils.isNotEmpty(isAsc)) {
|
||||||
|
@ -68,4 +70,7 @@ public class PageDomain {
|
||||||
return reasonable;
|
return reasonable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setReasonable (Boolean reasonable) {
|
||||||
|
this.reasonable = reasonable;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package com.muyu.common.core.web.page;
|
package com.muyu.common.core.web.page;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.*;
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
package com.muyu.common.security.config.mybatisplus;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.apache.ibatis.reflection.MetaObject;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 实体类字段填充
|
|
||||||
*/
|
|
||||||
@Log4j2
|
|
||||||
@Component
|
|
||||||
public class MyMetaObjectHandler implements MetaObjectHandler {
|
|
||||||
|
|
||||||
public MyMetaObjectHandler () {
|
|
||||||
log.info("mybatis-plus 系统字段填充拦截器 初始化成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void insertFill(MetaObject metaObject) {
|
|
||||||
this.setFieldValByName("createBy", SecurityUtils.getUsername(), metaObject);
|
|
||||||
this.setFieldValByName("createTime", new Date(), metaObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateFill(MetaObject metaObject) {
|
|
||||||
this.setFieldValByName("updateBy", SecurityUtils.getUsername(), metaObject);
|
|
||||||
this.setFieldValByName("updateTime", new Date(),metaObject);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,6 +3,7 @@ package com.muyu.common.security.config.mybatisplus;
|
||||||
import com.baomidou.mybatisplus.annotation.DbType;
|
import com.baomidou.mybatisplus.annotation.DbType;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@ -15,8 +16,7 @@ public class MybatisPlusConfig {
|
||||||
@Bean
|
@Bean
|
||||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); // 如果配置多个插件, 切记分页最后添加
|
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2));
|
||||||
// 如果有多数据源可以不配具体类型, 否则都建议配上具体的 DbType
|
|
||||||
return interceptor;
|
return interceptor;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.gateway.config.properties;
|
package com.muyu.gateway.config.properties;
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
|
@ -56,3 +57,4 @@ public class CorsConfig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,87 +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 com.muyu.marketing.domain.model.ActivityTeamOpenInfoAddModel;
|
|
||||||
import lombok.*;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@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;
|
|
||||||
|
|
||||||
public static ActivityTeamOpenInfo addBuildModel(ActivityTeamOpenInfoAddModel activityTeamOpenInfoAddModel){
|
|
||||||
return ActivityTeamOpenInfo.builder()
|
|
||||||
.id(activityTeamOpenInfoAddModel.getId())
|
|
||||||
.teamId(activityTeamOpenInfoAddModel.getTeamId())
|
|
||||||
.teamType(activityTeamOpenInfoAddModel.getTeamType())
|
|
||||||
.teamStrategyId(activityTeamOpenInfoAddModel.getTeamStrategyId())
|
|
||||||
.executiveType(activityTeamOpenInfoAddModel.getExecutiveType())
|
|
||||||
.endTime(activityTeamOpenInfoAddModel.getEndTime())
|
|
||||||
.productId(activityTeamOpenInfoAddModel.getProductId())
|
|
||||||
.productName(activityTeamOpenInfoAddModel.getProductName())
|
|
||||||
.productSku(activityTeamOpenInfoAddModel.getProductSku())
|
|
||||||
.key(activityTeamOpenInfoAddModel.getKey())
|
|
||||||
.orderId(activityTeamOpenInfoAddModel.getOrderId())
|
|
||||||
.status(activityTeamOpenInfoAddModel.getStatus())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,47 +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;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@TableName(value = "team_strategy_exemption_hundred", autoResultMap = true)
|
|
||||||
public class TeamStrategyHundred 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,47 +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;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@TableName(value = "team_strategy_exemption_ordinary", autoResultMap = true)
|
|
||||||
public class TeamStrategyOrdinary 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,104 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购活动添加模型
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-26 09:38
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ActivityTeamInfoAddModel {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
/**
|
|
||||||
* 商品ID
|
|
||||||
*/
|
|
||||||
private Long productId;
|
|
||||||
/**
|
|
||||||
* 商品活动图
|
|
||||||
*/
|
|
||||||
private String productImage;
|
|
||||||
/**
|
|
||||||
* 活动简介
|
|
||||||
*/
|
|
||||||
private String introduction;
|
|
||||||
/**
|
|
||||||
* 单位
|
|
||||||
*/
|
|
||||||
|
|
||||||
private String unit;
|
|
||||||
/**
|
|
||||||
* 轮播图
|
|
||||||
*/
|
|
||||||
|
|
||||||
private String imageList;
|
|
||||||
/**
|
|
||||||
* 活动结束时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
|
||||||
private Date endTime;
|
|
||||||
/**
|
|
||||||
* 活动排序
|
|
||||||
*/
|
|
||||||
private Long sort;
|
|
||||||
/**
|
|
||||||
* 商品SkU集合
|
|
||||||
*/
|
|
||||||
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
|
|
||||||
/**
|
|
||||||
* 活动详情
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
/**
|
|
||||||
* 活动状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
/**
|
|
||||||
* 策略类型
|
|
||||||
*/
|
|
||||||
private String strategyType;
|
|
||||||
/**
|
|
||||||
* 策略ID
|
|
||||||
*/
|
|
||||||
private Long strategyId;
|
|
||||||
|
|
||||||
public static ActivityTeamInfoAddModel addReqBuild (ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
|
||||||
return ActivityTeamInfoAddModel.builder()
|
|
||||||
.name(activityTeamInfoSaveReq.getName())
|
|
||||||
.productId(activityTeamInfoSaveReq.getProductId())
|
|
||||||
.productImage(activityTeamInfoSaveReq.getProductImage())
|
|
||||||
.introduction(activityTeamInfoSaveReq.getIntroduction())
|
|
||||||
.unit(activityTeamInfoSaveReq.getUnit())
|
|
||||||
.imageList(activityTeamInfoSaveReq.getImageList())
|
|
||||||
.endTime(activityTeamInfoSaveReq.getEndTime())
|
|
||||||
.sort(activityTeamInfoSaveReq.getSort())
|
|
||||||
.content(activityTeamInfoSaveReq.getContent())
|
|
||||||
.status(activityTeamInfoSaveReq.getStatus())
|
|
||||||
.strategyType(activityTeamInfoSaveReq.getStrategyType())
|
|
||||||
.strategyId(activityTeamInfoSaveReq.getStrategyId())
|
|
||||||
.activityTeamProductSkuAddModelList(
|
|
||||||
activityTeamInfoSaveReq.getTeamProjectSkuInfoAddReqList()
|
|
||||||
.stream()
|
|
||||||
.map(addReq -> ActivityTeamProductSkuAddModel.addReqBuild(addReq, activityTeamInfoSaveReq::getProductId))
|
|
||||||
.toList()
|
|
||||||
).build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,91 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamOpenInfoAdReq;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购策略类型模板
|
|
||||||
*
|
|
||||||
* @author CuiFu Bo
|
|
||||||
* @create 2024-12-01 20:24
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class ActivityTeamOpenInfoAddModel {
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
@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;
|
|
||||||
|
|
||||||
public static ActivityTeamOpenInfoAddModel addOpenBuild(ActivityTeamOpenInfoAdReq activityTeamOpenInfoAdReq){
|
|
||||||
return ActivityTeamOpenInfoAddModel.builder()
|
|
||||||
.id(activityTeamOpenInfoAdReq.getId())
|
|
||||||
.teamId(activityTeamOpenInfoAdReq.getTeamId())
|
|
||||||
.teamType(activityTeamOpenInfoAdReq.getTeamType())
|
|
||||||
.teamStrategyId(activityTeamOpenInfoAdReq.getTeamStrategyId())
|
|
||||||
.executiveType(activityTeamOpenInfoAdReq.getExecutiveType())
|
|
||||||
.endTime(activityTeamOpenInfoAdReq.getEndTime())
|
|
||||||
.productId(activityTeamOpenInfoAdReq.getProductId())
|
|
||||||
.productName(activityTeamOpenInfoAdReq.getProductName())
|
|
||||||
.productSku(activityTeamOpenInfoAdReq.getProductSku())
|
|
||||||
.key(activityTeamOpenInfoAdReq.getKey())
|
|
||||||
.orderId(activityTeamOpenInfoAdReq.getOrderId())
|
|
||||||
.status(activityTeamOpenInfoAdReq.getStatus())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购商品优惠力度模型
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-21 11:57
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
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(
|
|
||||||
Double.valueOf(productPrice.subtract(teamPrice).divide(productPrice, 2, RoundingMode.HALF_UP).doubleValue())
|
|
||||||
)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,76 +0,0 @@
|
||||||
package com.muyu.marketing.domain.req;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamOpenInfoAddModel;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购策略类型
|
|
||||||
*
|
|
||||||
* @author CuiFu Bo
|
|
||||||
* @create 2024-12-01 20:28
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class ActivityTeamOpenInfoAdReq {
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
@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,81 +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.model.ActivityTeamInfoAddModel;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
|
||||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
|
||||||
import com.muyu.marketing.domain.resp.TeamInfoFindByIdResp;
|
|
||||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 营销团购活动控制层
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-20 14:25
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/team")
|
|
||||||
public class ActivityTeamController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamInfoService activityTeamInfoService;;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询营销团购活动列表
|
|
||||||
* @param teamInfoListReq 活动查询入参
|
|
||||||
* @return 活动响应结果
|
|
||||||
*/
|
|
||||||
@PostMapping("/list")
|
|
||||||
public Result<TableDataInfo<TeamInfoListResp>> list(@RequestBody TeamInfoListReq teamInfoListReq) {
|
|
||||||
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = activityTeamInfoService.query(teamInfoListReq.buildQueryModel());
|
|
||||||
List<TeamInfoListResp> respList = tableDataInfo.getRows().stream().map(TeamInfoListResp::listModelBuild).toList();
|
|
||||||
return Result.success(
|
|
||||||
new TableDataInfo<>(){{
|
|
||||||
setRows(respList);
|
|
||||||
setTotal(tableDataInfo.getTotal());
|
|
||||||
}}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加团购活动
|
|
||||||
* @param activityTeamInfoSaveReq 添加请求对象
|
|
||||||
* @return 结果集
|
|
||||||
*/
|
|
||||||
@PostMapping
|
|
||||||
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
|
||||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
|
||||||
return Result.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/findById/{id}")
|
|
||||||
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
|
||||||
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
|
||||||
}
|
|
||||||
@PutMapping("/updateByTeamId")
|
|
||||||
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
|
||||||
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
|
||||||
return Result.success();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 根据活动id查找
|
|
||||||
*/
|
|
||||||
@GetMapping("/teamList/{id}")
|
|
||||||
public Result<List<ActivityTeamInfo>> teamList(@PathVariable("id") Long id){
|
|
||||||
List<ActivityTeamInfo> activityTeamInfoList= activityTeamInfoService.teamList(id);
|
|
||||||
return Result.success(activityTeamInfoList);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
package com.muyu.marketing.team.controller;
|
|
||||||
|
|
||||||
import com.dtflys.forest.annotation.Post;
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamOpenInfoAddModel;
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamOpenInfoAdReq;
|
|
||||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 营销团购活动策略类型控制层
|
|
||||||
*
|
|
||||||
* @author CuiFu Bo
|
|
||||||
* @create 2024-12-01 20:32
|
|
||||||
**/
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/open")
|
|
||||||
public class ActivityTeamOpenInfoController {
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
|
||||||
@PostMapping("/install")
|
|
||||||
public Result<String> save(ActivityTeamOpenInfoAdReq activityTeamOpenInfoAdReq){
|
|
||||||
activityTeamOpenInfoService.save(ActivityTeamOpenInfoAddModel.addOpenBuild(activityTeamOpenInfoAdReq));
|
|
||||||
return Result.success();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
package com.muyu.marketing.team.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
package com.muyu.marketing.team.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface TeamStrategyHundredMapper extends BaseMapper<TeamStrategyHundred> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
package com.muyu.marketing.team.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface TeamStrategyOrdinaryMapper extends BaseMapper<TeamStrategyOrdinary> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
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 com.muyu.marketing.domain.model.ActivityTeamOpenInfoAddModel;
|
|
||||||
|
|
||||||
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过活动ID和开团类型查询开团数量
|
|
||||||
* @param teamId 活动ID
|
|
||||||
* @param teamOpenType 开团类型
|
|
||||||
* @return 开团数量
|
|
||||||
*/
|
|
||||||
public Long getTeamOpenNumberByTeamIdAndType(Long teamId, TeamOpenTypeEnum teamOpenType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据活动ID获取开团数量
|
|
||||||
* @param teamId 团购活动ID
|
|
||||||
* @return 开团数量
|
|
||||||
*/
|
|
||||||
public default Long getTeamOpenTypeNumberByTeamId(Long teamId){
|
|
||||||
return this.getTeamOpenNumberByTeamIdAndType(teamId, TeamOpenTypeEnum.OPEN_TEAM);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据活动ID获取参团数量
|
|
||||||
* @param teamId 团购活动ID
|
|
||||||
* @return 参团数量
|
|
||||||
*/
|
|
||||||
public default Long getTeamInTypeNumberByTeamId(Long teamId){
|
|
||||||
return this.getTeamOpenNumberByTeamIdAndType(teamId, TeamOpenTypeEnum.IN_TEAM);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void save(ActivityTeamOpenInfoAddModel activityTeamOpenInfoAddModel);
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.muyu.marketing.team.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 免单
|
|
||||||
*/
|
|
||||||
public interface TeamStrategyExemptionService extends ActivityTeamStrategy, IService<TeamStrategyExemption> {
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.muyu.marketing.team.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百人
|
|
||||||
*/
|
|
||||||
public interface TeamStrategyHundredService extends ActivityTeamStrategy, IService<TeamStrategyHundred> {
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.muyu.marketing.team.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 普通
|
|
||||||
*/
|
|
||||||
public interface TeamStrategyOrdinaryService extends ActivityTeamStrategy, IService<TeamStrategyOrdinary> {
|
|
||||||
}
|
|
|
@ -1,121 +0,0 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
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.*;
|
|
||||||
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 org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.util.Assert;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
|
||||||
implements ActivityTeamInfoService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
|
||||||
|
|
||||||
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());
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Object<T> -> 创建对象的时候进行的占用
|
|
||||||
* <T> Result<T> 以方法返回值为占用
|
|
||||||
*/
|
|
||||||
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(activityTeamInfoListQueryModel.buildPage(), queryWrapper);
|
|
||||||
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
|
||||||
List<ActivityTeamInfoListModel> activityTeamInfoListModels = activityTeamInfoList.stream()
|
|
||||||
.map(activityTeamInfo -> ActivityTeamInfoListModel.infoBuild(activityTeamInfo,
|
|
||||||
(activityTeamInfoListModelBuilder) -> {
|
|
||||||
TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
|
|
||||||
TeamProductStockModel teamProductStockModel = activityTeamProductSkuInfoService.getStock(activityTeamInfo.getId());
|
|
||||||
Long teamOpenTypeNumber = activityTeamOpenInfoService.getTeamOpenTypeNumberByTeamId(activityTeamInfo.getId());
|
|
||||||
Long teamInTypeNumber = activityTeamOpenInfoService.getTeamInTypeNumberByTeamId(activityTeamInfo.getId());
|
|
||||||
|
|
||||||
return activityTeamInfoListModelBuilder
|
|
||||||
.openTeamNumber(teamOpenTypeNumber)
|
|
||||||
.addTeamNumber(teamInTypeNumber)
|
|
||||||
.attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
|
||||||
.teamPrice(discountPrice.getTeamPrice())
|
|
||||||
.productPrice(discountPrice.getProductPrice())
|
|
||||||
.teamStock(teamProductStockModel.getTeamStock())
|
|
||||||
.remainStock(teamProductStockModel.getRemainStock())
|
|
||||||
.build();
|
|
||||||
})).toList();
|
|
||||||
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>();
|
|
||||||
tableDataInfo.setTotal(activityTeamInfoPage.getTotal());
|
|
||||||
tableDataInfo.setRows(activityTeamInfoListModels);
|
|
||||||
return tableDataInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过添加模型,去进行商品拼团活动的操作
|
|
||||||
*
|
|
||||||
* @param activityTeamInfoAddModel 团购添加模型
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel) {
|
|
||||||
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.addModelBuild(activityTeamInfoAddModel);
|
|
||||||
Assert.isTrue(this.save(activityTeamInfo), StringUtils.format("团购活动添加失败:[{}]", activityTeamInfoAddModel));
|
|
||||||
List<ActivityTeamProductSkuAddModel> teamProductSkuAddModelList = activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList();
|
|
||||||
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
|
||||||
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ID查询商品的详情
|
|
||||||
* @param id 团购活动ID
|
|
||||||
* @return 团购详情
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ActivityTeamDetailModel findDetailById(Long id) {
|
|
||||||
ActivityTeamInfo activityTeamInfo = this.getById(id);
|
|
||||||
List<ActivityTeamProductSkuModel> activityTeamProductSkuModelList = activityTeamProductSkuInfoService.findListByTeamId(id);
|
|
||||||
return ActivityTeamDetailModel.findSkuSumList(activityTeamInfo,
|
|
||||||
(teamInfoFindByIdRespModelBuilder) -> teamInfoFindByIdRespModelBuilder.projectSkuInfoAddReqList(activityTeamProductSkuModelList).build()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改团购活动信息
|
|
||||||
* @param activityTeamInfoUpdModel 团购活动信息
|
|
||||||
* @return 是否成功
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
|
||||||
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
|
||||||
Assert.isTrue(update,"修改失败");
|
|
||||||
activityTeamProductSkuInfoService.setting(activityTeamInfoUpdModel.getActivityTeamProductSkuSettingModel());
|
|
||||||
return update;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据活动id查找拼团
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<ActivityTeamInfo> teamList(Long id) {
|
|
||||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(ActivityTeamInfo::getId,id);
|
|
||||||
List<ActivityTeamInfo> list = this.list(queryWrapper);
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Assert;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.github.pagehelper.util.StringUtil;
|
|
||||||
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamOpenInfoAddModel;
|
|
||||||
import com.muyu.marketing.team.mapper.ActivityTeamOpenInfoMapper;
|
|
||||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
|
|
||||||
implements ActivityTeamOpenInfoService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过活动ID和开团类型查询开团数量
|
|
||||||
*
|
|
||||||
* @param teamId 活动ID
|
|
||||||
* @param teamOpenType 开团类型
|
|
||||||
* @return 开团数量
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Long getTeamOpenNumberByTeamIdAndType(Long teamId, TeamOpenTypeEnum teamOpenType) {
|
|
||||||
LambdaQueryWrapper<ActivityTeamOpenInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(ActivityTeamOpenInfo::getTeamId, teamId);
|
|
||||||
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType, teamOpenType.code());
|
|
||||||
return this.count(queryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save(ActivityTeamOpenInfoAddModel activityTeamOpenInfoAddModel) {
|
|
||||||
ActivityTeamOpenInfo activityTeamOpenInfo = ActivityTeamOpenInfo.addBuildModel(activityTeamOpenInfoAddModel);
|
|
||||||
Assert.isTrue(this.save(activityTeamOpenInfo), StringUtils.format("团购活动添加失败[{}]",activityTeamOpenInfo));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,69 +0,0 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
|
||||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
@Service("team-strategy-exemption")
|
|
||||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
|
||||||
implements TeamStrategyExemptionService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId) {
|
|
||||||
log.info("参加 - 免单团 - [{}]", activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void backTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settle(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,75 +0,0 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyHundredMapper;
|
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
|
||||||
import com.muyu.marketing.team.service.TeamStrategyHundredService;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
@Service("team-strategy-hundred")
|
|
||||||
public class TeamStrategyHundredServiceImpl extends ServiceImpl<TeamStrategyHundredMapper, TeamStrategyHundred>
|
|
||||||
implements TeamStrategyHundredService {
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamInfoService activityTeamInfoService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId) {
|
|
||||||
log.info("参加 - 百人团 - [{}]", activityTeamId);
|
|
||||||
ActivityTeamOpenInfo activityTeamOpenInfo = new ActivityTeamOpenInfo();
|
|
||||||
activityTeamOpenInfo.setTeamId(activityTeamId);
|
|
||||||
activityTeamOpenInfo.setTeamType("百人团");
|
|
||||||
ActivityTeamInfo byId = activityTeamInfoService.getById(activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void backTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settle(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyOrdinaryMapper;
|
|
||||||
import com.muyu.marketing.team.service.TeamStrategyOrdinaryService;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
@Service("team-strategy-ordinary")
|
|
||||||
public class TeamStrategyOrdinaryServiceImpl extends ServiceImpl<TeamStrategyOrdinaryMapper, TeamStrategyOrdinary>
|
|
||||||
implements TeamStrategyOrdinaryService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId) {
|
|
||||||
|
|
||||||
log.info("参加 - 普通团 - [{}]", activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void backTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settle(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,85 +0,0 @@
|
||||||
package com.muyu.marketing.team.strategy.impl;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
|
||||||
import com.muyu.common.core.utils.SpringUtils;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购执行器
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-29 15:28
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Primary
|
|
||||||
public class ActivityTeamStrategyImpl implements ActivityTeamStrategy {
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId) {
|
|
||||||
// 假设这里是通过方法获取的type,activityTeamId.toString()
|
|
||||||
// "team-strategy-exemption"
|
|
||||||
// "team-strategy-hundred"
|
|
||||||
// "team-strategy-ordinary"
|
|
||||||
|
|
||||||
String activityTeamType = null;
|
|
||||||
if (activityTeamId == null) {
|
|
||||||
throw new ServiceException("activityTeamId is null");
|
|
||||||
}else if (activityTeamId == 0) {
|
|
||||||
activityTeamType = "team-strategy-exemption";
|
|
||||||
}else if (activityTeamId == 1) {
|
|
||||||
activityTeamType = "team-strategy-hundred";
|
|
||||||
}else if (activityTeamId == 2) {
|
|
||||||
activityTeamType = "team-strategy-ordinary";
|
|
||||||
}
|
|
||||||
ActivityTeamStrategy activityTeamStrategy = SpringUtils.getBean(activityTeamType);
|
|
||||||
activityTeamStrategy.openTeam(activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void backTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settle(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
package com.muyu.test;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.MuYuMarketingApplication;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-29 15:40
|
|
||||||
*/
|
|
||||||
@SpringBootTest(classes = MuYuMarketingApplication.class)
|
|
||||||
public class TeamStrategyTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamStrategy activityTeamStrategy;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testStrategy() {
|
|
||||||
activityTeamStrategy.openTeam(0L);
|
|
||||||
activityTeamStrategy.openTeam(1L);
|
|
||||||
activityTeamStrategy.openTeam(2L);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -9,21 +9,17 @@
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>marketing-common</artifactId>
|
<artifactId>muyu-marketing-common</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- 系统公共core -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>muyu-common-core</artifactId>
|
<artifactId>muyu-common-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -1,24 +1,25 @@
|
||||||
package com.muyu.marketing.domain;
|
package com.muyu.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.muyu.domain.model.ActivityTeamInfoAddModel;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.domain.model.ActivityTeamInfoSaveModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
import com.muyu.domain.model.ActivityTeamInfoUpdModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
import com.muyu.domain.req.ActivityTeamInfoSaveReq;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.*;
|
import lombok.Builder;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@Builder
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@NoArgsConstructor
|
||||||
@TableName(value = "activity_team_info", autoResultMap = true)
|
|
||||||
public class ActivityTeamInfo extends BaseEntity {
|
public class ActivityTeamInfo {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
|
@ -95,6 +96,21 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
public static ActivityTeamInfo buildModel(ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
||||||
|
String images = activityTeamInfoSaveReq.getImageList().toString();
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.productId(activityTeamInfoSaveReq.getProjectId())
|
||||||
|
.productImage(activityTeamInfoSaveReq.getProjectImage())
|
||||||
|
.unit(activityTeamInfoSaveReq.getUnit())
|
||||||
|
.imageList(images)
|
||||||
|
.name(activityTeamInfoSaveReq.getName())
|
||||||
|
.introduction(activityTeamInfoSaveReq.getIntroduction())
|
||||||
|
.endTime(activityTeamInfoSaveReq.getEndTime())
|
||||||
|
.strategyId(activityTeamInfoSaveReq.getStrategyId())
|
||||||
|
.strategyType(activityTeamInfoSaveReq.getStrategyType())
|
||||||
|
.sort(activityTeamInfoSaveReq.getSort())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
public static ActivityTeamInfo teamSaveBuild(ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
public static ActivityTeamInfo teamSaveBuild(ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
||||||
return ActivityTeamInfo.builder()
|
return ActivityTeamInfo.builder()
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.muyu.domain;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.domain.model.ActivityTeamOpenInfoAddModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ActivityTeamOpenInfo {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 团购活动ID
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
/**
|
||||||
|
* 团购类型
|
||||||
|
*/
|
||||||
|
private String teamType;
|
||||||
|
/**
|
||||||
|
* 团购策略
|
||||||
|
*/
|
||||||
|
private Long teamStrategyId;
|
||||||
|
/**
|
||||||
|
* 参团类型
|
||||||
|
*/
|
||||||
|
private String executiveType;
|
||||||
|
/**
|
||||||
|
* 结束团购时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
private String productName;
|
||||||
|
/**
|
||||||
|
* 商品规格
|
||||||
|
*/
|
||||||
|
private String productSku;
|
||||||
|
/**
|
||||||
|
* 开团标识
|
||||||
|
*/
|
||||||
|
private String openkey;
|
||||||
|
/**
|
||||||
|
* 订单ID
|
||||||
|
*/
|
||||||
|
private Long orderId;
|
||||||
|
/**
|
||||||
|
* 开团状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
public static ActivityTeamOpenInfo add(ActivityTeamOpenInfoAddModel addModel){
|
||||||
|
return ActivityTeamOpenInfo.builder()
|
||||||
|
.teamId(addModel.getTeamId())
|
||||||
|
.teamType(addModel.getTeamType())
|
||||||
|
.teamStrategyId(addModel.getTeamStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,26 +1,22 @@
|
||||||
package com.muyu.marketing.domain;
|
package com.muyu.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.muyu.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.domain.model.ActivityTeamProductSkuReqModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
import com.muyu.domain.model.ActivityTeamProductSkuUpdModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
import lombok.AllArgsConstructor;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
import lombok.Builder;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
import lombok.Data;
|
||||||
import lombok.*;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@Builder
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@NoArgsConstructor
|
||||||
@TableName(value = "activity_team_product_sku_info", autoResultMap = true)
|
public class ActivityTeamProductSkuInfo {
|
||||||
public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
*/
|
*/
|
|
@ -1,24 +1,19 @@
|
||||||
package com.muyu.marketing.domain;
|
package com.muyu.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import lombok.AllArgsConstructor;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import lombok.Builder;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import lombok.Data;
|
||||||
import lombok.*;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@Builder
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@NoArgsConstructor
|
||||||
@TableName(value = "team_strategy_exemption", autoResultMap = true)
|
public class TeamStrategyExemption {
|
||||||
public class TeamStrategyExemption extends BaseEntity {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
*/
|
*/
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private long id;
|
private long id;
|
||||||
/**
|
/**
|
||||||
* 持续时间
|
* 持续时间
|
||||||
|
@ -52,4 +47,5 @@ public class TeamStrategyExemption extends BaseEntity {
|
||||||
* 策略状态
|
* 策略状态
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.muyu.domain;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TeamStrategyExemptionHundred {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private long id;
|
||||||
|
/**
|
||||||
|
* 持续时间
|
||||||
|
*/
|
||||||
|
private long duration;
|
||||||
|
/**
|
||||||
|
* 最大购买量
|
||||||
|
*/
|
||||||
|
private long maxBuy;
|
||||||
|
/**
|
||||||
|
* 单次购买量
|
||||||
|
*/
|
||||||
|
private long oneBuy;
|
||||||
|
/**
|
||||||
|
* 虚拟人数
|
||||||
|
*/
|
||||||
|
private long virtualNumber;
|
||||||
|
/**
|
||||||
|
* 策略状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 规则信息
|
||||||
|
*/
|
||||||
|
private String ruleInfo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.muyu.domain;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TeamStrategyExemptionOrdinary {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private long id;
|
||||||
|
/**
|
||||||
|
* 持续时间
|
||||||
|
*/
|
||||||
|
private long duration;
|
||||||
|
/**
|
||||||
|
* 成团人数
|
||||||
|
*/
|
||||||
|
private long teamNumber;
|
||||||
|
/**
|
||||||
|
* 最大购买量
|
||||||
|
*/
|
||||||
|
private long maxBuy;
|
||||||
|
/**
|
||||||
|
* 单次购买量
|
||||||
|
*/
|
||||||
|
private long oneBuy;
|
||||||
|
/**
|
||||||
|
* 虚拟人数
|
||||||
|
*/
|
||||||
|
private long virtualNumber;
|
||||||
|
/**
|
||||||
|
* 策略状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.domain.req.ActivityInfoAddReq;
|
||||||
|
import com.muyu.domain.req.ActivityInfoSkuAddReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团规格添加模板
|
||||||
|
*
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-22 20:37
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ActivitySkuModel {
|
||||||
|
|
||||||
|
List<ActivityInfoSkuAddReq> activityInfoAdd;
|
||||||
|
|
||||||
|
public static ActivitySkuModel activitySkuModel(ActivityInfoAddReq req){
|
||||||
|
return ActivitySkuModel.builder()
|
||||||
|
.activityInfoAdd(req.getSkuList())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.domain.ActivityTeamInfo;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -82,7 +82,7 @@ public class ActivityTeamDetailModel {
|
||||||
*/
|
*/
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
public static ActivityTeamDetailModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
public static ActivityTeamDetailModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
||||||
Function<ActivityTeamDetailModel.ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
Function<ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
||||||
return function.apply(ActivityTeamDetailModel.builder()
|
return function.apply(ActivityTeamDetailModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
.id(activityTeamInfo.getId())
|
||||||
.name(activityTeamInfo.getName())
|
.name(activityTeamInfo.getName())
|
|
@ -1,17 +1,14 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
import com.muyu.domain.resp.TeamInfoProductSkuIdByIdResp;
|
||||||
import com.muyu.marketing.domain.resp.TeamInfoProductSkuIdByIdResp;
|
|
||||||
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 org.springframework.web.context.annotation.ApplicationScope;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -41,10 +38,6 @@ public class ActivityTeamFindByIdModel {
|
||||||
* 商品ID
|
* 商品ID
|
||||||
*/
|
*/
|
||||||
private long productId;
|
private long productId;
|
||||||
/**
|
|
||||||
* 商品价格
|
|
||||||
*/
|
|
||||||
private BigDecimal price;
|
|
||||||
/**
|
/**
|
||||||
* 商品活动图
|
* 商品活动图
|
||||||
*/
|
*/
|
||||||
|
@ -91,7 +84,7 @@ public class ActivityTeamFindByIdModel {
|
||||||
private List<TeamInfoProductSkuIdByIdResp> teamProjectSkuInfoAddReqList;
|
private List<TeamInfoProductSkuIdByIdResp> teamProjectSkuInfoAddReqList;
|
||||||
|
|
||||||
|
|
||||||
public static ActivityTeamFindByIdModel findByIdModel(ActivityTeamInfo activityTeamInfo,List<TeamInfoProductSkuIdByIdResp> teamProjectSkuInfoAddReqList){
|
public static ActivityTeamFindByIdModel findByIdModel(ActivityTeamInfo activityTeamInfo, List<TeamInfoProductSkuIdByIdResp> teamProjectSkuInfoAddReqList){
|
||||||
return ActivityTeamFindByIdModel.builder()
|
return ActivityTeamFindByIdModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
.id(activityTeamInfo.getId())
|
||||||
.name(activityTeamInfo.getName())
|
.name(activityTeamInfo.getName())
|
|
@ -0,0 +1,110 @@
|
||||||
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.domain.req.ActivityInfoAddReq;
|
||||||
|
import lombok.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Null;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动添加模型
|
||||||
|
*
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-22 16:48
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ActivityTeamInfoAddModel {
|
||||||
|
/**
|
||||||
|
* 商品iD
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
*商品图片
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 商品轮播图
|
||||||
|
*/
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
*活动名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
*活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
*商品单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
*商品的轮番图
|
||||||
|
*/
|
||||||
|
private String imagesList;
|
||||||
|
/**
|
||||||
|
*活动时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
*策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
*策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
/**
|
||||||
|
*排序
|
||||||
|
*/
|
||||||
|
private long sort;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
*详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
|
||||||
|
public static ActivityTeamInfoAddModel activityTeamInfoAddModel (ActivityInfoAddReq req){
|
||||||
|
return ActivityTeamInfoAddModel.builder()
|
||||||
|
.productImage(req.getProductImage())
|
||||||
|
.name(req.getName())
|
||||||
|
.introduction(req.getIntroduction())
|
||||||
|
.unit(req.getUnit())
|
||||||
|
.imagesList(req.getImagesList())
|
||||||
|
.endTime(req.getEndTime())
|
||||||
|
.strategyType(req.getStrategyType())
|
||||||
|
.strategyId(req.getStrategyId())
|
||||||
|
.sort(req.getSort())
|
||||||
|
.content(req.getContent())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActivityTeamInfo activityTeamInfoAdd(){
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.productImage(this.getProductImage())
|
||||||
|
.name(this.getName())
|
||||||
|
.introduction(this.getIntroduction())
|
||||||
|
.unit(this.getUnit())
|
||||||
|
.imageList(this.getImagesList())
|
||||||
|
.endTime(this.getEndTime())
|
||||||
|
.strategyType(this.getStrategyType())
|
||||||
|
.strategyId(this.getStrategyId())
|
||||||
|
.sort(this.getSort())
|
||||||
|
.content(this.getContent())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,91 +1,75 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
import com.muyu.common.core.web.model.QueryModel;
|
import com.muyu.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.*;
|
import lombok.Builder;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigInteger;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购活动雷彪查询结果模型
|
* 团购活动列表查询结果模型
|
||||||
* @author DongZeLiang
|
* @author: CuiFu Bo
|
||||||
* @date 2024-11-20 14:18:10
|
* @create: 2024-11-20 19:59
|
||||||
*/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class ActivityTeamInfoListModel {
|
public class ActivityTeamInfoListModel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团活动ID
|
* ID 编号
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 拼团名称
|
* 拼团名称
|
||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
/**
|
|
||||||
* 参团人数
|
|
||||||
*/
|
|
||||||
private Long addTeamNumber;
|
|
||||||
/**
|
|
||||||
* 拼团人数
|
|
||||||
*/
|
|
||||||
private Long attendNumber;
|
|
||||||
/**
|
|
||||||
* 团购结束时间
|
|
||||||
*/
|
|
||||||
private Date endTime;
|
|
||||||
/**
|
|
||||||
* 开团人数
|
|
||||||
*/
|
|
||||||
private Long openTeamNumber;
|
|
||||||
/**
|
/**
|
||||||
* 拼团商品图片
|
* 拼团商品图片
|
||||||
*/
|
*/
|
||||||
private String productImage;
|
private String productImage;
|
||||||
/**
|
|
||||||
* 商品价格
|
|
||||||
*/
|
|
||||||
private BigDecimal productPrice;
|
|
||||||
/**
|
|
||||||
* 剩余库存
|
|
||||||
*/
|
|
||||||
private Long remainStock;
|
|
||||||
/**
|
|
||||||
* 团购状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
/**
|
/**
|
||||||
* 拼团价格
|
* 拼团价格
|
||||||
*/
|
*/
|
||||||
private BigDecimal teamPrice;
|
private BigDecimal teamPrice;
|
||||||
|
/**
|
||||||
|
* 拼团人数
|
||||||
|
*/
|
||||||
|
private Long attendNumber;
|
||||||
|
/**
|
||||||
|
* 开团人数
|
||||||
|
*/
|
||||||
|
private Long openTeamNumber;
|
||||||
|
/**
|
||||||
|
* 参团人数
|
||||||
|
*/
|
||||||
|
private Long addTeamNumber;
|
||||||
/**
|
/**
|
||||||
* 团购库存
|
* 团购库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
|
/**
|
||||||
|
* 剩余库存
|
||||||
|
*/
|
||||||
|
private Long remainStock;
|
||||||
|
/**
|
||||||
|
* 团购结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 团购状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModel.ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) {
|
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModel.ActivityTeamInfoListModelBuilder , ActivityTeamInfoListModel> function){
|
||||||
ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
|
||||||
.id(activityTeamInfo.getId())
|
|
||||||
.name(activityTeamInfo.getName())
|
|
||||||
// .openTeamNumber(teamOpenTypeNumber)
|
|
||||||
// .addTeamNumber(teamInTypeNumber)
|
|
||||||
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
|
||||||
.endTime(activityTeamInfo.getEndTime())
|
|
||||||
.productImage(activityTeamInfo.getProductImage())
|
|
||||||
// .teamPrice(discountPrice.getTeamPrice())
|
|
||||||
// .productPrice(discountPrice.getProductPrice())
|
|
||||||
// .teamStock(teamProductStockModel.getTeamStock())
|
|
||||||
// .remainStock(teamProductStockModel.getRemainStock())
|
|
||||||
.status(activityTeamInfo.getStatus())
|
|
||||||
.build();
|
|
||||||
return function.apply(
|
return function.apply(
|
||||||
ActivityTeamInfoListModel.builder()
|
ActivityTeamInfoListModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
.id(activityTeamInfo.getId())
|
||||||
|
@ -95,5 +79,4 @@ public class ActivityTeamInfoListModel {
|
||||||
.status(activityTeamInfo.getStatus())
|
.status(activityTeamInfo.getStatus())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,21 +1,18 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
import com.muyu.common.core.web.model.QueryModel;
|
import com.muyu.common.core.web.model.QueryModel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.*;
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购活动雷彪查询模型
|
* 团购活动列表查询模型
|
||||||
* @author DongZeLiang
|
* @author: CuiFu Bo
|
||||||
* @date 2024-11-20 14:18:10
|
* @create: 2024-11-20 20:05
|
||||||
*/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class ActivityTeamInfoListQueryModel extends QueryModel<ActivityTeamInfoListQueryModel> {
|
public class ActivityTeamInfoListQueryModel extends QueryModel<ActivityTeamInfoListQueryModel> {
|
||||||
|
|
||||||
|
@ -23,10 +20,8 @@ public class ActivityTeamInfoListQueryModel extends QueryModel<ActivityTeamInfoL
|
||||||
* 搜索关键词
|
* 搜索关键词
|
||||||
*/
|
*/
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 活动状态
|
* 状态
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,14 +1,12 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
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 java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: 2204a-cloud-server
|
* @program: 2204a-cloud-server
|
|
@ -1,17 +1,12 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
import com.muyu.domain.req.ActivityTeamInfoUpdReq;
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoUpdReq;
|
|
||||||
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 java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: 2204a-cloud-server
|
* @program: 2204a-cloud-server
|
|
@ -1,35 +1,28 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购策略类型
|
|
||||||
*
|
|
||||||
* @author CuiFu Bo
|
* @author CuiFu Bo
|
||||||
* @create 2024-12-01 20:27
|
* @create 2024-12-04 19:05
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ActivityTeamOpenInfoAddResp {
|
public class ActivityTeamOpenInfoAddModel {
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private long id;
|
|
||||||
/**
|
/**
|
||||||
* 团购活动ID
|
* 团购活动ID
|
||||||
*/
|
*/
|
||||||
private long teamId;
|
private Long teamId;
|
||||||
/**
|
/**
|
||||||
* 团购类型
|
* 团购类型
|
||||||
*/
|
*/
|
||||||
|
@ -37,7 +30,7 @@ public class ActivityTeamOpenInfoAddResp {
|
||||||
/**
|
/**
|
||||||
* 团购策略
|
* 团购策略
|
||||||
*/
|
*/
|
||||||
private String teamStrategyId;
|
private Long teamStrategyId;
|
||||||
/**
|
/**
|
||||||
* 参团类型
|
* 参团类型
|
||||||
*/
|
*/
|
||||||
|
@ -45,11 +38,12 @@ public class ActivityTeamOpenInfoAddResp {
|
||||||
/**
|
/**
|
||||||
* 结束团购时间
|
* 结束团购时间
|
||||||
*/
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 商品ID
|
* 商品ID
|
||||||
*/
|
*/
|
||||||
private String productId;
|
private Long productId;
|
||||||
/**
|
/**
|
||||||
* 商品名称
|
* 商品名称
|
||||||
*/
|
*/
|
||||||
|
@ -61,13 +55,15 @@ public class ActivityTeamOpenInfoAddResp {
|
||||||
/**
|
/**
|
||||||
* 开团标识
|
* 开团标识
|
||||||
*/
|
*/
|
||||||
private String key;
|
private String openkey;
|
||||||
/**
|
/**
|
||||||
* 订单ID
|
* 订单ID
|
||||||
*/
|
*/
|
||||||
private String orderId;
|
private Long orderId;
|
||||||
/**
|
/**
|
||||||
* 开团状态
|
* 开团状态
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
import com.muyu.domain.req.TeamProjectSkuInfoAddReq;
|
||||||
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 java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
|
@ -1,7 +1,7 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
|
||||||
import com.muyu.marketing.domain.resp.ProjectFindSkuInfoResp;
|
import com.muyu.domain.ActivityTeamProductSkuInfo;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,6 +1,6 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuReq;
|
import com.muyu.domain.req.ActivityTeamProductSkuReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,7 +1,7 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
import com.muyu.domain.req.ActivityTeamProductSkuSettingReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,7 +1,7 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoUpdReq;
|
import com.muyu.domain.req.TeamProjectSkuInfoUpdReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动价格模型
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-21 16:07
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TeamDiscountPriceModel {
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
/**
|
||||||
|
* 商品价格
|
||||||
|
*/
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
/**
|
||||||
|
* 优惠力度
|
||||||
|
*/
|
||||||
|
private Double discount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @param teamPrice
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static TeamDiscountPriceModel of(BigDecimal price, BigDecimal teamPrice){
|
||||||
|
return TeamDiscountPriceModel.builder()
|
||||||
|
.productPrice(price)
|
||||||
|
.teamPrice(teamPrice)
|
||||||
|
.discount(price.subtract(teamPrice).divide(price,2, RoundingMode.HALF_EVEN).doubleValue())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,4 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.domain.model;
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
@ -7,25 +6,22 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购商品库存模型
|
* 商品库存
|
||||||
*
|
* @author: CuiFu Bo
|
||||||
* @author DongZeLiang
|
* @create: 2024-11-21 16:54
|
||||||
* @date 2024-11-21 14:04
|
**/
|
||||||
*/
|
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class TeamProductStockModel {
|
public class TeamProductStockModel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团总库存
|
* 团购库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团剩余库存
|
* 剩余库存
|
||||||
*/
|
*/
|
||||||
private Long remainStock;
|
private Long remainStock;
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.muyu.domain.req;
|
||||||
|
|
||||||
|
import com.muyu.domain.model.ActivitySkuModel;
|
||||||
|
import com.muyu.domain.model.ActivityTeamInfoAddModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动添加
|
||||||
|
*
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-22 20:48
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ActivityInfoAddReq {
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
*商品图片
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
*活动名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
*活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
*商品单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
*商品的轮番图
|
||||||
|
*/
|
||||||
|
private String imagesList;
|
||||||
|
/**
|
||||||
|
*活动时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
*策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
*策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
/**
|
||||||
|
*排序
|
||||||
|
*/
|
||||||
|
private long sort;
|
||||||
|
/**
|
||||||
|
*详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 商品规格
|
||||||
|
*/
|
||||||
|
private List<ActivityInfoSkuAddReq> skuList;
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.muyu.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品Sku
|
||||||
|
*
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-23 01:18
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
|
||||||
|
public class ActivityInfoSkuAddReq {
|
||||||
|
/**
|
||||||
|
* 商品规格
|
||||||
|
*/
|
||||||
|
private String productSku;
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
}
|
|
@ -1,8 +1,7 @@
|
||||||
package com.muyu.marketing.domain.req;
|
package com.muyu.domain.req;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
@ -24,11 +23,11 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 商品ID
|
* 商品ID
|
||||||
*/
|
*/
|
||||||
private Long productId;
|
private Long projectId;
|
||||||
/**
|
/**
|
||||||
* 商品活动图
|
* 商品活动图
|
||||||
*/
|
*/
|
||||||
private String productImage;
|
private String projectImage;
|
||||||
/**
|
/**
|
||||||
* 活动简介
|
* 活动简介
|
||||||
*/
|
*/
|
||||||
|
@ -55,7 +54,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
private List<ActivityInfoSkuAddReq> teamProjectSkuInfoAddReqList;
|
||||||
/**
|
/**
|
||||||
* 活动详情
|
* 活动详情
|
||||||
*/
|
*/
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.marketing.domain.req;
|
package com.muyu.domain.req;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
@ -6,7 +6,6 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: 2204a-cloud-server
|
* @program: 2204a-cloud-server
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.marketing.domain.req;
|
package com.muyu.domain.req;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,7 +1,6 @@
|
||||||
package com.muyu.marketing.domain.req;
|
package com.muyu.domain.req;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,14 +1,18 @@
|
||||||
package com.muyu.marketing.domain.req;
|
package com.muyu.domain.req;
|
||||||
|
|
||||||
import com.muyu.common.core.web.page.PageDomain;
|
import com.muyu.common.core.web.page.PageDomain;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
import com.muyu.domain.model.ActivityTeamInfoListQueryModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
* @Date:2024.11.20 19:49
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class TeamInfoListReq extends PageDomain {
|
public class TeamInfoListReq extends PageDomain {
|
||||||
|
|
||||||
|
@ -16,18 +20,16 @@ public class TeamInfoListReq extends PageDomain {
|
||||||
* 搜索关键词
|
* 搜索关键词
|
||||||
*/
|
*/
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 活动状态
|
* 状态
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过当前对象构建业务查询模型
|
* 通过当前对象构建业务查询模型
|
||||||
* @return 业务查询模型
|
* @return 业务查询模型
|
||||||
*/
|
*/
|
||||||
public ActivityTeamInfoListQueryModel buildQueryModel() {
|
public ActivityTeamInfoListQueryModel buildQueryModel(){
|
||||||
return ActivityTeamInfoListQueryModel.builder()
|
return ActivityTeamInfoListQueryModel.builder()
|
||||||
.keyWord(this.keyWord)
|
.keyWord(this.keyWord)
|
||||||
.status(this.status)
|
.status(this.status)
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.marketing.domain.req;
|
package com.muyu.domain.req;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.marketing.domain.req;
|
package com.muyu.domain.req;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,8 +1,7 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.domain.resp;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
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.req.TeamProjectSkuInfoAddReq;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.domain.resp;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,8 +1,6 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.domain.resp;
|
||||||
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.domain.model.ActivityTeamProductSkuModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
|
@ -1,7 +1,8 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.domain.resp;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
|
||||||
|
import com.muyu.domain.model.ActivityTeamDetailModel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,14 +1,12 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.domain.resp;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamFindByIdModel;
|
import com.muyu.domain.model.ActivityTeamFindByIdModel;
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
|
||||||
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 java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.domain.resp;
|
||||||
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.common.core.web.page.PageDomain;
|
||||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
import com.muyu.domain.model.ActivityTeamInfoListModel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -10,81 +10,74 @@ import lombok.NoArgsConstructor;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*TeamInfoListResp
|
||||||
|
* @Date:2024.11.20 19:47
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class TeamInfoListResp {
|
@NoArgsConstructor
|
||||||
|
public class TeamInfoListResp {
|
||||||
/**
|
/**
|
||||||
* 拼团活动ID
|
* ID编号
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 拼团名称
|
* 拼团名称
|
||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
/**
|
|
||||||
* 参团人数
|
|
||||||
*/
|
|
||||||
private Long addTeamNumber;
|
|
||||||
/**
|
|
||||||
* 拼团人数
|
|
||||||
*/
|
|
||||||
private Long attendNumber;
|
|
||||||
/**
|
|
||||||
* 团购结束时间
|
|
||||||
*/
|
|
||||||
private Date endTime;
|
|
||||||
/**
|
|
||||||
* 开团人数
|
|
||||||
*/
|
|
||||||
private Long openTeamNumber;
|
|
||||||
/**
|
/**
|
||||||
* 拼团商品图片
|
* 拼团商品图片
|
||||||
*/
|
*/
|
||||||
private String productImage;
|
private String productImage;
|
||||||
/**
|
|
||||||
* 商品价格
|
|
||||||
*/
|
|
||||||
private BigDecimal productPrice;
|
|
||||||
/**
|
|
||||||
* 剩余库存
|
|
||||||
*/
|
|
||||||
private Long remainStock;
|
|
||||||
/**
|
|
||||||
* 团购状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
/**
|
/**
|
||||||
* 拼团价格
|
* 拼团价格
|
||||||
*/
|
*/
|
||||||
private BigDecimal teamPrice;
|
private BigDecimal teamPrice;
|
||||||
|
/**
|
||||||
|
* 拼团人数
|
||||||
|
*/
|
||||||
|
private Long attendNumber;
|
||||||
|
/**
|
||||||
|
* 开团人数
|
||||||
|
*/
|
||||||
|
private Long openTeamNumber;
|
||||||
|
/**
|
||||||
|
* 参团人数
|
||||||
|
*/
|
||||||
|
private Long addTeamNumber;
|
||||||
/**
|
/**
|
||||||
* 团购库存
|
* 团购库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询结果,构建为响应对象
|
* 剩余库存
|
||||||
* @param activityTeamInfoListModel 列表数据查询结果
|
|
||||||
* @return 响应对象
|
|
||||||
*/
|
*/
|
||||||
public static TeamInfoListResp listModelBuild(ActivityTeamInfoListModel activityTeamInfoListModel) {
|
private Long remainStock;
|
||||||
|
/**
|
||||||
|
* 团购结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 团购状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
public static TeamInfoListResp listModerBuild(ActivityTeamInfoListModel activityTeamInfoListModel){
|
||||||
return TeamInfoListResp.builder()
|
return TeamInfoListResp.builder()
|
||||||
.id(activityTeamInfoListModel.getId())
|
.id(activityTeamInfoListModel.getId())
|
||||||
.name(activityTeamInfoListModel.getName())
|
.name(activityTeamInfoListModel.getName())
|
||||||
|
.productImage(activityTeamInfoListModel.getProductImage())
|
||||||
|
.teamPrice(activityTeamInfoListModel.getTeamPrice())
|
||||||
|
.attendNumber(activityTeamInfoListModel.getAttendNumber())
|
||||||
.openTeamNumber(activityTeamInfoListModel.getOpenTeamNumber())
|
.openTeamNumber(activityTeamInfoListModel.getOpenTeamNumber())
|
||||||
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
||||||
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
|
||||||
.attendNumber(activityTeamInfoListModel.getAttendNumber())
|
|
||||||
.endTime(activityTeamInfoListModel.getEndTime())
|
|
||||||
.teamPrice(activityTeamInfoListModel.getTeamPrice())
|
|
||||||
.productImage(activityTeamInfoListModel.getProductImage())
|
|
||||||
.productPrice(activityTeamInfoListModel.getProductPrice())
|
|
||||||
.remainStock(activityTeamInfoListModel.getRemainStock())
|
|
||||||
.status(activityTeamInfoListModel.getStatus())
|
|
||||||
.teamStock(activityTeamInfoListModel.getTeamStock())
|
.teamStock(activityTeamInfoListModel.getTeamStock())
|
||||||
|
.remainStock(activityTeamInfoListModel.getRemainStock())
|
||||||
|
.endTime(activityTeamInfoListModel.getEndTime())
|
||||||
|
.status(activityTeamInfoListModel.getStatus())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,16 +1,14 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.domain.resp;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamFindByIdModel;
|
import com.muyu.domain.model.ActivityTeamProductSkuIdModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuIdModel;
|
|
||||||
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 java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购活动规格回显
|
* 团购活动规格回显
|
|
@ -9,7 +9,7 @@
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>marketing-remote</artifactId>
|
<artifactId>muyu-marketing-remote</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
@ -17,10 +17,4 @@
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>marketing-common</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
</project>
|
|
@ -9,7 +9,7 @@
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>marketing-server</artifactId>
|
<artifactId>muyu-marketing-server</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
@ -17,7 +17,16 @@
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-product-cache</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-marketing-common</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</dependency>
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
@ -83,18 +92,12 @@
|
||||||
<groupId>com.dtflys.forest</groupId>
|
<groupId>com.dtflys.forest</groupId>
|
||||||
<artifactId>forest-spring-boot-starter</artifactId>
|
<artifactId>forest-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 远程调用 -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>marketing-remote</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
|
<version>5.8.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 商品服务 缓存依赖 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>muyu-product-cache</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -121,4 +124,5 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.marketing;
|
package com.muyu.system.team;
|
||||||
|
|
||||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
|
@ -0,0 +1,92 @@
|
||||||
|
package com.muyu.system.team.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.dtflys.forest.annotation.Post;
|
||||||
|
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.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.domain.model.ActivitySkuModel;
|
||||||
|
import com.muyu.domain.model.ActivityTeamInfoAddModel;
|
||||||
|
import com.muyu.domain.model.ActivityTeamInfoListModel;
|
||||||
|
import com.muyu.domain.model.ActivityTeamInfoUpdModel;
|
||||||
|
import com.muyu.domain.req.ActivityInfoAddReq;
|
||||||
|
import com.muyu.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
import com.muyu.domain.req.ActivityTeamInfoUpdReq;
|
||||||
|
import com.muyu.domain.req.TeamInfoListReq;
|
||||||
|
import com.muyu.domain.resp.TeamInfoFindByIdResp;
|
||||||
|
import com.muyu.domain.resp.TeamInfoListResp;
|
||||||
|
import com.muyu.system.team.service.ActivityTeamInfoService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息
|
||||||
|
* @program: cloud-server
|
||||||
|
* @description: 商品拼团信息
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 21:49
|
||||||
|
**/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/team")
|
||||||
|
public class ActivityTeamInfoController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ActivityTeamInfoService activityTeamInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动列表查询
|
||||||
|
* @param teamInfoListReq 分页
|
||||||
|
* @return 列表数据
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("marketing:marketing:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public Result<TableDataInfo<TeamInfoListResp>> list(@RequestBody TeamInfoListReq teamInfoListReq){
|
||||||
|
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = activityTeamInfoService.query(teamInfoListReq.buildQueryModel());
|
||||||
|
List<TeamInfoListResp> listResp = tableDataInfo.getRows().stream().map(TeamInfoListResp::listModerBuild).toList();
|
||||||
|
return Result.success(
|
||||||
|
new TableDataInfo<>(){{
|
||||||
|
setRows(listResp);
|
||||||
|
setTotal(tableDataInfo.getTotal());
|
||||||
|
}}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增团购活动
|
||||||
|
* @param activityTeamInfoSaveReq 团购参数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("marketing:marketing:save")
|
||||||
|
@PostMapping("/save")
|
||||||
|
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq ) throws ParseException {
|
||||||
|
return activityTeamInfoService.save(activityTeamInfoSaveReq);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/findById/{id}")
|
||||||
|
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
||||||
|
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
||||||
|
}
|
||||||
|
@PutMapping("/updateByTeamId")
|
||||||
|
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
|
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据活动ID查询商品拼团信息
|
||||||
|
* @param id 活动ID
|
||||||
|
* @return 商品拼团信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/ActivityTeamList/{id}")
|
||||||
|
public Result<List<ActivityTeamInfo>> teamList(@PathVariable("id") Long id){
|
||||||
|
List<ActivityTeamInfo> activityTeamInfoList= activityTeamInfoService.ActivityTeamList(id);
|
||||||
|
return Result.success(activityTeamInfoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.muyu.system.team.controller;
|
||||||
|
|
||||||
|
import com.muyu.system.team.service.ActivityTeamOpenInfoService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动执行表
|
||||||
|
* @program: cloud-server
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 21:50
|
||||||
|
**/
|
||||||
|
@Api(tags = "团购活动执行")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/open")
|
||||||
|
|
||||||
|
public class ActivityTeamOpenInfoController {
|
||||||
|
@Autowired(required=true)
|
||||||
|
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.muyu.system.team.controller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团规格信息表
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 21:50
|
||||||
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
public class ActivityTeamProductSkuInfoController {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.system.team.controller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团免单策略
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 21:51
|
||||||
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
public class TeamStrategyExemptionController {
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.system.team.controller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百人策略
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 21:51
|
||||||
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
public class TeamStrategyExemptionHundredController {
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.system.team.controller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普通策略
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 21:51
|
||||||
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
public class TeamStrategyExemptionOrdinaryController {
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.muyu.system.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.domain.ActivityTeamInfo;
|
||||||
|
import net.minidev.json.writer.BeansMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
商品拼团信息
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 20:41
|
||||||
|
**/
|
||||||
|
@Mapper
|
||||||
|
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo> {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,15 @@
|
||||||
package com.muyu.marketing.team.mapper;
|
package com.muyu.system.team.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
import com.muyu.domain.ActivityTeamOpenInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
团购活动执行表
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 20:44
|
||||||
|
**/
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ActivityTeamOpenInfoMapper extends BaseMapper<ActivityTeamOpenInfo> {
|
public interface ActivityTeamOpenInfoMapper extends BaseMapper<ActivityTeamOpenInfo> {
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,11 +1,17 @@
|
||||||
package com.muyu.marketing.team.mapper;
|
package com.muyu.system.team.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
import com.muyu.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
商品拼团规格信息表
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 20:45
|
||||||
|
**/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ActivityTeamProductSkuInfoMapper extends BaseMapper<ActivityTeamProductSkuInfo> {
|
public interface ActivityTeamProductSkuInfoMapper extends BaseMapper<ActivityTeamProductSkuInfo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.muyu.system.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.domain.TeamStrategyExemptionHundred;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
百人策略
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 20:47
|
||||||
|
**/
|
||||||
|
@Mapper
|
||||||
|
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyExemptionHundred> {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
package com.muyu.marketing.team.mapper;
|
package com.muyu.system.team.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.domain.TeamStrategyExemption;
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
拼团免单策略
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 20:46
|
||||||
|
**/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TeamStrategyExemptionMapper extends BaseMapper<TeamStrategyExemption> {
|
public interface TeamStrategyExemptionMapper extends BaseMapper<TeamStrategyExemption> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.muyu.system.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普通策略
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 20:48
|
||||||
|
**/
|
||||||
|
@Mapper
|
||||||
|
public interface TeamStrategyExemptionOrdinaryMapper extends BaseMapper<TeamStrategyExemptionOrdinary> {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,30 @@
|
||||||
package com.muyu.marketing.team.service;
|
package com.muyu.system.team.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.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.domain.model.*;
|
||||||
|
import com.muyu.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
import com.muyu.product.domain.req.ProjectInfoSaveReq;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
商品拼团信息
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 20:49
|
||||||
|
**/
|
||||||
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);
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过添加模型,去进行商品拼团活动的操作
|
Result<String> save(ActivityTeamInfoSaveReq activityTeamInfoSaveReq);
|
||||||
* @param activityTeamInfoAddModel 团购添加模型
|
|
||||||
*/
|
|
||||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询商品的详情
|
* 根据ID查询商品的详情
|
||||||
|
@ -37,9 +40,13 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
*/
|
*/
|
||||||
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||||
|
|
||||||
|
/**
|
||||||
List<ActivityTeamInfo> teamList(Long id);
|
* 根据活动ID查询商品拼团信息
|
||||||
|
* @param id 活动ID
|
||||||
|
* @return 商品拼团信息
|
||||||
|
*/
|
||||||
|
List<ActivityTeamInfo> ActivityTeamList(Long id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.muyu.system.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.common.core.enums.TeamOpenTypeEnums;
|
||||||
|
import com.muyu.domain.ActivityTeamOpenInfo;
|
||||||
|
import com.muyu.system.team.mapper.ActivityTeamOpenInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动执行表
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 20:49
|
||||||
|
**/
|
||||||
|
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
||||||
|
/**
|
||||||
|
* 通过活动Id和开团类型查询开团数量
|
||||||
|
* @param teamId 活动ID
|
||||||
|
* @param teamOpenTypeEnums 开团类型
|
||||||
|
* @return 开团数量
|
||||||
|
*/
|
||||||
|
public Long getTeamOpenNumberByTeamIdAndType(Long teamId, TeamOpenTypeEnums teamOpenTypeEnums);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据活动id查询开团数量
|
||||||
|
* @param teamId 活动ID
|
||||||
|
* @return 开团数量
|
||||||
|
*/
|
||||||
|
public default Long getTeamOpenTypeByOpenAndTypeTeam(Long teamId){
|
||||||
|
return this.getTeamOpenNumberByTeamIdAndType(teamId,TeamOpenTypeEnums.OPEN_TEAM);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据活动Id查询参团数量
|
||||||
|
* @param teamId 活动ID
|
||||||
|
* @return 参团数量
|
||||||
|
*/
|
||||||
|
public default Long getTeamOpenTypeByInAndTypeTeam(Long teamId){
|
||||||
|
return this.getTeamOpenNumberByTeamIdAndType(teamId,TeamOpenTypeEnums.IN_TEAM);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
package com.muyu.marketing.team.service;
|
package com.muyu.system.team.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.domain.model.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团规格信息表
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 20:50
|
||||||
|
**/
|
||||||
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
||||||
|
|
||||||
public default List<ActivityTeamProductSkuInfo> getActivityTeamProductSkuInfoByTeamId(Long teamId){
|
public default List<ActivityTeamProductSkuInfo> getActivityTeamProductSkuInfoByTeamId(Long teamId){
|
||||||
|
@ -17,21 +22,19 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过团购活动ID获取团购中最优惠的价格
|
* 通过活动ID获取商品最优惠的价格
|
||||||
* @param teamId 团购ID
|
* @param teamId 活动Id
|
||||||
* @return 优惠价格
|
* @return 优惠价格
|
||||||
*/
|
*/
|
||||||
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId);
|
public TeamDiscountPriceModel getDiscountPrice(Long teamId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过活动ID获取 剩余库存
|
* 通过活动ID 获取剩余库存
|
||||||
* @param teamId 活动ID
|
* @param teamId 活动Id
|
||||||
* @return 库存
|
* @return 剩余库存
|
||||||
*/
|
*/
|
||||||
public TeamProductStockModel getStock(Long teamId);
|
public TeamProductStockModel getStock(Long teamId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加团购商品SKU
|
* 添加团购商品SKU
|
||||||
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
||||||
|
@ -71,3 +74,6 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
this.removeByIds(activityTeamProductSkuSettingModel.getRemoveIds());
|
this.removeByIds(activityTeamProductSkuSettingModel.getRemoveIds());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.muyu.system.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.domain.TeamStrategyExemption;
|
||||||
|
import com.muyu.system.team.strategy.ActivityTeamStrategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团免单策略
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 21:38
|
||||||
|
**/
|
||||||
|
public interface TeamStrategyExemptionService extends ActivityTeamStrategy, IService<TeamStrategyExemption> {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.muyu.system.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.system.team.strategy.ActivityTeamStrategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百人策略
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 21:38
|
||||||
|
**/
|
||||||
|
public interface TeamStrategyHundredService extends ActivityTeamStrategy, IService<TeamStrategyExemptionHundred> {
|
||||||
|
/**
|
||||||
|
* 开团
|
||||||
|
*/
|
||||||
|
public void openTeam(Long activityTeamId,String orderNumber);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参团
|
||||||
|
*/
|
||||||
|
public void addTeam(Long teamId,String orderNumber);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.muyu.system.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
import com.muyu.system.team.strategy.ActivityTeamStrategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普通策略
|
||||||
|
* @author: CuiFu Bo
|
||||||
|
* @create: 2024-11-20 21:39
|
||||||
|
**/
|
||||||
|
public interface TeamStrategyOrdinaryService extends ActivityTeamStrategy, IService<TeamStrategyExemptionOrdinary> {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue