Compare commits
3 Commits
master
...
1128/zhuyu
Author | SHA1 | Date |
---|---|---|
|
d23f85f6c8 | |
|
c788779d4c | |
|
67d1a4637b |
21
doc/策略.md
21
doc/策略.md
|
@ -0,0 +1,21 @@
|
||||||
|
# 功能划分
|
||||||
|
## 查看商品列表
|
||||||
|
获取商品列表
|
||||||
|
## 选择团购信息
|
||||||
|
获取团购列表
|
||||||
|
## 选择商品以及规格
|
||||||
|
根据商品id查询规格列表
|
||||||
|
选择商品规格信息
|
||||||
|
## 加入团购
|
||||||
|
填写拼团信息
|
||||||
|
将拼团信息添加到团购执行表中
|
||||||
|
## 完成付款
|
||||||
|
付款接口
|
||||||
|
|
||||||
|
|
||||||
|
### 商品详情页面
|
||||||
|
1.商品详情
|
||||||
|
2.商品评论
|
||||||
|
3.商品商品规格
|
||||||
|
4.商品详情
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
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);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -33,7 +33,7 @@ spring:
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
dataId: sentinel-muyu-gateway
|
dataId: sentinel-muyu-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -3,12 +3,14 @@ package com.muyu.marketing.domain;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -52,6 +54,8 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
|
@ -112,7 +116,8 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
.strategyId(activityTeamInfoSaveModel.getStrategyId())
|
.strategyId(activityTeamInfoSaveModel.getStrategyId())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
public static ActivityTeamInfo TeamUpdateBuild (ActivityTeamInfoUpdModel activityTeamInfoUpdModel){
|
|
||||||
|
public static ActivityTeamInfo updTeamInfoBuild(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||||
return ActivityTeamInfo.builder()
|
return ActivityTeamInfo.builder()
|
||||||
.id(activityTeamInfoUpdModel.getId())
|
.id(activityTeamInfoUpdModel.getId())
|
||||||
.name(activityTeamInfoUpdModel.getName())
|
.name(activityTeamInfoUpdModel.getName())
|
||||||
|
|
|
@ -3,9 +3,11 @@ package com.muyu.marketing.domain;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -41,6 +43,8 @@ public class ActivityTeamOpenInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 结束团购时间
|
* 结束团购时间
|
||||||
*/
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 商品ID
|
* 商品ID
|
||||||
|
|
|
@ -5,9 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||||
|
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动ID
|
* 活动ID
|
||||||
*/
|
*/
|
||||||
private long teamId;
|
private Long teamId;
|
||||||
/**
|
/**
|
||||||
* 商品ID
|
* 商品ID
|
||||||
*/
|
*/
|
||||||
|
@ -76,12 +76,22 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ActivityTeamProductSkuInfo updModelBuild(ActivityTeamProductSkuUpdModel teamProductSkuUpdModel){
|
public static ActivityTeamProductSkuInfo updModelBuild(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
||||||
return ActivityTeamProductSkuInfo.builder()
|
return ActivityTeamProductSkuInfo.builder()
|
||||||
.id(teamProductSkuUpdModel.getId())
|
.id(activityTeamProductSkuUpdModel.getId())
|
||||||
.teamPrice(teamProductSkuUpdModel.getTeamPrice())
|
.teamPrice(activityTeamProductSkuUpdModel.getTeamPrice())
|
||||||
.teamStock(teamProductSkuUpdModel.getTeamStock())
|
.teamStock(activityTeamProductSkuUpdModel.getTeamStock())
|
||||||
.remainStock(teamProductSkuUpdModel.getTeamStock())
|
.remainStock(activityTeamProductSkuUpdModel.getTeamStock())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuInfo buildAddSku(TeamProjectSkuInfoAddReq teamProjectSkuInfoAddReq) {
|
||||||
|
return ActivityTeamProductSkuInfo.builder()
|
||||||
|
.teamId(teamProjectSkuInfoAddReq.getTeamId())
|
||||||
|
.productId(teamProjectSkuInfoAddReq.getProductId())
|
||||||
|
.productSku(teamProjectSkuInfoAddReq.getSku())
|
||||||
|
.teamPrice(teamProjectSkuInfoAddReq.getTeamPrice())
|
||||||
|
.teamStock(teamProjectSkuInfoAddReq.getTeamStock())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,15 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhuyufeng
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "team_strategy_exemption", autoResultMap = true)
|
@TableName(value = "team_strategy_exemption_free", autoResultMap = true)
|
||||||
public class TeamStrategyExemption extends BaseEntity {
|
public class TeamStrategyExemption extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,7 +13,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "team_strategy_exemption_hundred", autoResultMap = true)
|
@TableName(value = "team_strategy_exemption_hundred", autoResultMap = true)
|
||||||
public class TeamStrategyHundred extends BaseEntity {
|
public class TeamStrategyExemptionHundred extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
|
@ -13,7 +13,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "team_strategy_exemption_ordinary", autoResultMap = true)
|
@TableName(value = "team_strategy_exemption_ordinary", autoResultMap = true)
|
||||||
public class TeamStrategyOrdinary extends BaseEntity {
|
public class TeamStrategyExemptionOrdinary extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
|
@ -6,6 +6,7 @@ import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -55,7 +56,8 @@ public class ActivityTeamDetailModel {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
|
|
|
@ -7,6 +7,7 @@ import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -53,12 +54,13 @@ public class ActivityTeamInfoAddModel {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Long sort;
|
private Integer sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.common.core.web.model.QueryModel;
|
import com.muyu.common.core.web.model.QueryModel;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -29,6 +31,8 @@ public class ActivityTeamInfoListModel {
|
||||||
* 拼团名称
|
* 拼团名称
|
||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
private Long productId;
|
||||||
/**
|
/**
|
||||||
* 参团人数
|
* 参团人数
|
||||||
*/
|
*/
|
||||||
|
@ -40,6 +44,8 @@ public class ActivityTeamInfoListModel {
|
||||||
/**
|
/**
|
||||||
* 团购结束时间
|
* 团购结束时间
|
||||||
*/
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 开团人数
|
* 开团人数
|
||||||
|
@ -75,6 +81,7 @@ public class ActivityTeamInfoListModel {
|
||||||
ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
.id(activityTeamInfo.getId())
|
||||||
.name(activityTeamInfo.getName())
|
.name(activityTeamInfo.getName())
|
||||||
|
.productId(activityTeamInfo.getProductId())
|
||||||
// .openTeamNumber(teamOpenTypeNumber)
|
// .openTeamNumber(teamOpenTypeNumber)
|
||||||
// .addTeamNumber(teamInTypeNumber)
|
// .addTeamNumber(teamInTypeNumber)
|
||||||
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||||
|
@ -90,6 +97,7 @@ public class ActivityTeamInfoListModel {
|
||||||
ActivityTeamInfoListModel.builder()
|
ActivityTeamInfoListModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
.id(activityTeamInfo.getId())
|
||||||
.name(activityTeamInfo.getName())
|
.name(activityTeamInfo.getName())
|
||||||
|
.productId(activityTeamInfo.getProductId())
|
||||||
.endTime(activityTeamInfo.getEndTime())
|
.endTime(activityTeamInfo.getEndTime())
|
||||||
.productImage(activityTeamInfo.getProductImage())
|
.productImage(activityTeamInfo.getProductImage())
|
||||||
.status(activityTeamInfo.getStatus())
|
.status(activityTeamInfo.getStatus())
|
||||||
|
|
|
@ -6,6 +6,7 @@ import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -51,12 +52,13 @@ public class ActivityTeamInfoSaveModel {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Long sort;
|
private Integer sort;
|
||||||
/**
|
/**
|
||||||
* 活动详情
|
* 活动详情
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuUpdReq;
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoUpdReq;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -24,20 +24,62 @@ import java.util.List;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
public class ActivityTeamInfoUpdModel {
|
public class ActivityTeamInfoUpdModel {
|
||||||
|
|
||||||
|
/** 主键自增 */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/** 活动表名称 */
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/** 主键商品id */
|
||||||
private Long productId;
|
private Long productId;
|
||||||
|
|
||||||
|
/** 商品图片 */
|
||||||
private String productImage;
|
private String productImage;
|
||||||
|
|
||||||
|
/** 活动介绍 */
|
||||||
private String introduction;
|
private String introduction;
|
||||||
|
|
||||||
|
/** 单位 */
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
|
/** 轮播图 */
|
||||||
private String imageList;
|
private String imageList;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
|
|
||||||
|
/** 排序 */
|
||||||
private Long sort;
|
private Long sort;
|
||||||
|
|
||||||
|
/** 主键介绍 */
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
/** 活动状态 */
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/** 策略类型 */
|
||||||
private String strategyType;
|
private String strategyType;
|
||||||
|
|
||||||
|
/** 策略id */
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
private ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel;
|
|
||||||
|
/**
|
||||||
|
* 拼团商品sku集合
|
||||||
|
*/
|
||||||
|
private List<Long> teamProductSkuIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改的活动商品sku集合
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuUpdReq> activityTeamProductSkuList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增的活动商品sku集合
|
||||||
|
*/
|
||||||
|
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddList;
|
||||||
|
|
||||||
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
return ActivityTeamInfoUpdModel.builder()
|
return ActivityTeamInfoUpdModel.builder()
|
||||||
|
@ -54,12 +96,10 @@ public class ActivityTeamInfoUpdModel {
|
||||||
.status(activityTeamInfoUpdReq.getStatus())
|
.status(activityTeamInfoUpdReq.getStatus())
|
||||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||||
.activityTeamProductSkuSettingModel(
|
.teamProductSkuIds(activityTeamInfoUpdReq.getTeamProductSkuIds())
|
||||||
ActivityTeamProductSkuSettingModel.settingReqModel(
|
.activityTeamProductSkuList(activityTeamInfoUpdReq.getActivityTeamProductSkuList())
|
||||||
activityTeamInfoUpdReq.getActivityTeamProductSkuSettingReq(),
|
.teamProjectSkuInfoAddList(activityTeamInfoUpdReq.getTeamProjectSkuInfoAddList())
|
||||||
activityTeamInfoUpdReq::getProductId
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购商品规格一键设置
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-28 11:15
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ActivityTeamProductSkuSettingModel {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动ID
|
|
||||||
*/
|
|
||||||
private Long teamId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除的ID集合
|
|
||||||
*/
|
|
||||||
private List<Long> removeIds;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的规格集合
|
|
||||||
*/
|
|
||||||
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改的规格集合
|
|
||||||
*/
|
|
||||||
private List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList;
|
|
||||||
|
|
||||||
public static ActivityTeamProductSkuSettingModel settingReqModel(ActivityTeamProductSkuSettingReq activityTeamProductSkuSettingReq, Supplier<Long> productId) {
|
|
||||||
return ActivityTeamProductSkuSettingModel.builder()
|
|
||||||
.removeIds(activityTeamProductSkuSettingReq.getRemoveIds())
|
|
||||||
.activityTeamProductSkuAddModelList(
|
|
||||||
activityTeamProductSkuSettingReq.getTeamProjectSkuInfoAddReqList().stream()
|
|
||||||
.map(teamProjectSkuInfoAddReq -> ActivityTeamProductSkuAddModel.addReqBuild(teamProjectSkuInfoAddReq, productId))
|
|
||||||
.toList()
|
|
||||||
)
|
|
||||||
.activityTeamProductSkuUpdModelList(
|
|
||||||
activityTeamProductSkuSettingReq.getTeamProjectSkuInfoUpdReqList().stream()
|
|
||||||
.map(ActivityTeamProductSkuUpdModel::updReqBuild)
|
|
||||||
.toList()
|
|
||||||
).build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoUpdReq;
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuUpdReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -36,11 +36,11 @@ public class ActivityTeamProductSkuUpdModel {
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
|
|
||||||
public static ActivityTeamProductSkuUpdModel updReqBuild(TeamProjectSkuInfoUpdReq teamProjectSkuInfoUpdReq){
|
public static ActivityTeamProductSkuUpdModel skuUpdBuild(ActivityTeamProductSkuUpdReq activityTeamProductSkuUpdReq) {
|
||||||
return ActivityTeamProductSkuUpdModel.builder()
|
return ActivityTeamProductSkuUpdModel.builder()
|
||||||
.id(teamProjectSkuInfoUpdReq.getId())
|
.id(activityTeamProductSkuUpdReq.getId())
|
||||||
.teamStock(teamProjectSkuInfoUpdReq.getTeamStock())
|
.teamPrice(activityTeamProductSkuUpdReq.getTeamPrice())
|
||||||
.teamPrice(teamProjectSkuInfoUpdReq.getTeamPrice())
|
.teamStock(activityTeamProductSkuUpdReq.getTeamStock())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -46,12 +47,13 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Long sort;
|
private Integer sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package com.muyu.marketing.domain.req;
|
package com.muyu.marketing.domain.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -19,18 +21,61 @@ import java.util.List;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
public class ActivityTeamInfoUpdReq {
|
public class ActivityTeamInfoUpdReq {
|
||||||
|
|
||||||
|
/** 主键自增 */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/** 活动表名称 */
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/** 主键商品id */
|
||||||
private Long productId;
|
private Long productId;
|
||||||
|
|
||||||
|
/** 商品图片 */
|
||||||
private String productImage;
|
private String productImage;
|
||||||
|
|
||||||
|
/** 活动简介 */
|
||||||
private String introduction;
|
private String introduction;
|
||||||
|
|
||||||
|
/** 单位 */
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
|
/** 轮播图 */
|
||||||
private String imageList;
|
private String imageList;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
|
|
||||||
|
/** 排序 */
|
||||||
private Long sort;
|
private Long sort;
|
||||||
|
|
||||||
|
/** 详情 */
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
/** 活动状态 */
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/** 策略类型 */
|
||||||
private String strategyType;
|
private String strategyType;
|
||||||
|
|
||||||
|
/** 策略id */
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
private ActivityTeamProductSkuSettingReq activityTeamProductSkuSettingReq;
|
|
||||||
|
/**
|
||||||
|
* 拼团商品sku集合
|
||||||
|
*/
|
||||||
|
private List<Long> teamProductSkuIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改的活动商品sku集合
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuUpdReq> activityTeamProductSkuList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增的活动商品sku集合
|
||||||
|
*/
|
||||||
|
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
package com.muyu.marketing.domain.req;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购商品规格设置
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-28 11:27
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ActivityTeamProductSkuSettingReq {
|
|
||||||
/**
|
|
||||||
* 删除的ID集合
|
|
||||||
*/
|
|
||||||
private List<Long> removeIds;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的规格集合
|
|
||||||
*/
|
|
||||||
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的规格集合
|
|
||||||
*/
|
|
||||||
private List<TeamProjectSkuInfoUpdReq> teamProjectSkuInfoUpdReqList;
|
|
||||||
}
|
|
|
@ -3,31 +3,32 @@ package com.muyu.marketing.domain.req;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加的
|
* @Author 夜は眠れるかい?
|
||||||
|
* @Date 2024/11/27 16:49
|
||||||
|
*
|
||||||
|
* 修改活动商品sku的req
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class TeamProjectSkuInfoUpdReq {
|
public class ActivityTeamProductSkuUpdReq {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格SKU
|
* 商品规格ID
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团价格
|
* 团购价格
|
||||||
*/
|
*/
|
||||||
private BigDecimal teamPrice;
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团库存
|
* 团购库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
}
|
}
|
|
@ -9,6 +9,7 @@ import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加的
|
* 添加的
|
||||||
|
* @author zhuyufeng
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
|
@ -16,6 +17,16 @@ import java.math.BigDecimal;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class TeamProjectSkuInfoAddReq {
|
public class TeamProjectSkuInfoAddReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动id
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品id
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格SKU
|
* 规格SKU
|
||||||
*/
|
*/
|
||||||
|
@ -30,4 +41,6 @@ public class TeamProjectSkuInfoAddReq {
|
||||||
* 拼团库存
|
* 拼团库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -52,7 +53,8 @@ public class ActivityTeamDetailResp extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
|
|
|
@ -2,11 +2,11 @@ package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
||||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -55,7 +55,8 @@ public class TeamInfoFindByIdResp {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -24,6 +26,9 @@ public class TeamInfoListResp {
|
||||||
* 拼团名称
|
* 拼团名称
|
||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参团人数
|
* 参团人数
|
||||||
*/
|
*/
|
||||||
|
@ -35,6 +40,8 @@ public class TeamInfoListResp {
|
||||||
/**
|
/**
|
||||||
* 团购结束时间
|
* 团购结束时间
|
||||||
*/
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 开团人数
|
* 开团人数
|
||||||
|
@ -74,6 +81,7 @@ public class TeamInfoListResp {
|
||||||
return TeamInfoListResp.builder()
|
return TeamInfoListResp.builder()
|
||||||
.id(activityTeamInfoListModel.getId())
|
.id(activityTeamInfoListModel.getId())
|
||||||
.name(activityTeamInfoListModel.getName())
|
.name(activityTeamInfoListModel.getName())
|
||||||
|
.productId(activityTeamInfoListModel.getProductId())
|
||||||
.openTeamNumber(activityTeamInfoListModel.getOpenTeamNumber())
|
.openTeamNumber(activityTeamInfoListModel.getOpenTeamNumber())
|
||||||
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
||||||
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package com.muyu.marketing.team.controller;
|
package com.muyu.marketing.team.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
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.ActivityTeamInfoUpdModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||||
|
@ -13,6 +15,7 @@ import com.muyu.marketing.domain.resp.TeamInfoFindByIdResp;
|
||||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -28,10 +31,11 @@ import java.util.List;
|
||||||
public class ActivityTeamController {
|
public class ActivityTeamController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamInfoService activityTeamInfoService;;
|
private ActivityTeamInfoService activityTeamInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询营销团购活动列表
|
* 查询营销团购活动列表
|
||||||
|
*
|
||||||
* @param teamInfoListReq 活动查询入参
|
* @param teamInfoListReq 活动查询入参
|
||||||
* @return 活动响应结果
|
* @return 活动响应结果
|
||||||
*/
|
*/
|
||||||
|
@ -40,16 +44,16 @@ public class ActivityTeamController {
|
||||||
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = activityTeamInfoService.query(teamInfoListReq.buildQueryModel());
|
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = activityTeamInfoService.query(teamInfoListReq.buildQueryModel());
|
||||||
List<TeamInfoListResp> respList = tableDataInfo.getRows().stream().map(TeamInfoListResp::listModelBuild).toList();
|
List<TeamInfoListResp> respList = tableDataInfo.getRows().stream().map(TeamInfoListResp::listModelBuild).toList();
|
||||||
return Result.success(
|
return Result.success(
|
||||||
new TableDataInfo<>(){{
|
new TableDataInfo<>() {{
|
||||||
setRows(respList);
|
setRows(respList);
|
||||||
setTotal(tableDataInfo.getTotal());
|
setTotal(respList.size());
|
||||||
}}
|
}}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加团购活动
|
* 添加团购活动
|
||||||
|
*
|
||||||
* @param activityTeamInfoSaveReq 添加请求对象
|
* @param activityTeamInfoSaveReq 添加请求对象
|
||||||
* @return 结果集
|
* @return 结果集
|
||||||
*/
|
*/
|
||||||
|
@ -60,12 +64,31 @@ public class ActivityTeamController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/findById/{id}")
|
@PostMapping("/findById/{id}")
|
||||||
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id) {
|
||||||
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
||||||
}
|
}
|
||||||
@PutMapping("/updateByTeamId")
|
|
||||||
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
/**
|
||||||
|
* 修改拼团活动信息
|
||||||
|
*
|
||||||
|
* @param activityTeamInfoUpdReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping("/updateActivityTeamInfo")
|
||||||
|
public Result<?> updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq) {
|
||||||
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据商品ID查询活动列表
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("getTeamListByProductId/{id}")
|
||||||
|
public Result<List<ActivityTeamInfo>> getTeamListByProductId(@PathVariable Long id){
|
||||||
|
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(ActivityTeamInfo::getProductId,id);
|
||||||
|
return Result.success(this.activityTeamInfoService.list(queryWrapper));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyExemptionHundred> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TeamStrategyExemptionOrdinaryMapper extends BaseMapper<TeamStrategyExemptionOrdinary> {
|
||||||
|
|
||||||
|
}
|
|
@ -1,10 +0,0 @@
|
||||||
package com.muyu.marketing.team.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface TeamStrategyHundredMapper extends BaseMapper<TeamStrategyHundred> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
package com.muyu.marketing.team.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface TeamStrategyOrdinaryMapper extends BaseMapper<TeamStrategyOrdinary> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -33,7 +33,6 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
* @param activityTeamInfoUpdModel 团购活动信息
|
* @param activityTeamInfoUpdModel 团购活动信息
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
public void update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ 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;
|
||||||
|
@ -45,29 +46,20 @@ 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信息
|
||||||
* @param activityTeamProductSkuUpdModel 修改业务模型
|
*
|
||||||
* @return 修改结果
|
* @param activityTeamProductSkuUpdModel
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel);
|
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据 业务模型 进行 团购商品批量修改
|
* 修改团购商品sku信息(批量修改)
|
||||||
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
*
|
||||||
* @return 修改结果
|
* @param activityTeamProductSkuUpdModelList
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList);
|
public void batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList);
|
||||||
|
|
||||||
/**
|
|
||||||
* 一键设置
|
|
||||||
* @param activityTeamProductSkuSettingModel 整体修改模型
|
|
||||||
*/
|
|
||||||
public default void setting(ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel){
|
|
||||||
this.batchSave(activityTeamProductSkuSettingModel.getActivityTeamProductSkuAddModelList());
|
|
||||||
this.batchUpdate(activityTeamProductSkuSettingModel.getActivityTeamProductSkuUpdModelList());
|
|
||||||
this.removeByIds(activityTeamProductSkuSettingModel.getRemoveIds());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
|
||||||
|
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred> {
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
|
||||||
|
public interface TeamStrategyExemptionOrdinaryService extends IService<TeamStrategyExemptionOrdinary> {
|
||||||
|
}
|
|
@ -2,10 +2,12 @@ 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;
|
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @author zhuyufeng
|
||||||
* 免单
|
* 免单
|
||||||
*/
|
*/
|
||||||
public interface TeamStrategyExemptionService extends ActivityTeamStrategy, IService<TeamStrategyExemption> {
|
public interface TeamStrategyExemptionService extends ActivityTeamStrategy,IService<TeamStrategyExemption> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.muyu.marketing.team.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百人
|
|
||||||
*/
|
|
||||||
public interface TeamStrategyHundredService extends ActivityTeamStrategy, IService<TeamStrategyHundred> {
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.muyu.marketing.team.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 普通
|
|
||||||
*/
|
|
||||||
public interface TeamStrategyOrdinaryService extends ActivityTeamStrategy, IService<TeamStrategyOrdinary> {
|
|
||||||
}
|
|
|
@ -3,24 +3,29 @@ 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.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuUpdReq;
|
||||||
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.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
||||||
implements ActivityTeamInfoService {
|
implements ActivityTeamInfoService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||||
|
@ -81,6 +86,7 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询商品的详情
|
* 根据ID查询商品的详情
|
||||||
|
*
|
||||||
* @param id 团购活动ID
|
* @param id 团购活动ID
|
||||||
* @return 团购详情
|
* @return 团购详情
|
||||||
*/
|
*/
|
||||||
|
@ -95,14 +101,37 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改团购活动信息
|
* 修改团购活动信息
|
||||||
|
*
|
||||||
* @param activityTeamInfoUpdModel 团购活动信息
|
* @param activityTeamInfoUpdModel 团购活动信息
|
||||||
* @return 是否成功
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
@Transactional(rollbackFor = {ServiceException.class})
|
||||||
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
public void update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||||
Assert.isTrue(update,"修改失败");
|
//判断活动状态是否是关闭状态
|
||||||
activityTeamProductSkuInfoService.setting(activityTeamInfoUpdModel.getActivityTeamProductSkuSettingModel());
|
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
return update;
|
queryWrapper.eq(ActivityTeamInfo::getId,activityTeamInfoUpdModel.getId());
|
||||||
|
ActivityTeamInfo activityTeamInfo = this.getOne(queryWrapper);
|
||||||
|
if ("已开启".equals(activityTeamInfo.getStatus())){
|
||||||
|
throw new ServiceException("活动已开启,无法修改");
|
||||||
|
}
|
||||||
|
//修改拼团活动表信息
|
||||||
|
this.updateById(ActivityTeamInfo.updTeamInfoBuild(activityTeamInfoUpdModel));
|
||||||
|
//根据根据前台传过来的skuIds集合,批量删除团购商品sku集合
|
||||||
|
activityTeamProductSkuInfoService.removeBatchByIds(activityTeamInfoUpdModel.getTeamProductSkuIds());
|
||||||
|
//批量添加团购商品sku集合
|
||||||
|
activityTeamProductSkuInfoService.saveBatch(
|
||||||
|
//将activityTeamInfoUpdModel类型转成ActivityTeamProductSkuInfo类型集合
|
||||||
|
activityTeamInfoUpdModel.getTeamProjectSkuInfoAddList().stream()
|
||||||
|
.map(ActivityTeamProductSkuInfo::buildAddSku)
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
//根据activityTeamProductSkuList集合,批量修改团购商品sku集合
|
||||||
|
List<ActivityTeamProductSkuUpdReq> activityTeamProductSkuList = activityTeamInfoUpdModel.getActivityTeamProductSkuList();
|
||||||
|
activityTeamProductSkuInfoService.batchUpdate(
|
||||||
|
activityTeamProductSkuList.stream()
|
||||||
|
.map(ActivityTeamProductSkuUpdModel::skuUpdBuild)
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||||
|
@ -96,43 +97,33 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
|
||||||
@Override
|
|
||||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList) {
|
|
||||||
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据 业务模型 进行 团购商品修改
|
* 修改团购商品sku信息(单个信息修改)
|
||||||
*
|
*
|
||||||
* @param activityTeamProductSkuUpdModel 修改业务模型
|
* @param activityTeamProductSkuUpdModel
|
||||||
* @return 修改结果
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
||||||
// update set where
|
|
||||||
LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
// 字段=值
|
|
||||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock,activityTeamProductSkuUpdModel.getTeamStock());
|
|
||||||
updateWrapper.set(ActivityTeamProductSkuInfo::getRemainStock,activityTeamProductSkuUpdModel.getTeamStock());
|
|
||||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice,activityTeamProductSkuUpdModel.getTeamPrice());
|
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice,activityTeamProductSkuUpdModel.getTeamPrice());
|
||||||
// id=?
|
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock,activityTeamProductSkuUpdModel.getTeamStock());
|
||||||
updateWrapper.eq(ActivityTeamProductSkuInfo::getId,activityTeamProductSkuUpdModel.getId());
|
updateWrapper.eq(ActivityTeamProductSkuInfo::getId,activityTeamProductSkuUpdModel.getId());
|
||||||
return this.update(updateWrapper);
|
return this.update(updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据 业务模型 进行 团购商品批量修改
|
* 修改团购商品sku信息(批量修改)
|
||||||
*
|
*
|
||||||
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
* @param activityTeamProductSkuUpdModelList
|
||||||
* @return 修改结果
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
public void batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
||||||
return this.updateBatchById(
|
List<ActivityTeamProductSkuInfo> teamProductSkuInfos = activityTeamProductSkuUpdModelList.stream()
|
||||||
activityTeamProductSkuUpdModelList.stream()
|
.map(ActivityTeamProductSkuInfo::updModelBuild)
|
||||||
.map(ActivityTeamProductSkuInfo::updModelBuild)
|
.toList();
|
||||||
.toList()
|
this.updateBatchById(teamProductSkuInfos);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhuyufeng
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred>
|
||||||
|
implements TeamStrategyExemptionHundredService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhuyufeng
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary>
|
||||||
|
implements TeamStrategyExemptionOrdinaryService {
|
||||||
|
|
||||||
|
}
|
|
@ -4,62 +4,37 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Log4j2
|
/**
|
||||||
@Service("team-strategy-exemption")
|
* @author zhuyufeng
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||||
implements TeamStrategyExemptionService {
|
implements TeamStrategyExemptionService {
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void openTeam(Long activityTeamId) {
|
public void openTeam(Long activityTeamId) {
|
||||||
log.info("参加 - 免单团 - [{}]", activityTeamId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void applyTeam(Long teamId) {
|
public void applyTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
public void addTeam(Long teamId, String orderNumber) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void backTeam(Long teamId) {
|
public void exitTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void settle(Long teamId) {
|
public void settleTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,66 +0,0 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyHundredMapper;
|
|
||||||
import com.muyu.marketing.team.service.TeamStrategyHundredService;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
@Service("team-strategy-hundred")
|
|
||||||
public class TeamStrategyHundredServiceImpl extends ServiceImpl<TeamStrategyHundredMapper, TeamStrategyHundred>
|
|
||||||
implements TeamStrategyHundredService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId) {
|
|
||||||
|
|
||||||
log.info("参加 - 百人团 - [{}]", activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void backTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settle(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyOrdinaryMapper;
|
|
||||||
import com.muyu.marketing.team.service.TeamStrategyOrdinaryService;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
@Service("team-strategy-ordinary")
|
|
||||||
public class TeamStrategyOrdinaryServiceImpl extends ServiceImpl<TeamStrategyOrdinaryMapper, TeamStrategyOrdinary>
|
|
||||||
implements TeamStrategyOrdinaryService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId) {
|
|
||||||
|
|
||||||
log.info("参加 - 普通团 - [{}]", activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void backTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settle(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +1,45 @@
|
||||||
package com.muyu.marketing.team.strategy;
|
package com.muyu.marketing.team.strategy;
|
||||||
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团活动策略
|
* @Author 夜は眠れるかい?
|
||||||
*
|
* @Date 2024/11/29 16:49
|
||||||
* @author DongZeLiang
|
* 好好学习,天天向上
|
||||||
* @date 2024-11-29 15:03
|
|
||||||
*/
|
*/
|
||||||
public interface ActivityTeamStrategy {
|
public interface ActivityTeamStrategy {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开团
|
* 开团
|
||||||
* @param activityTeamId 团购活动ID
|
*
|
||||||
|
* @param activityTeamId 团购活动id
|
||||||
*/
|
*/
|
||||||
public void openTeam(Long activityTeamId);
|
public void openTeam(Long activityTeamId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请加团
|
* 申请加团
|
||||||
* @param teamId 团ID
|
*
|
||||||
|
* @param teamId 团id
|
||||||
*/
|
*/
|
||||||
public void applyTeam(Long teamId);
|
public void applyTeam(Long teamId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参团
|
* 参团
|
||||||
* @param teamId 加团ID
|
*
|
||||||
|
* @param teamId 团id
|
||||||
* @param orderNumber 订单编号
|
* @param orderNumber 订单编号
|
||||||
*/
|
*/
|
||||||
public void addTeam(Long teamId, String orderNumber);
|
public void addTeam(Long teamId, String orderNumber);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退团
|
* 退出团
|
||||||
* @param teamId 团购ID
|
*
|
||||||
|
* @param teamId
|
||||||
*/
|
*/
|
||||||
public void backTeam(Long teamId);
|
public void exitTeam(Long teamId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结算团
|
* 结算团
|
||||||
* @param teamId 团购ID
|
*
|
||||||
|
* @param teamId
|
||||||
*/
|
*/
|
||||||
public void settle(Long teamId);
|
public void settleTeam(Long teamId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,85 +0,0 @@
|
||||||
package com.muyu.marketing.team.strategy.impl;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
|
||||||
import com.muyu.common.core.utils.SpringUtils;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购执行器
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-29 15:28
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Primary
|
|
||||||
public class ActivityTeamStrategyImpl implements ActivityTeamStrategy {
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId) {
|
|
||||||
// 假设这里是通过方法获取的type,activityTeamId.toString()
|
|
||||||
// "team-strategy-exemption"
|
|
||||||
// "team-strategy-hundred"
|
|
||||||
// "team-strategy-ordinary"
|
|
||||||
|
|
||||||
String activityTeamType = null;
|
|
||||||
if (activityTeamId == null) {
|
|
||||||
throw new ServiceException("activityTeamId is null");
|
|
||||||
}else if (activityTeamId == 0) {
|
|
||||||
activityTeamType = "team-strategy-exemption";
|
|
||||||
}else if (activityTeamId == 1) {
|
|
||||||
activityTeamType = "team-strategy-hundred";
|
|
||||||
}else if (activityTeamId == 2) {
|
|
||||||
activityTeamType = "team-strategy-ordinary";
|
|
||||||
}
|
|
||||||
ActivityTeamStrategy activityTeamStrategy = SpringUtils.getBean(activityTeamType);
|
|
||||||
activityTeamStrategy.openTeam(activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void backTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settle(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-buy
|
name: muyu-team
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
package com.muyu.test;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.MuYuMarketIngApplication;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-29 15:40
|
|
||||||
*/
|
|
||||||
@SpringBootTest(classes = MuYuMarketIngApplication.class)
|
|
||||||
public class TeamStrategyTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamStrategy activityTeamStrategy;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testStrategy() {
|
|
||||||
activityTeamStrategy.openTeam(0L);
|
|
||||||
activityTeamStrategy.openTeam(1L);
|
|
||||||
activityTeamStrategy.openTeam(2L);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -16,10 +16,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.35.234.240:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
Loading…
Reference in New Issue