Compare commits
10 Commits
f10ee15063
...
f91f2c5340
Author | SHA1 | Date |
---|---|---|
|
f91f2c5340 | |
|
ce1b8f30bd | |
|
341383d398 | |
|
517f694ec2 | |
|
d1d9109b43 | |
|
c02afc9a93 | |
|
b6c4a790d7 | |
|
e4580e8bd1 | |
|
46a7e2e8db | |
|
0a636c4728 |
|
@ -0,0 +1,21 @@
|
||||||
|
# 拼团活动列表(活动页面)
|
||||||
|
|
||||||
|
# 拼团详情(展示活动页面)
|
||||||
|
#优惠券
|
||||||
|
# 开团/加团(用户拼团页面)
|
||||||
|
#选择商品(选择拼团的商品页面)
|
||||||
|
#拼团中 (等待拼团页面)
|
||||||
|
#品团 成功
|
||||||
|
# 订单
|
||||||
|
# 支付 成功/失败
|
||||||
|
# 拼团
|
||||||
|
|
||||||
|
商品详情
|
||||||
|
拼团活动详情
|
||||||
|
拼团类型
|
||||||
|
评论
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,10 @@
|
||||||
"拼团库存": "Long"
|
"拼团库存": "Long"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"删除商品规格IdList" : ["Long", "Long"],
|
"删除商品规格IdList" : [
|
||||||
"添加商品规格List": [
|
"Long", "Long"
|
||||||
|
],
|
||||||
|
"添加商品规格List": [ //
|
||||||
"商品SKU": "String",
|
"商品SKU": "String",
|
||||||
"商品价格": "BigDecimal",
|
"商品价格": "BigDecimal",
|
||||||
"拼团价格": "BigDecimal",
|
"拼团价格": "BigDecimal",
|
||||||
|
|
|
@ -20,12 +20,12 @@ public class PageDomain {
|
||||||
/**
|
/**
|
||||||
* 当前记录起始索引
|
* 当前记录起始索引
|
||||||
*/
|
*/
|
||||||
private Integer pageNum;
|
private Integer pageNum=1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 每页显示记录数
|
* 每页显示记录数
|
||||||
*/
|
*/
|
||||||
private Integer pageSize;
|
private Integer pageSize=3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序列
|
* 排序列
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.muyu.gateway.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||||
|
import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||||
|
import org.springframework.web.cors.reactive.CorsUtils;
|
||||||
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
|
import org.springframework.web.server.WebFilter;
|
||||||
|
import org.springframework.web.server.WebFilterChain;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跨域配置
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class CorsConfig {
|
||||||
|
/**
|
||||||
|
* 这里为支持的请求头,如果有自定义的header字段请自己添加
|
||||||
|
*/
|
||||||
|
private static final String ALLOWED_HEADERS = "X-Requested-With, Content-Type, Authorization, credential, X-XSRF-TOKEN, token, Admin-Token, App-Token";
|
||||||
|
private static final String ALLOWED_METHODS = "GET,POST,PUT,DELETE,OPTIONS,HEAD";
|
||||||
|
private static final String ALLOWED_ORIGIN = "*";
|
||||||
|
private static final String ALLOWED_EXPOSE = "*";
|
||||||
|
private static final String MAX_AGE = "18000L";
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public WebFilter corsFilter()
|
||||||
|
{
|
||||||
|
return (ServerWebExchange ctx, WebFilterChain chain) -> {
|
||||||
|
ServerHttpRequest request = ctx.getRequest();
|
||||||
|
if (CorsUtils.isCorsRequest(request))
|
||||||
|
{
|
||||||
|
ServerHttpResponse response = ctx.getResponse();
|
||||||
|
HttpHeaders headers = response.getHeaders();
|
||||||
|
headers.add("Access-Control-Allow-Headers", ALLOWED_HEADERS);
|
||||||
|
headers.add("Access-Control-Allow-Methods", ALLOWED_METHODS);
|
||||||
|
headers.add("Access-Control-Allow-Origin", ALLOWED_ORIGIN);
|
||||||
|
headers.add("Access-Control-Expose-Headers", ALLOWED_EXPOSE);
|
||||||
|
headers.add("Access-Control-Max-Age", MAX_AGE);
|
||||||
|
headers.add("Access-Control-Allow-Credentials", "true");
|
||||||
|
if (request.getMethod() == HttpMethod.OPTIONS)
|
||||||
|
{
|
||||||
|
response.setStatusCode(HttpStatus.OK);
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return chain.filter(ctx);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -28,12 +28,12 @@ spring:
|
||||||
eager: true
|
eager: true
|
||||||
transport:
|
transport:
|
||||||
# 控制台地址
|
# 控制台地址
|
||||||
dashboard: 127.0.0.1:8718
|
dashboard: 60.204.150.30:8718
|
||||||
# nacos配置持久化
|
# nacos配置持久化
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 60.204.150.30:8848
|
||||||
dataId: sentinel-muyu-gateway
|
dataId: sentinel-muyu-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|
|
@ -19,6 +19,11 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-loadbalancer</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 系统公共core -->
|
<!-- 系统公共core -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
|
|
|
@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,7 +38,8 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
* 商品ID
|
* 商品ID
|
||||||
*/
|
*/
|
||||||
private Long productId;
|
private Long productId;
|
||||||
/**
|
|
||||||
|
/**
|
||||||
* 商品活动图
|
* 商品活动图
|
||||||
*/
|
*/
|
||||||
private String productImage;
|
private String productImage;
|
||||||
|
|
|
@ -5,6 +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.ActivityTeamProductSkuUpdModel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
@ -65,8 +66,17 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
.productId(activityTeamProductSkuAddModel.getProductId())
|
.productId(activityTeamProductSkuAddModel.getProductId())
|
||||||
.teamId(activityTeamProductSkuAddModel.getTeamId())
|
.teamId(activityTeamProductSkuAddModel.getTeamId())
|
||||||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||||
// .remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
|
||||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuInfo updateModelBuild(ActivityTeamProductSkuUpdModel activityTeamProductSkuReqModel) {
|
||||||
|
return ActivityTeamProductSkuInfo.builder()
|
||||||
|
.id(activityTeamProductSkuReqModel.getId())
|
||||||
|
.productId(activityTeamProductSkuReqModel.getProductId())
|
||||||
|
.teamStock(activityTeamProductSkuReqModel.getTeamStock())
|
||||||
|
.productSku(activityTeamProductSkuReqModel.getProductSku())
|
||||||
|
.teamPrice(activityTeamProductSkuReqModel.getTeamPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,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 {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
|
@ -19,7 +19,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 {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
|
@ -1,102 +0,0 @@
|
||||||
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())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -57,7 +57,7 @@ public class ActivityTeamInfoAddModel {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -49,6 +49,8 @@ public class ActivityTeamInfoListModel {
|
||||||
* 拼团商品图片
|
* 拼团商品图片
|
||||||
*/
|
*/
|
||||||
private String productImage;
|
private String productImage;
|
||||||
|
/** 商品id*/
|
||||||
|
private Long productId;
|
||||||
/**
|
/**
|
||||||
* 商品价格
|
* 商品价格
|
||||||
*/
|
*/
|
||||||
|
@ -72,20 +74,20 @@ public class ActivityTeamInfoListModel {
|
||||||
|
|
||||||
|
|
||||||
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) {
|
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) {
|
||||||
ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
// ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
// .id(activityTeamInfo.getId())
|
||||||
.name(activityTeamInfo.getName())
|
// .name(activityTeamInfo.getName())
|
||||||
// .openTeamNumber(teamOpenTypeNumber)
|
//// .openTeamNumber(teamOpenTypeNumber)
|
||||||
// .addTeamNumber(teamInTypeNumber)
|
//// .addTeamNumber(teamInTypeNumber)
|
||||||
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
//// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||||
.endTime(activityTeamInfo.getEndTime())
|
// .endTime(activityTeamInfo.getEndTime())
|
||||||
.productImage(activityTeamInfo.getProductImage())
|
// .productImage(activityTeamInfo.getProductImage())
|
||||||
// .teamPrice(discountPrice.getTeamPrice())
|
//// .teamPrice(discountPrice.getTeamPrice())
|
||||||
// .productPrice(discountPrice.getProductPrice())
|
//// .productPrice(discountPrice.getProductPrice())
|
||||||
// .teamStock(teamProductStockModel.getTeamStock())
|
//// .teamStock(teamProductStockModel.getTeamStock())
|
||||||
// .remainStock(teamProductStockModel.getRemainStock())
|
//// .remainStock(teamProductStockModel.getRemainStock())
|
||||||
.status(activityTeamInfo.getStatus())
|
// .status(activityTeamInfo.getStatus())
|
||||||
.build();
|
// .build();
|
||||||
return function.apply(
|
return function.apply(
|
||||||
ActivityTeamInfoListModel.builder()
|
ActivityTeamInfoListModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
.id(activityTeamInfo.getId())
|
||||||
|
|
|
@ -1,92 +0,0 @@
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -12,6 +12,7 @@ import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购活动查询模型
|
* 团购活动查询模型
|
||||||
|
@ -67,7 +68,7 @@ public class ActivityTeamInfoSelectModel {
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
private List<TeamProjectSkuInfoResp> teamProjectSkuInfoResp;
|
private List<ActivityTeamProductSkuModel> activityTeamProductSkuModels;
|
||||||
/**
|
/**
|
||||||
* 活动详情
|
* 活动详情
|
||||||
*/
|
*/
|
||||||
|
@ -84,28 +85,28 @@ public class ActivityTeamInfoSelectModel {
|
||||||
* 策略ID
|
* 策略ID
|
||||||
*/
|
*/
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
|
private Long remainStock;
|
||||||
|
|
||||||
|
|
||||||
/** 回显 构造 ActivityTeamInfoSelectModel*/
|
/** 回显 构造 ActivityTeamInfoSelectModel*/
|
||||||
|
|
||||||
public static ActivityTeamInfoSelectModel getTeamInfoSelectModel(ActivityTeamInfo activityTeamInfo, List<ActivityTeamProductSkuInfo> list) {
|
public static ActivityTeamInfoSelectModel getTeamInfoSelectModel(ActivityTeamInfo activityTeamInfo,
|
||||||
return ActivityTeamInfoSelectModel.builder()
|
Function<ActivityTeamInfoSelectModel.ActivityTeamInfoSelectModelBuilder, ActivityTeamInfoSelectModel> function) {
|
||||||
.teamId(activityTeamInfo.getId())
|
return function.apply(
|
||||||
.name(activityTeamInfo.getName())
|
ActivityTeamInfoSelectModel.builder()
|
||||||
.productId(activityTeamInfo.getProductId())
|
.teamId(activityTeamInfo.getId())
|
||||||
.productImage(activityTeamInfo.getProductImage())
|
.name(activityTeamInfo.getName())
|
||||||
.introduction(activityTeamInfo.getIntroduction())
|
.productId(activityTeamInfo.getProductId())
|
||||||
.unit(activityTeamInfo.getUnit())
|
.productImage(activityTeamInfo.getProductImage())
|
||||||
.imageList(activityTeamInfo.getImageList())
|
.introduction(activityTeamInfo.getIntroduction())
|
||||||
.endTime(activityTeamInfo.getEndTime())
|
.unit(activityTeamInfo.getUnit())
|
||||||
.sort(activityTeamInfo.getSort())
|
.imageList(activityTeamInfo.getImageList())
|
||||||
.teamProjectSkuInfoResp( list.stream().map(skuInfo ->
|
.endTime(activityTeamInfo.getEndTime())
|
||||||
TeamProjectSkuInfoResp.getSkuInfoResp(skuInfo)
|
.sort(activityTeamInfo.getSort())
|
||||||
).toList())
|
.content(activityTeamInfo.getContent())
|
||||||
.content(activityTeamInfo.getContent())
|
.status(activityTeamInfo.getStatus())
|
||||||
.status(activityTeamInfo.getStatus())
|
.strategyType(activityTeamInfo.getStrategyType())
|
||||||
.strategyType(activityTeamInfo.getStrategyType())
|
.strategyId(activityTeamInfo.getStrategyId())
|
||||||
.strategyId(activityTeamInfo.getStrategyId())
|
);
|
||||||
.build();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuInfoUpdReq;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamProductUpdCheckReq;
|
||||||
|
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;
|
||||||
|
@ -8,49 +13,95 @@ import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: 2204a-cloud-server
|
* 团购活动修改模型
|
||||||
* @description: 活动商品规格修改模型
|
*
|
||||||
* @author: AoCi Tian
|
* @author DongZeLiang
|
||||||
* @create: 2024-11-26 19:25
|
* @date 2024-11-26 09:38
|
||||||
**/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Builder
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class ActivityTeamInfoUpdModel {
|
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 List<ActivityTeamProductSkuReqModel> activityTeamProductSkuModelList;
|
|
||||||
|
|
||||||
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
/**
|
||||||
|
* 活动ID
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品活动图
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轮播图
|
||||||
|
*/
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品规格
|
||||||
|
*/
|
||||||
|
private ActivityTeamProductUpdCheckModel skuList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
/** 拼团活动req 构造 model*/
|
||||||
|
public static ActivityTeamInfoUpdModel reqConvertModel(ActivityTeamProductSkuInfoUpdReq skuInfoUpdReq){
|
||||||
return ActivityTeamInfoUpdModel.builder()
|
return ActivityTeamInfoUpdModel.builder()
|
||||||
.id(activityTeamInfoUpdReq.getId())
|
.teamId(skuInfoUpdReq.getTeamId())
|
||||||
.name(activityTeamInfoUpdReq.getName())
|
.productId(skuInfoUpdReq.getProductId())
|
||||||
.productId(activityTeamInfoUpdReq.getProductId())
|
.name(skuInfoUpdReq.getName())
|
||||||
.productImage(activityTeamInfoUpdReq.getProductImage())
|
.introduction(skuInfoUpdReq.getIntroduction())
|
||||||
.introduction(activityTeamInfoUpdReq.getIntroduction())
|
.content(skuInfoUpdReq.getContent())
|
||||||
.unit(activityTeamInfoUpdReq.getUnit())
|
.unit(skuInfoUpdReq.getUnit())
|
||||||
.imageList(activityTeamInfoUpdReq.getImageList())
|
.imageList(skuInfoUpdReq.getImageList())
|
||||||
.endTime(activityTeamInfoUpdReq.getEndTime())
|
.endTime(skuInfoUpdReq.getEndTime())
|
||||||
.sort(activityTeamInfoUpdReq.getSort())
|
.strategyType(skuInfoUpdReq.getStrategyType())
|
||||||
.content(activityTeamInfoUpdReq.getContent())
|
.skuList(ActivityTeamProductUpdCheckModel
|
||||||
.status(activityTeamInfoUpdReq.getStatus())
|
.reqConvertModel(skuInfoUpdReq.getSukList())) //req skuList 构造 model
|
||||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
.status(skuInfoUpdReq.getStatus())
|
||||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
.strategyId(skuInfoUpdReq.getStrategyId())
|
||||||
.activityTeamProductSkuModelList(activityTeamInfoUpdReq.getActivityTeamProductSkuList().stream().map(ActivityTeamProductSkuReqModel::activityTeamProductSkuReqModelBuild).toList())
|
.build();
|
||||||
.build();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
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 java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购活动修改模型
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-26 09:38
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ActivityTeamInfoUpdateModel {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团名称
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
/**
|
|
||||||
* 活动详情
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
/**
|
|
||||||
* 活动状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
/**
|
|
||||||
* 策略类型
|
|
||||||
*/
|
|
||||||
private String strategyType;
|
|
||||||
/**
|
|
||||||
* 策略ID
|
|
||||||
*/
|
|
||||||
private Long strategyId;
|
|
||||||
|
|
||||||
/** 删除商品规格idList*/
|
|
||||||
private List<Long> ids;
|
|
||||||
}
|
|
|
@ -11,8 +11,7 @@ import java.math.BigDecimal;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购spu库存添加模型
|
* 团购sku库存添加模型
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
* @author DongZeLiang
|
||||||
* @date 2024-11-26 09:36
|
* @date 2024-11-26 09:36
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,8 +10,7 @@ import lombok.NoArgsConstructor;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: 2204a-cloud-server
|
*回显sku模型
|
||||||
* @description: 回显sku模型
|
|
||||||
* @author: AoCi Tian
|
* @author: AoCi Tian
|
||||||
* @create: 2024-11-26 16:03
|
* @create: 2024-11-26 16:03
|
||||||
**/
|
**/
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
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,45 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
}
|
|
@ -1,15 +1,17 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团活动商品SKU
|
* 拼团活动商品SKU修改模型
|
||||||
*
|
*
|
||||||
* @author DongZeLiang
|
* @author DongZeLiang
|
||||||
* @date 2024-11-27 14:18
|
* @date 2024-11-27 14:18
|
||||||
|
@ -21,17 +23,46 @@ import java.math.BigDecimal;
|
||||||
public class ActivityTeamProductSkuUpdModel {
|
public class ActivityTeamProductSkuUpdModel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品规格ID
|
* 拼团规格信息ID
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 活动id
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
/**
|
||||||
|
* 商品id
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String productSku;
|
||||||
/**
|
/**
|
||||||
* 团购价格
|
* 团购价格
|
||||||
*/
|
*/
|
||||||
private BigDecimal teamPrice;
|
private Long teamStock;
|
||||||
|
/**
|
||||||
|
* 剩余库存
|
||||||
|
*/
|
||||||
|
private Long remainStock;
|
||||||
/**
|
/**
|
||||||
* 团购库存
|
* 团购库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**拼团活动SkuReq 构造 model */
|
||||||
|
public static ActivityTeamProductSkuUpdModel activityTeamProductSkuReqModelBuild(ActivityTeamProductSkuReq activityTeamProductSkuReq) {
|
||||||
|
return ActivityTeamProductSkuUpdModel.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,48 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamProductUpdCheckReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (团购活动修改SKU操作模型)
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-27 14:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamProductUpdCheckModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改商品规格List
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuUpdModel> skuUpdateList;
|
||||||
|
/**
|
||||||
|
* 删除商品规格IdList
|
||||||
|
*/
|
||||||
|
private List<Long> skuByIdDeleteList;
|
||||||
|
/**
|
||||||
|
* 添加商品规格List
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuAddModel> skuAddList;
|
||||||
|
|
||||||
|
|
||||||
|
/** skuListReq 构造 skuListModel */
|
||||||
|
public static ActivityTeamProductUpdCheckModel reqConvertModel(ActivityTeamProductUpdCheckReq sukListReq) {
|
||||||
|
return ActivityTeamProductUpdCheckModel.builder()
|
||||||
|
.skuUpdateList(sukListReq.getSkuUpdateList())
|
||||||
|
.skuByIdDeleteList(sukListReq.getSkuByIdDeleteList())
|
||||||
|
.skuAddList(sukListReq.getSkuAddList())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -58,7 +58,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
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 List<ActivityTeamProductSkuReq> activityTeamProductSkuList;
|
|
||||||
}
|
|
|
@ -1,26 +1,27 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
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.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动商品规格修改入参
|
||||||
|
**/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@NoArgsConstructor
|
||||||
public class ActivityTeamDetailResp extends BaseEntity {
|
@SuperBuilder
|
||||||
|
public class ActivityTeamProductSkuInfoUpdReq {
|
||||||
/**
|
/**
|
||||||
* 团购ID
|
* 活动ID
|
||||||
*/
|
*/
|
||||||
private Long teamId;
|
private Long teamId;
|
||||||
/**
|
/**
|
||||||
|
@ -61,7 +62,7 @@ public class ActivityTeamDetailResp extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
private List<ActivityTeamProjectSkuResp> activityTeamProjectSkuList;
|
private ActivityTeamProductUpdCheckReq sukList;
|
||||||
/**
|
/**
|
||||||
* 活动详情
|
* 活动详情
|
||||||
*/
|
*/
|
||||||
|
@ -78,4 +79,5 @@ public class ActivityTeamDetailResp extends BaseEntity {
|
||||||
* 策略ID
|
* 策略ID
|
||||||
*/
|
*/
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
|
|
||||||
}
|
}
|
|
@ -8,8 +8,7 @@ import lombok.NoArgsConstructor;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: 2204a-cloud-server
|
*sku修改入参
|
||||||
* @description: sku修改入参
|
|
||||||
* @author: AoCi Tian
|
* @author: AoCi Tian
|
||||||
* @create: 2024-11-26 19:45
|
* @create: 2024-11-26 19:45
|
||||||
**/
|
**/
|
||||||
|
@ -18,11 +17,22 @@ import java.math.BigDecimal;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
public class ActivityTeamProductSkuReq {
|
public class ActivityTeamProductSkuReq {
|
||||||
|
|
||||||
|
/** 主键*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
/** 活动ID*/
|
||||||
private Long teamId;
|
private Long teamId;
|
||||||
|
/** 商品ID*/
|
||||||
private Long productId;
|
private Long productId;
|
||||||
|
/** 商品SKU*/
|
||||||
private String productSku;
|
private String productSku;
|
||||||
|
/** 拼团库存*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
|
/** 剩余库存*/
|
||||||
private Long remainStock;
|
private Long remainStock;
|
||||||
|
/** 拼团价格*/
|
||||||
private BigDecimal teamPrice;
|
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,37 @@
|
||||||
|
package com.muyu.marketing.domain.req;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*(团购活动修改SKU参数)
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-27 14:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamProductUpdCheckReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改商品规格List
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuUpdModel> skuUpdateList;
|
||||||
|
/**
|
||||||
|
* 删除商品规格IdList
|
||||||
|
*/
|
||||||
|
private List<Long> skuByIdDeleteList;
|
||||||
|
/**
|
||||||
|
* 添加商品规格List
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuAddModel> skuAddList;
|
||||||
|
|
||||||
|
}
|
|
@ -8,7 +8,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加的Sku
|
* 添加的req
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
|
@ -6,6 +6,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.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSelectModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoSelectModel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -13,6 +14,7 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -26,6 +28,7 @@ import java.util.List;
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class ActivityTeamInfoResp extends BaseEntity {
|
public class ActivityTeamInfoResp extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团活动id
|
* 拼团活动id
|
||||||
*/
|
*/
|
||||||
|
@ -38,6 +41,10 @@ public class ActivityTeamInfoResp extends BaseEntity {
|
||||||
* 商品ID
|
* 商品ID
|
||||||
*/
|
*/
|
||||||
private Long productId;
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品价格
|
||||||
|
*/
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品活动图
|
* 商品活动图
|
||||||
|
@ -69,7 +76,7 @@ public class ActivityTeamInfoResp extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
private List<TeamProjectSkuInfoResp> teamProjectSkuInfoResp;
|
private List<ProjectFindSkuInfoResp> projectFindSkuInfoResps;
|
||||||
/**
|
/**
|
||||||
* 活动详情
|
* 活动详情
|
||||||
*/
|
*/
|
||||||
|
@ -88,7 +95,7 @@ public class ActivityTeamInfoResp extends BaseEntity {
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
|
|
||||||
/** 构造ActivityTeamInfoResp */
|
/** 构造ActivityTeamInfoResp */
|
||||||
public static ActivityTeamInfoResp select(ActivityTeamInfoSelectModel teamSelectModel) {
|
public static ActivityTeamInfoResp teamInfoFindByIdBuild(ActivityTeamInfoSelectModel teamSelectModel) {
|
||||||
|
|
||||||
return ActivityTeamInfoResp.builder()
|
return ActivityTeamInfoResp.builder()
|
||||||
.teamId(teamSelectModel.getTeamId())
|
.teamId(teamSelectModel.getTeamId())
|
||||||
|
@ -100,11 +107,32 @@ public class ActivityTeamInfoResp extends BaseEntity {
|
||||||
.imageList(teamSelectModel.getImageList())
|
.imageList(teamSelectModel.getImageList())
|
||||||
.endTime(teamSelectModel.getEndTime())
|
.endTime(teamSelectModel.getEndTime())
|
||||||
.sort(teamSelectModel.getSort())
|
.sort(teamSelectModel.getSort())
|
||||||
.teamProjectSkuInfoResp(teamSelectModel.getTeamProjectSkuInfoResp())
|
.projectFindSkuInfoResps(
|
||||||
|
teamSelectModel.getActivityTeamProductSkuModels()
|
||||||
|
.stream().map(ProjectFindSkuInfoResp::projectFindSkuInfoBuild).toList())
|
||||||
.content(teamSelectModel.getContent())
|
.content(teamSelectModel.getContent())
|
||||||
.status(teamSelectModel.getStatus())
|
.status(teamSelectModel.getStatus())
|
||||||
.strategyType(teamSelectModel.getStrategyType())
|
.strategyType(teamSelectModel.getStrategyType())
|
||||||
.strategyId(teamSelectModel.getStrategyId())
|
.strategyId(teamSelectModel.getStrategyId())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 构造 */
|
||||||
|
public static ActivityTeamInfoResp client(ActivityTeamInfo activityTeamInfo) {
|
||||||
|
return ActivityTeamInfoResp.builder()
|
||||||
|
.teamId(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())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加的
|
* 添加的resp
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
|
|
|
@ -11,7 +11,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回显resp
|
* 回显 Sku resp
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
|
|
|
@ -1,107 +0,0 @@
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -9,6 +9,9 @@ import lombok.NoArgsConstructor;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动展示Resp
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@ -86,4 +89,5 @@ public class TeamInfoListResp {
|
||||||
.teamStock(activityTeamInfoListModel.getTeamStock())
|
.teamStock(activityTeamInfoListModel.getTeamStock())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class TeamProjectSkuInfoResp {
|
||||||
.ruleId(skuInfo.getId())
|
.ruleId(skuInfo.getId())
|
||||||
.sku(skuInfo.getProductSku())
|
.sku(skuInfo.getProductSku())
|
||||||
.teamPrice(skuInfo.getTeamPrice())
|
.teamPrice(skuInfo.getTeamPrice())
|
||||||
// .teamStock(skuInfo.getTeamStock())
|
.teamStock(skuInfo.getTeamStock())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@EnableCustomSwagger2
|
@EnableCustomSwagger2
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class MuYuMarketIngApplication {
|
public class MuYuMarketIngApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(MuYuMarketIngApplication.class, args);
|
SpringApplication.run(MuYuMarketIngApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,24 @@
|
||||||
package com.muyu.marketing.team.controller;
|
package com.muyu.marketing.team.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.utils.PageUtils;
|
||||||
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.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSelectModel;
|
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.ActivityTeamProductSkuInfoUpdReq;
|
||||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
||||||
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.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 营销团购活动控制层
|
* 营销团购活动控制层
|
||||||
*
|
*
|
||||||
|
@ -29,6 +32,20 @@ public class ActivityTeamController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamInfoService activityTeamInfoService;;
|
private ActivityTeamInfoService activityTeamInfoService;;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户端拼团列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/clientList")
|
||||||
|
public Result<PageInfo<ActivityTeamInfoResp>> clientList(@RequestBody TeamInfoListReq teamInfoListReq){
|
||||||
|
PageUtils.startPage(teamInfoListReq.getPageNum(),teamInfoListReq.getPageSize());
|
||||||
|
List<ActivityTeamInfoResp> activityTeamInfoRespList=activityTeamInfoService.clientList(teamInfoListReq);
|
||||||
|
PageInfo<ActivityTeamInfoResp> pageInfo = new PageInfo<>(activityTeamInfoRespList);
|
||||||
|
return Result.success(pageInfo);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询营销团购活动列表
|
* 查询营销团购活动列表
|
||||||
* @param teamInfoListReq 活动查询入参
|
* @param teamInfoListReq 活动查询入参
|
||||||
|
@ -52,7 +69,7 @@ public class ActivityTeamController {
|
||||||
* @param activityTeamInfoSaveReq 添加请求对象
|
* @param activityTeamInfoSaveReq 添加请求对象
|
||||||
* @return 结果集
|
* @return 结果集
|
||||||
*/
|
*/
|
||||||
@PostMapping
|
@PostMapping("/add")
|
||||||
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
||||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
||||||
return Result.success();
|
return Result.success();
|
||||||
|
@ -63,12 +80,23 @@ public class ActivityTeamController {
|
||||||
* 回显拼团活动
|
* 回显拼团活动
|
||||||
* @teamId 拼团活动id
|
* @teamId 拼团活动id
|
||||||
*/
|
*/
|
||||||
@GetMapping("/{teamId}")
|
@GetMapping("/getById/{teamId}")
|
||||||
public Result<ActivityTeamInfoResp> getTeamInfo(@PathVariable Long teamId){
|
public Result<ActivityTeamInfoResp> getTeamInfo(@PathVariable("teamId") Long teamId){
|
||||||
//调用Service方法 获取回显Model
|
return Result.success(ActivityTeamInfoResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(teamId)));
|
||||||
ActivityTeamInfoSelectModel activityTeamInfoSelectModel = activityTeamInfoService.selectTeamInfo(teamId);
|
|
||||||
// 将 回显的Model 构造 成 Resp
|
|
||||||
ActivityTeamInfoResp activityTeamInfoResp = ActivityTeamInfoResp.select(activityTeamInfoSelectModel);
|
|
||||||
return Result.success(activityTeamInfoResp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 修改拼团活动*/
|
||||||
|
@PutMapping
|
||||||
|
private Result<String> update(ActivityTeamProductSkuInfoUpdReq activityTeamProductSkuInfoUpdReq){
|
||||||
|
//转换拼团修改Model
|
||||||
|
ActivityTeamInfoUpdModel activityTeamInfoUpdModel = ActivityTeamInfoUpdModel.reqConvertModel(activityTeamProductSkuInfoUpdReq);
|
||||||
|
|
||||||
|
activityTeamInfoService.updateTeamInfo(activityTeamInfoUpdModel);
|
||||||
|
|
||||||
|
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> {
|
||||||
|
|
||||||
|
}
|
|
@ -3,11 +3,16 @@ package com.muyu.marketing.team.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
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.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuInfoUpdReq;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSelectModel;
|
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动
|
||||||
|
*/
|
||||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +30,21 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询拼团活动(回显)
|
* 根据ID查询商品的详情
|
||||||
|
* @param id 团购活动ID
|
||||||
|
* @return 团购详情
|
||||||
*/
|
*/
|
||||||
public ActivityTeamInfoSelectModel selectTeamInfo(Long teamId);
|
ActivityTeamInfoSelectModel findDetailById(Long id);
|
||||||
}
|
// public ActivityTeamInfoSelectModel selectTeamInfo(Long teamId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改活动
|
||||||
|
*/
|
||||||
|
void updateTeamInfo(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||||
|
|
||||||
|
/** 客户端列表*/
|
||||||
|
List<ActivityTeamInfoResp> clientList(TeamInfoListReq teamInfoListReq);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -3,11 +3,11 @@ 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;
|
||||||
|
|
||||||
|
/** 规格SKU*/
|
||||||
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
||||||
|
|
||||||
public default List<ActivityTeamProductSkuInfo> getActivityTeamProductSkuInfoByTeamId(Long teamId){
|
public default List<ActivityTeamProductSkuInfo> getActivityTeamProductSkuInfoByTeamId(Long teamId){
|
||||||
|
@ -46,6 +46,36 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
*/
|
*/
|
||||||
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
||||||
|
|
||||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
/** 修改规格SKU*/
|
||||||
|
public boolean updateBath(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuReqModelList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除商品规格list
|
||||||
|
*/
|
||||||
|
public boolean deleteById(List<Long> skuByIdDeleteList);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 业务模型 进行 团购商品修改
|
||||||
|
* @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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,30 +1,30 @@
|
||||||
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.ActivityTeamOpenInfo;
|
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||||
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.req.TeamInfoListReq;
|
||||||
|
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
||||||
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;
|
||||||
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 org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
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.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
||||||
implements ActivityTeamInfoService {
|
implements ActivityTeamInfoService {
|
||||||
|
@ -35,19 +35,45 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||||
|
|
||||||
|
// LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
// queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getKeyWord()), ActivityTeamInfo::getName, activityTeamInfoListQueryModel.getKeyWord());
|
||||||
|
// queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getStatus()), ActivityTeamInfo::getStatus, activityTeamInfoListQueryModel.getStatus());
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * Object<T> -> 创建对象的时候进行的占用
|
||||||
|
// * <T> Result<T> 以方法返回值为占用
|
||||||
|
// */
|
||||||
|
// Page<ActivityTeamInfo> activityTeamInfoPage = this.page(activityTeamInfoListQueryModel.buildPage(), queryWrapper);
|
||||||
|
// List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
||||||
|
// List<ActivityTeamInfoListModel> activityTeamInfoListModels = activityTeamInfoList.stream()
|
||||||
|
// .map(activityTeamInfo -> ActivityTeamInfoListModel.infoBuild(activityTeamInfo,
|
||||||
|
// (activityTeamInfoListModelBuilder) -> {
|
||||||
|
// TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
|
||||||
|
// TeamProductStockModel teamProductStockModel = activityTeamProductSkuInfoService.getStock(activityTeamInfo.getId());
|
||||||
|
// Long teamOpenTypeNumber = activityTeamOpenInfoService.getTeamOpenTypeNumberByTeamId(activityTeamInfo.getId());
|
||||||
|
// Long teamInTypeNumber = activityTeamOpenInfoService.getTeamInTypeNumberByTeamId(activityTeamInfo.getId());
|
||||||
|
//
|
||||||
|
// return activityTeamInfoListModelBuilder
|
||||||
|
// .openTeamNumber(teamOpenTypeNumber)
|
||||||
|
// .addTeamNumber(teamInTypeNumber)
|
||||||
|
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||||
|
// .teamPrice(discountPrice.getTeamPrice())
|
||||||
|
// .productPrice(discountPrice.getProductPrice())
|
||||||
|
// .teamStock(teamProductStockModel.getTeamStock())
|
||||||
|
// .remainStock(teamProductStockModel.getRemainStock())
|
||||||
|
// .build();
|
||||||
|
// })).toList();
|
||||||
|
// TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>();
|
||||||
|
// tableDataInfo.setTotal(activityTeamInfoPage.getTotal());
|
||||||
|
// tableDataInfo.setRows(activityTeamInfoListModels);
|
||||||
|
// return tableDataInfo;
|
||||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getKeyWord()), ActivityTeamInfo::getName, activityTeamInfoListQueryModel.getKeyWord());
|
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getKeyWord()), ActivityTeamInfo::getName, activityTeamInfoListQueryModel.getKeyWord());
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getStatus()), ActivityTeamInfo::getStatus, activityTeamInfoListQueryModel.getStatus());
|
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getStatus()), ActivityTeamInfo::getStatus, activityTeamInfoListQueryModel.getStatus());
|
||||||
|
|
||||||
/**
|
|
||||||
* Object<T> -> 创建对象的时候进行的占用
|
|
||||||
* <T> Result<T> 以方法返回值为占用
|
|
||||||
*/
|
|
||||||
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(activityTeamInfoListQueryModel.buildPage(), queryWrapper);
|
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(activityTeamInfoListQueryModel.buildPage(), queryWrapper);
|
||||||
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
||||||
List<ActivityTeamInfoListModel> activityTeamInfoListModels = activityTeamInfoList.stream()
|
List<ActivityTeamInfoListModel> activityTeamInfoListModels = activityTeamInfoList.stream()
|
||||||
|
@ -66,6 +92,7 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
.productPrice(discountPrice.getProductPrice())
|
.productPrice(discountPrice.getProductPrice())
|
||||||
.teamStock(teamProductStockModel.getTeamStock())
|
.teamStock(teamProductStockModel.getTeamStock())
|
||||||
.remainStock(teamProductStockModel.getRemainStock())
|
.remainStock(teamProductStockModel.getRemainStock())
|
||||||
|
.productId(activityTeamInfo.getProductId())
|
||||||
.build();
|
.build();
|
||||||
})).toList();
|
})).toList();
|
||||||
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>();
|
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>();
|
||||||
|
@ -94,15 +121,74 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ActivityTeamInfoSelectModel selectTeamInfo(Long teamId) {
|
public ActivityTeamInfoSelectModel findDetailById(Long teamId) {
|
||||||
//根据拼团活动id 查询拼团活动
|
//根据拼团活动id 查询拼团活动
|
||||||
ActivityTeamInfo activityTeamInfo = this.getById(teamId);
|
ActivityTeamInfo activityTeamInfo = this.getById(teamId);
|
||||||
//查询活动中的 商品sku集合
|
//查询活动中的 商品sku集合
|
||||||
List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfoList = activityTeamProductSkuInfoService.getActivityTeamProductSkuInfoByTeamId(teamId);
|
List<ActivityTeamProductSkuModel> activityTeamProductSkuModelList = activityTeamProductSkuInfoService.findListByTeamId(teamId);
|
||||||
|
return ActivityTeamInfoSelectModel.getTeamInfoSelectModel(activityTeamInfo,
|
||||||
//构造成 ActivityTeamInfoSelectModel
|
(teamInfoFindByIdRespModelBuilder) -> teamInfoFindByIdRespModelBuilder.activityTeamProductSkuModels(activityTeamProductSkuModelList).build()
|
||||||
ActivityTeamInfoSelectModel teamInfoSelectModel = ActivityTeamInfoSelectModel.getTeamInfoSelectModel(activityTeamInfo, activityTeamProductSkuInfoList);
|
);
|
||||||
|
|
||||||
return teamInfoSelectModel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改拼团活动活动
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void updateTeamInfo(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||||
|
//查询当前活动状态
|
||||||
|
ActivityTeamInfo activityTeamInfo = this.getById(activityTeamInfoUpdModel.getTeamId());
|
||||||
|
if ("Y".equals(activityTeamInfo.getStatus())){
|
||||||
|
//当前活动运营中禁止修改
|
||||||
|
throw new RuntimeException("当前活动运营中禁止修改");
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改:
|
||||||
|
List<ActivityTeamProductSkuAddModel> skuAddList = activityTeamInfoUpdModel.getSkuList().getSkuAddList();
|
||||||
|
//添加列表不为空并且长度大于零
|
||||||
|
if (null != skuAddList && 0<skuAddList.size()){
|
||||||
|
//构造 添加
|
||||||
|
activityTeamProductSkuInfoService.batchSave(skuAddList);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ActivityTeamProductSkuUpdModel> skuUpdateList = activityTeamInfoUpdModel.getSkuList().getSkuUpdateList();
|
||||||
|
//修改列表不为空并且长度大于零
|
||||||
|
if (null != skuUpdateList && 0<skuUpdateList.size()){
|
||||||
|
//构造 修改
|
||||||
|
activityTeamProductSkuInfoService.updateBath(skuUpdateList);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> skuByIdDeleteList = activityTeamInfoUpdModel.getSkuList().getSkuByIdDeleteList();
|
||||||
|
if (null != skuByIdDeleteList && 0<skuByIdDeleteList.size()){
|
||||||
|
//构造 删除
|
||||||
|
activityTeamProductSkuInfoService.deleteById(skuByIdDeleteList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户端列表*/
|
||||||
|
@Override
|
||||||
|
public List<ActivityTeamInfoResp> clientList(TeamInfoListReq teamInfoListReq) {
|
||||||
|
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
//查询活动状态
|
||||||
|
if (null != teamInfoListReq.getStatus() && ! "".equals(teamInfoListReq.getStatus())){
|
||||||
|
queryWrapper.eq(ActivityTeamInfo::getStatus,teamInfoListReq.getStatus());
|
||||||
|
}
|
||||||
|
if (null != teamInfoListReq.getKeyWord() && ! "".equals(teamInfoListReq.getKeyWord())){
|
||||||
|
queryWrapper.eq(ActivityTeamInfo::getStatus,teamInfoListReq.getStatus());
|
||||||
|
}
|
||||||
|
//拼团列表
|
||||||
|
List<ActivityTeamInfo> activityTeamInfos = this.list(queryWrapper);
|
||||||
|
//构造成Resp
|
||||||
|
ArrayList<ActivityTeamInfoResp> activityTeamInfoResps = new ArrayList<>();
|
||||||
|
activityTeamInfos.forEach(activityTeamInfo -> {
|
||||||
|
ActivityTeamInfoResp client = ActivityTeamInfoResp.client(activityTeamInfo);
|
||||||
|
activityTeamInfoResps.add(client);
|
||||||
|
});
|
||||||
|
|
||||||
|
return activityTeamInfoResps;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,9 +95,44 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改商品规格list
|
||||||
|
* @param activityTeamProductSkuReqModelList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList) {
|
public boolean updateBath(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuReqModelList) {
|
||||||
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
return
|
||||||
|
this.updateBatchById(activityTeamProductSkuReqModelList
|
||||||
|
.stream()
|
||||||
|
.map(ActivityTeamProductSkuInfo::updateModelBuild)
|
||||||
|
.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除商品规格list
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean deleteById(List<Long> skuByIdDeleteList) {
|
||||||
|
boolean b = this.removeBatchByIds(skuByIdDeleteList);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,4 +20,5 @@
|
||||||
<description>
|
<description>
|
||||||
muyu-marketing营销模块
|
muyu-marketing营销模块
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class CommentInfoController extends BaseController {
|
||||||
* 查询商品评论列表
|
* 查询商品评论列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取商品评论列表")
|
@ApiOperation("获取商品评论列表")
|
||||||
@RequiresPermissions("product:comment:list")
|
// @RequiresPermissions("product:comment:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo<CommentInfo>> list(CommentInfoQueryReq commentInfoQueryReq) {
|
public Result<TableDataInfo<CommentInfo>> list(CommentInfoQueryReq commentInfoQueryReq) {
|
||||||
startPage();
|
startPage();
|
||||||
|
@ -68,7 +68,7 @@ public class CommentInfoController extends BaseController {
|
||||||
* 获取商品评论详细信息
|
* 获取商品评论详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取商品评论详细信息")
|
@ApiOperation("获取商品评论详细信息")
|
||||||
@RequiresPermissions("product:comment:query")
|
// @RequiresPermissions("product:comment:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||||
public Result<CommentInfo> getInfo(@PathVariable("id") Long id) {
|
public Result<CommentInfo> getInfo(@PathVariable("id") Long id) {
|
||||||
|
|
|
@ -73,9 +73,8 @@ public class ProjectInfoController extends BaseController {
|
||||||
* 获取商品信息详细信息
|
* 获取商品信息详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取商品信息详细信息")
|
@ApiOperation("获取商品信息详细信息")
|
||||||
@RequiresPermissions("product:info:query")
|
// @RequiresPermissions("product:info:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
|
||||||
public Result<ProjectInfo> getInfo(@PathVariable("id") Long id) {
|
public Result<ProjectInfo> getInfo(@PathVariable("id") Long id) {
|
||||||
return Result.success(projectInfoCache.get(id));
|
return Result.success(projectInfoCache.get(id));
|
||||||
}
|
}
|
||||||
|
@ -84,7 +83,7 @@ public class ProjectInfoController extends BaseController {
|
||||||
* 获取商品信息详细信息
|
* 获取商品信息详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取商品信息详细信息")
|
@ApiOperation("获取商品信息详细信息")
|
||||||
@RequiresPermissions("product:info:query")
|
// @RequiresPermissions("product:info:query")
|
||||||
@GetMapping(value = "/cache/{id}")
|
@GetMapping(value = "/cache/{id}")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||||
public Result<ProjectInfo> getCacheInfo(@PathVariable("id") Long id) {
|
public Result<ProjectInfo> getCacheInfo(@PathVariable("id") Long id) {
|
||||||
|
@ -95,7 +94,7 @@ public class ProjectInfoController extends BaseController {
|
||||||
* 获取商品信息详细信息
|
* 获取商品信息详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取商品信息详细信息")
|
@ApiOperation("获取商品信息详细信息")
|
||||||
@RequiresPermissions("product:info:query")
|
// @RequiresPermissions("product:info:query")
|
||||||
@GetMapping(value = "/detail/{id}")
|
@GetMapping(value = "/detail/{id}")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||||
public Result<ProjectDetailResp> getDetailInfo(@PathVariable("id") Long id) {
|
public Result<ProjectDetailResp> getDetailInfo(@PathVariable("id") Long id) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class ProjectSkuInfoController extends BaseController {
|
||||||
* 查询商品SKU列表
|
* 查询商品SKU列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取商品SKU列表")
|
@ApiOperation("获取商品SKU列表")
|
||||||
@RequiresPermissions("product:sku:list")
|
// @RequiresPermissions("product:sku:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo<ProjectSkuInfo>> list(ProjectSkuInfoQueryReq projectSkuInfoQueryReq) {
|
public Result<TableDataInfo<ProjectSkuInfo>> list(ProjectSkuInfoQueryReq projectSkuInfoQueryReq) {
|
||||||
startPage();
|
startPage();
|
||||||
|
@ -65,7 +65,7 @@ public class ProjectSkuInfoController extends BaseController {
|
||||||
* 导出商品SKU列表
|
* 导出商品SKU列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("导出商品SKU列表")
|
@ApiOperation("导出商品SKU列表")
|
||||||
@RequiresPermissions("product:sku:export")
|
// @RequiresPermissions("product:sku:export")
|
||||||
@Log(title = "商品SKU", businessType = BusinessType.EXPORT)
|
@Log(title = "商品SKU", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, ProjectSkuInfo projectSkuInfo) {
|
public void export(HttpServletResponse response, ProjectSkuInfo projectSkuInfo) {
|
||||||
|
@ -78,7 +78,7 @@ public class ProjectSkuInfoController extends BaseController {
|
||||||
* 获取商品SKU详细信息
|
* 获取商品SKU详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取商品SKU详细信息")
|
@ApiOperation("获取商品SKU详细信息")
|
||||||
@RequiresPermissions("product:sku:query")
|
// @RequiresPermissions("product:sku:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||||
public Result<ProjectSkuInfo> getInfo(@PathVariable("id") Long id) {
|
public Result<ProjectSkuInfo> getInfo(@PathVariable("id") Long id) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class RuleAttrInfoController extends BaseController {
|
||||||
* 查询规格详情列表
|
* 查询规格详情列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取规格详情列表")
|
@ApiOperation("获取规格详情列表")
|
||||||
@RequiresPermissions("product:ruleAttr:list")
|
// @RequiresPermissions("product:ruleAttr:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo<RuleAttrInfo>> list(RuleAttrInfoQueryReq ruleAttrInfoQueryReq) {
|
public Result<TableDataInfo<RuleAttrInfo>> list(RuleAttrInfoQueryReq ruleAttrInfoQueryReq) {
|
||||||
startPage();
|
startPage();
|
||||||
|
@ -68,7 +68,7 @@ public class RuleAttrInfoController extends BaseController {
|
||||||
* 获取规格详情详细信息
|
* 获取规格详情详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取规格详情详细信息")
|
@ApiOperation("获取规格详情详细信息")
|
||||||
@RequiresPermissions("product:ruleAttr:query")
|
// @RequiresPermissions("product:ruleAttr:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||||
public Result<RuleAttrInfo> getInfo(@PathVariable("id") Long id) {
|
public Result<RuleAttrInfo> getInfo(@PathVariable("id") Long id) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class RuleInfoController extends BaseController {
|
||||||
* 查询商品规格列表
|
* 查询商品规格列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取商品规格列表")
|
@ApiOperation("获取商品规格列表")
|
||||||
@RequiresPermissions("product:rule:list")
|
// @RequiresPermissions("product:rule:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result list(RuleInfoQueryReq ruleInfoQueryReq) {
|
public Result list(RuleInfoQueryReq ruleInfoQueryReq) {
|
||||||
boolean isPage = ruleInfoQueryReq.getParams().get("isPage") == null || Convert.toBool(ruleInfoQueryReq.getParams().get("isPage"), true);
|
boolean isPage = ruleInfoQueryReq.getParams().get("isPage") == null || Convert.toBool(ruleInfoQueryReq.getParams().get("isPage"), true);
|
||||||
|
@ -62,7 +62,7 @@ public class RuleInfoController extends BaseController {
|
||||||
* 导出商品规格列表
|
* 导出商品规格列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("导出商品规格列表")
|
@ApiOperation("导出商品规格列表")
|
||||||
@RequiresPermissions("product:rule:export")
|
// @RequiresPermissions("product:rule:export")
|
||||||
@Log(title = "商品规格", businessType = BusinessType.EXPORT)
|
@Log(title = "商品规格", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, RuleInfo ruleInfo) {
|
public void export(HttpServletResponse response, RuleInfo ruleInfo) {
|
||||||
|
@ -75,7 +75,7 @@ public class RuleInfoController extends BaseController {
|
||||||
* 获取商品规格详细信息
|
* 获取商品规格详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取商品规格详细信息")
|
@ApiOperation("获取商品规格详细信息")
|
||||||
@RequiresPermissions("product:rule:query")
|
// @RequiresPermissions("product:rule:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||||
public Result<RuleInfoUpdResp> getInfo(@PathVariable("id") Long id) {
|
public Result<RuleInfoUpdResp> getInfo(@PathVariable("id") Long id) {
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-loadbalancer</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- SpringBoot Admin -->
|
<!-- SpringBoot Admin -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
Loading…
Reference in New Issue