Compare commits
1 Commits
1202/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:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
package com.muyu.common.core.constant;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author 夜は眠れるかい?
|
|
||||||
* @Date 2024/12/1 19:46
|
|
||||||
* 好好学习,天天向上
|
|
||||||
*/
|
|
||||||
public class TeamOpenKeyConstants {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团标识
|
|
||||||
*/
|
|
||||||
public static final String TEAM_OPEN_KEY = "team_open_key:";
|
|
||||||
}
|
|
|
@ -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:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -33,7 +33,7 @@ spring:
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1: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: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.46.147.226:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.46.147.226:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.46.147.226:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.46.147.226:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -3,20 +3,15 @@ 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;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@ -57,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;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
|
@ -119,8 +112,7 @@ 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,17 +3,12 @@ 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;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@ -26,11 +21,11 @@ public class ActivityTeamOpenInfo extends BaseEntity {
|
||||||
* 主键
|
* 主键
|
||||||
*/
|
*/
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Long id;
|
private long id;
|
||||||
/**
|
/**
|
||||||
* 团购活动ID
|
* 团购活动ID
|
||||||
*/
|
*/
|
||||||
private Long teamId;
|
private long teamId;
|
||||||
/**
|
/**
|
||||||
* 团购类型
|
* 团购类型
|
||||||
*/
|
*/
|
||||||
|
@ -38,7 +33,7 @@ public class ActivityTeamOpenInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 团购策略
|
* 团购策略
|
||||||
*/
|
*/
|
||||||
private Long teamStrategyId;
|
private String teamStrategyId;
|
||||||
/**
|
/**
|
||||||
* 参团类型
|
* 参团类型
|
||||||
*/
|
*/
|
||||||
|
@ -46,13 +41,11 @@ 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
|
||||||
*/
|
*/
|
||||||
private Long productId;
|
private String productId;
|
||||||
/**
|
/**
|
||||||
* 商品名称
|
* 商品名称
|
||||||
*/
|
*/
|
||||||
|
@ -64,7 +57,7 @@ public class ActivityTeamOpenInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 开团标识
|
* 开团标识
|
||||||
*/
|
*/
|
||||||
private String openKey;
|
private String key;
|
||||||
/**
|
/**
|
||||||
* 订单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,22 +76,12 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ActivityTeamProductSkuInfo updModelBuild(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
public static ActivityTeamProductSkuInfo updModelBuild(ActivityTeamProductSkuUpdModel teamProductSkuUpdModel){
|
||||||
return ActivityTeamProductSkuInfo.builder()
|
return ActivityTeamProductSkuInfo.builder()
|
||||||
.id(activityTeamProductSkuUpdModel.getId())
|
.id(teamProductSkuUpdModel.getId())
|
||||||
.teamPrice(activityTeamProductSkuUpdModel.getTeamPrice())
|
.teamPrice(teamProductSkuUpdModel.getTeamPrice())
|
||||||
.teamStock(activityTeamProductSkuUpdModel.getTeamStock())
|
.teamStock(teamProductSkuUpdModel.getTeamStock())
|
||||||
.remainStock(activityTeamProductSkuUpdModel.getTeamStock())
|
.remainStock(teamProductSkuUpdModel.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,15 +7,12 @@ 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_free", autoResultMap = true)
|
@TableName(value = "team_strategy_exemption", autoResultMap = true)
|
||||||
public class TeamStrategyExemption extends BaseEntity {
|
public class TeamStrategyExemption extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,16 +7,13 @@ 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_hundred", autoResultMap = true)
|
@TableName(value = "team_strategy_exemption_hundred", autoResultMap = true)
|
||||||
public class TeamStrategyExemptionHundred extends BaseEntity {
|
public class TeamStrategyHundred extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
|
@ -13,7 +13,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "team_strategy_exemption_ordinary", autoResultMap = true)
|
@TableName(value = "team_strategy_exemption_ordinary", autoResultMap = true)
|
||||||
public class TeamStrategyExemptionOrdinary extends BaseEntity {
|
public class TeamStrategyOrdinary extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
|
@ -6,7 +6,6 @@ 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;
|
||||||
|
@ -56,8 +55,7 @@ public class ActivityTeamDetailModel {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
|
|
|
@ -7,7 +7,6 @@ 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;
|
||||||
|
@ -54,13 +53,12 @@ public class ActivityTeamInfoAddModel {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
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;
|
||||||
|
@ -31,8 +29,6 @@ public class ActivityTeamInfoListModel {
|
||||||
* 拼团名称
|
* 拼团名称
|
||||||
*/
|
*/
|
||||||
private String name;
|
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;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 开团人数
|
* 开团人数
|
||||||
|
@ -81,7 +75,6 @@ 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)
|
||||||
|
@ -97,7 +90,6 @@ 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,7 +6,6 @@ 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;
|
||||||
|
@ -52,13 +51,12 @@ public class ActivityTeamInfoSaveModel {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long 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.ActivityTeamProductSkuUpdReq;
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
||||||
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,62 +24,20 @@ 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()
|
||||||
|
@ -96,10 +54,12 @@ public class ActivityTeamInfoUpdModel {
|
||||||
.status(activityTeamInfoUpdReq.getStatus())
|
.status(activityTeamInfoUpdReq.getStatus())
|
||||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||||
.teamProductSkuIds(activityTeamInfoUpdReq.getTeamProductSkuIds())
|
.activityTeamProductSkuSettingModel(
|
||||||
.activityTeamProductSkuList(activityTeamInfoUpdReq.getActivityTeamProductSkuList())
|
ActivityTeamProductSkuSettingModel.settingReqModel(
|
||||||
.teamProjectSkuInfoAddList(activityTeamInfoUpdReq.getTeamProjectSkuInfoAddList())
|
activityTeamInfoUpdReq.getActivityTeamProductSkuSettingReq(),
|
||||||
|
activityTeamInfoUpdReq::getProductId
|
||||||
|
)
|
||||||
|
)
|
||||||
.build();
|
.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;
|
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.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 skuUpdBuild(ActivityTeamProductSkuUpdReq activityTeamProductSkuUpdReq) {
|
public static ActivityTeamProductSkuUpdModel updReqBuild(TeamProjectSkuInfoUpdReq teamProjectSkuInfoUpdReq){
|
||||||
return ActivityTeamProductSkuUpdModel.builder()
|
return ActivityTeamProductSkuUpdModel.builder()
|
||||||
.id(activityTeamProductSkuUpdReq.getId())
|
.id(teamProjectSkuInfoUpdReq.getId())
|
||||||
.teamPrice(activityTeamProductSkuUpdReq.getTeamPrice())
|
.teamStock(teamProjectSkuInfoUpdReq.getTeamStock())
|
||||||
.teamStock(activityTeamProductSkuUpdReq.getTeamStock())
|
.teamPrice(teamProjectSkuInfoUpdReq.getTeamPrice())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ 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;
|
||||||
|
@ -47,13 +46,12 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
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;
|
||||||
|
@ -21,61 +19,18 @@ 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;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
|
@ -17,16 +16,6 @@ import java.math.BigDecimal;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class TeamProjectSkuInfoAddReq {
|
public class TeamProjectSkuInfoAddReq {
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动id
|
|
||||||
*/
|
|
||||||
private Long teamId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品id
|
|
||||||
*/
|
|
||||||
private Long productId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格SKU
|
* 规格SKU
|
||||||
*/
|
*/
|
||||||
|
@ -41,6 +30,4 @@ public class TeamProjectSkuInfoAddReq {
|
||||||
* 拼团库存
|
* 拼团库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,32 +3,31 @@ 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 ActivityTeamProductSkuUpdReq {
|
public class TeamProjectSkuInfoUpdReq {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品规格ID
|
* 规格SKU
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购价格
|
* 拼团价格
|
||||||
*/
|
*/
|
||||||
private BigDecimal teamPrice;
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购库存
|
* 拼团库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
}
|
}
|
|
@ -8,7 +8,6 @@ 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;
|
||||||
|
@ -53,8 +52,7 @@ public class ActivityTeamDetailResp extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||||
@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,8 +55,7 @@ public class TeamInfoFindByIdResp {
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
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;
|
||||||
|
@ -26,9 +24,6 @@ public class TeamInfoListResp {
|
||||||
* 拼团名称
|
* 拼团名称
|
||||||
*/
|
*/
|
||||||
private String name;
|
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;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
* 开团人数
|
* 开团人数
|
||||||
|
@ -81,7 +74,6 @@ 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())
|
||||||
|
|
|
@ -121,4 +121,4 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
|
@ -3,7 +3,6 @@ package com.muyu.marketing;
|
||||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@ -16,7 +15,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@EnableCustomSwagger2
|
@EnableCustomSwagger2
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@MapperScan("com.muyu.marketing.team.mapper")
|
|
||||||
public class MuYuMarketIngApplication {
|
public class MuYuMarketIngApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(MuYuMarketIngApplication.class, args);
|
SpringApplication.run(MuYuMarketIngApplication.class, args);
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
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;
|
||||||
|
@ -15,7 +13,6 @@ 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;
|
||||||
|
@ -31,11 +28,10 @@ import java.util.List;
|
||||||
public class ActivityTeamController {
|
public class ActivityTeamController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamInfoService activityTeamInfoService;
|
private ActivityTeamInfoService activityTeamInfoService;;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询营销团购活动列表
|
* 查询营销团购活动列表
|
||||||
*
|
|
||||||
* @param teamInfoListReq 活动查询入参
|
* @param teamInfoListReq 活动查询入参
|
||||||
* @return 活动响应结果
|
* @return 活动响应结果
|
||||||
*/
|
*/
|
||||||
|
@ -44,16 +40,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(respList.size());
|
setTotal(tableDataInfo.getTotal());
|
||||||
}}
|
}}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加团购活动
|
* 添加团购活动
|
||||||
*
|
|
||||||
* @param activityTeamInfoSaveReq 添加请求对象
|
* @param activityTeamInfoSaveReq 添加请求对象
|
||||||
* @return 结果集
|
* @return 结果集
|
||||||
*/
|
*/
|
||||||
|
@ -64,31 +60,12 @@ 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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
package com.muyu.marketing.team.controller;
|
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author 夜は眠れるかい?
|
|
||||||
* @Date 2024/12/1 10:37
|
|
||||||
* 好好学习,天天向上
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("teamOpen")
|
|
||||||
public class ActivityTeamOpenController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamStrategy activityTeamStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
* @param activityTeamId
|
|
||||||
* @param teamProjectSkuId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("openTeam/{activityTeamId}/{teamProjectSkuId}")
|
|
||||||
public Result<?> openTeam(@PathVariable Long activityTeamId,@PathVariable Long teamProjectSkuId){
|
|
||||||
activityTeamStrategy.openTeam(activityTeamId,teamProjectSkuId);
|
|
||||||
return Result.success();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -4,9 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo> {
|
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo> {
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,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.ActivityTeamOpenInfo;
|
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ActivityTeamOpenInfoMapper extends BaseMapper<ActivityTeamOpenInfo> {
|
public interface ActivityTeamOpenInfoMapper extends BaseMapper<ActivityTeamOpenInfo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +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;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
@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> {
|
||||||
|
|
||||||
|
}
|
|
@ -5,9 +5,6 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,6 +33,7 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
* @param activityTeamInfoUpdModel 团购活动信息
|
* @param activityTeamInfoUpdModel 团购活动信息
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
public void update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,9 @@ package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,18 +2,14 @@ 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.common.core.domain.Result;
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
||||||
|
|
||||||
public default List<ActivityTeamProductSkuInfo> getActivityTeamProductSkuInfoByTeamId(Long teamId) {
|
public default List<ActivityTeamProductSkuInfo> getActivityTeamProductSkuInfoByTeamId(Long teamId){
|
||||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId, teamId);
|
lambdaQueryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId, teamId);
|
||||||
return this.list(lambdaQueryWrapper);
|
return this.list(lambdaQueryWrapper);
|
||||||
|
@ -22,7 +18,6 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过团购活动ID获取团购中最优惠的价格
|
* 通过团购活动ID获取团购中最优惠的价格
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
* @param teamId 团购ID
|
||||||
* @return 优惠价格
|
* @return 优惠价格
|
||||||
*/
|
*/
|
||||||
|
@ -31,7 +26,6 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过活动ID获取 剩余库存
|
* 通过活动ID获取 剩余库存
|
||||||
*
|
|
||||||
* @param teamId 活动ID
|
* @param teamId 活动ID
|
||||||
* @return 库存
|
* @return 库存
|
||||||
*/
|
*/
|
||||||
|
@ -40,50 +34,40 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加团购商品SKU
|
* 添加团购商品SKU
|
||||||
*
|
|
||||||
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
||||||
*/
|
*/
|
||||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过拼团活动ID获取拼团下商品SKU集合
|
* 通过拼团活动ID获取拼团下商品SKU集合
|
||||||
*
|
|
||||||
* @param teamId 活动ID
|
* @param teamId 活动ID
|
||||||
* @return 拼团商品SKU集合
|
* @return 拼团商品SKU集合
|
||||||
*/
|
*/
|
||||||
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
||||||
|
|
||||||
|
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改团购商品sku信息
|
* 根据 业务模型 进行 团购商品修改
|
||||||
*
|
* @param activityTeamProductSkuUpdModel 修改业务模型
|
||||||
* @param activityTeamProductSkuUpdModel
|
* @return 修改结果
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel);
|
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改团购商品sku信息(批量修改)
|
* 根据 业务模型 进行 团购商品批量修改
|
||||||
*
|
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
||||||
* @param activityTeamProductSkuUpdModelList
|
* @return 修改结果
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public void batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList);
|
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据活动id和商品id获取活动商品sku的集合
|
* 一键设置
|
||||||
*
|
* @param activityTeamProductSkuSettingModel 整体修改模型
|
||||||
* @param teamId
|
|
||||||
* @param productId
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public Result<List<ActivityTeamProductSkuModel>> findListByTeamIdAndProductId(Long teamId, Long productId);
|
public default void setting(ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel){
|
||||||
|
this.batchSave(activityTeamProductSkuSettingModel.getActivityTeamProductSkuAddModelList());
|
||||||
/**
|
this.batchUpdate(activityTeamProductSkuSettingModel.getActivityTeamProductSkuUpdModelList());
|
||||||
* 根据ID获取团购商品SKU信息
|
this.removeByIds(activityTeamProductSkuSettingModel.getRemoveIds());
|
||||||
*
|
}
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result<ActivityTeamProductSkuInfo> findById(Long id);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +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.team.strategy.ActivityTeamStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
public interface TeamStrategyExemptionHundredService extends ActivityTeamStrategy, IService<TeamStrategyExemptionHundred> {
|
|
||||||
|
|
||||||
public void addTeam(Long teamId, String orderNumber);
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.muyu.marketing.team.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
public interface TeamStrategyExemptionOrdinaryService extends ActivityTeamStrategy, IService<TeamStrategyExemptionOrdinary> {
|
|
||||||
}
|
|
|
@ -2,12 +2,10 @@ package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
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,29 +3,24 @@ 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;
|
||||||
|
@ -86,7 +81,6 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询商品的详情
|
* 根据ID查询商品的详情
|
||||||
*
|
|
||||||
* @param id 团购活动ID
|
* @param id 团购活动ID
|
||||||
* @return 团购详情
|
* @return 团购详情
|
||||||
*/
|
*/
|
||||||
|
@ -101,37 +95,14 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改团购活动信息
|
* 修改团购活动信息
|
||||||
*
|
|
||||||
* @param activityTeamInfoUpdModel 团购活动信息
|
* @param activityTeamInfoUpdModel 团购活动信息
|
||||||
* @return
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {ServiceException.class})
|
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||||
public void update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
||||||
//判断活动状态是否是关闭状态
|
Assert.isTrue(update,"修改失败");
|
||||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
activityTeamProductSkuInfoService.setting(activityTeamInfoUpdModel.getActivityTeamProductSkuSettingModel());
|
||||||
queryWrapper.eq(ActivityTeamInfo::getId,activityTeamInfoUpdModel.getId());
|
return update;
|
||||||
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())
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,23 +3,15 @@ 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.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||||
import com.muyu.marketing.team.mapper.ActivityTeamOpenInfoMapper;
|
import com.muyu.marketing.team.mapper.ActivityTeamOpenInfoMapper;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
|
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
|
||||||
implements ActivityTeamOpenInfoService {
|
implements ActivityTeamOpenInfoService {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamOpenInfoMapper activityTeamOpenInfoMapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过活动ID和开团类型查询开团数量
|
* 通过活动ID和开团类型查询开团数量
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.muyu.marketing.team.service.impl;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
|
@ -21,11 +20,10 @@ 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>
|
||||||
implements ActivityTeamProductSkuInfoService {
|
implements ActivityTeamProductSkuInfoService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectSkuCache projectSkuCache;
|
private ProjectSkuCache projectSkuCache;
|
||||||
|
@ -47,7 +45,7 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
return TeamProductDiscountPriceModel.of(projectSkuInfo.getPrice(), activityTeamProductSkuInfo.getTeamPrice());
|
return TeamProductDiscountPriceModel.of(projectSkuInfo.getPrice(), activityTeamProductSkuInfo.getTeamPrice());
|
||||||
}).min((o1, o2) -> Double.valueOf(o1.getDiscount() * 100 - o2.getDiscount() * 100).intValue());
|
}).min((o1, o2) -> Double.valueOf(o1.getDiscount() * 100 - o2.getDiscount() * 100).intValue());
|
||||||
|
|
||||||
if (discountPriceModelOptional.isEmpty()) {
|
if (discountPriceModelOptional.isEmpty()){
|
||||||
throw new ServiceException("团购活动下没有商品绑定");
|
throw new ServiceException("团购活动下没有商品绑定");
|
||||||
}
|
}
|
||||||
return discountPriceModelOptional.get();
|
return discountPriceModelOptional.get();
|
||||||
|
@ -92,68 +90,49 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
@Override
|
@Override
|
||||||
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId) {
|
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId) {
|
||||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId, teamId);
|
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,teamId);
|
||||||
List<ActivityTeamProductSkuInfo> list = this.list(queryWrapper);
|
List<ActivityTeamProductSkuInfo> list = this.list(queryWrapper);
|
||||||
return list.stream().map(ActivityTeamProductSkuModel::FindBuild).toList();
|
return list.stream().map(ActivityTeamProductSkuModel::FindBuild).toList();
|
||||||
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@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::getTeamPrice, activityTeamProductSkuUpdModel.getTeamPrice());
|
// 字段=值
|
||||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock, activityTeamProductSkuUpdModel.getTeamStock());
|
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock,activityTeamProductSkuUpdModel.getTeamStock());
|
||||||
updateWrapper.eq(ActivityTeamProductSkuInfo::getId, activityTeamProductSkuUpdModel.getId());
|
updateWrapper.set(ActivityTeamProductSkuInfo::getRemainStock,activityTeamProductSkuUpdModel.getTeamStock());
|
||||||
|
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice,activityTeamProductSkuUpdModel.getTeamPrice());
|
||||||
|
// id=?
|
||||||
|
updateWrapper.eq(ActivityTeamProductSkuInfo::getId,activityTeamProductSkuUpdModel.getId());
|
||||||
return this.update(updateWrapper);
|
return this.update(updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改团购商品sku信息(批量修改)
|
* 根据 业务模型 进行 团购商品批量修改
|
||||||
*
|
*
|
||||||
* @param activityTeamProductSkuUpdModelList
|
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
||||||
* @return
|
* @return 修改结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
||||||
List<ActivityTeamProductSkuInfo> teamProductSkuInfos = activityTeamProductSkuUpdModelList.stream()
|
return this.updateBatchById(
|
||||||
.map(ActivityTeamProductSkuInfo::updModelBuild)
|
activityTeamProductSkuUpdModelList.stream()
|
||||||
.toList();
|
.map(ActivityTeamProductSkuInfo::updModelBuild)
|
||||||
this.updateBatchById(teamProductSkuInfos);
|
.toList()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据活动id和商品id获取活动商品sku的集合
|
|
||||||
*
|
|
||||||
* @param teamId
|
|
||||||
* @param productId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Result<List<ActivityTeamProductSkuModel>> findListByTeamIdAndProductId(Long teamId, Long productId) {
|
|
||||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId, teamId);
|
|
||||||
queryWrapper.eq(ActivityTeamProductSkuInfo::getProductId, productId);
|
|
||||||
List<ActivityTeamProductSkuInfo> list = this.list(queryWrapper);
|
|
||||||
List<ActivityTeamProductSkuModel> activityTeamProductSkuModels = list.stream().map(ActivityTeamProductSkuModel::FindBuild).toList();
|
|
||||||
return Result.success(activityTeamProductSkuModels);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id获取团购商品sku信息
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Result<ActivityTeamProductSkuInfo> findById(Long id) {
|
|
||||||
ActivityTeamProductSkuInfo teamProductSkuInfo = this.getById(id);
|
|
||||||
return Result.success(teamProductSkuInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,134 +0,0 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.common.core.constant.TeamOpenKeyConstants;
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.common.core.utils.uuid.UUID;
|
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
|
||||||
import com.muyu.marketing.domain.*;
|
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
|
||||||
import com.muyu.marketing.team.service.*;
|
|
||||||
import com.muyu.product.cache.ProjectInfoCache;
|
|
||||||
import com.muyu.product.domain.ProjectInfo;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
@Log4j2
|
|
||||||
@Service("team-strategy-hundred")
|
|
||||||
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred>
|
|
||||||
implements TeamStrategyExemptionHundredService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamInfoService activityTeamInfoService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ProjectInfoCache projectInfoCache;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StringRedisTemplate redisTemplate;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团-百人团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动id
|
|
||||||
* @param activityTeamId 活动商品规格的id
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId,Long teamProjectSkuId) {
|
|
||||||
//添加拼团活动执行表
|
|
||||||
ActivityTeamOpenInfo teamOpenInfo = new ActivityTeamOpenInfo();
|
|
||||||
teamOpenInfo.setTeamId(activityTeamId);
|
|
||||||
teamOpenInfo.setTeamType("百人团");
|
|
||||||
//根据团购活动id查询活动表获取团购策略id
|
|
||||||
ActivityTeamInfo teamInfo = activityTeamInfoService.getById(activityTeamId);
|
|
||||||
teamOpenInfo.setTeamStrategyId(teamInfo.getStrategyId());
|
|
||||||
//参团类型
|
|
||||||
teamOpenInfo.setExecutiveType("开团");
|
|
||||||
//拿到活动结束时间
|
|
||||||
teamOpenInfo.setEndTime(teamInfo.getEndTime());
|
|
||||||
//根据活动对象获取商品信息
|
|
||||||
teamOpenInfo.setProductId(teamInfo.getProductId());
|
|
||||||
ProjectInfo projectInfo = projectInfoCache.get(teamInfo.getProductId());
|
|
||||||
teamOpenInfo.setProductName(projectInfo.getName());
|
|
||||||
//根据活动商品sku的id查询列表,获取商品sku信息
|
|
||||||
Result<ActivityTeamProductSkuInfo> teamProductSkuInfo = activityTeamProductSkuInfoService.findById(teamProjectSkuId);
|
|
||||||
teamOpenInfo.setProductSku(teamProductSkuInfo.getData().getProductSku());
|
|
||||||
//生成开团标识
|
|
||||||
String key = UUID.randomUUID().toString();
|
|
||||||
teamOpenInfo.setOpenKey(key);
|
|
||||||
//获取当前登录人信息
|
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
||||||
teamOpenInfo.setCreateBy(loginUser.getUsername());
|
|
||||||
//执行开团操作
|
|
||||||
boolean save = this.activityTeamOpenInfoService.save(teamOpenInfo);
|
|
||||||
//最后把开团标识存进redis(团购id+用户id+团购活动id,key)
|
|
||||||
if (save){
|
|
||||||
redisTemplate.opsForValue().set(TeamOpenKeyConstants.TEAM_OPEN_KEY+
|
|
||||||
teamOpenInfo.getId()+":"+loginUser.getUserid()+":"
|
|
||||||
+teamOpenInfo.getTeamId(),key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团,得到申请的令牌
|
|
||||||
*
|
|
||||||
* @param teamId 团id
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
* 需要拿到开团标识
|
|
||||||
*
|
|
||||||
* @param teamId 团id
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
//添加拼团活动执行表
|
|
||||||
ActivityTeamOpenInfo teamOpenInfo = new ActivityTeamOpenInfo();
|
|
||||||
teamOpenInfo.setTeamId(teamId);
|
|
||||||
teamOpenInfo.setTeamType("百人团");
|
|
||||||
//根据团购活动id查询活动表获取团购策略id
|
|
||||||
ActivityTeamInfo teamInfo = activityTeamInfoService.getById(teamId);
|
|
||||||
teamOpenInfo.setTeamStrategyId(teamInfo.getStrategyId());
|
|
||||||
//参团类型
|
|
||||||
teamOpenInfo.setExecutiveType("参团");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void exitTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settleTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,47 +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 lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
@Log4j2
|
|
||||||
@Service("team-strategy-ordinary")
|
|
||||||
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary>
|
|
||||||
implements TeamStrategyExemptionOrdinaryService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团-普通团
|
|
||||||
* @param activityTeamId 团购活动id
|
|
||||||
* @param teamProjectSkuId 团购活动商品规格id
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId,Long teamProjectSkuId) {
|
|
||||||
log.info("参加-普通团-[{}]", activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void exitTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void settleTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -7,36 +7,59 @@ import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhuyufeng
|
|
||||||
*/
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@Service("team-strategy-free")
|
@Service("team-strategy-exemption")
|
||||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||||
implements TeamStrategyExemptionService {
|
implements TeamStrategyExemptionService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开团
|
||||||
|
*
|
||||||
|
* @param activityTeamId 团购活动ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void openTeam(Long activityTeamId,Long teamProjectSkuId) {
|
public void openTeam(Long activityTeamId) {
|
||||||
log.info("参加-免单团-[{}]",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 exitTeam(Long teamId) {
|
public void backTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算团
|
||||||
|
*
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
@Override
|
@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,46 +1,44 @@
|
||||||
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
|
|
||||||
* @param teamProjectSkuId 团购活动商品规格id
|
|
||||||
*/
|
*/
|
||||||
public void openTeam(Long activityTeamId,Long teamProjectSkuId);
|
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 exitTeam(Long teamId);
|
public void backTeam(Long teamId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结算团
|
* 结算团
|
||||||
*
|
* @param teamId 团购ID
|
||||||
* @param teamId
|
|
||||||
*/
|
*/
|
||||||
public void settleTeam(Long teamId);
|
public void settle(Long teamId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,58 +1,85 @@
|
||||||
package com.muyu.marketing.team.strategy.impl;
|
package com.muyu.marketing.team.strategy.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.common.core.utils.SpringUtils;
|
import com.muyu.common.core.utils.SpringUtils;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author 夜は眠れるかい?
|
* 团购执行器
|
||||||
* @Date 2024/12/1 14:58
|
*
|
||||||
* 好好学习,天天向上
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-29 15:28
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Primary
|
@Primary
|
||||||
public class ActivityTeamStrategyImpl implements ActivityTeamStrategy {
|
public class ActivityTeamStrategyImpl implements ActivityTeamStrategy {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamInfoService activityTeamInfoService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开团
|
* 开团
|
||||||
* @param activityTeamId 团购活动id
|
*
|
||||||
* @param teamProjectSkuId 团购活动商品规格id
|
* @param activityTeamId 团购活动ID
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void openTeam(Long activityTeamId,Long teamProjectSkuId) {
|
public void openTeam(Long activityTeamId) {
|
||||||
//先根据活动id查询活动的拼团类型
|
// 假设这里是通过方法获取的type,activityTeamId.toString()
|
||||||
ActivityTeamInfo teamInfo = activityTeamInfoService.getById(activityTeamId);
|
// "team-strategy-exemption"
|
||||||
//获取活动拼团类型
|
// "team-strategy-hundred"
|
||||||
String teamStrategyType = teamInfo.getStrategyType();
|
// "team-strategy-ordinary"
|
||||||
//根据不同的拼团类型,调用不同的策略类
|
|
||||||
ActivityTeamStrategy activityTeamStrategy = SpringUtils.getBean(teamStrategyType);
|
String activityTeamType = null;
|
||||||
activityTeamStrategy.openTeam(activityTeamId,teamProjectSkuId);
|
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
|
@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 exitTeam(Long teamId) {
|
public void backTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算团
|
||||||
|
*
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void settleTeam(Long teamId) {
|
public void settle(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-team
|
name: muyu-buy
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.muyu.marketing.team.mapper.ActivityTeamOpenInfoMapper">
|
|
||||||
|
|
||||||
</mapper>
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.test;
|
package com.muyu.test;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.MuYuMarketIngApplication;
|
import com.muyu.marketing.MuYuMarketIngApplication;
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -7,18 +8,21 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author 夜は眠れるかい?
|
* 测试
|
||||||
* @Date 2024/12/1 15:22
|
*
|
||||||
* 好好学习,天天向上
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-29 15:40
|
||||||
*/
|
*/
|
||||||
@SpringBootTest(classes = MuYuMarketIngApplication.class)
|
@SpringBootTest(classes = MuYuMarketIngApplication.class)
|
||||||
public class StrategyTest {
|
public class TeamStrategyTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamStrategy activityTeamStrategy;
|
private ActivityTeamStrategy activityTeamStrategy;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() {
|
public void testStrategy() {
|
||||||
activityTeamStrategy.openTeam(0L);
|
activityTeamStrategy.openTeam(0L);
|
||||||
|
activityTeamStrategy.openTeam(1L);
|
||||||
|
activityTeamStrategy.openTeam(2L);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -38,7 +38,6 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/info")
|
@RequestMapping("/info")
|
||||||
public class ProjectInfoController extends BaseController {
|
public class ProjectInfoController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectInfoService projectInfoService;
|
private ProjectInfoService projectInfoService;
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -16,10 +16,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.35.234.240:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
Loading…
Reference in New Issue