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