Compare commits
2 Commits
master
...
1126/dongh
Author | SHA1 | Date |
---|---|---|
|
8c5fba2ea9 | |
|
e5597f3b49 |
|
@ -0,0 +1,35 @@
|
||||||
|
$.{
|
||||||
|
"活动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",
|
||||||
|
"商品价格":"BigDecimal", // activity_team_product_sku_info.product_sku
|
||||||
|
"拼团价格":"BigDecimal",
|
||||||
|
"拼团库存":"Long" // 若是只修改库存可以直接写一个单独的修改库存接口
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"删除商品规格IdList":["Long","Long"],
|
||||||
|
"删除商品规格IdList":[
|
||||||
|
"商品SKU": "String",
|
||||||
|
"商品价格":"BigDecimal",
|
||||||
|
"拼团价格":"BigDecimal",
|
||||||
|
"拼团库存":"Long" // 若是只修改库存可以直接写一个单独的修改库存接口
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"状态":"String" //需要判断该商品是否已开启秒杀状态 若开启禁止修改 未开启则可以修改
|
||||||
|
"排序":"Integer",
|
||||||
|
"详情":"String"
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
$.{
|
||||||
|
"活动ID": "Long",
|
||||||
|
"商品ID": "Long", //activity_team_info.product_id
|
||||||
|
"商品图片": "String",
|
||||||
|
"活动名称": "String",
|
||||||
|
"活动简介": "String",
|
||||||
|
"商品单位": "String",
|
||||||
|
"商品的轮播图": [
|
||||||
|
"String", "String"
|
||||||
|
],
|
||||||
|
"活动时间": "date",
|
||||||
|
"策略类型": "String",
|
||||||
|
"策略ID": "Long",
|
||||||
|
"商品规格List": [ // activity_team_product_sku_info
|
||||||
|
{
|
||||||
|
"规格Id": "Long",
|
||||||
|
"规格SKU": "String", // activity_team_product_sku_info.product_sku
|
||||||
|
"拼团价格": "BigDecimal",
|
||||||
|
"拼团库存": "Long"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"排序": "Integer",
|
||||||
|
"详情": "String"
|
||||||
|
}
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
amespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
|
@ -22,7 +25,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
* 主键
|
* 主键
|
||||||
*/
|
*/
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 拼团名称
|
* 拼团名称
|
||||||
*/
|
*/
|
||||||
|
@ -54,7 +57,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private long sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 活动详情
|
* 活动详情
|
||||||
*/
|
*/
|
||||||
|
@ -70,7 +73,8 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 策略ID
|
* 策略ID
|
||||||
*/
|
*/
|
||||||
private long strategyId;
|
private Long strategyId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公共添加模型,转换成添加对象
|
* 公共添加模型,转换成添加对象
|
||||||
|
|
|
@ -60,6 +60,6 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||||
.build()
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class ActivityTeamInfoAddModel {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,97 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
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
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamInfoDatailModel {
|
||||||
|
/**
|
||||||
|
* 拼团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> activityTeamProductSkuList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
public static ActivityTeamInfoDatailModel DatailModel(ActivityTeamInfo activityTeamInfo, List<ActivityTeamProductSkuModel> teamInfoSkuListModelList) {
|
||||||
|
return ActivityTeamInfoDatailModel.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())
|
||||||
|
.activityTeamProductSkuList(teamInfoSkuListModelList)
|
||||||
|
.content(activityTeamInfo.getContent())
|
||||||
|
.status(activityTeamInfo.getStatus())
|
||||||
|
.strategyType(activityTeamInfo.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfo.getStrategyId())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动Id查询结果模型
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-20 14:18:10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamInfoSkuListModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动Id
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品Id
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuModel skuByIdModel(ActivityTeamProductSkuInfo activityTeamProductSkuInfo) {
|
||||||
|
return ActivityTeamProductSkuModel.builder()
|
||||||
|
.teamId(activityTeamProductSkuInfo.getTeamId())
|
||||||
|
.productId(activityTeamProductSkuInfo.getProductId())
|
||||||
|
.sku(activityTeamProductSkuInfo.getProductSku())
|
||||||
|
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
||||||
|
.teamStock(activityTeamProductSkuInfo.getTeamStock())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamProductSkuModel {
|
||||||
|
/**
|
||||||
|
* 规格Id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 团购活动ID
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
}
|
|
@ -44,7 +44,7 @@ public class TeamProductDiscountPriceModel {
|
||||||
* @return 优惠力度
|
* @return 优惠力度
|
||||||
*/
|
*/
|
||||||
public static TeamProductDiscountPriceModel of(BigDecimal productPrice, BigDecimal teamPrice) {
|
public static TeamProductDiscountPriceModel of(BigDecimal productPrice, BigDecimal teamPrice) {
|
||||||
TeamProductDiscountPriceModel.builder()
|
return TeamProductDiscountPriceModel.builder()
|
||||||
.productPrice(productPrice)
|
.productPrice(productPrice)
|
||||||
.teamPrice(teamPrice)
|
.teamPrice(teamPrice)
|
||||||
.discount(
|
.discount(
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,9 +3,10 @@ package com.muyu.marketing.domain.req;
|
||||||
import com.muyu.common.core.web.page.PageDomain;
|
import com.muyu.common.core.web.page.PageDomain;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
|
|
@ -0,0 +1,129 @@
|
||||||
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoDatailModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动添加模型
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-26 09:38
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamInfoDatailResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团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<ActivityTeamProductSkuResp> activityTeamProductSkuList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
public static ActivityTeamInfoDatailResp findRespBuild (ActivityTeamInfoDatailResp activityTeamInfoDatailResp){
|
||||||
|
return ActivityTeamInfoDatailResp.builder()
|
||||||
|
.name(activityTeamInfoDatailResp.getName())
|
||||||
|
.productId(activityTeamInfoDatailResp.getProductId())
|
||||||
|
.productImage(activityTeamInfoDatailResp.getProductImage())
|
||||||
|
.introduction(activityTeamInfoDatailResp.getIntroduction())
|
||||||
|
.unit(activityTeamInfoDatailResp.getUnit())
|
||||||
|
.imageList(activityTeamInfoDatailResp.getImageList())
|
||||||
|
.endTime(activityTeamInfoDatailResp.getEndTime())
|
||||||
|
.sort(activityTeamInfoDatailResp.getSort())
|
||||||
|
.content(activityTeamInfoDatailResp.getContent())
|
||||||
|
.status(activityTeamInfoDatailResp.getStatus())
|
||||||
|
.strategyType(activityTeamInfoDatailResp.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoDatailResp.getStrategyId())
|
||||||
|
.activityTeamProductSkuList(
|
||||||
|
activityTeamInfoDatailResp.getActivityTeamProductSkuList()
|
||||||
|
.stream()
|
||||||
|
.map(findResp -> ActivityTeamProductSkuResp.addReqBuild(findResp, activityTeamInfoDatailResp::getProductId))
|
||||||
|
.toList()
|
||||||
|
).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ActivityTeamInfoDatailResp datailRespBuilder(ActivityTeamInfoDatailModel datailModel,List<ActivityTeamProductSkuResp> activityTeamProductSkuResps ) {
|
||||||
|
return ActivityTeamInfoDatailResp.builder()
|
||||||
|
.id(datailModel.getId())
|
||||||
|
.name(datailModel.getName())
|
||||||
|
.productId(datailModel.getProductId())
|
||||||
|
.productImage(datailModel.getProductImage())
|
||||||
|
.introduction(datailModel.getIntroduction())
|
||||||
|
.unit(datailModel.getUnit())
|
||||||
|
.imageList(datailModel.getImageList())
|
||||||
|
.endTime(datailModel.getEndTime())
|
||||||
|
.sort(datailModel.getSort())
|
||||||
|
.status(datailModel.getStatus())
|
||||||
|
.content(datailModel.getContent())
|
||||||
|
.strategyType(datailModel.getStrategyType())
|
||||||
|
.strategyId(datailModel.getStrategyId())
|
||||||
|
.activityTeamProductSkuList(activityTeamProductSkuResps)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||||
|
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.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购spu库存添加模型
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-26 09:36
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamProductSkuResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格Id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 团购活动ID
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuResp addReqBuild(ActivityTeamProductSkuResp activityTeamProductSkuResp, Supplier<Long> productId){
|
||||||
|
return ActivityTeamProductSkuResp.builder()
|
||||||
|
.productId(productId.get())
|
||||||
|
.sku(activityTeamProductSkuResp.getSku())
|
||||||
|
.teamStock(activityTeamProductSkuResp.getTeamStock())
|
||||||
|
.teamPrice(activityTeamProductSkuResp.getTeamPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuResp skuRespbuilder(ActivityTeamProductSkuModel activityTeamProductSkuModel) {
|
||||||
|
return ActivityTeamProductSkuResp.builder()
|
||||||
|
.id(activityTeamProductSkuModel.getId())
|
||||||
|
.productId(activityTeamProductSkuModel.getProductId())
|
||||||
|
.sku(activityTeamProductSkuModel.getSku())
|
||||||
|
.teamStock(activityTeamProductSkuModel.getTeamStock())
|
||||||
|
.teamStock(activityTeamProductSkuModel.getTeamStock())
|
||||||
|
.teamPrice(activityTeamProductSkuModel.getTeamPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,13 +7,12 @@ import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||||
|
import com.muyu.marketing.domain.resp.ActivityTeamInfoDatailResp;
|
||||||
|
import com.muyu.marketing.domain.resp.ActivityTeamProductSkuResp;
|
||||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ import java.util.List;
|
||||||
public class ActivityTeamController {
|
public class ActivityTeamController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamInfoService activityTeamInfoService;;
|
private ActivityTeamInfoService activityTeamInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询营销团购活动列表
|
* 查询营销团购活动列表
|
||||||
|
@ -58,4 +57,17 @@ public class ActivityTeamController {
|
||||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据活动Id查询信息
|
||||||
|
* @param
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public Result<ActivityTeamInfoDatailResp> findById(@PathVariable Long id) {
|
||||||
|
ActivityTeamInfoDatailResp activityById = activityTeamInfoService.findActivityById(id);
|
||||||
|
return Result.success(activityById);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||||
|
import com.muyu.marketing.domain.resp.ActivityTeamInfoDatailResp;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -24,4 +25,6 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
* @param activityTeamInfoAddModel 团购添加模型
|
* @param activityTeamInfoAddModel 团购添加模型
|
||||||
*/
|
*/
|
||||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||||
|
|
||||||
|
public ActivityTeamInfoDatailResp findActivityById(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
|
||||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -41,4 +39,8 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
*/
|
*/
|
||||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过活动Id查询规格集合数据
|
||||||
|
*/
|
||||||
|
public List<ActivityTeamProductSkuModel> findById(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,10 @@ import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
|
import com.muyu.marketing.domain.resp.ActivityTeamInfoDatailResp;
|
||||||
|
import com.muyu.marketing.domain.resp.ActivityTeamProductSkuResp;
|
||||||
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||||
|
@ -82,4 +85,24 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
||||||
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询活动信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ActivityTeamInfoDatailResp findActivityById(Long id) {
|
||||||
|
//查找根据活动Id规格信息
|
||||||
|
List<ActivityTeamProductSkuModel> teamInfoSkuListModelList = activityTeamProductSkuInfoService.findById(id);
|
||||||
|
ActivityTeamInfo activityTeamInfo = this.getById(id);
|
||||||
|
ActivityTeamInfoDatailModel datailModel = ActivityTeamInfoDatailModel.DatailModel(activityTeamInfo, teamInfoSkuListModelList);
|
||||||
|
List<ActivityTeamProductSkuModel> activityTeamProductSkuList = datailModel.getActivityTeamProductSkuList();
|
||||||
|
List<ActivityTeamProductSkuResp> activityTeamProductSkuResps = new ArrayList<>();
|
||||||
|
activityTeamProductSkuList.stream().map(ActivityTeamInfoSkuListModel->{
|
||||||
|
return activityTeamProductSkuResps.add(ActivityTeamProductSkuResp.skuRespbuilder(ActivityTeamInfoSkuListModel));
|
||||||
|
}).toList();
|
||||||
|
return ActivityTeamInfoDatailResp.datailRespBuilder(datailModel,activityTeamProductSkuResps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
|
||||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
|
||||||
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||||
import com.muyu.product.cache.ProjectSkuCache;
|
import com.muyu.product.cache.ProjectSkuCache;
|
||||||
|
@ -80,4 +78,25 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
|
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过活动Id查询规格集合数据
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ActivityTeamProductSkuModel> findById(Long id) {
|
||||||
|
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,id);
|
||||||
|
List<ActivityTeamProductSkuInfo> list = this.list(lambdaQueryWrapper);
|
||||||
|
|
||||||
|
List<ActivityTeamProductSkuModel> teamInfoSkuListModelList = list.stream().map(ActivityTeamProductSkuInfo -> {
|
||||||
|
ActivityTeamProductSkuModel activityTeamInfoSkuListModel = ActivityTeamInfoSkuListModel.skuByIdModel(ActivityTeamProductSkuInfo);
|
||||||
|
return activityTeamInfoSkuListModel;
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
return teamInfoSkuListModelList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -16,10 +16,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 124.71.140.64:8848
|
||||||
|
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
Loading…
Reference in New Issue