Compare commits
4 Commits
6424c0ac8e
...
f6a56a9e6b
Author | SHA1 | Date |
---|---|---|
|
f6a56a9e6b | |
|
b6c4a790d7 | |
|
02f640092a | |
|
c6b7a3aa6a |
|
@ -0,0 +1,24 @@
|
||||||
|
$.{
|
||||||
|
"活动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"
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"活动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"
|
||||||
|
}
|
|
@ -5,6 +5,8 @@ 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.ActivityTeamInfoAddModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@ -94,5 +96,37 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ActivityTeamInfo teamSaveBuild(ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.name(activityTeamInfoSaveModel.getName())
|
||||||
|
.productId(activityTeamInfoSaveModel.getProductId())
|
||||||
|
.productImage(activityTeamInfoSaveModel.getProductImage())
|
||||||
|
.introduction(activityTeamInfoSaveModel.getIntroduction())
|
||||||
|
.unit(activityTeamInfoSaveModel.getUnit())
|
||||||
|
.imageList(activityTeamInfoSaveModel.getImageList())
|
||||||
|
.endTime(activityTeamInfoSaveModel.getEndTime())
|
||||||
|
.sort(activityTeamInfoSaveModel.getSort())
|
||||||
|
.content(activityTeamInfoSaveModel.getContent())
|
||||||
|
.status(activityTeamInfoSaveModel.getStatus())
|
||||||
|
.strategyType(activityTeamInfoSaveModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoSaveModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
public static ActivityTeamInfo TeamUpdateBuild (ActivityTeamInfoUpdModel activityTeamInfoUpdModel){
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.id(activityTeamInfoUpdModel.getId())
|
||||||
|
.name(activityTeamInfoUpdModel.getName())
|
||||||
|
.productId(activityTeamInfoUpdModel.getProductId())
|
||||||
|
.productImage(activityTeamInfoUpdModel.getProductImage())
|
||||||
|
.introduction(activityTeamInfoUpdModel.getIntroduction())
|
||||||
|
.unit(activityTeamInfoUpdModel.getUnit())
|
||||||
|
.imageList(activityTeamInfoUpdModel.getImageList())
|
||||||
|
.endTime(activityTeamInfoUpdModel.getEndTime())
|
||||||
|
.sort(activityTeamInfoUpdModel.getSort())
|
||||||
|
.content(activityTeamInfoUpdModel.getContent())
|
||||||
|
.status(activityTeamInfoUpdModel.getStatus())
|
||||||
|
.strategyType(activityTeamInfoUpdModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoUpdModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@ 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.ActivityTeamProductSkuUpdModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@ -58,8 +61,28 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
.productId(activityTeamProductSkuAddModel.getProductId())
|
.productId(activityTeamProductSkuAddModel.getProductId())
|
||||||
.teamId(activityTeamProductSkuAddModel.getTeamId())
|
.teamId(activityTeamProductSkuAddModel.getTeamId())
|
||||||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||||
|
.productSku(activityTeamProductSkuAddModel.getSku())
|
||||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
public static ActivityTeamProductSkuInfo updateModelBuild(ActivityTeamProductSkuReqModel activityTeamProductSkuReqModel) {
|
||||||
|
return ActivityTeamProductSkuInfo.builder()
|
||||||
|
.id(activityTeamProductSkuReqModel.getId())
|
||||||
|
.productId(activityTeamProductSkuReqModel.getProductId())
|
||||||
|
.teamStock(activityTeamProductSkuReqModel.getTeamStock())
|
||||||
|
.productSku(activityTeamProductSkuReqModel.getProductSku())
|
||||||
|
.teamPrice(activityTeamProductSkuReqModel.getTeamPrice())
|
||||||
|
.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 TeamStrategyExemptionHundred extends BaseEntity {
|
public class TeamStrategyHundred 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 TeamStrategyExemptionOrdinary extends BaseEntity {
|
public class TeamStrategyOrdinary extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
|
@ -0,0 +1,102 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 活动回显总模型
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 16:00
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamDetailModel {
|
||||||
|
/**
|
||||||
|
* 拼团id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
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<ActivityTeamProductSkuModel> projectSkuInfoAddReqList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
public static ActivityTeamDetailModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
||||||
|
Function<ActivityTeamDetailModel.ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
||||||
|
return function.apply(ActivityTeamDetailModel.builder()
|
||||||
|
.id(activityTeamInfo.getId())
|
||||||
|
.name(activityTeamInfo.getName())
|
||||||
|
.productId(activityTeamInfo.getProductId())
|
||||||
|
.productImage(activityTeamInfo.getProductImage())
|
||||||
|
.introduction(activityTeamInfo.getIntroduction())
|
||||||
|
.unit(activityTeamInfo.getUnit())
|
||||||
|
.imageList(activityTeamInfo.getImageList())
|
||||||
|
.endTime(activityTeamInfo.getEndTime())
|
||||||
|
.sort(activityTeamInfo.getSort())
|
||||||
|
.content(activityTeamInfo.getContent())
|
||||||
|
.status(activityTeamInfo.getStatus())
|
||||||
|
.strategyType(activityTeamInfo.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfo.getStrategyId())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -58,7 +58,7 @@ public class ActivityTeamInfoAddModel {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 添加活动模型
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 10:59
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamInfoSaveModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
public static ActivityTeamInfoSaveModel activityTeamInfoSaveModelBuild (ActivityTeamInfoAddModel activityTeamInfoAddModel){
|
||||||
|
return ActivityTeamInfoSaveModel.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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.marketing.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.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 活动商品规格修改模型
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 19:25
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamInfoUpdModel {
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private Long productId;
|
||||||
|
private String productImage;
|
||||||
|
private String introduction;
|
||||||
|
private String unit;
|
||||||
|
private String imageList;
|
||||||
|
private Date endTime;
|
||||||
|
private Long sort;
|
||||||
|
private String content;
|
||||||
|
private String status;
|
||||||
|
private String strategyType;
|
||||||
|
private Long strategyId;
|
||||||
|
private ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel;
|
||||||
|
|
||||||
|
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
|
return ActivityTeamInfoUpdModel.builder()
|
||||||
|
.id(activityTeamInfoUpdReq.getId())
|
||||||
|
.name(activityTeamInfoUpdReq.getName())
|
||||||
|
.productId(activityTeamInfoUpdReq.getProductId())
|
||||||
|
.productImage(activityTeamInfoUpdReq.getProductImage())
|
||||||
|
.introduction(activityTeamInfoUpdReq.getIntroduction())
|
||||||
|
.unit(activityTeamInfoUpdReq.getUnit())
|
||||||
|
.imageList(activityTeamInfoUpdReq.getImageList())
|
||||||
|
.endTime(activityTeamInfoUpdReq.getEndTime())
|
||||||
|
.sort(activityTeamInfoUpdReq.getSort())
|
||||||
|
.content(activityTeamInfoUpdReq.getContent())
|
||||||
|
.status(activityTeamInfoUpdReq.getStatus())
|
||||||
|
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||||
|
.activityTeamProductSkuSettingModel(
|
||||||
|
ActivityTeamProductSkuSettingModel.settingReqModel(
|
||||||
|
activityTeamInfoUpdReq.getActivityTeamProductSkuSettingReq(),
|
||||||
|
activityTeamInfoUpdReq::getProductId
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
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;
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.resp.ProjectFindSkuInfoResp;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 回显sku模型
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 16:03
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamProductSkuModel {
|
||||||
|
/**
|
||||||
|
* 规格id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuModel FindBuild(ActivityTeamProductSkuInfo activityTeamProductSkuInfo) {
|
||||||
|
return ActivityTeamProductSkuModel.builder()
|
||||||
|
.id(activityTeamProductSkuInfo.getId())
|
||||||
|
.sku(activityTeamProductSkuInfo.getProductSku())
|
||||||
|
.teamStock(activityTeamProductSkuInfo.getTeamStock())
|
||||||
|
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: sku修改模型
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 19:45
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamProductSkuReqModel {
|
||||||
|
private Long id;
|
||||||
|
private Long teamId;
|
||||||
|
private Long productId;
|
||||||
|
private String productSku;
|
||||||
|
private Long teamStock;
|
||||||
|
private Long remainStock;
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
public static ActivityTeamProductSkuReqModel activityTeamProductSkuReqModelBuild(ActivityTeamProductSkuReq activityTeamProductSkuReq){
|
||||||
|
return ActivityTeamProductSkuReqModel.builder()
|
||||||
|
.id(activityTeamProductSkuReq.getId())
|
||||||
|
.productId(activityTeamProductSkuReq.getProductId())
|
||||||
|
.teamId(activityTeamProductSkuReq.getTeamId())
|
||||||
|
.productSku(activityTeamProductSkuReq.getProductSku())
|
||||||
|
.remainStock(activityTeamProductSkuReq.getRemainStock())
|
||||||
|
.teamStock(activityTeamProductSkuReq.getTeamStock())
|
||||||
|
.teamPrice(activityTeamProductSkuReq.getTeamPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -51,7 +51,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.marketing.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 活动商品规格修改入参
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 19:25
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamInfoUpdReq {
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private Long productId;
|
||||||
|
private String productImage;
|
||||||
|
private String introduction;
|
||||||
|
private String unit;
|
||||||
|
private String imageList;
|
||||||
|
private Date endTime;
|
||||||
|
private Long sort;
|
||||||
|
private String content;
|
||||||
|
private String status;
|
||||||
|
private String strategyType;
|
||||||
|
private Long strategyId;
|
||||||
|
private ActivityTeamProductSkuSettingReq activityTeamProductSkuSettingReq;
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.muyu.marketing.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: sku修改入参
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 19:45
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamProductSkuReq {
|
||||||
|
private Long id;
|
||||||
|
private Long teamId;
|
||||||
|
private Long productId;
|
||||||
|
private String productSku;
|
||||||
|
private Long teamStock;
|
||||||
|
private Long remainStock;
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
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;
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
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;
|
||||||
|
}
|
|
@ -2,7 +2,7 @@ package com.muyu.marketing.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.model.ActivityTeamInfoDetailModel;
|
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;
|
||||||
|
@ -11,7 +11,6 @@ import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
|
@ -21,9 +20,9 @@ import java.util.function.Function;
|
||||||
public class ActivityTeamDetailResp extends BaseEntity {
|
public class ActivityTeamDetailResp extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 活动ID
|
* 团购ID
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long teamId;
|
||||||
/**
|
/**
|
||||||
* 拼团名称
|
* 拼团名称
|
||||||
*/
|
*/
|
||||||
|
@ -58,11 +57,11 @@ public class ActivityTeamDetailResp extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Long sort;
|
private Integer sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
private List<ActivityTeamProjectSkuInfoResp> skuInfoRespList;
|
private List<ActivityTeamProjectSkuResp> activityTeamProjectSkuList;
|
||||||
/**
|
/**
|
||||||
* 活动详情
|
* 活动详情
|
||||||
*/
|
*/
|
||||||
|
@ -79,26 +78,4 @@ public class ActivityTeamDetailResp extends BaseEntity {
|
||||||
* 策略ID
|
* 策略ID
|
||||||
*/
|
*/
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static ActivityTeamDetailResp findByid(ActivityTeamInfoDetailModel ActivityTeamDetailModel, Function<Long,List<ActivityTeamProjectSkuInfoResp>> skuInfoRespList) {
|
|
||||||
return ActivityTeamDetailResp.builder()
|
|
||||||
.id(ActivityTeamDetailModel.getId())
|
|
||||||
.name(ActivityTeamDetailModel.getName())
|
|
||||||
.productId(ActivityTeamDetailModel.getProductId())
|
|
||||||
.productImage(ActivityTeamDetailModel.getProductImage())
|
|
||||||
.introduction(ActivityTeamDetailModel.getIntroduction())
|
|
||||||
.unit(ActivityTeamDetailModel.getUnit())
|
|
||||||
.imageList(ActivityTeamDetailModel.getImageList())
|
|
||||||
.endTime(ActivityTeamDetailModel.getEndTime())
|
|
||||||
.sort(ActivityTeamDetailModel.getSort())
|
|
||||||
.content(ActivityTeamDetailModel.getContent())
|
|
||||||
.status(ActivityTeamDetailModel.getStatus())
|
|
||||||
.strategyType(ActivityTeamDetailModel.getStrategyType())
|
|
||||||
.strategyId(ActivityTeamDetailModel.getStrategyId())
|
|
||||||
.skuInfoRespList(skuInfoRespList.apply(ActivityTeamDetailModel.getId()))
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
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;
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回显resp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ProjectFindSkuInfoResp {
|
||||||
|
/**
|
||||||
|
* 规格id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
public static ProjectFindSkuInfoResp projectFindSkuInfoBuild (ActivityTeamProductSkuModel activityTeamProductSkuModel) {
|
||||||
|
return ProjectFindSkuInfoResp.builder()
|
||||||
|
.teamStock(activityTeamProductSkuModel.getTeamStock())
|
||||||
|
.teamPrice(activityTeamProductSkuModel.getTeamPrice())
|
||||||
|
.id(activityTeamProductSkuModel.getId())
|
||||||
|
.sku(activityTeamProductSkuModel.getSku())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,107 @@
|
||||||
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
||||||
|
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 团购活动回显响应
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 15:19
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class TeamInfoFindByIdResp {
|
||||||
|
/**
|
||||||
|
* 拼团id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
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<ProjectFindSkuInfoResp> projectSkuInfoAddList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
public static TeamInfoFindByIdResp teamInfoFindByIdBuild (ActivityTeamDetailModel activityTeamDetailModel){
|
||||||
|
return TeamInfoFindByIdResp.builder()
|
||||||
|
.id(activityTeamDetailModel.getId())
|
||||||
|
.name(activityTeamDetailModel.getName())
|
||||||
|
.productId(activityTeamDetailModel.getProductId())
|
||||||
|
.productImage(activityTeamDetailModel.getProductImage())
|
||||||
|
.introduction(activityTeamDetailModel.getIntroduction())
|
||||||
|
.unit(activityTeamDetailModel.getUnit())
|
||||||
|
.imageList(activityTeamDetailModel.getImageList())
|
||||||
|
.endTime(activityTeamDetailModel.getEndTime())
|
||||||
|
.sort(activityTeamDetailModel.getSort())
|
||||||
|
.projectSkuInfoAddList(activityTeamDetailModel.getProjectSkuInfoAddReqList().stream().map(ProjectFindSkuInfoResp::projectFindSkuInfoBuild).toList())
|
||||||
|
// .projectSkuInfoAddList(
|
||||||
|
// teamInfoFindByIdRespModel.getProjectSkuInfoAddReqList().stream().map(activityTeamProductSkuModel ->
|
||||||
|
// ProjectFindSkuInfoResp.projectFindSkuInfoBuild(activityTeamProductSkuModel)).toList()
|
||||||
|
// )
|
||||||
|
.content(activityTeamDetailModel.getContent())
|
||||||
|
.status(activityTeamDetailModel.getStatus())
|
||||||
|
.strategyType(activityTeamDetailModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamDetailModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,15 +4,14 @@ package com.muyu.marketing.team.controller;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoDetailModel;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
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.TeamInfoListReq;
|
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||||
import com.muyu.marketing.domain.resp.ActivityTeamDetailResp;
|
import com.muyu.marketing.domain.resp.TeamInfoFindByIdResp;
|
||||||
import com.muyu.marketing.domain.resp.ActivityTeamProjectSkuInfoResp;
|
|
||||||
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 com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
|
||||||
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.*;
|
||||||
|
|
||||||
|
@ -30,8 +29,6 @@ public class ActivityTeamController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamInfoService activityTeamInfoService;;
|
private ActivityTeamInfoService activityTeamInfoService;;
|
||||||
@Autowired
|
|
||||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询营销团购活动列表
|
* 查询营销团购活动列表
|
||||||
|
@ -62,18 +59,13 @@ public class ActivityTeamController {
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动回显
|
|
||||||
* @param id 活动id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/findById/{id}")
|
@PostMapping("/findById/{id}")
|
||||||
public Result<ActivityTeamDetailResp> findById(@PathVariable("id") Long id) {
|
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
||||||
ActivityTeamInfoDetailModel detailModel = activityTeamInfoService.getByIds(id);
|
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
||||||
ActivityTeamDetailResp detailResp = ActivityTeamDetailResp.findByid(detailModel,
|
}
|
||||||
teamId -> ActivityTeamProjectSkuInfoResp.findSkuId(activityTeamProductSkuInfoService.getDetailModel(teamId))
|
@PutMapping("/updateByTeamId")
|
||||||
);
|
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
return Result.success(detailResp);
|
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||||
|
return Result.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@ 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
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
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> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
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> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
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> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
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> {
|
||||||
|
|
||||||
|
}
|
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
|
|
||||||
|
@ -22,13 +21,19 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
*/
|
*/
|
||||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||||
|
|
||||||
public void saves(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
/**
|
||||||
|
* 根据ID查询商品的详情
|
||||||
|
* @param id 团购活动ID
|
||||||
|
* @return 团购详情
|
||||||
|
*/
|
||||||
|
ActivityTeamDetailModel findDetailById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id 查询活动列表
|
* 修改团购活动信息
|
||||||
* @param id
|
* @param activityTeamInfoUpdModel 团购活动信息
|
||||||
* @return
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
ActivityTeamInfoDetailModel getByIds(@Param("id") Long id);
|
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ 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 java.util.List;
|
import java.util.List;
|
||||||
|
@ -39,12 +38,36 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
*/
|
*/
|
||||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||||
|
|
||||||
// public void batchSaves(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
/**
|
||||||
|
* 通过拼团活动ID获取拼团下商品SKU集合
|
||||||
|
* @param teamId 活动ID
|
||||||
|
* @return 拼团商品SKU集合
|
||||||
|
*/
|
||||||
|
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
||||||
|
|
||||||
public void batchUpd(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList);
|
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回显团购商品SKU
|
* 根据 业务模型 进行 团购商品修改
|
||||||
|
* @param activityTeamProductSkuUpdModel 修改业务模型
|
||||||
|
* @return 修改结果
|
||||||
*/
|
*/
|
||||||
public List<ActivityTeamProductSkuDetailModel> getDetailModel(Long teamId);
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
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> {
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
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,7 +2,10 @@ 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.domain.TeamStrategyExemptionHundred;
|
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||||
|
|
||||||
public interface TeamStrategyExemptionService extends IService<TeamStrategyExemption> {
|
/**
|
||||||
|
* 免单
|
||||||
|
*/
|
||||||
|
public interface TeamStrategyExemptionService extends ActivityTeamStrategy, IService<TeamStrategyExemption> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
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> {
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
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,14 +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.metadata.OrderItem;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||||
|
@ -18,9 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@ -84,29 +79,30 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询商品的详情
|
||||||
|
* @param id 团购活动ID
|
||||||
|
* @return 团购详情
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void saves(ActivityTeamInfoAddModel activityTeamInfoAddModel) {
|
public ActivityTeamDetailModel findDetailById(Long id) {
|
||||||
|
ActivityTeamInfo activityTeamInfo = this.getById(id);
|
||||||
// 团购活动模型添加
|
List<ActivityTeamProductSkuModel> activityTeamProductSkuModelList = activityTeamProductSkuInfoService.findListByTeamId(id);
|
||||||
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.addModelBuild(activityTeamInfoAddModel);
|
return ActivityTeamDetailModel.findSkuSumList(activityTeamInfo,
|
||||||
//断言 判断条件是否为真
|
(teamInfoFindByIdRespModelBuilder) -> teamInfoFindByIdRespModelBuilder.projectSkuInfoAddReqList(activityTeamProductSkuModelList).build()
|
||||||
Assert.isTrue(this.save(activityTeamInfo),StringUtils.format("团购活动添加失败:{[]}", activityTeamInfoAddModel));
|
);
|
||||||
// 团购SKU模型集合
|
|
||||||
List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList = activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList();
|
|
||||||
|
|
||||||
activityTeamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改团购活动信息
|
||||||
|
* @param activityTeamInfoUpdModel 团购活动信息
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ActivityTeamInfoDetailModel getByIds(Long id) {
|
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||||
|
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
||||||
|
Assert.isTrue(update,"修改失败");
|
||||||
return ActivityTeamInfoDetailModel.DetailModelBuild(this.getById(id));
|
activityTeamProductSkuInfoService.setting(activityTeamInfoUpdModel.getActivityTeamProductSkuSettingModel());
|
||||||
|
return update;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
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;
|
||||||
|
@ -11,7 +12,12 @@ import com.muyu.product.cache.ProjectSkuCache;
|
||||||
import com.muyu.product.domain.ProjectSkuInfo;
|
import com.muyu.product.domain.ProjectSkuInfo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@ -75,24 +81,58 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过拼团活动ID获取拼团下商品SKU集合
|
||||||
|
*
|
||||||
|
* @param teamId 活动ID
|
||||||
|
* @return 拼团商品SKU集合
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void batchUpd(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ActivityTeamProductSkuDetailModel> getDetailModel(Long teamId) {
|
|
||||||
|
|
||||||
|
|
||||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(ActivityTeamProductSkuInfo::getProductId, teamId);
|
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,teamId);
|
||||||
List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfoList = this.list(queryWrapper);
|
List<ActivityTeamProductSkuInfo> list = this.list(queryWrapper);
|
||||||
|
return list.stream().map(ActivityTeamProductSkuModel::FindBuild).toList();
|
||||||
List<ActivityTeamProductSkuDetailModel> list = activityTeamProductSkuInfoList.stream().map(ActivityTeamProductSkuDetailModel::getIdBuild).toList();
|
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList) {
|
||||||
|
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()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
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 {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
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,10 +4,62 @@ 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;
|
||||||
|
|
||||||
@Service
|
@Log4j2
|
||||||
|
@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) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
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);
|
||||||
|
}
|
|
@ -0,0 +1,85 @@
|
||||||
|
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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-marketings
|
name: muyu-buy
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,12 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 1.94.33.190:8848
|
server-addr: 127.0.0.1:8848
|
||||||
namespace: 3e693a9e-cf1c-46f1-b42a-d4419204abd0
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 1.94.33.190:8848
|
server-addr: 127.0.0.1:8848
|
||||||
namespace: 3e693a9e-cf1c-46f1-b42a-d4419204abd0
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -27,4 +25,4 @@ spring:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
com.muyu.marketings.mapper: DEBUG
|
com.muyu.marketing.mapper: DEBUG
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue