Compare commits
5 Commits
master
...
1125/AoCi_
Author | SHA1 | Date |
---|---|---|
|
7b02cd2513 | |
|
168e7c9974 | |
|
2569d39767 | |
|
1d2da89b42 | |
|
5b5fb58ea1 |
|
@ -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,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,24 @@
|
||||||
|
{
|
||||||
|
"活动ID": "Long",
|
||||||
|
"活动名称": "String",
|
||||||
|
"商品名称": "String",
|
||||||
|
"商品图片": "String",
|
||||||
|
"活动简介": "String",
|
||||||
|
"商品单位": "String",
|
||||||
|
"商品的轮播图": [
|
||||||
|
"String", "String"
|
||||||
|
],
|
||||||
|
"活动时间": "date",
|
||||||
|
"策略类型": "String",
|
||||||
|
"商品规格List": [
|
||||||
|
{
|
||||||
|
"规格ID": "Long",
|
||||||
|
"规格SKU": "String",
|
||||||
|
"商品价格": "BigDecimal",
|
||||||
|
"商品库存": "Long",
|
||||||
|
"拼团价格": "BigDecimal",
|
||||||
|
"拼团库存": "Long"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"详情": "String"
|
||||||
|
}
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -33,7 +33,7 @@ spring:
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
dataId: sentinel-muyu-gateway
|
dataId: sentinel-muyu-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -4,9 +4,8 @@ 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.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdReqModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@ -56,7 +55,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private long sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 活动详情
|
* 活动详情
|
||||||
*/
|
*/
|
||||||
|
@ -73,30 +72,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
* 策略ID
|
* 策略ID
|
||||||
*/
|
*/
|
||||||
private long strategyId;
|
private long strategyId;
|
||||||
|
public static ActivityTeamInfo TeamSaveBuild (ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
||||||
/**
|
|
||||||
* 公共添加模型,转换成添加对象
|
|
||||||
* @param activityTeamInfoAddModel 添加模型
|
|
||||||
* @return 添加对象
|
|
||||||
*/
|
|
||||||
public static ActivityTeamInfo addModelBuild(ActivityTeamInfoAddModel activityTeamInfoAddModel){
|
|
||||||
return ActivityTeamInfo.builder()
|
|
||||||
.name(activityTeamInfoAddModel.getName())
|
|
||||||
.productId(activityTeamInfoAddModel.getProductId())
|
|
||||||
.productImage(activityTeamInfoAddModel.getProductImage())
|
|
||||||
.introduction(activityTeamInfoAddModel.getIntroduction())
|
|
||||||
.unit(activityTeamInfoAddModel.getUnit())
|
|
||||||
.imageList(activityTeamInfoAddModel.getImageList())
|
|
||||||
.endTime(activityTeamInfoAddModel.getEndTime())
|
|
||||||
.sort(activityTeamInfoAddModel.getSort())
|
|
||||||
.content(activityTeamInfoAddModel.getContent())
|
|
||||||
.status(activityTeamInfoAddModel.getStatus())
|
|
||||||
.strategyType(activityTeamInfoAddModel.getStrategyType())
|
|
||||||
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ActivityTeamInfo teamSaveBuild(ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
|
||||||
return ActivityTeamInfo.builder()
|
return ActivityTeamInfo.builder()
|
||||||
.name(activityTeamInfoSaveModel.getName())
|
.name(activityTeamInfoSaveModel.getName())
|
||||||
.productId(activityTeamInfoSaveModel.getProductId())
|
.productId(activityTeamInfoSaveModel.getProductId())
|
||||||
|
@ -112,21 +88,21 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
.strategyId(activityTeamInfoSaveModel.getStrategyId())
|
.strategyId(activityTeamInfoSaveModel.getStrategyId())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
public static ActivityTeamInfo TeamUpdateBuild (ActivityTeamInfoUpdModel activityTeamInfoUpdModel){
|
public static ActivityTeamInfo TeamUpdateBuild (ActivityTeamInfoUpdReqModel activityTeamInfoUpdReqModel){
|
||||||
return ActivityTeamInfo.builder()
|
return ActivityTeamInfo.builder()
|
||||||
.id(activityTeamInfoUpdModel.getId())
|
.id(activityTeamInfoUpdReqModel.getId())
|
||||||
.name(activityTeamInfoUpdModel.getName())
|
.name(activityTeamInfoUpdReqModel.getName())
|
||||||
.productId(activityTeamInfoUpdModel.getProductId())
|
.productId(activityTeamInfoUpdReqModel.getProductId())
|
||||||
.productImage(activityTeamInfoUpdModel.getProductImage())
|
.productImage(activityTeamInfoUpdReqModel.getProductImage())
|
||||||
.introduction(activityTeamInfoUpdModel.getIntroduction())
|
.introduction(activityTeamInfoUpdReqModel.getIntroduction())
|
||||||
.unit(activityTeamInfoUpdModel.getUnit())
|
.unit(activityTeamInfoUpdReqModel.getUnit())
|
||||||
.imageList(activityTeamInfoUpdModel.getImageList())
|
.imageList(activityTeamInfoUpdReqModel.getImageList())
|
||||||
.endTime(activityTeamInfoUpdModel.getEndTime())
|
.endTime(activityTeamInfoUpdReqModel.getEndTime())
|
||||||
.sort(activityTeamInfoUpdModel.getSort())
|
.sort(activityTeamInfoUpdReqModel.getSort())
|
||||||
.content(activityTeamInfoUpdModel.getContent())
|
.content(activityTeamInfoUpdReqModel.getContent())
|
||||||
.status(activityTeamInfoUpdModel.getStatus())
|
.status(activityTeamInfoUpdReqModel.getStatus())
|
||||||
.strategyType(activityTeamInfoUpdModel.getStrategyType())
|
.strategyType(activityTeamInfoUpdReqModel.getStrategyType())
|
||||||
.strategyId(activityTeamInfoUpdModel.getStrategyId())
|
.strategyId(activityTeamInfoUpdReqModel.getStrategyId())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@ -76,13 +74,4 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ActivityTeamProductSkuInfo updModelBuild(ActivityTeamProductSkuUpdModel teamProductSkuUpdModel){
|
|
||||||
return ActivityTeamProductSkuInfo.builder()
|
|
||||||
.id(teamProductSkuUpdModel.getId())
|
|
||||||
.teamPrice(teamProductSkuUpdModel.getTeamPrice())
|
|
||||||
.teamStock(teamProductSkuUpdModel.getTeamStock())
|
|
||||||
.remainStock(teamProductSkuUpdModel.getTeamStock())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "team_strategy_exemption_hundred", autoResultMap = true)
|
@TableName(value = "team_strategy_exemption_hundred", autoResultMap = true)
|
||||||
public class TeamStrategyHundred extends BaseEntity {
|
public class TeamStrategyExemptionHundred extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
|
@ -13,7 +13,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "team_strategy_exemption_ordinary", autoResultMap = true)
|
@TableName(value = "team_strategy_exemption_ordinary", autoResultMap = true)
|
||||||
public class TeamStrategyOrdinary extends BaseEntity {
|
public class TeamStrategyExemptionOrdinary extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
|
@ -3,6 +3,7 @@ package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -10,7 +11,7 @@ import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购活动添加模型
|
* 团购活动添加模型
|
||||||
|
@ -80,8 +81,9 @@ public class ActivityTeamInfoAddModel {
|
||||||
*/
|
*/
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
|
|
||||||
public static ActivityTeamInfoAddModel addReqBuild (ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
public static ActivityTeamInfoAddModel activityTeamInfoAddModelBuild (ActivityTeamInfoSaveReq activityTeamInfoSaveReq,
|
||||||
return ActivityTeamInfoAddModel.builder()
|
Function<ActivityTeamInfoAddModel.ActivityTeamInfoAddModelBuilder,ActivityTeamInfoAddModel> function){
|
||||||
|
return function.apply(ActivityTeamInfoAddModel.builder()
|
||||||
.name(activityTeamInfoSaveReq.getName())
|
.name(activityTeamInfoSaveReq.getName())
|
||||||
.productId(activityTeamInfoSaveReq.getProductId())
|
.productId(activityTeamInfoSaveReq.getProductId())
|
||||||
.productImage(activityTeamInfoSaveReq.getProductImage())
|
.productImage(activityTeamInfoSaveReq.getProductImage())
|
||||||
|
@ -93,12 +95,6 @@ public class ActivityTeamInfoAddModel {
|
||||||
.content(activityTeamInfoSaveReq.getContent())
|
.content(activityTeamInfoSaveReq.getContent())
|
||||||
.status(activityTeamInfoSaveReq.getStatus())
|
.status(activityTeamInfoSaveReq.getStatus())
|
||||||
.strategyType(activityTeamInfoSaveReq.getStrategyType())
|
.strategyType(activityTeamInfoSaveReq.getStrategyType())
|
||||||
.strategyId(activityTeamInfoSaveReq.getStrategyId())
|
.strategyId(activityTeamInfoSaveReq.getStrategyId()));
|
||||||
.activityTeamProductSkuAddModelList(
|
|
||||||
activityTeamInfoSaveReq.getTeamProjectSkuInfoAddReqList()
|
|
||||||
.stream()
|
|
||||||
.map(addReq -> ActivityTeamProductSkuAddModel.addReqBuild(addReq, activityTeamInfoSaveReq::getProductId))
|
|
||||||
.toList()
|
|
||||||
).build();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuReq;
|
||||||
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;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -23,7 +20,7 @@ import java.util.List;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
public class ActivityTeamInfoUpdModel {
|
public class ActivityTeamInfoUpdReqModel {
|
||||||
private Long id;
|
private Long id;
|
||||||
private String name;
|
private String name;
|
||||||
private Long productId;
|
private Long productId;
|
||||||
|
@ -37,10 +34,10 @@ public class ActivityTeamInfoUpdModel {
|
||||||
private String status;
|
private String status;
|
||||||
private String strategyType;
|
private String strategyType;
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
private ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel;
|
private List<ActivityTeamProductSkuReqModel> activityTeamProductSkuModelList;
|
||||||
|
|
||||||
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
public static ActivityTeamInfoUpdReqModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
return ActivityTeamInfoUpdModel.builder()
|
return ActivityTeamInfoUpdReqModel.builder()
|
||||||
.id(activityTeamInfoUpdReq.getId())
|
.id(activityTeamInfoUpdReq.getId())
|
||||||
.name(activityTeamInfoUpdReq.getName())
|
.name(activityTeamInfoUpdReq.getName())
|
||||||
.productId(activityTeamInfoUpdReq.getProductId())
|
.productId(activityTeamInfoUpdReq.getProductId())
|
||||||
|
@ -54,12 +51,7 @@ public class ActivityTeamInfoUpdModel {
|
||||||
.status(activityTeamInfoUpdReq.getStatus())
|
.status(activityTeamInfoUpdReq.getStatus())
|
||||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||||
.activityTeamProductSkuSettingModel(
|
.activityTeamProductSkuModelList(activityTeamInfoUpdReq.getActivityTeamProductSkuList().stream().map(ActivityTeamProductSkuReqModel::activityTeamProductSkuReqModelBuild).toList())
|
||||||
ActivityTeamProductSkuSettingModel.settingReqModel(
|
|
||||||
activityTeamInfoUpdReq.getActivityTeamProductSkuSettingReq(),
|
|
||||||
activityTeamInfoUpdReq::getProductId
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,15 +1,12 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
|
||||||
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.math.BigDecimal;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购spu库存添加模型
|
* 团购spu库存添加模型
|
||||||
|
@ -47,13 +44,4 @@ public class ActivityTeamProductSkuAddModel {
|
||||||
* 拼团库存
|
* 拼团库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
|
|
||||||
public static ActivityTeamProductSkuAddModel addReqBuild(TeamProjectSkuInfoAddReq teamProjectSkuInfoAddReq, Supplier<Long> productId){
|
|
||||||
return ActivityTeamProductSkuAddModel.builder()
|
|
||||||
.productId(productId.get())
|
|
||||||
.sku(teamProjectSkuInfoAddReq.getSku())
|
|
||||||
.teamStock(teamProjectSkuInfoAddReq.getTeamStock())
|
|
||||||
.teamPrice(teamProjectSkuInfoAddReq.getTeamPrice())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品活动SKU信息模型
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-26 15:35
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ActivityTeamProductSkuInfoModel {
|
|
||||||
/**
|
|
||||||
* 团购商品SKU的ID
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团ID
|
|
||||||
*/
|
|
||||||
private Long teamId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品ID
|
|
||||||
*/
|
|
||||||
private Long productId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 规格SKU
|
|
||||||
*/
|
|
||||||
private String sku;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团价格
|
|
||||||
*/
|
|
||||||
private BigDecimal teamPrice;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团库存
|
|
||||||
*/
|
|
||||||
private Long teamStock;
|
|
||||||
}
|
|
|
@ -1,59 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购商品规格一键设置
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-28 11:15
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ActivityTeamProductSkuSettingModel {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动ID
|
|
||||||
*/
|
|
||||||
private Long teamId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除的ID集合
|
|
||||||
*/
|
|
||||||
private List<Long> removeIds;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的规格集合
|
|
||||||
*/
|
|
||||||
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改的规格集合
|
|
||||||
*/
|
|
||||||
private List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList;
|
|
||||||
|
|
||||||
public static ActivityTeamProductSkuSettingModel settingReqModel(ActivityTeamProductSkuSettingReq activityTeamProductSkuSettingReq, Supplier<Long> productId) {
|
|
||||||
return ActivityTeamProductSkuSettingModel.builder()
|
|
||||||
.removeIds(activityTeamProductSkuSettingReq.getRemoveIds())
|
|
||||||
.activityTeamProductSkuAddModelList(
|
|
||||||
activityTeamProductSkuSettingReq.getTeamProjectSkuInfoAddReqList().stream()
|
|
||||||
.map(teamProjectSkuInfoAddReq -> ActivityTeamProductSkuAddModel.addReqBuild(teamProjectSkuInfoAddReq, productId))
|
|
||||||
.toList()
|
|
||||||
)
|
|
||||||
.activityTeamProductSkuUpdModelList(
|
|
||||||
activityTeamProductSkuSettingReq.getTeamProjectSkuInfoUpdReqList().stream()
|
|
||||||
.map(ActivityTeamProductSkuUpdModel::updReqBuild)
|
|
||||||
.toList()
|
|
||||||
).build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,46 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoUpdReq;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团活动商品SKU
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-27 14:18
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ActivityTeamProductSkuUpdModel {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品规格ID
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购价格
|
|
||||||
*/
|
|
||||||
private BigDecimal teamPrice;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购库存
|
|
||||||
*/
|
|
||||||
private Long teamStock;
|
|
||||||
|
|
||||||
public static ActivityTeamProductSkuUpdModel updReqBuild(TeamProjectSkuInfoUpdReq teamProjectSkuInfoUpdReq){
|
|
||||||
return ActivityTeamProductSkuUpdModel.builder()
|
|
||||||
.id(teamProjectSkuInfoUpdReq.getId())
|
|
||||||
.teamStock(teamProjectSkuInfoUpdReq.getTeamStock())
|
|
||||||
.teamPrice(teamProjectSkuInfoUpdReq.getTeamPrice())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,6 +2,7 @@ package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -21,7 +22,7 @@ import java.util.function.Function;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
public class ActivityTeamDetailModel {
|
public class TeamInfoFindByIdRespModel {
|
||||||
/**
|
/**
|
||||||
* 拼团id
|
* 拼团id
|
||||||
*/
|
*/
|
||||||
|
@ -81,9 +82,9 @@ public class ActivityTeamDetailModel {
|
||||||
* 策略ID
|
* 策略ID
|
||||||
*/
|
*/
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
public static ActivityTeamDetailModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
public static TeamInfoFindByIdRespModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
||||||
Function<ActivityTeamDetailModel.ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
Function<TeamInfoFindByIdRespModel.TeamInfoFindByIdRespModelBuilder,TeamInfoFindByIdRespModel> function){
|
||||||
return function.apply(ActivityTeamDetailModel.builder()
|
return function.apply(TeamInfoFindByIdRespModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
.id(activityTeamInfo.getId())
|
||||||
.name(activityTeamInfo.getName())
|
.name(activityTeamInfo.getName())
|
||||||
.productId(activityTeamInfo.getProductId())
|
.productId(activityTeamInfo.getProductId())
|
|
@ -3,6 +3,7 @@ package com.muyu.marketing.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 com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
@ -55,7 +56,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
private List<ProjectSkuInfoAddReq> projectSkuInfoAddReqList;
|
||||||
/**
|
/**
|
||||||
* 活动详情
|
* 活动详情
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,5 +32,5 @@ public class ActivityTeamInfoUpdReq {
|
||||||
private String status;
|
private String status;
|
||||||
private String strategyType;
|
private String strategyType;
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
private ActivityTeamProductSkuSettingReq activityTeamProductSkuSettingReq;
|
private List<ActivityTeamProductSkuReq> activityTeamProductSkuList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
package com.muyu.marketing.domain.req;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购商品规格设置
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-28 11:27
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ActivityTeamProductSkuSettingReq {
|
|
||||||
/**
|
|
||||||
* 删除的ID集合
|
|
||||||
*/
|
|
||||||
private List<Long> removeIds;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的规格集合
|
|
||||||
*/
|
|
||||||
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的规格集合
|
|
||||||
*/
|
|
||||||
private List<TeamProjectSkuInfoUpdReq> teamProjectSkuInfoUpdReqList;
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.muyu.marketing.domain.req;
|
package com.muyu.marketing.domain.req;
|
||||||
|
|
||||||
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 lombok.experimental.SuperBuilder;
|
||||||
|
@ -14,8 +15,7 @@ import java.math.BigDecimal;
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class TeamProjectSkuInfoAddReq {
|
public class ProjectSkuInfoAddReq {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格SKU
|
* 规格SKU
|
||||||
*/
|
*/
|
|
@ -1,33 +0,0 @@
|
||||||
package com.muyu.marketing.domain.req;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class TeamProjectSkuInfoUpdReq {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 规格SKU
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团价格
|
|
||||||
*/
|
|
||||||
private BigDecimal teamPrice;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团库存
|
|
||||||
*/
|
|
||||||
private Long teamStock;
|
|
||||||
}
|
|
|
@ -1,81 +0,0 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ActivityTeamDetailResp extends BaseEntity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购ID
|
|
||||||
*/
|
|
||||||
private Long teamId;
|
|
||||||
/**
|
|
||||||
* 拼团名称
|
|
||||||
*/
|
|
||||||
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 Integer sort;
|
|
||||||
/**
|
|
||||||
* 商品SkU集合
|
|
||||||
*/
|
|
||||||
private List<ActivityTeamProjectSkuResp> activityTeamProjectSkuList;
|
|
||||||
/**
|
|
||||||
* 活动详情
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
/**
|
|
||||||
* 活动状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
/**
|
|
||||||
* 策略类型
|
|
||||||
*/
|
|
||||||
private String strategyType;
|
|
||||||
/**
|
|
||||||
* 策略ID
|
|
||||||
*/
|
|
||||||
private Long strategyId;
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class ActivityTeamProjectSkuResp {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购商品SKU的ID
|
|
||||||
*/
|
|
||||||
private Long productSkuId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 规格SKU
|
|
||||||
*/
|
|
||||||
private String sku;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团价格
|
|
||||||
*/
|
|
||||||
private BigDecimal teamPrice;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团库存
|
|
||||||
*/
|
|
||||||
private Long teamStock;
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
import com.muyu.marketing.domain.model.TeamInfoFindByIdRespModel;
|
||||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
@ -82,26 +82,26 @@ public class TeamInfoFindByIdResp {
|
||||||
*/
|
*/
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
|
|
||||||
public static TeamInfoFindByIdResp teamInfoFindByIdBuild (ActivityTeamDetailModel activityTeamDetailModel){
|
public static TeamInfoFindByIdResp teamInfoFindByIdBuild (TeamInfoFindByIdRespModel teamInfoFindByIdRespModel){
|
||||||
return TeamInfoFindByIdResp.builder()
|
return TeamInfoFindByIdResp.builder()
|
||||||
.id(activityTeamDetailModel.getId())
|
.id(teamInfoFindByIdRespModel.getId())
|
||||||
.name(activityTeamDetailModel.getName())
|
.name(teamInfoFindByIdRespModel.getName())
|
||||||
.productId(activityTeamDetailModel.getProductId())
|
.productId(teamInfoFindByIdRespModel.getProductId())
|
||||||
.productImage(activityTeamDetailModel.getProductImage())
|
.productImage(teamInfoFindByIdRespModel.getProductImage())
|
||||||
.introduction(activityTeamDetailModel.getIntroduction())
|
.introduction(teamInfoFindByIdRespModel.getIntroduction())
|
||||||
.unit(activityTeamDetailModel.getUnit())
|
.unit(teamInfoFindByIdRespModel.getUnit())
|
||||||
.imageList(activityTeamDetailModel.getImageList())
|
.imageList(teamInfoFindByIdRespModel.getImageList())
|
||||||
.endTime(activityTeamDetailModel.getEndTime())
|
.endTime(teamInfoFindByIdRespModel.getEndTime())
|
||||||
.sort(activityTeamDetailModel.getSort())
|
.sort(teamInfoFindByIdRespModel.getSort())
|
||||||
.projectSkuInfoAddList(activityTeamDetailModel.getProjectSkuInfoAddReqList().stream().map(ProjectFindSkuInfoResp::projectFindSkuInfoBuild).toList())
|
.projectSkuInfoAddList(teamInfoFindByIdRespModel.getProjectSkuInfoAddReqList().stream().map(ProjectFindSkuInfoResp::projectFindSkuInfoBuild).toList())
|
||||||
// .projectSkuInfoAddList(
|
// .projectSkuInfoAddList(
|
||||||
// teamInfoFindByIdRespModel.getProjectSkuInfoAddReqList().stream().map(activityTeamProductSkuModel ->
|
// teamInfoFindByIdRespModel.getProjectSkuInfoAddReqList().stream().map(activityTeamProductSkuModel ->
|
||||||
// ProjectFindSkuInfoResp.projectFindSkuInfoBuild(activityTeamProductSkuModel)).toList()
|
// ProjectFindSkuInfoResp.projectFindSkuInfoBuild(activityTeamProductSkuModel)).toList()
|
||||||
// )
|
// )
|
||||||
.content(activityTeamDetailModel.getContent())
|
.content(teamInfoFindByIdRespModel.getContent())
|
||||||
.status(activityTeamDetailModel.getStatus())
|
.status(teamInfoFindByIdRespModel.getStatus())
|
||||||
.strategyType(activityTeamDetailModel.getStrategyType())
|
.strategyType(teamInfoFindByIdRespModel.getStrategyType())
|
||||||
.strategyId(activityTeamDetailModel.getStrategyId())
|
.strategyId(teamInfoFindByIdRespModel.getStrategyId())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,25 @@
|
||||||
package com.muyu.marketing.team.controller;
|
package com.muyu.marketing.team.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.dtflys.forest.annotation.Put;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
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.ActivityTeamInfoSaveReq;
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||||
|
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||||
|
import com.muyu.marketing.domain.resp.ProjectFindSkuInfoResp;
|
||||||
import com.muyu.marketing.domain.resp.TeamInfoFindByIdResp;
|
import com.muyu.marketing.domain.resp.TeamInfoFindByIdResp;
|
||||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 营销团购活动控制层
|
* 营销团购活动控制层
|
||||||
|
@ -46,26 +50,33 @@ public class ActivityTeamController {
|
||||||
}}
|
}}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/saveTeam")
|
||||||
|
public boolean saveTeam (@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
||||||
|
List<ProjectSkuInfoAddReq> projectSkuInfoAddReqList = activityTeamInfoSaveReq.getProjectSkuInfoAddReqList();
|
||||||
|
|
||||||
|
return activityTeamInfoService.saveActivityTeamInfo(
|
||||||
/**
|
ActivityTeamInfoAddModel.activityTeamInfoAddModelBuild(activityTeamInfoSaveReq, (activityTeamInfoAddModelBuilder) -> {
|
||||||
* 添加团购活动
|
List<ActivityTeamProductSkuAddModel> collect = projectSkuInfoAddReqList.stream().map(projectSkuInfoAddReq -> {
|
||||||
* @param activityTeamInfoSaveReq 添加请求对象
|
return ActivityTeamProductSkuAddModel.builder()
|
||||||
* @return 结果集
|
.teamStock(projectSkuInfoAddReq.getTeamStock())
|
||||||
*/
|
.teamPrice(projectSkuInfoAddReq.getTeamPrice())
|
||||||
@PostMapping
|
.sku(projectSkuInfoAddReq.getSku())
|
||||||
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
.productId(activityTeamInfoSaveReq.getProductId())
|
||||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
.build();
|
||||||
return Result.success();
|
}).collect(Collectors.toList());
|
||||||
|
return activityTeamInfoAddModelBuilder
|
||||||
|
.activityTeamProductSkuAddModelList(collect)
|
||||||
|
.build();
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/findById/{id}")
|
@PostMapping("/findById/{id}")
|
||||||
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
||||||
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findTeamById(id)));
|
||||||
}
|
}
|
||||||
@PutMapping("/updateByTeamId")
|
@PutMapping("/updateByTeamId")
|
||||||
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
activityTeamInfoService.updateByTeamId(ActivityTeamInfoUpdReqModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyExemptionHundred> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TeamStrategyExemptionOrdinaryMapper extends BaseMapper<TeamStrategyExemptionOrdinary> {
|
||||||
|
|
||||||
|
}
|
|
@ -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> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -15,25 +15,9 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
*/
|
*/
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
||||||
|
|
||||||
/**
|
public boolean saveActivityTeamInfo(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||||
* 通过添加模型,去进行商品拼团活动的操作
|
|
||||||
* @param activityTeamInfoAddModel 团购添加模型
|
|
||||||
*/
|
|
||||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ID查询商品的详情
|
|
||||||
* @param id 团购活动ID
|
|
||||||
* @return 团购详情
|
|
||||||
*/
|
|
||||||
ActivityTeamDetailModel findDetailById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改团购活动信息
|
|
||||||
* @param activityTeamInfoUpdModel 团购活动信息
|
|
||||||
* @return 是否成功
|
|
||||||
*/
|
|
||||||
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
|
||||||
|
|
||||||
|
TeamInfoFindByIdRespModel findTeamById(Long id);
|
||||||
|
|
||||||
|
boolean updateByTeamId(ActivityTeamInfoUpdReqModel activityTeamInfoUpdReqModel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,9 @@ package com.muyu.marketing.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.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
|
import com.muyu.marketing.domain.resp.ProjectFindSkuInfoResp;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -37,37 +39,8 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
||||||
*/
|
*/
|
||||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||||
|
public List<ActivityTeamProductSkuModel> findSkuByTeamId(Long teamId);
|
||||||
/**
|
|
||||||
* 通过拼团活动ID获取拼团下商品SKU集合
|
|
||||||
* @param teamId 活动ID
|
|
||||||
* @return 拼团商品SKU集合
|
|
||||||
*/
|
|
||||||
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
|
||||||
|
|
||||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据 业务模型 进行 团购商品修改
|
|
||||||
* @param activityTeamProductSkuUpdModel 修改业务模型
|
|
||||||
* @return 修改结果
|
|
||||||
*/
|
|
||||||
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据 业务模型 进行 团购商品批量修改
|
|
||||||
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
|
||||||
* @return 修改结果
|
|
||||||
*/
|
|
||||||
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 一键设置
|
|
||||||
* @param activityTeamProductSkuSettingModel 整体修改模型
|
|
||||||
*/
|
|
||||||
public default void setting(ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel){
|
|
||||||
this.batchSave(activityTeamProductSkuSettingModel.getActivityTeamProductSkuAddModelList());
|
|
||||||
this.batchUpdate(activityTeamProductSkuSettingModel.getActivityTeamProductSkuUpdModelList());
|
|
||||||
this.removeByIds(activityTeamProductSkuSettingModel.getRemoveIds());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
|
||||||
|
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred> {
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
|
||||||
|
public interface TeamStrategyExemptionOrdinaryService extends IService<TeamStrategyExemptionOrdinary> {
|
||||||
|
}
|
|
@ -2,10 +2,7 @@ package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
|
||||||
/**
|
public interface TeamStrategyExemptionService extends IService<TeamStrategyExemption> {
|
||||||
* 免单
|
|
||||||
*/
|
|
||||||
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> {
|
|
||||||
}
|
|
|
@ -11,16 +11,15 @@ import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||||
|
import io.jsonwebtoken.lang.Assert;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.Assert;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo> implements ActivityTeamInfoService {
|
||||||
implements ActivityTeamInfoService {
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||||
|
@ -65,44 +64,31 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
return tableDataInfo;
|
return tableDataInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过添加模型,去进行商品拼团活动的操作
|
|
||||||
*
|
|
||||||
* @param activityTeamInfoAddModel 团购添加模型
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel) {
|
public boolean saveActivityTeamInfo(ActivityTeamInfoAddModel activityTeamInfoAddModel) {
|
||||||
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.addModelBuild(activityTeamInfoAddModel);
|
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.TeamSaveBuild(ActivityTeamInfoSaveModel.activityTeamInfoSaveModelBuild(activityTeamInfoAddModel));
|
||||||
Assert.isTrue(this.save(activityTeamInfo), StringUtils.format("团购活动添加失败:[{}]", activityTeamInfoAddModel));
|
boolean save = this.save(activityTeamInfo);
|
||||||
List<ActivityTeamProductSkuAddModel> teamProductSkuAddModelList = activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList();
|
Assert.isTrue(save,"添加失败");
|
||||||
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList().forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
||||||
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
activityTeamProductSkuInfoService.batchSave(activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList());
|
||||||
|
return save;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ID查询商品的详情
|
|
||||||
* @param id 团购活动ID
|
|
||||||
* @return 团购详情
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public ActivityTeamDetailModel findDetailById(Long id) {
|
public TeamInfoFindByIdRespModel findTeamById(Long id) {
|
||||||
ActivityTeamInfo activityTeamInfo = this.getById(id);
|
ActivityTeamInfo byId = this.getById(id);
|
||||||
List<ActivityTeamProductSkuModel> activityTeamProductSkuModelList = activityTeamProductSkuInfoService.findListByTeamId(id);
|
List<ActivityTeamProductSkuModel> skuByTeamId = activityTeamProductSkuInfoService.findSkuByTeamId(id);
|
||||||
return ActivityTeamDetailModel.findSkuSumList(activityTeamInfo,
|
return TeamInfoFindByIdRespModel.findSkuSumList(byId, (teamInfoFindByIdRespModelBuilder) -> {
|
||||||
(teamInfoFindByIdRespModelBuilder) -> teamInfoFindByIdRespModelBuilder.projectSkuInfoAddReqList(activityTeamProductSkuModelList).build()
|
return teamInfoFindByIdRespModelBuilder.projectSkuInfoAddReqList(skuByTeamId)
|
||||||
);
|
.build();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改团购活动信息
|
|
||||||
* @param activityTeamInfoUpdModel 团购活动信息
|
|
||||||
* @return 是否成功
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
public boolean updateByTeamId(ActivityTeamInfoUpdReqModel activityTeamInfoUpdReqModel) {
|
||||||
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdReqModel));
|
||||||
Assert.isTrue(update,"修改失败");
|
Assert.isTrue(update,"修改失败");
|
||||||
activityTeamProductSkuInfoService.setting(activityTeamInfoUpdModel.getActivityTeamProductSkuSettingModel());
|
activityTeamProductSkuInfoService.updateBath(activityTeamInfoUpdReqModel.getActivityTeamProductSkuModelList());
|
||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,4 @@ public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpe
|
||||||
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType, teamOpenType.code());
|
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType, teamOpenType.code());
|
||||||
return this.count(queryWrapper);
|
return this.count(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
|
import com.muyu.marketing.domain.resp.ProjectFindSkuInfoResp;
|
||||||
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||||
import com.muyu.product.cache.ProjectSkuCache;
|
import com.muyu.product.cache.ProjectSkuCache;
|
||||||
|
@ -81,58 +81,17 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过拼团活动ID获取拼团下商品SKU集合
|
|
||||||
*
|
|
||||||
* @param teamId 活动ID
|
|
||||||
* @return 拼团商品SKU集合
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId) {
|
public List<ActivityTeamProductSkuModel> findSkuByTeamId(Long teamId) {
|
||||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,teamId);
|
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,teamId);
|
||||||
List<ActivityTeamProductSkuInfo> list = this.list(queryWrapper);
|
List<ActivityTeamProductSkuInfo> list = this.list(queryWrapper);
|
||||||
return list.stream().map(ActivityTeamProductSkuModel::FindBuild).toList();
|
return list.stream().map(ActivityTeamProductSkuModel::FindBuild).toList();
|
||||||
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList) {
|
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList) {
|
||||||
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据 业务模型 进行 团购商品修改
|
|
||||||
*
|
|
||||||
* @param activityTeamProductSkuUpdModel 修改业务模型
|
|
||||||
* @return 修改结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
|
||||||
// update set where
|
|
||||||
LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
|
||||||
// 字段=值
|
|
||||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock,activityTeamProductSkuUpdModel.getTeamStock());
|
|
||||||
updateWrapper.set(ActivityTeamProductSkuInfo::getRemainStock,activityTeamProductSkuUpdModel.getTeamStock());
|
|
||||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice,activityTeamProductSkuUpdModel.getTeamPrice());
|
|
||||||
// id=?
|
|
||||||
updateWrapper.eq(ActivityTeamProductSkuInfo::getId,activityTeamProductSkuUpdModel.getId());
|
|
||||||
return this.update(updateWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据 业务模型 进行 团购商品批量修改
|
|
||||||
*
|
|
||||||
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
|
||||||
* @return 修改结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
|
||||||
return this.updateBatchById(
|
|
||||||
activityTeamProductSkuUpdModelList.stream()
|
|
||||||
.map(ActivityTeamProductSkuInfo::updModelBuild)
|
|
||||||
.toList()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
||||||
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||||
|
import com.muyu.marketing.team.service.TeamStrategyExemptionHundredService;
|
||||||
|
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred>
|
||||||
|
implements TeamStrategyExemptionHundredService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionOrdinaryMapper;
|
||||||
|
import com.muyu.marketing.team.service.TeamStrategyExemptionOrdinaryService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary>
|
||||||
|
implements TeamStrategyExemptionOrdinaryService {
|
||||||
|
|
||||||
|
}
|
|
@ -4,62 +4,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Log4j2
|
@Service
|
||||||
@Service("team-strategy-exemption")
|
|
||||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||||
implements TeamStrategyExemptionService {
|
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,66 +0,0 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyHundredMapper;
|
|
||||||
import com.muyu.marketing.team.service.TeamStrategyHundredService;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
@Service("team-strategy-hundred")
|
|
||||||
public class TeamStrategyHundredServiceImpl extends ServiceImpl<TeamStrategyHundredMapper, TeamStrategyHundred>
|
|
||||||
implements TeamStrategyHundredService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @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,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,44 +0,0 @@
|
||||||
package com.muyu.marketing.team.strategy;
|
|
||||||
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团活动策略
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-29 15:03
|
|
||||||
*/
|
|
||||||
public interface ActivityTeamStrategy {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
public void openTeam(Long activityTeamId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
public void applyTeam(Long teamId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
public void addTeam(Long teamId, String orderNumber);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
public void backTeam(Long teamId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
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) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -16,10 +16,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
Loading…
Reference in New Issue