Compare commits
4 Commits
master
...
1127/wangy
Author | SHA1 | Date |
---|---|---|
|
6e2314ab3b | |
|
39c0db585e | |
|
6dcaa301f8 | |
|
5fed8d7869 |
|
@ -0,0 +1,32 @@
|
||||||
|
参团:
|
||||||
|
商品列表
|
||||||
|
商品列表接口
|
||||||
|
选择商品
|
||||||
|
商品详情接口
|
||||||
|
一键参团
|
||||||
|
添加数据,修改库存接口
|
||||||
|
前端数据回显
|
||||||
|
回显接口
|
||||||
|
生成订单
|
||||||
|
|
||||||
|
通过时间统计订单 判断是否成功
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
拼团商品详情
|
||||||
|
商品详情接口
|
||||||
|
评价接口
|
||||||
|
统计接口
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"活动ID":"Long",
|
||||||
|
"商品ID":"Long",
|
||||||
|
"活动名称":"String",
|
||||||
|
"商品名称":"String",
|
||||||
|
"商品图片":"String",
|
||||||
|
"活动简介":"String",
|
||||||
|
"商品单位":"String",
|
||||||
|
"商品轮播图":[
|
||||||
|
"String","String"
|
||||||
|
],
|
||||||
|
"活动时间":"date",
|
||||||
|
"策略类型":"string",
|
||||||
|
"商品规格":{
|
||||||
|
"修改商品规格List":[
|
||||||
|
{
|
||||||
|
"团购规格ID":"Long",
|
||||||
|
"拼团价格":"BigDecimal",
|
||||||
|
"拼团库存":"Long",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"添加商品规格List":[
|
||||||
|
"商品sku":"String",
|
||||||
|
"拼团价格":"BigDecimal",
|
||||||
|
"拼团库存":"Long",
|
||||||
|
]
|
||||||
|
"删除商品规格List":["Long","Long"]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,24 +0,0 @@
|
||||||
$.{
|
|
||||||
"活动ID": "Long",
|
|
||||||
"商品ID": "Long", //activity_team_info.product_id
|
|
||||||
"商品图片": "String",
|
|
||||||
"活动名称": "String",
|
|
||||||
"活动简介": "String",
|
|
||||||
"商品单位": "String",
|
|
||||||
"商品的轮播图": [
|
|
||||||
"String", "String"
|
|
||||||
],
|
|
||||||
"活动时间": "date",
|
|
||||||
"策略类型": "String",
|
|
||||||
"策略ID": "Long",
|
|
||||||
"商品规格List": [ // activity_team_product_sku_info
|
|
||||||
{
|
|
||||||
"活动商品规格ID": "Long",
|
|
||||||
"规格SKU": "String", // activity_team_product_sku_info.product_sku
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"排序": "Integer",
|
|
||||||
"详情": "String"
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
{
|
|
||||||
"活动ID": "Long",
|
|
||||||
"商品ID": "Long",
|
|
||||||
"活动名称": "String",
|
|
||||||
"商品名称": "String",
|
|
||||||
"商品图片": "String",
|
|
||||||
"活动简介": "String",
|
|
||||||
"商品单位": "String",
|
|
||||||
"商品的轮播图": [
|
|
||||||
"String", "String"
|
|
||||||
],
|
|
||||||
"活动时间": "date",
|
|
||||||
"策略类型": "String",
|
|
||||||
"商品规格": {
|
|
||||||
"修改商品规格List": [ // 修改
|
|
||||||
{
|
|
||||||
"团购规格ID": "Long",
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"删除商品规格IdList" : ["Long", "Long"],
|
|
||||||
"添加商品规格List": [
|
|
||||||
"商品SKU": "String",
|
|
||||||
"商品价格": "BigDecimal",
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
"详情": "String"
|
|
||||||
}
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
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,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -33,7 +35,8 @@ spring:
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
dataId: sentinel-muyu-gateway
|
dataId: sentinel-muyu-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -7,6 +7,7 @@ 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 com.muyu.marketing.domain.model.ActivityUpdTeamModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@ -129,4 +130,22 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
.strategyId(activityTeamInfoUpdModel.getStrategyId())
|
.strategyId(activityTeamInfoUpdModel.getStrategyId())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
public static ActivityTeamInfo activityUpdTeamModel (ActivityUpdTeamModel activityTeamInfo){
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.id(activityTeamInfo.getId())
|
||||||
|
.productId(activityTeamInfo.getProductId())
|
||||||
|
.name(activityTeamInfo.getName())
|
||||||
|
.productImage(activityTeamInfo.getProductImage())
|
||||||
|
.introduction(activityTeamInfo.getIntroduction())
|
||||||
|
.unit(activityTeamInfo.getUnit())
|
||||||
|
.imageList(activityTeamInfo.getImageList())
|
||||||
|
.createTime(activityTeamInfo.getCreateTime())
|
||||||
|
.strategyType(activityTeamInfo.getStrategyType())
|
||||||
|
.content(activityTeamInfo.getContent())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@ -76,13 +74,4 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ActivityTeamProductSkuInfo updModelBuild(ActivityTeamProductSkuUpdModel teamProductSkuUpdModel){
|
|
||||||
return ActivityTeamProductSkuInfo.builder()
|
|
||||||
.id(teamProductSkuUpdModel.getId())
|
|
||||||
.teamPrice(teamProductSkuUpdModel.getTeamPrice())
|
|
||||||
.teamStock(teamProductSkuUpdModel.getTeamStock())
|
|
||||||
.remainStock(teamProductSkuUpdModel.getTeamStock())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "team_strategy_exemption_hundred", autoResultMap = true)
|
@TableName(value = "team_strategy_exemption_hundred", autoResultMap = true)
|
||||||
public class TeamStrategyHundred extends BaseEntity {
|
public class TeamStrategyExemptionHundred extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
|
@ -13,7 +13,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "team_strategy_exemption_ordinary", autoResultMap = true)
|
@TableName(value = "team_strategy_exemption_ordinary", autoResultMap = true)
|
||||||
public class TeamStrategyOrdinary extends BaseEntity {
|
public class TeamStrategyExemptionOrdinary extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
|
@ -7,6 +7,7 @@ import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
@ -77,12 +78,18 @@ public class ActivityTeamDetailModel {
|
||||||
* 策略类型
|
* 策略类型
|
||||||
*/
|
*/
|
||||||
private String strategyType;
|
private String strategyType;
|
||||||
|
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
/**
|
||||||
|
* 剩余库存
|
||||||
|
*/
|
||||||
|
private Long remainStock;
|
||||||
/**
|
/**
|
||||||
* 策略ID
|
* 策略ID
|
||||||
*/
|
*/
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
public static ActivityTeamDetailModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
public static ActivityTeamDetailModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
||||||
Function<ActivityTeamDetailModel.ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
Function<ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
||||||
return function.apply(ActivityTeamDetailModel.builder()
|
return function.apply(ActivityTeamDetailModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
.id(activityTeamInfo.getId())
|
||||||
.name(activityTeamInfo.getName())
|
.name(activityTeamInfo.getName())
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class ActivityTeamInfoListModel {
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
|
|
||||||
|
|
||||||
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModel.ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) {
|
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) {
|
||||||
ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
.id(activityTeamInfo.getId())
|
||||||
.name(activityTeamInfo.getName())
|
.name(activityTeamInfo.getName())
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
|
||||||
import com.muyu.marketing.domain.req.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 java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -37,7 +33,7 @@ public class ActivityTeamInfoUpdModel {
|
||||||
private String status;
|
private String status;
|
||||||
private String strategyType;
|
private String strategyType;
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
private ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel;
|
private List<ActivityTeamProductSkuReqModel> activityTeamProductSkuModelList;
|
||||||
|
|
||||||
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
return ActivityTeamInfoUpdModel.builder()
|
return ActivityTeamInfoUpdModel.builder()
|
||||||
|
@ -54,12 +50,7 @@ public class ActivityTeamInfoUpdModel {
|
||||||
.status(activityTeamInfoUpdReq.getStatus())
|
.status(activityTeamInfoUpdReq.getStatus())
|
||||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||||
.activityTeamProductSkuSettingModel(
|
.activityTeamProductSkuModelList(activityTeamInfoUpdReq.getActivityTeamProductSkuList().stream().map(ActivityTeamProductSkuReqModel::activityTeamProductSkuReqModelBuild).toList())
|
||||||
ActivityTeamProductSkuSettingModel.settingReqModel(
|
|
||||||
activityTeamInfoUpdReq.getActivityTeamProductSkuSettingReq(),
|
|
||||||
activityTeamInfoUpdReq::getProductId
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购商品规格一键设置
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-28 11:15
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ActivityTeamProductSkuSettingModel {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动ID
|
|
||||||
*/
|
|
||||||
private Long teamId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除的ID集合
|
|
||||||
*/
|
|
||||||
private List<Long> removeIds;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的规格集合
|
|
||||||
*/
|
|
||||||
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改的规格集合
|
|
||||||
*/
|
|
||||||
private List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList;
|
|
||||||
|
|
||||||
public static ActivityTeamProductSkuSettingModel settingReqModel(ActivityTeamProductSkuSettingReq activityTeamProductSkuSettingReq, Supplier<Long> productId) {
|
|
||||||
return ActivityTeamProductSkuSettingModel.builder()
|
|
||||||
.removeIds(activityTeamProductSkuSettingReq.getRemoveIds())
|
|
||||||
.activityTeamProductSkuAddModelList(
|
|
||||||
activityTeamProductSkuSettingReq.getTeamProjectSkuInfoAddReqList().stream()
|
|
||||||
.map(teamProjectSkuInfoAddReq -> ActivityTeamProductSkuAddModel.addReqBuild(teamProjectSkuInfoAddReq, productId))
|
|
||||||
.toList()
|
|
||||||
)
|
|
||||||
.activityTeamProductSkuUpdModelList(
|
|
||||||
activityTeamProductSkuSettingReq.getTeamProjectSkuInfoUpdReqList().stream()
|
|
||||||
.map(ActivityTeamProductSkuUpdModel::updReqBuild)
|
|
||||||
.toList()
|
|
||||||
).build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
@ -35,12 +34,4 @@ public class ActivityTeamProductSkuUpdModel {
|
||||||
* 团购库存
|
* 团购库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
|
|
||||||
public static ActivityTeamProductSkuUpdModel updReqBuild(TeamProjectSkuInfoUpdReq teamProjectSkuInfoUpdReq){
|
|
||||||
return ActivityTeamProductSkuUpdModel.builder()
|
|
||||||
.id(teamProjectSkuInfoUpdReq.getId())
|
|
||||||
.teamStock(teamProjectSkuInfoUpdReq.getTeamStock())
|
|
||||||
.teamPrice(teamProjectSkuInfoUpdReq.getTeamPrice())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,5 +32,5 @@ public class ActivityTeamInfoUpdReq {
|
||||||
private String status;
|
private String status;
|
||||||
private String strategyType;
|
private String strategyType;
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
private ActivityTeamProductSkuSettingReq activityTeamProductSkuSettingReq;
|
private List<ActivityTeamProductSkuReq> activityTeamProductSkuList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
package com.muyu.marketing.domain.req;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购商品规格设置
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-28 11:27
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ActivityTeamProductSkuSettingReq {
|
|
||||||
/**
|
|
||||||
* 删除的ID集合
|
|
||||||
*/
|
|
||||||
private List<Long> removeIds;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的规格集合
|
|
||||||
*/
|
|
||||||
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的规格集合
|
|
||||||
*/
|
|
||||||
private List<TeamProjectSkuInfoUpdReq> teamProjectSkuInfoUpdReqList;
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
package com.muyu.marketing.domain.req;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加的
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class TeamProjectSkuInfoUpdReq {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 规格SKU
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团价格
|
|
||||||
*/
|
|
||||||
private BigDecimal teamPrice;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团库存
|
|
||||||
*/
|
|
||||||
private Long teamStock;
|
|
||||||
}
|
|
|
@ -2,12 +2,13 @@ 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 java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -52,6 +53,12 @@ public class TeamInfoFindByIdResp {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String imageList;
|
private String imageList;
|
||||||
|
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
/**
|
||||||
|
* 剩余库存
|
||||||
|
*/
|
||||||
|
private Long remainStock;
|
||||||
/**
|
/**
|
||||||
* 活动结束时间
|
* 活动结束时间
|
||||||
*/
|
*/
|
||||||
|
@ -77,6 +84,9 @@ public class TeamInfoFindByIdResp {
|
||||||
* 策略类型
|
* 策略类型
|
||||||
*/
|
*/
|
||||||
private String strategyType;
|
private String strategyType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略ID
|
* 策略ID
|
||||||
*/
|
*/
|
||||||
|
@ -102,6 +112,8 @@ public class TeamInfoFindByIdResp {
|
||||||
.status(activityTeamDetailModel.getStatus())
|
.status(activityTeamDetailModel.getStatus())
|
||||||
.strategyType(activityTeamDetailModel.getStrategyType())
|
.strategyType(activityTeamDetailModel.getStrategyType())
|
||||||
.strategyId(activityTeamDetailModel.getStrategyId())
|
.strategyId(activityTeamDetailModel.getStrategyId())
|
||||||
|
.remainStock(activityTeamDetailModel.getRemainStock())
|
||||||
|
.productPrice(activityTeamDetailModel.getProductPrice())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,27 @@
|
||||||
package com.muyu.marketing.team.controller;
|
package com.muyu.marketing.team.controller;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamUpdProductUpdReq;
|
||||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||||
import com.muyu.marketing.domain.resp.TeamInfoFindByIdResp;
|
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.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 营销团购活动控制层
|
* 营销团购活动控制层
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
* @author DongZeLiang
|
||||||
* @date 2024-11-20 14:25
|
* @date 2024-11-20 14:25
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/team")
|
@RequestMapping("/team")
|
||||||
public class ActivityTeamController {
|
public class ActivityTeamController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamInfoService activityTeamInfoService;;
|
private ActivityTeamInfoService activityTeamInfoService;;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询营销团购活动列表
|
* 查询营销团购活动列表
|
||||||
* @param teamInfoListReq 活动查询入参
|
* @param teamInfoListReq 活动查询入参
|
||||||
|
@ -46,8 +38,6 @@ public class ActivityTeamController {
|
||||||
}}
|
}}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加团购活动
|
* 添加团购活动
|
||||||
* @param activityTeamInfoSaveReq 添加请求对象
|
* @param activityTeamInfoSaveReq 添加请求对象
|
||||||
|
@ -58,7 +48,6 @@ public class ActivityTeamController {
|
||||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@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)));
|
||||||
|
@ -68,4 +57,13 @@ public class ActivityTeamController {
|
||||||
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
@PostMapping("/updActivityTeamInfo")
|
||||||
|
public Result updActivityTeamInfo (@RequestBody ActivityTeamUpdProductUpdReq activityTeamUpdProductUpdReq){
|
||||||
|
boolean a= activityTeamInfoService.updproduct(ActivityUpdTeamModel.update(activityTeamUpdProductUpdReq));
|
||||||
|
if(a){
|
||||||
|
return Result.success("删除成功");
|
||||||
|
}else{
|
||||||
|
return Result.error("删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyExemptionHundred> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TeamStrategyExemptionOrdinaryMapper extends BaseMapper<TeamStrategyExemptionOrdinary> {
|
||||||
|
|
||||||
|
}
|
|
@ -1,10 +0,0 @@
|
||||||
package com.muyu.marketing.team.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface TeamStrategyHundredMapper extends BaseMapper<TeamStrategyHundred> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
package com.muyu.marketing.team.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface TeamStrategyOrdinaryMapper extends BaseMapper<TeamStrategyOrdinary> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.muyu.marketing.team.satery;
|
||||||
|
|
||||||
|
public interface ActivityTeamStratey {
|
||||||
|
public void openTeam(Long activityTeamId);
|
||||||
|
public void ApplyTeam(Long activityTeamId);
|
||||||
|
public void addTeam(Long teamId,Long number);
|
||||||
|
public void backTeam(Long teamId);
|
||||||
|
public void settle(Long team);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.muyu.marketing.team.satery.impl;
|
||||||
|
|
||||||
|
public class ActivityTeamStrateyImpl {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -36,4 +36,5 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||||
|
|
||||||
|
|
||||||
|
boolean updproduct(ActivityUpdTeamModel update);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
package com.muyu.marketing.team.service;
|
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.ActivityTeamOpenInfo;
|
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
|
||||||
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.marketing.team.service;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -47,27 +48,12 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
|
|
||||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
||||||
|
|
||||||
/**
|
public boolean updtoBath(List<ActivityTeamUpdModel> activityTeamUpdModels);
|
||||||
* 根据 业务模型 进行 团购商品修改
|
|
||||||
* @param activityTeamProductSkuUpdModel 修改业务模型
|
public boolean addBath(List<ActivityTeamAddModel> activityTeamAddModels);
|
||||||
* @return 修改结果
|
|
||||||
*/
|
public boolean delBath(List<Long> ids);
|
||||||
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据 业务模型 进行 团购商品批量修改
|
|
||||||
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
|
||||||
* @return 修改结果
|
|
||||||
*/
|
|
||||||
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 一键设置
|
|
||||||
* @param activityTeamProductSkuSettingModel 整体修改模型
|
|
||||||
*/
|
|
||||||
public default void setting(ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel){
|
|
||||||
this.batchSave(activityTeamProductSkuSettingModel.getActivityTeamProductSkuAddModelList());
|
|
||||||
this.batchUpdate(activityTeamProductSkuSettingModel.getActivityTeamProductSkuUpdModelList());
|
|
||||||
this.removeByIds(activityTeamProductSkuSettingModel.getRemoveIds());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
|
||||||
|
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred> {
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
|
||||||
|
public interface TeamStrategyExemptionOrdinaryService extends IService<TeamStrategyExemptionOrdinary> {
|
||||||
|
}
|
|
@ -2,10 +2,7 @@ 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.team.strategy.ActivityTeamStrategy;
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
|
||||||
/**
|
public interface TeamStrategyExemptionService extends IService<TeamStrategyExemption> {
|
||||||
* 免单
|
|
||||||
*/
|
|
||||||
public interface TeamStrategyExemptionService extends ActivityTeamStrategy, IService<TeamStrategyExemption> {
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.muyu.marketing.team.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百人
|
|
||||||
*/
|
|
||||||
public interface TeamStrategyHundredService extends ActivityTeamStrategy, IService<TeamStrategyHundred> {
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.muyu.marketing.team.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 普通
|
|
||||||
*/
|
|
||||||
public interface TeamStrategyOrdinaryService extends ActivityTeamStrategy, IService<TeamStrategyOrdinary> {
|
|
||||||
}
|
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||||
|
@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,6 +29,8 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||||
|
@Autowired
|
||||||
|
private ActivityTeamInfoService activityTeamInfoService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||||
|
@ -41,6 +45,7 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
*/
|
*/
|
||||||
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(activityTeamInfoListQueryModel.buildPage(), queryWrapper);
|
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(activityTeamInfoListQueryModel.buildPage(), queryWrapper);
|
||||||
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
||||||
|
|
||||||
List<ActivityTeamInfoListModel> activityTeamInfoListModels = activityTeamInfoList.stream()
|
List<ActivityTeamInfoListModel> activityTeamInfoListModels = activityTeamInfoList.stream()
|
||||||
.map(activityTeamInfo -> ActivityTeamInfoListModel.infoBuild(activityTeamInfo,
|
.map(activityTeamInfo -> ActivityTeamInfoListModel.infoBuild(activityTeamInfo,
|
||||||
(activityTeamInfoListModelBuilder) -> {
|
(activityTeamInfoListModelBuilder) -> {
|
||||||
|
@ -101,8 +106,22 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
@Override
|
@Override
|
||||||
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||||
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
||||||
Assert.isTrue(update,"修改失败");
|
io.jsonwebtoken.lang.Assert.isTrue(update,"修改失败");
|
||||||
activityTeamProductSkuInfoService.setting(activityTeamInfoUpdModel.getActivityTeamProductSkuSettingModel());
|
|
||||||
|
activityTeamProductSkuInfoService.updateBath(activityTeamInfoUpdModel.getActivityTeamProductSkuModelList());
|
||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updproduct(ActivityUpdTeamModel update) {
|
||||||
|
boolean b = this.updateById(ActivityTeamInfo.activityUpdTeamModel(update));
|
||||||
|
io.jsonwebtoken.lang.Assert.isTrue(b,"修改失败");
|
||||||
|
List<ActivityTeamUpdModel> activityTeamUpdModels = update.getActivityTeamUpdModels();
|
||||||
|
List<ActivityTeamAddModel> activityTeamAddModels = update.getActivityTeamAddModels();
|
||||||
|
List<Long> ids = update.getIds();
|
||||||
|
activityTeamProductSkuInfoService.updtoBath(activityTeamUpdModels);
|
||||||
|
activityTeamProductSkuInfoService.addBath(activityTeamAddModels);
|
||||||
|
activityTeamProductSkuInfoService.delBath(ids);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ import org.springframework.stereotype.Service;
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
|
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
|
||||||
implements ActivityTeamOpenInfoService {
|
implements ActivityTeamOpenInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过活动ID和开团类型查询开团数量
|
* 通过活动ID和开团类型查询开团数量
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
@ -28,6 +27,8 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectSkuCache projectSkuCache;
|
private ProjectSkuCache projectSkuCache;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过团购活动ID获取团购中最优惠的价格
|
* 通过团购活动ID获取团购中最优惠的价格
|
||||||
*
|
*
|
||||||
|
@ -50,7 +51,6 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
}
|
}
|
||||||
return discountPriceModelOptional.get();
|
return discountPriceModelOptional.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过活动ID获取 剩余库存
|
* 通过活动ID获取 剩余库存
|
||||||
*
|
*
|
||||||
|
@ -102,37 +102,42 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据 业务模型 进行 团购商品修改
|
|
||||||
*
|
|
||||||
* @param activityTeamProductSkuUpdModel 修改业务模型
|
|
||||||
* @return 修改结果
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
public boolean updtoBath(List<ActivityTeamUpdModel> activityTeamUpdModels) {
|
||||||
// update set where
|
List<ActivityTeamProductSkuInfo> list = activityTeamUpdModels.stream().map(activityTeamUpdModel -> {
|
||||||
LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
ActivityTeamProductSkuInfo build = ActivityTeamProductSkuInfo.builder()
|
||||||
// 字段=值
|
.id(activityTeamUpdModel.getId())
|
||||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock,activityTeamProductSkuUpdModel.getTeamStock());
|
.teamPrice(activityTeamUpdModel.getTeamPrice())
|
||||||
updateWrapper.set(ActivityTeamProductSkuInfo::getRemainStock,activityTeamProductSkuUpdModel.getTeamStock());
|
.teamStock(activityTeamUpdModel.getTeamStock())
|
||||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice,activityTeamProductSkuUpdModel.getTeamPrice());
|
.remainStock(activityTeamUpdModel.getTeamStock())
|
||||||
// id=?
|
.build();
|
||||||
updateWrapper.eq(ActivityTeamProductSkuInfo::getId,activityTeamProductSkuUpdModel.getId());
|
return build;
|
||||||
return this.update(updateWrapper);
|
}).toList();
|
||||||
|
return this.updateBatchById(list);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据 业务模型 进行 团购商品批量修改
|
|
||||||
*
|
|
||||||
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
|
||||||
* @return 修改结果
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
public boolean addBath(List<ActivityTeamAddModel> activityTeamAddModels) {
|
||||||
return this.updateBatchById(
|
List<ActivityTeamProductSkuInfo> list = activityTeamAddModels.stream().map(activityTeamAddModel -> {
|
||||||
activityTeamProductSkuUpdModelList.stream()
|
ActivityTeamProductSkuInfo build = ActivityTeamProductSkuInfo.builder()
|
||||||
.map(ActivityTeamProductSkuInfo::updModelBuild)
|
.productSku(activityTeamAddModel.getProduckSku())
|
||||||
.toList()
|
.teamPrice(activityTeamAddModel.getTeamPrice())
|
||||||
);
|
.teamStock(activityTeamAddModel.getTeamStock())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return build;
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
return this.saveBatch(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delBath(List<Long> ids) {
|
||||||
|
boolean b = this.removeBatchByIds(ids);
|
||||||
|
return b;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
||||||
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||||
|
import com.muyu.marketing.team.service.TeamStrategyExemptionHundredService;
|
||||||
|
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred>
|
||||||
|
implements TeamStrategyExemptionHundredService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionOrdinaryMapper;
|
||||||
|
import com.muyu.marketing.team.service.TeamStrategyExemptionOrdinaryService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary>
|
||||||
|
implements TeamStrategyExemptionOrdinaryService {
|
||||||
|
|
||||||
|
}
|
|
@ -4,62 +4,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Log4j2
|
@Service
|
||||||
@Service("team-strategy-exemption")
|
|
||||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||||
implements TeamStrategyExemptionService {
|
implements TeamStrategyExemptionService {
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId) {
|
|
||||||
log.info("参加 - 免单团 - [{}]", activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void backTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settle(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,66 +0,0 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyHundredMapper;
|
|
||||||
import com.muyu.marketing.team.service.TeamStrategyHundredService;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
@Service("team-strategy-hundred")
|
|
||||||
public class TeamStrategyHundredServiceImpl extends ServiceImpl<TeamStrategyHundredMapper, TeamStrategyHundred>
|
|
||||||
implements TeamStrategyHundredService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId) {
|
|
||||||
|
|
||||||
log.info("参加 - 百人团 - [{}]", activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void backTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settle(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyOrdinaryMapper;
|
|
||||||
import com.muyu.marketing.team.service.TeamStrategyOrdinaryService;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
@Service("team-strategy-ordinary")
|
|
||||||
public class TeamStrategyOrdinaryServiceImpl extends ServiceImpl<TeamStrategyOrdinaryMapper, TeamStrategyOrdinary>
|
|
||||||
implements TeamStrategyOrdinaryService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId) {
|
|
||||||
|
|
||||||
log.info("参加 - 普通团 - [{}]", activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void backTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settle(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
package com.muyu.marketing.team.strategy;
|
|
||||||
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团活动策略
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-29 15:03
|
|
||||||
*/
|
|
||||||
public interface ActivityTeamStrategy {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
public void openTeam(Long activityTeamId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
public void applyTeam(Long teamId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
public void addTeam(Long teamId, String orderNumber);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
public void backTeam(Long teamId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
public void settle(Long teamId);
|
|
||||||
}
|
|
|
@ -1,85 +0,0 @@
|
||||||
package com.muyu.marketing.team.strategy.impl;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
|
||||||
import com.muyu.common.core.utils.SpringUtils;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团购执行器
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-29 15:28
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Primary
|
|
||||||
public class ActivityTeamStrategyImpl implements ActivityTeamStrategy {
|
|
||||||
/**
|
|
||||||
* 开团
|
|
||||||
*
|
|
||||||
* @param activityTeamId 团购活动ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void openTeam(Long activityTeamId) {
|
|
||||||
// 假设这里是通过方法获取的type,activityTeamId.toString()
|
|
||||||
// "team-strategy-exemption"
|
|
||||||
// "team-strategy-hundred"
|
|
||||||
// "team-strategy-ordinary"
|
|
||||||
|
|
||||||
String activityTeamType = null;
|
|
||||||
if (activityTeamId == null) {
|
|
||||||
throw new ServiceException("activityTeamId is null");
|
|
||||||
}else if (activityTeamId == 0) {
|
|
||||||
activityTeamType = "team-strategy-exemption";
|
|
||||||
}else if (activityTeamId == 1) {
|
|
||||||
activityTeamType = "team-strategy-hundred";
|
|
||||||
}else if (activityTeamId == 2) {
|
|
||||||
activityTeamType = "team-strategy-ordinary";
|
|
||||||
}
|
|
||||||
ActivityTeamStrategy activityTeamStrategy = SpringUtils.getBean(activityTeamType);
|
|
||||||
activityTeamStrategy.openTeam(activityTeamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请加团
|
|
||||||
*
|
|
||||||
* @param teamId 团ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void applyTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参团
|
|
||||||
*
|
|
||||||
* @param teamId 加团ID
|
|
||||||
* @param orderNumber 订单编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void backTeam(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结算团
|
|
||||||
*
|
|
||||||
* @param teamId 团购ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void settle(Long teamId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,7 +6,9 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-buy
|
name: muyu-activity
|
||||||
|
main:
|
||||||
|
allow-circular-references: true
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +16,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
package com.muyu.test;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.marketing.MuYuMarketIngApplication;
|
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试
|
|
||||||
*
|
|
||||||
* @author DongZeLiang
|
|
||||||
* @date 2024-11-29 15:40
|
|
||||||
*/
|
|
||||||
@SpringBootTest(classes = MuYuMarketIngApplication.class)
|
|
||||||
public class TeamStrategyTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamStrategy activityTeamStrategy;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testStrategy() {
|
|
||||||
activityTeamStrategy.openTeam(0L);
|
|
||||||
activityTeamStrategy.openTeam(1L);
|
|
||||||
activityTeamStrategy.openTeam(2L);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -35,7 +35,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
@Api(tags = "商品评论")
|
@Api(tags = "商品评论")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/comment")
|
@RequestMapping("/comment")
|
||||||
public class CommentInfoController extends BaseController {
|
public class CommentInfoController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CommentInfoService commentInfoService;
|
private CommentInfoService commentInfoService;
|
||||||
|
|
||||||
|
@ -86,6 +86,11 @@ public class CommentInfoController extends BaseController {
|
||||||
return toAjax(commentInfoService.save(CommentInfo.saveBuild(commentInfoSaveReq)));
|
return toAjax(commentInfoService.save(CommentInfo.saveBuild(commentInfoSaveReq)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/tocomment/{id}")
|
||||||
|
public Result<List<CommentInfo>> commentInfoResult(@PathVariable Long id){
|
||||||
|
return Result.success(commentInfoService.commentInfoId(id));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改商品评论
|
* 修改商品评论
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,4 +19,5 @@ public interface CommentInfoService extends IService<CommentInfo> {
|
||||||
*/
|
*/
|
||||||
public List<CommentInfo> list(CommentInfo commentInfo);
|
public List<CommentInfo> list(CommentInfo commentInfo);
|
||||||
|
|
||||||
|
List<CommentInfo> commentInfoId(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,4 +54,13 @@ public class CommentInfoServiceImpl extends ServiceImpl<CommentInfoMapper, Comme
|
||||||
|
|
||||||
return list(queryWrapper);
|
return list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CommentInfo> commentInfoId(Long id) {
|
||||||
|
LambdaQueryWrapper<CommentInfo> commentInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
commentInfoLambdaQueryWrapper.eq(CommentInfo::getProjectId,id);
|
||||||
|
List<CommentInfo> list = this.list(commentInfoLambdaQueryWrapper);
|
||||||
|
return list;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -16,10 +16,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.221.130.240:8848
|
||||||
|
namespace: cloud-wang
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
Loading…
Reference in New Issue