Compare commits
4 Commits
1125/liuhe
...
master
Author | SHA1 | Date |
---|---|---|
|
b6c4a790d7 | |
|
02f640092a | |
|
c6b7a3aa6a | |
|
a04925eab4 |
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
"团购活动id":"Long"
|
||||
"商品ID":"Long",
|
||||
"活动名称":"String",
|
||||
"活动简介":"String",
|
||||
"商品图片":"String",
|
||||
"商品单位":"String",
|
||||
"商品的轮播图":[
|
||||
"String","String"
|
||||
],
|
||||
"活动时间":"date",
|
||||
"策略类型":"String",
|
||||
"策略ID":"Long",
|
||||
"商品规格":{
|
||||
"商品规格List":[
|
||||
{
|
||||
"规格id":"Long",
|
||||
"拼团价格":"BigDecimal",
|
||||
"拼团库存":"Long"
|
||||
}
|
||||
],
|
||||
"删除商品规格idList":["Long","Long"],
|
||||
"添加商品规格List":[
|
||||
"规格SKU": "String", // activity_team_product_sku_info.product_sku
|
||||
"拼团价格": "BigDecimal",
|
||||
"商品价格":"BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
]
|
||||
},
|
||||
"排序":"Integer",
|
||||
"详情":"String",
|
||||
"状态":"String"
|
||||
}
|
|
@ -1,24 +1,24 @@
|
|||
{
|
||||
"团购活动id":"Long"
|
||||
"商品ID":"Long",
|
||||
"活动名称":"String",
|
||||
"活动简介":"String",
|
||||
"商品图片":"String",
|
||||
"商品单位":"String",
|
||||
"商品的轮播图":[
|
||||
"String","String"
|
||||
],
|
||||
"活动时间":"date",
|
||||
"策略类型":"String",
|
||||
"策略ID":"Long",
|
||||
"商品规格List":[
|
||||
$.{
|
||||
"活动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",
|
||||
"拼团价格":"BigDecimal",
|
||||
"拼团库存":"Long"
|
||||
"活动商品规格ID": "Long",
|
||||
"规格SKU": "String", // activity_team_product_sku_info.product_sku
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
}
|
||||
],
|
||||
"排序":"Integer",
|
||||
"详情":"String"
|
||||
}
|
||||
],
|
||||
"排序": "Integer",
|
||||
"详情": "String"
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"活动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,12 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -1,58 +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,12 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
@ -22,7 +24,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
private long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
|
@ -30,7 +32,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long projectId;
|
||||
private long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
|
@ -54,7 +56,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
private long sort;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
|
@ -70,7 +72,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
private long strategyId;
|
||||
|
||||
/**
|
||||
* 公共添加模型,转换成添加对象
|
||||
|
@ -80,7 +82,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
public static ActivityTeamInfo addModelBuild(ActivityTeamInfoAddModel activityTeamInfoAddModel){
|
||||
return ActivityTeamInfo.builder()
|
||||
.name(activityTeamInfoAddModel.getName())
|
||||
.projectId(activityTeamInfoAddModel.getProductId())
|
||||
.productId(activityTeamInfoAddModel.getProductId())
|
||||
.productImage(activityTeamInfoAddModel.getProductImage())
|
||||
.introduction(activityTeamInfoAddModel.getIntroduction())
|
||||
.unit(activityTeamInfoAddModel.getUnit())
|
||||
|
@ -93,4 +95,38 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ActivityTeamInfo teamSaveBuild(ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
||||
return ActivityTeamInfo.builder()
|
||||
.name(activityTeamInfoSaveModel.getName())
|
||||
.productId(activityTeamInfoSaveModel.getProductId())
|
||||
.productImage(activityTeamInfoSaveModel.getProductImage())
|
||||
.introduction(activityTeamInfoSaveModel.getIntroduction())
|
||||
.unit(activityTeamInfoSaveModel.getUnit())
|
||||
.imageList(activityTeamInfoSaveModel.getImageList())
|
||||
.endTime(activityTeamInfoSaveModel.getEndTime())
|
||||
.sort(activityTeamInfoSaveModel.getSort())
|
||||
.content(activityTeamInfoSaveModel.getContent())
|
||||
.status(activityTeamInfoSaveModel.getStatus())
|
||||
.strategyType(activityTeamInfoSaveModel.getStrategyType())
|
||||
.strategyId(activityTeamInfoSaveModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
public static ActivityTeamInfo TeamUpdateBuild (ActivityTeamInfoUpdModel activityTeamInfoUpdModel){
|
||||
return ActivityTeamInfo.builder()
|
||||
.id(activityTeamInfoUpdModel.getId())
|
||||
.name(activityTeamInfoUpdModel.getName())
|
||||
.productId(activityTeamInfoUpdModel.getProductId())
|
||||
.productImage(activityTeamInfoUpdModel.getProductImage())
|
||||
.introduction(activityTeamInfoUpdModel.getIntroduction())
|
||||
.unit(activityTeamInfoUpdModel.getUnit())
|
||||
.imageList(activityTeamInfoUpdModel.getImageList())
|
||||
.endTime(activityTeamInfoUpdModel.getEndTime())
|
||||
.sort(activityTeamInfoUpdModel.getSort())
|
||||
.content(activityTeamInfoUpdModel.getContent())
|
||||
.status(activityTeamInfoUpdModel.getStatus())
|
||||
.strategyType(activityTeamInfoUpdModel.getStrategyType())
|
||||
.strategyId(activityTeamInfoUpdModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
@ -22,11 +25,11 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
private long id;
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
private Long teamId;
|
||||
private long teamId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
|
@ -58,8 +61,28 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
.productId(activityTeamProductSkuAddModel.getProductId())
|
||||
.teamId(activityTeamProductSkuAddModel.getTeamId())
|
||||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.productSku(activityTeamProductSkuAddModel.getSku())
|
||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
public static ActivityTeamProductSkuInfo updateModelBuild(ActivityTeamProductSkuReqModel activityTeamProductSkuReqModel) {
|
||||
return ActivityTeamProductSkuInfo.builder()
|
||||
.id(activityTeamProductSkuReqModel.getId())
|
||||
.productId(activityTeamProductSkuReqModel.getProductId())
|
||||
.teamStock(activityTeamProductSkuReqModel.getTeamStock())
|
||||
.productSku(activityTeamProductSkuReqModel.getProductSku())
|
||||
.teamPrice(activityTeamProductSkuReqModel.getTeamPrice())
|
||||
.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
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "team_strategy_exemption_hundred", autoResultMap = true)
|
||||
public class TeamStrategyExemptionHundred extends BaseEntity {
|
||||
public class TeamStrategyHundred extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
|
@ -13,7 +13,7 @@ import lombok.experimental.SuperBuilder;
|
|||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "team_strategy_exemption_ordinary", autoResultMap = true)
|
||||
public class TeamStrategyExemptionOrdinary extends BaseEntity {
|
||||
public class TeamStrategyOrdinary extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
|
@ -1,79 +0,0 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.resp.ActivityProductUpdResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamProductSkuResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 活动商品修改参数
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityProductUpdModel {
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU
|
||||
*/
|
||||
private ActivityProductUpdResp activityProductUpdResp;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 活动回显总模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 16:00
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamDetailModel {
|
||||
/**
|
||||
* 拼团id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ActivityTeamProductSkuModel> projectSkuInfoAddReqList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
public static ActivityTeamDetailModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
||||
Function<ActivityTeamDetailModel.ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
||||
return function.apply(ActivityTeamDetailModel.builder()
|
||||
.id(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
||||
.productId(activityTeamInfo.getProductId())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
.introduction(activityTeamInfo.getIntroduction())
|
||||
.unit(activityTeamInfo.getUnit())
|
||||
.imageList(activityTeamInfo.getImageList())
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.sort(activityTeamInfo.getSort())
|
||||
.content(activityTeamInfo.getContent())
|
||||
.status(activityTeamInfo.getStatus())
|
||||
.strategyType(activityTeamInfo.getStrategyType())
|
||||
.strategyId(activityTeamInfo.getStrategyId())
|
||||
);
|
||||
}
|
||||
}
|
|
@ -3,7 +3,6 @@ package com.muyu.marketing.domain.model;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -11,6 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 团购活动添加模型
|
||||
|
@ -23,6 +23,7 @@ import java.util.List;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoAddModel {
|
||||
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
|
@ -42,10 +43,12 @@ public class ActivityTeamInfoAddModel {
|
|||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
|
@ -77,7 +80,7 @@ public class ActivityTeamInfoAddModel {
|
|||
*/
|
||||
private Long strategyId;
|
||||
|
||||
public static ActivityTeamInfoAddModel addBuild(ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
||||
public static ActivityTeamInfoAddModel addReqBuild (ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
||||
return ActivityTeamInfoAddModel.builder()
|
||||
.name(activityTeamInfoSaveReq.getName())
|
||||
.productId(activityTeamInfoSaveReq.getProductId())
|
||||
|
@ -92,13 +95,10 @@ public class ActivityTeamInfoAddModel {
|
|||
.strategyType(activityTeamInfoSaveReq.getStrategyType())
|
||||
.strategyId(activityTeamInfoSaveReq.getStrategyId())
|
||||
.activityTeamProductSkuAddModelList(
|
||||
activityTeamInfoSaveReq.getProjectSkuInfoAddReqList()
|
||||
.stream().map(addReq -> ActivityTeamProductSkuAddModel.addReqBuild(addReq,activityTeamInfoSaveReq::getProductId))
|
||||
activityTeamInfoSaveReq.getTeamProjectSkuInfoAddReqList()
|
||||
.stream()
|
||||
.map(addReq -> ActivityTeamProductSkuAddModel.addReqBuild(addReq, activityTeamInfoSaveReq::getProductId))
|
||||
.toList()
|
||||
).build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 添加活动模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 10:59
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamInfoSaveModel {
|
||||
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
public static ActivityTeamInfoSaveModel activityTeamInfoSaveModelBuild (ActivityTeamInfoAddModel activityTeamInfoAddModel){
|
||||
return ActivityTeamInfoSaveModel.builder()
|
||||
.name(activityTeamInfoAddModel.getName())
|
||||
.productId(activityTeamInfoAddModel.getProductId())
|
||||
.productImage(activityTeamInfoAddModel.getProductImage())
|
||||
.introduction(activityTeamInfoAddModel.getIntroduction())
|
||||
.unit(activityTeamInfoAddModel.getUnit())
|
||||
.imageList(activityTeamInfoAddModel.getImageList())
|
||||
.endTime(activityTeamInfoAddModel.getEndTime())
|
||||
.sort(activityTeamInfoAddModel.getSort())
|
||||
.content(activityTeamInfoAddModel.getContent())
|
||||
.status(activityTeamInfoAddModel.getStatus())
|
||||
.strategyType(activityTeamInfoAddModel.getStrategyType())
|
||||
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
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.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 活动商品规格修改模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 19:25
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamInfoUpdModel {
|
||||
private Long id;
|
||||
private String name;
|
||||
private Long productId;
|
||||
private String productImage;
|
||||
private String introduction;
|
||||
private String unit;
|
||||
private String imageList;
|
||||
private Date endTime;
|
||||
private Long sort;
|
||||
private String content;
|
||||
private String status;
|
||||
private String strategyType;
|
||||
private Long strategyId;
|
||||
private ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel;
|
||||
|
||||
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||
return ActivityTeamInfoUpdModel.builder()
|
||||
.id(activityTeamInfoUpdReq.getId())
|
||||
.name(activityTeamInfoUpdReq.getName())
|
||||
.productId(activityTeamInfoUpdReq.getProductId())
|
||||
.productImage(activityTeamInfoUpdReq.getProductImage())
|
||||
.introduction(activityTeamInfoUpdReq.getIntroduction())
|
||||
.unit(activityTeamInfoUpdReq.getUnit())
|
||||
.imageList(activityTeamInfoUpdReq.getImageList())
|
||||
.endTime(activityTeamInfoUpdReq.getEndTime())
|
||||
.sort(activityTeamInfoUpdReq.getSort())
|
||||
.content(activityTeamInfoUpdReq.getContent())
|
||||
.status(activityTeamInfoUpdReq.getStatus())
|
||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||
.activityTeamProductSkuSettingModel(
|
||||
ActivityTeamProductSkuSettingModel.settingReqModel(
|
||||
activityTeamInfoUpdReq.getActivityTeamProductSkuSettingReq(),
|
||||
activityTeamInfoUpdReq::getProductId
|
||||
)
|
||||
)
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
|
@ -36,7 +36,7 @@ public class ActivityTeamProductSkuAddModel {
|
|||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String productSku;
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
|
@ -48,13 +48,12 @@ public class ActivityTeamProductSkuAddModel {
|
|||
*/
|
||||
private Long teamStock;
|
||||
|
||||
public static ActivityTeamProductSkuAddModel addReqBuild(ProjectSkuInfoAddReq projectSkuInfoAddReq, Supplier<Long> getProductId) {
|
||||
public static ActivityTeamProductSkuAddModel addReqBuild(TeamProjectSkuInfoAddReq teamProjectSkuInfoAddReq, Supplier<Long> productId){
|
||||
return ActivityTeamProductSkuAddModel.builder()
|
||||
.teamId(projectSkuInfoAddReq.getId())
|
||||
.productId(getProductId.get())
|
||||
.productSku(projectSkuInfoAddReq.getSku())
|
||||
.teamStock(projectSkuInfoAddReq.getTeamStock())
|
||||
.teamPrice(projectSkuInfoAddReq.getTeamPrice())
|
||||
.productId(productId.get())
|
||||
.sku(teamProjectSkuInfoAddReq.getSku())
|
||||
.teamStock(teamProjectSkuInfoAddReq.getTeamStock())
|
||||
.teamPrice(teamProjectSkuInfoAddReq.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -7,23 +8,32 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品活动SKU信息模型
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-26 15:35
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityProductSkuListModel {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductSkuInfoModel {
|
||||
/**
|
||||
* 活动id
|
||||
* 团购商品SKU的ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 规格id
|
||||
* 团ID
|
||||
*/
|
||||
private Long skuId;
|
||||
private Long teamId;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.resp.ProjectFindSkuInfoResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 回显sku模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 16:03
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamProductSkuModel {
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
public static ActivityTeamProductSkuModel FindBuild(ActivityTeamProductSkuInfo activityTeamProductSkuInfo) {
|
||||
return ActivityTeamProductSkuModel.builder()
|
||||
.id(activityTeamProductSkuInfo.getId())
|
||||
.sku(activityTeamProductSkuInfo.getProductSku())
|
||||
.teamStock(activityTeamProductSkuInfo.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: sku修改模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 19:45
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamProductSkuReqModel {
|
||||
private Long id;
|
||||
private Long teamId;
|
||||
private Long productId;
|
||||
private String productSku;
|
||||
private Long teamStock;
|
||||
private Long remainStock;
|
||||
private BigDecimal teamPrice;
|
||||
public static ActivityTeamProductSkuReqModel activityTeamProductSkuReqModelBuild(ActivityTeamProductSkuReq activityTeamProductSkuReq){
|
||||
return ActivityTeamProductSkuReqModel.builder()
|
||||
.id(activityTeamProductSkuReq.getId())
|
||||
.productId(activityTeamProductSkuReq.getProductId())
|
||||
.teamId(activityTeamProductSkuReq.getTeamId())
|
||||
.productSku(activityTeamProductSkuReq.getProductSku())
|
||||
.remainStock(activityTeamProductSkuReq.getRemainStock())
|
||||
.teamStock(activityTeamProductSkuReq.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuReq.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,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,5 +1,7 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoUpdReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -8,17 +10,21 @@ import lombok.NoArgsConstructor;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 拼团活动商品sku修改模型
|
||||
* 拼团活动商品SKU
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-27 14:18
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductSkuUpdModel {
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
* 商品规格ID
|
||||
*/
|
||||
private Long ProductId;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 团购价格
|
||||
|
@ -29,4 +35,12 @@ public class ActivityTeamProductSkuUpdModel {
|
|||
* 团购库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
public static ActivityTeamProductSkuUpdModel updReqBuild(TeamProjectSkuInfoUpdReq teamProjectSkuInfoUpdReq){
|
||||
return ActivityTeamProductSkuUpdModel.builder()
|
||||
.id(teamProjectSkuInfoUpdReq.getId())
|
||||
.teamStock(teamProjectSkuInfoUpdReq.getTeamStock())
|
||||
.teamPrice(teamProjectSkuInfoUpdReq.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,75 +0,0 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.resp.ActivityProductUpdResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityProductUpdReq {
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU
|
||||
*/
|
||||
private ActivityProductUpdResp activityProductUpdResp;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
}
|
|
@ -36,6 +36,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
|||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
|
@ -54,7 +55,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
|||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ProjectSkuInfoAddReq> projectSkuInfoAddReqList;
|
||||
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
|
@ -71,6 +72,4 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
|||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 活动商品规格修改入参
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 19:25
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamInfoUpdReq {
|
||||
private Long id;
|
||||
private String name;
|
||||
private Long productId;
|
||||
private String productImage;
|
||||
private String introduction;
|
||||
private String unit;
|
||||
private String imageList;
|
||||
private Date endTime;
|
||||
private Long sort;
|
||||
private String content;
|
||||
private String status;
|
||||
private String strategyType;
|
||||
private Long strategyId;
|
||||
private ActivityTeamProductSkuSettingReq activityTeamProductSkuSettingReq;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
@ -7,27 +7,22 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: sku修改入参
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 19:45
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ProductSkuAddModel {
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
public class ActivityTeamProductSkuReq {
|
||||
private Long id;
|
||||
private Long teamId;
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private String productSku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
private Long remainStock;
|
||||
private BigDecimal teamPrice;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 团购商品规格设置
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-28 11:27
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductSkuSettingReq {
|
||||
/**
|
||||
* 删除的ID集合
|
||||
*/
|
||||
private List<Long> removeIds;
|
||||
|
||||
/**
|
||||
* 添加的规格集合
|
||||
*/
|
||||
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
||||
|
||||
/**
|
||||
* 添加的规格集合
|
||||
*/
|
||||
private List<TeamProjectSkuInfoUpdReq> teamProjectSkuInfoUpdReqList;
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
@ -15,8 +14,7 @@ import java.math.BigDecimal;
|
|||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ProjectSkuInfoAddReq {
|
||||
private Long id;
|
||||
public class TeamProjectSkuInfoAddReq {
|
||||
|
||||
/**
|
||||
* 规格SKU
|
|
@ -1,25 +1,25 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品规格的修改模型
|
||||
* 添加的
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ProductSkuUpdModel {
|
||||
public class TeamProjectSkuInfoUpdReq {
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
* 规格SKU
|
||||
*/
|
||||
private Long productId;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
|
@ -1,34 +0,0 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import com.muyu.marketing.domain.model.ProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ProductSkuUpdModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityProductUpdResp {
|
||||
/**
|
||||
* 商品修改SkU集合
|
||||
*/
|
||||
private List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdList;
|
||||
|
||||
/**
|
||||
* 删除商品规格idList
|
||||
*/
|
||||
private List<Long> deleteSkuIdList;
|
||||
|
||||
/**
|
||||
* 添加商品规格的List
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddList;
|
||||
|
||||
|
||||
}
|
|
@ -1,29 +1,28 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 修改回显的团购活动信息
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-26 09:38
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoDetailResp {
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ActivityTeamDetailResp extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 活动id
|
||||
* 团购ID
|
||||
*/
|
||||
private Long id;
|
||||
private Long teamId;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
|
@ -31,7 +30,7 @@ public class ActivityTeamInfoDetailResp {
|
|||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long projectId;
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
|
@ -43,10 +42,12 @@ public class ActivityTeamInfoDetailResp {
|
|||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
|
@ -60,7 +61,7 @@ public class ActivityTeamInfoDetailResp {
|
|||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ActivityTeamProductSkuResp> ActivityTeamProductSkuList;
|
||||
private List<ActivityTeamProjectSkuResp> activityTeamProjectSkuList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
|
@ -1,20 +1,25 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 添加的
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductSkuResp {
|
||||
@NoArgsConstructor
|
||||
public class ActivityTeamProjectSkuResp {
|
||||
|
||||
/**
|
||||
* 规格id
|
||||
* 团购商品SKU的ID
|
||||
*/
|
||||
private Long ProductId;
|
||||
private Long productSkuId;
|
||||
|
||||
/**
|
||||
* 规格SKU
|
|
@ -1,32 +0,0 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品规格数据
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ProductSkuResp {
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
private Long ProductId;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 回显resp
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ProjectFindSkuInfoResp {
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
public static ProjectFindSkuInfoResp projectFindSkuInfoBuild (ActivityTeamProductSkuModel activityTeamProductSkuModel) {
|
||||
return ProjectFindSkuInfoResp.builder()
|
||||
.teamStock(activityTeamProductSkuModel.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuModel.getTeamPrice())
|
||||
.id(activityTeamProductSkuModel.getId())
|
||||
.sku(activityTeamProductSkuModel.getSku())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 团购活动回显响应
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 15:19
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TeamInfoFindByIdResp {
|
||||
/**
|
||||
* 拼团id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ProjectFindSkuInfoResp> projectSkuInfoAddList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
public static TeamInfoFindByIdResp teamInfoFindByIdBuild (ActivityTeamDetailModel activityTeamDetailModel){
|
||||
return TeamInfoFindByIdResp.builder()
|
||||
.id(activityTeamDetailModel.getId())
|
||||
.name(activityTeamDetailModel.getName())
|
||||
.productId(activityTeamDetailModel.getProductId())
|
||||
.productImage(activityTeamDetailModel.getProductImage())
|
||||
.introduction(activityTeamDetailModel.getIntroduction())
|
||||
.unit(activityTeamDetailModel.getUnit())
|
||||
.imageList(activityTeamDetailModel.getImageList())
|
||||
.endTime(activityTeamDetailModel.getEndTime())
|
||||
.sort(activityTeamDetailModel.getSort())
|
||||
.projectSkuInfoAddList(activityTeamDetailModel.getProjectSkuInfoAddReqList().stream().map(ProjectFindSkuInfoResp::projectFindSkuInfoBuild).toList())
|
||||
// .projectSkuInfoAddList(
|
||||
// teamInfoFindByIdRespModel.getProjectSkuInfoAddReqList().stream().map(activityTeamProductSkuModel ->
|
||||
// ProjectFindSkuInfoResp.projectFindSkuInfoBuild(activityTeamProductSkuModel)).toList()
|
||||
// )
|
||||
.content(activityTeamDetailModel.getContent())
|
||||
.status(activityTeamDetailModel.getStatus())
|
||||
.strategyType(activityTeamDetailModel.getStrategyType())
|
||||
.strategyId(activityTeamDetailModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -3,14 +3,13 @@ package com.muyu.marketing.team.controller;
|
|||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityProductUpdModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.req.ActivityProductUpdReq;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoDetailResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoFindByIdResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -48,43 +47,25 @@ public class ActivityTeamController {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加营销团购活动
|
||||
* 添加团购活动
|
||||
* @param activityTeamInfoSaveReq 添加请求对象
|
||||
* @return 结果集
|
||||
*/
|
||||
@PostMapping("insert")
|
||||
public Result<String> insert(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addBuild(activityTeamInfoSaveReq));
|
||||
@PostMapping
|
||||
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取营销团购活动信息
|
||||
*/
|
||||
@GetMapping("/{teamId}")
|
||||
public Result<ActivityTeamInfoDetailResp> getTeamInfo(@PathVariable("teamId") Long teamId){
|
||||
return Result.success(activityTeamInfoService.getActivityByTeamId(teamId));
|
||||
@PostMapping("/findById/{id}")
|
||||
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
||||
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 营销活动的修改
|
||||
*/
|
||||
@PutMapping("update")
|
||||
public Result<String> update(@RequestBody ActivityProductUpdReq activityProductUpdReq){
|
||||
activityTeamInfoService.edit(activityProductUpdReq);
|
||||
@PutMapping("/updateByTeamId")
|
||||
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 团购活动列表
|
||||
*/
|
||||
@GetMapping("/teamList")
|
||||
public Result<TableDataInfo<ActivityTeamInfo>> teamList(){
|
||||
List<ActivityTeamInfo> list = activityTeamInfoService.list();
|
||||
TableDataInfo<ActivityTeamInfo> tableDataInfo = new TableDataInfo<>();
|
||||
tableDataInfo.setRows(list);
|
||||
tableDataInfo.setTotal(list.size());
|
||||
return Result.success(tableDataInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
package com.muyu.marketing.team.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.marketing.domain.model.ActivityProductSkuListModel;
|
||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sku")
|
||||
public class ActivityTeamProductSkuController {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||
|
||||
|
||||
}
|
|
@ -2,8 +2,6 @@ package com.muyu.marketing.team.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyExemptionHundred> {
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TeamStrategyExemptionOrdinaryMapper extends BaseMapper<TeamStrategyExemptionOrdinary> {
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TeamStrategyHundredMapper extends BaseMapper<TeamStrategyHundred> {
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TeamStrategyOrdinaryMapper extends BaseMapper<TeamStrategyOrdinary> {
|
||||
|
||||
}
|
|
@ -3,15 +3,7 @@ package com.muyu.marketing.team.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityProductUpdModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import com.muyu.marketing.domain.req.ActivityProductUpdReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoDetailResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
|
||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||
|
||||
|
@ -30,20 +22,18 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
|||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||
|
||||
/**
|
||||
* 通过id查询团购活动详情
|
||||
* 根据ID查询商品的详情
|
||||
* @param id 团购活动ID
|
||||
* @return 团购详情
|
||||
*/
|
||||
ActivityTeamInfoDetailResp getActivityByTeamId(Long teamId);
|
||||
|
||||
ActivityTeamDetailModel findDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 修改团购活动信息
|
||||
* @param activityProductUpdReq
|
||||
* @param activityTeamInfoUpdModel 团购活动信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
void edit(ActivityProductUpdReq activityProductUpdReq);
|
||||
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param activityTeamInfo
|
||||
* @return
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -39,17 +39,35 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||
|
||||
/**
|
||||
* 通过活动id查询活动商品规格信息
|
||||
* 通过拼团活动ID获取拼团下商品SKU集合
|
||||
* @param teamId 活动ID
|
||||
* @return 拼团商品SKU集合
|
||||
*/
|
||||
public List<ActivityProductSkuListModel> getTeamProductSkuInfoListByTeamId(Long teamId);
|
||||
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
||||
|
||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
||||
|
||||
/**
|
||||
* 修改商品规格
|
||||
* 根据 业务模型 进行 团购商品修改
|
||||
* @param activityTeamProductSkuUpdModel 修改业务模型
|
||||
* @return 修改结果
|
||||
*/
|
||||
public boolean editBatchActivityTeamProductSkuUpdModelList(List<ActivityTeamProductSkuUpdModel> productSkuUpdList);
|
||||
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel);
|
||||
|
||||
/**
|
||||
* 商品规格的批量删除
|
||||
* 根据 业务模型 进行 团购商品批量修改
|
||||
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
||||
* @return 修改结果
|
||||
*/
|
||||
public boolean deleteBatchByTeamIds(List<Long> id);
|
||||
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList);
|
||||
|
||||
/**
|
||||
* 一键设置
|
||||
* @param activityTeamProductSkuSettingModel 整体修改模型
|
||||
*/
|
||||
public default void setting(ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel){
|
||||
this.batchSave(activityTeamProductSkuSettingModel.getActivityTeamProductSkuAddModelList());
|
||||
this.batchUpdate(activityTeamProductSkuSettingModel.getActivityTeamProductSkuUpdModelList());
|
||||
this.removeByIds(activityTeamProductSkuSettingModel.getRemoveIds());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
|
||||
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred>, ActivityTeamStrategy {
|
||||
}
|
|
@ -1,8 +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;
|
||||
|
||||
public interface TeamStrategyExemptionOrdinaryService extends ActivityTeamStrategy,IService<TeamStrategyExemptionOrdinary> {
|
||||
}
|
|
@ -2,8 +2,10 @@ package com.muyu.marketing.team.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
|
||||
/**
|
||||
* 免单
|
||||
*/
|
||||
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,36 +3,24 @@ package com.muyu.marketing.team.service.impl;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.utils.bean.BeanUtils;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.domain.req.ActivityProductUpdReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityProductUpdResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoDetailResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamProductSkuResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
import io.lettuce.core.ClientOptions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
||||
@Service
|
||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
||||
implements ActivityTeamInfoService {
|
||||
implements ActivityTeamInfoService {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||
|
@ -40,10 +28,6 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
@Autowired
|
||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||
|
||||
// @Autowired
|
||||
// private ActivityTeamInfoMapper activityTeamInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||
|
||||
|
@ -88,124 +72,37 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
*/
|
||||
@Override
|
||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel) {
|
||||
boolean save = this.save(ActivityTeamInfo.addModelBuild(activityTeamInfoAddModel));
|
||||
if (!save) {
|
||||
throw new ServiceException(
|
||||
StringUtils.format("团购活动添加失败:[{}]", activityTeamInfoAddModel)
|
||||
);
|
||||
}
|
||||
this.activityTeamProductSkuInfoService.batchSave(
|
||||
activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList()
|
||||
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.addModelBuild(activityTeamInfoAddModel);
|
||||
Assert.isTrue(this.save(activityTeamInfo), StringUtils.format("团购活动添加失败:[{}]", activityTeamInfoAddModel));
|
||||
List<ActivityTeamProductSkuAddModel> teamProductSkuAddModelList = activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList();
|
||||
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
||||
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询商品的详情
|
||||
* @param id 团购活动ID
|
||||
* @return 团购详情
|
||||
*/
|
||||
@Override
|
||||
public ActivityTeamDetailModel findDetailById(Long id) {
|
||||
ActivityTeamInfo activityTeamInfo = this.getById(id);
|
||||
List<ActivityTeamProductSkuModel> activityTeamProductSkuModelList = activityTeamProductSkuInfoService.findListByTeamId(id);
|
||||
return ActivityTeamDetailModel.findSkuSumList(activityTeamInfo,
|
||||
(teamInfoFindByIdRespModelBuilder) -> teamInfoFindByIdRespModelBuilder.projectSkuInfoAddReqList(activityTeamProductSkuModelList).build()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询活动详情
|
||||
*
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ActivityTeamInfoDetailResp getActivityByTeamId(Long teamId) {
|
||||
//根据id查询活动详情
|
||||
ActivityTeamInfo activityTeamInfo = getById(teamId);
|
||||
//封装活动详情
|
||||
ActivityTeamInfoDetailResp activityTeamInfoDetailResp = new ActivityTeamInfoDetailResp();
|
||||
//根据活动id查询活动商品SKU集合
|
||||
List<ActivityProductSkuListModel> teamProductSkuInfoList = activityTeamProductSkuInfoService.getTeamProductSkuInfoListByTeamId(teamId);
|
||||
if (teamProductSkuInfoList != null) {
|
||||
//定义一个空集合
|
||||
ArrayList<ActivityTeamProductSkuResp> activityProductSkuList = new ArrayList<>();
|
||||
for (ActivityProductSkuListModel activityProductSkuListModel : teamProductSkuInfoList) {
|
||||
Long id = activityProductSkuListModel.getId();
|
||||
//根据id查询
|
||||
ActivityTeamProductSkuInfo activityTeamProductSkuInfo = activityTeamProductSkuInfoService.getById(id);
|
||||
//添加到集合中
|
||||
activityProductSkuList.add(
|
||||
ActivityTeamProductSkuResp.builder()
|
||||
.ProductId(activityTeamProductSkuInfo.getProductId())
|
||||
.sku(activityTeamProductSkuInfo.getProductSku())
|
||||
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
||||
.teamStock(activityTeamProductSkuInfo.getTeamStock())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
activityTeamInfoDetailResp.setActivityTeamProductSkuList(activityProductSkuList);
|
||||
BeanUtils.copyBeanProp(activityTeamInfoDetailResp, activityTeamInfo);
|
||||
}
|
||||
return activityTeamInfoDetailResp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改团购活动信息
|
||||
* @param activityProductUpdReq
|
||||
* @param activityTeamInfoUpdModel 团购活动信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public void edit(ActivityProductUpdReq activityProductUpdReq) {
|
||||
//获取活动商品SKU
|
||||
ActivityProductUpdResp activityProductUpdResp = activityProductUpdReq.getActivityProductUpdResp();
|
||||
//获取需要删除的SKU集合
|
||||
List<Long> deleteSkuIdList = activityProductUpdResp.getDeleteSkuIdList();
|
||||
//判断是否为空
|
||||
if (deleteSkuIdList != null){
|
||||
activityTeamProductSkuInfoService.deleteBatchByTeamIds(deleteSkuIdList);
|
||||
}
|
||||
//获取需要修改的SKU集合
|
||||
List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuList = activityProductUpdResp.getActivityTeamProductSkuUpdList();
|
||||
//判断是否为空
|
||||
if (activityTeamProductSkuList != null){
|
||||
activityTeamProductSkuList.stream().map(productSkuUpdModel -> {
|
||||
return ProductSkuUpdModel.builder()
|
||||
.productId(productSkuUpdModel.getProductId())
|
||||
.teamPrice(productSkuUpdModel.getTeamPrice())
|
||||
.teamStock(productSkuUpdModel.getTeamStock())
|
||||
.build();
|
||||
}).toList();
|
||||
//批量修改SKU集合
|
||||
activityTeamProductSkuInfoService.editBatchActivityTeamProductSkuUpdModelList(activityTeamProductSkuList);
|
||||
}
|
||||
|
||||
//获取要添加的SKU集合
|
||||
List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddList = activityProductUpdResp.getActivityTeamProductSkuAddList();
|
||||
//判断是否为空
|
||||
if (activityTeamProductSkuAddList != null){
|
||||
activityTeamProductSkuAddList.stream().map(productSkuAddModel -> {
|
||||
return ProductSkuAddModel.builder()
|
||||
.productId(productSkuAddModel.getProductId())
|
||||
.teamPrice(productSkuAddModel.getTeamPrice())
|
||||
.teamStock(productSkuAddModel.getTeamStock())
|
||||
.productSku(productSkuAddModel.getProductSku())
|
||||
.build();
|
||||
}).toList();
|
||||
//批量添加SKU集合
|
||||
activityTeamProductSkuInfoService.batchSave(activityTeamProductSkuAddList);
|
||||
|
||||
}
|
||||
//修改活动信息
|
||||
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.builder()
|
||||
.id(activityProductUpdReq.getId())
|
||||
.name(activityProductUpdReq.getName())
|
||||
.projectId(activityProductUpdReq.getProjectId())
|
||||
.productImage(activityProductUpdReq.getProductImage())
|
||||
.introduction(activityProductUpdReq.getIntroduction())
|
||||
.unit(activityProductUpdReq.getUnit())
|
||||
.imageList(activityProductUpdReq.getImageList())
|
||||
.endTime(activityProductUpdReq.getEndTime())
|
||||
.sort(activityProductUpdReq.getSort())
|
||||
.content(activityProductUpdReq.getContent())
|
||||
.status(activityProductUpdReq.getStatus())
|
||||
.strategyType(activityProductUpdReq.getStrategyType())
|
||||
.strategyId(activityProductUpdReq.getStrategyId())
|
||||
.build();
|
||||
//修改拼团活动
|
||||
updateById(activityTeamInfo);
|
||||
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
||||
Assert.isTrue(update,"修改失败");
|
||||
activityTeamProductSkuInfoService.setting(activityTeamInfoUpdModel.getActivityTeamProductSkuSettingModel());
|
||||
return update;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,36 +2,31 @@ package com.muyu.marketing.team.service.impl;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoDetailResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamProductSkuResp;
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
import com.muyu.product.cache.ProjectSkuCache;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||
implements ActivityTeamProductSkuInfoService {
|
||||
implements ActivityTeamProductSkuInfoService {
|
||||
|
||||
@Autowired
|
||||
private ProjectSkuCache projectSkuCache;
|
||||
@Autowired
|
||||
private @Lazy ActivityTeamInfoService activityTeamInfoService;
|
||||
@Autowired
|
||||
private ActivityTeamProductSkuInfoMapper activityTeamProductSkuInfoMapper;
|
||||
|
||||
/**
|
||||
* 通过团购活动ID获取团购中最优惠的价格
|
||||
|
@ -50,7 +45,7 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
|||
return TeamProductDiscountPriceModel.of(projectSkuInfo.getPrice(), activityTeamProductSkuInfo.getTeamPrice());
|
||||
}).min((o1, o2) -> Double.valueOf(o1.getDiscount() * 100 - o2.getDiscount() * 100).intValue());
|
||||
|
||||
if (discountPriceModelOptional.isEmpty()) {
|
||||
if (discountPriceModelOptional.isEmpty()){
|
||||
throw new ServiceException("团购活动下没有商品绑定");
|
||||
}
|
||||
return discountPriceModelOptional.get();
|
||||
|
@ -87,66 +82,57 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
|||
}
|
||||
|
||||
/**
|
||||
* 根据团购ID获取团购商品SKU列表
|
||||
* 通过拼团活动ID获取拼团下商品SKU集合
|
||||
*
|
||||
* @param teamId
|
||||
* @return
|
||||
* @param teamId 活动ID
|
||||
* @return 拼团商品SKU集合
|
||||
*/
|
||||
@Override
|
||||
public List<ActivityProductSkuListModel> getTeamProductSkuInfoListByTeamId(Long teamId) {
|
||||
//根据活动id查询团购商品SKU集合
|
||||
List<ActivityTeamProductSkuInfo> activityTeamProductSkuList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||
ArrayList<ActivityProductSkuListModel> activityProductSkuList = new ArrayList<>();
|
||||
for (ActivityTeamProductSkuInfo activityTeamProductSkuInfo : activityTeamProductSkuList) {
|
||||
activityProductSkuList.add(ActivityProductSkuListModel.builder()
|
||||
.id(activityTeamProductSkuInfo.getId())
|
||||
.productId(activityTeamProductSkuInfo.getProductId())
|
||||
.sku(activityTeamProductSkuInfo.getProductSku())
|
||||
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
||||
.teamStock(activityTeamProductSkuInfo.getTeamStock())
|
||||
.build());
|
||||
}
|
||||
return activityProductSkuList;
|
||||
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId) {
|
||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,teamId);
|
||||
List<ActivityTeamProductSkuInfo> list = this.list(queryWrapper);
|
||||
return list.stream().map(ActivityTeamProductSkuModel::FindBuild).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 productSkuUpdList
|
||||
* @return
|
||||
* @param activityTeamProductSkuUpdModel 修改业务模型
|
||||
* @return 修改结果
|
||||
*/
|
||||
@Override
|
||||
public boolean editBatchActivityTeamProductSkuUpdModelList(List<ActivityTeamProductSkuUpdModel> productSkuUpdList) {
|
||||
//创建updateWrapper
|
||||
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
||||
// update set where
|
||||
LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
//遍历集合
|
||||
for (ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel : productSkuUpdList) {
|
||||
//赋值
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice, activityTeamProductSkuUpdModel.getTeamPrice());
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock, activityTeamProductSkuUpdModel.getTeamStock());
|
||||
updateWrapper.eq(ActivityTeamProductSkuInfo::getProductId, activityTeamProductSkuUpdModel.getProductId());
|
||||
}
|
||||
//返回
|
||||
// 字段=值
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock,activityTeamProductSkuUpdModel.getTeamStock());
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getRemainStock,activityTeamProductSkuUpdModel.getTeamStock());
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice,activityTeamProductSkuUpdModel.getTeamPrice());
|
||||
// id=?
|
||||
updateWrapper.eq(ActivityTeamProductSkuInfo::getId,activityTeamProductSkuUpdModel.getId());
|
||||
return this.update(updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品规格的批量删除
|
||||
* @param id
|
||||
* @return
|
||||
* 根据 业务模型 进行 团购商品批量修改
|
||||
*
|
||||
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
||||
* @return 修改结果
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteBatchByTeamIds(List<Long> id) {
|
||||
//创建updateWrapper
|
||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
//根据id查询
|
||||
List<Long> productIdList = activityTeamProductSkuInfoMapper.selectList(lambdaQueryWrapper).stream().map(ActivityTeamProductSkuInfo::getProductId).toList();
|
||||
//判断集合是否为空
|
||||
if (productIdList == null && productIdList.isEmpty()) {
|
||||
throw new ServiceException("该团购下没有商品");
|
||||
}
|
||||
return this.removeBatchByIds(productIdList);
|
||||
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
||||
return this.updateBatchById(
|
||||
activityTeamProductSkuUpdModelList.stream()
|
||||
.map(ActivityTeamProductSkuInfo::updModelBuild)
|
||||
.toList()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionHundredService;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service("team_strategy_exemption_hundred")
|
||||
@Log4j2
|
||||
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred>
|
||||
implements TeamStrategyExemptionHundredService {
|
||||
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
log.info("参加-百人团 -[{}]",activityTeamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,39 +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;
|
||||
|
||||
@Service("team_strategy_exemption_ordinary")
|
||||
@Log4j2
|
||||
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary>
|
||||
implements TeamStrategyExemptionOrdinaryService {
|
||||
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
log.info("参加-普通团 -[{}]",activityTeamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
|
@ -7,31 +7,57 @@ import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
|||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service("team_strategy_exemption")
|
||||
@Log4j2
|
||||
@Service("team-strategy-exemption")
|
||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||
implements TeamStrategyExemptionService {
|
||||
|
||||
/**
|
||||
* 开团
|
||||
*
|
||||
* @param activityTeamId 团购活动ID
|
||||
*/
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
log.info("参加-免单团 -[{}]",activityTeamId);
|
||||
log.info("参加 - 免单团 - [{}]", activityTeamId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
*
|
||||
* @param teamId 团ID
|
||||
*/
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 参团
|
||||
*
|
||||
* @param teamId 加团ID
|
||||
* @param orderNumber 订单编号
|
||||
*/
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyHundredMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyHundredService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Log4j2
|
||||
@Service("team-strategy-hundred")
|
||||
public class TeamStrategyHundredServiceImpl extends ServiceImpl<TeamStrategyHundredMapper, TeamStrategyHundred>
|
||||
implements TeamStrategyHundredService {
|
||||
|
||||
/**
|
||||
* 开团
|
||||
*
|
||||
* @param activityTeamId 团购活动ID
|
||||
*/
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
|
||||
log.info("参加 - 百人团 - [{}]", activityTeamId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
*
|
||||
* @param teamId 团ID
|
||||
*/
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 参团
|
||||
*
|
||||
* @param teamId 加团ID
|
||||
* @param orderNumber 订单编号
|
||||
*/
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyOrdinaryMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyOrdinaryService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Log4j2
|
||||
@Service("team-strategy-ordinary")
|
||||
public class TeamStrategyOrdinaryServiceImpl extends ServiceImpl<TeamStrategyOrdinaryMapper, TeamStrategyOrdinary>
|
||||
implements TeamStrategyOrdinaryService {
|
||||
|
||||
/**
|
||||
* 开团
|
||||
*
|
||||
* @param activityTeamId 团购活动ID
|
||||
*/
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
|
||||
log.info("参加 - 普通团 - [{}]", activityTeamId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
*
|
||||
* @param teamId 团ID
|
||||
*/
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 参团
|
||||
*
|
||||
* @param teamId 加团ID
|
||||
* @param orderNumber 订单编号
|
||||
*/
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,38 +1,44 @@
|
|||
package com.muyu.marketing.team.strategy;
|
||||
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 团购活动策略
|
||||
* 团活动策略
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-29 15:03
|
||||
*/
|
||||
public interface ActivityTeamStrategy {
|
||||
|
||||
/**
|
||||
* 开团
|
||||
* @param activityTeamId 活动拼团id
|
||||
* @param activityTeamId 团购活动ID
|
||||
*/
|
||||
public void openTeam(Long activityTeamId);
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
* @param teamId 拼团id
|
||||
* @param teamId 团ID
|
||||
*/
|
||||
public void applyTeam(Long teamId);
|
||||
|
||||
/**
|
||||
* 加团
|
||||
* @param teamId 拼团id
|
||||
* @param orderNumber 订单号
|
||||
* 参团
|
||||
* @param teamId 加团ID
|
||||
* @param orderNumber 订单编号
|
||||
*/
|
||||
public void addTeam(Long teamId, String orderNumber);
|
||||
|
||||
/**
|
||||
* 退团
|
||||
* @param teamId 拼团id
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
public void backTeam(Long teamId);
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
* @param teamId 拼团id
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
public void settle(Long teamId);
|
||||
}
|
||||
|
|
|
@ -1,45 +1,83 @@
|
|||
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 不能为空");
|
||||
}else if (activityTeamId==1){
|
||||
activityTeamType="team_strategy_exemption_hundred";
|
||||
}else if (activityTeamId==2){
|
||||
activityTeamType="team_strategy_exemption_ordinary";
|
||||
}else if (activityTeamId==3){
|
||||
activityTeamType="team_strategy_exemption";
|
||||
if (activityTeamId == null) {
|
||||
throw new ServiceException("activityTeamId is null");
|
||||
}else if (activityTeamId == 0) {
|
||||
activityTeamType = "team-strategy-exemption";
|
||||
}else if (activityTeamId == 1) {
|
||||
activityTeamType = "team-strategy-hundred";
|
||||
}else if (activityTeamId == 2) {
|
||||
activityTeamType = "team-strategy-ordinary";
|
||||
}
|
||||
ActivityTeamStrategy activityTeamStrategy = SpringUtils.getBean(activityTeamType);
|
||||
activityTeamStrategy.openTeam(activityTeamId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
*
|
||||
* @param teamId 团ID
|
||||
*/
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 参团
|
||||
*
|
||||
* @param teamId 加团ID
|
||||
* @param orderNumber 订单编号
|
||||
*/
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ server:
|
|||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: muyu-marketing
|
||||
name: muyu-buy
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
|
@ -14,12 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -1,22 +1,28 @@
|
|||
package com.muyu.test;
|
||||
|
||||
|
||||
import com.muyu.marketing.MuYuMarketIngApplication;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
import io.jsonwebtoken.lang.Classes;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest(classes= MuYuMarketIngApplication.class)
|
||||
/**
|
||||
* 测试
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-29 15:40
|
||||
*/
|
||||
@SpringBootTest(classes = MuYuMarketIngApplication.class)
|
||||
public class TeamStrategyTest {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamStrategy activityTeamStrategy;
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
public void testStrategy() {
|
||||
activityTeamStrategy.openTeam(0L);
|
||||
activityTeamStrategy.openTeam(1L);
|
||||
activityTeamStrategy.openTeam(2L);
|
||||
activityTeamStrategy.openTeam(3L);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.muyu.product.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -33,7 +32,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
//@Api(tags = "商品评论")
|
||||
@Api(tags = "商品评论")
|
||||
@RestController
|
||||
@RequestMapping("/comment")
|
||||
public class CommentInfoController extends BaseController {
|
||||
|
@ -43,10 +42,10 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 查询商品评论列表
|
||||
*/
|
||||
// @ApiOperation("获取商品评论列表")
|
||||
// @RequiresPermissions("product:comment:list")
|
||||
@ApiOperation("获取商品评论列表")
|
||||
@RequiresPermissions("product:comment:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<CommentInfo>> list(@RequestBody CommentInfoQueryReq commentInfoQueryReq) {
|
||||
public Result<TableDataInfo<CommentInfo>> list(CommentInfoQueryReq commentInfoQueryReq) {
|
||||
startPage();
|
||||
List<CommentInfo> list = commentInfoService.list(CommentInfo.queryBuild(commentInfoQueryReq));
|
||||
return getDataTable(list);
|
||||
|
@ -55,8 +54,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 导出商品评论列表
|
||||
*/
|
||||
// @ApiOperation("导出商品评论列表")
|
||||
// @RequiresPermissions("product:comment:export")
|
||||
@ApiOperation("导出商品评论列表")
|
||||
@RequiresPermissions("product:comment:export")
|
||||
@Log(title = "商品评论", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CommentInfo commentInfo) {
|
||||
|
@ -68,8 +67,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 获取商品评论详细信息
|
||||
*/
|
||||
// @ApiOperation("获取商品评论详细信息")
|
||||
// @RequiresPermissions("product:comment:query")
|
||||
@ApiOperation("获取商品评论详细信息")
|
||||
@RequiresPermissions("product:comment:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<CommentInfo> getInfo(@PathVariable("id") Long id) {
|
||||
|
@ -79,8 +78,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 新增商品评论
|
||||
*/
|
||||
// @RequiresPermissions("product:comment:add")
|
||||
// @Log(title = "商品评论", businessType = BusinessType.INSERT)
|
||||
@RequiresPermissions("product:comment:add")
|
||||
@Log(title = "商品评论", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation("新增商品评论")
|
||||
public Result<String> add(@RequestBody CommentInfoSaveReq commentInfoSaveReq) {
|
||||
|
@ -90,8 +89,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 修改商品评论
|
||||
*/
|
||||
// @RequiresPermissions("product:comment:edit")
|
||||
// @Log(title = "商品评论", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("product:comment:edit")
|
||||
@Log(title = "商品评论", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改商品评论")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody CommentInfoEditReq commentInfoEditReq) {
|
||||
|
@ -109,16 +108,4 @@ public class CommentInfoController extends BaseController {
|
|||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(commentInfoService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品Id查询评论
|
||||
*/
|
||||
@GetMapping("/getCommentByProjectId/{projectId}")
|
||||
public Result getCommentByProjectId(@PathVariable Long projectId){
|
||||
//查询条件
|
||||
LambdaQueryWrapper<CommentInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CommentInfo::getProjectId,projectId);
|
||||
//查询
|
||||
return Result.success(commentInfoService.list(lambdaQueryWrapper));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
//@Api(tags = "评论点赞")
|
||||
@Api(tags = "评论点赞")
|
||||
@RestController
|
||||
@RequestMapping("/commentLike")
|
||||
public class CommentLikeInfoController extends BaseController {
|
||||
|
@ -42,8 +42,8 @@ public class CommentLikeInfoController extends BaseController {
|
|||
/**
|
||||
* 查询评论点赞列表
|
||||
*/
|
||||
// @ApiOperation("获取评论点赞列表")
|
||||
// @RequiresPermissions("product:commentLike:list")
|
||||
@ApiOperation("获取评论点赞列表")
|
||||
@RequiresPermissions("product:commentLike:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<CommentLikeInfo>> list(CommentLikeInfoQueryReq commentLikeInfoQueryReq) {
|
||||
startPage();
|
||||
|
@ -54,8 +54,8 @@ public class CommentLikeInfoController extends BaseController {
|
|||
/**
|
||||
* 导出评论点赞列表
|
||||
*/
|
||||
// @ApiOperation("导出评论点赞列表")
|
||||
// @RequiresPermissions("product:commentLike:export")
|
||||
@ApiOperation("导出评论点赞列表")
|
||||
@RequiresPermissions("product:commentLike:export")
|
||||
@Log(title = "评论点赞", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CommentLikeInfo commentLikeInfo) {
|
||||
|
@ -68,7 +68,7 @@ public class CommentLikeInfoController extends BaseController {
|
|||
* 获取评论点赞详细信息
|
||||
*/
|
||||
@ApiOperation("获取评论点赞详细信息")
|
||||
// @RequiresPermissions("product:commentLike:query")
|
||||
@RequiresPermissions("product:commentLike:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<CommentLikeInfo> getInfo(@PathVariable("id") Long id) {
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.muyu.product.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -131,15 +130,4 @@ public class ProjectSkuInfoController extends BaseController {
|
|||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(projectSkuInfoService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品Id查询规格
|
||||
*/
|
||||
@GetMapping("getProductSKUByProductId/{productId}")
|
||||
public Result getProductSKUByProductId(@PathVariable Integer productId){
|
||||
LambdaQueryWrapper<ProjectSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ProjectSkuInfo::getProjectId, productId);
|
||||
List<ProjectSkuInfo> projectSkuInfoList = projectSkuInfoService.list(lambdaQueryWrapper);
|
||||
return Result.success(projectSkuInfoList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,5 +19,4 @@ public interface CommentInfoService extends IService<CommentInfo> {
|
|||
*/
|
||||
public List<CommentInfo> list(CommentInfo commentInfo);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -54,12 +54,4 @@ public class CommentInfoServiceImpl extends ServiceImpl<CommentInfoMapper, Comme
|
|||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<CommentInfo> getByProjectId(Long id) {
|
||||
// LambdaQueryWrapper<CommentInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// lambdaQueryWrapper.eq(CommentInfo::getProjectId, id);
|
||||
// List<CommentInfo> list = this.list(lambdaQueryWrapper);
|
||||
// return list;
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -16,12 +16,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue