Compare commits
4 Commits
b75c102e2c
...
4a17fc7227
Author | SHA1 | Date |
---|---|---|
|
4a17fc7227 | |
|
02f640092a | |
|
c6b7a3aa6a | |
|
a04925eab4 |
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"id":"Long",
|
||||
"团购名称":"String",
|
||||
"团购商品ID":"Long",
|
||||
"团购商品图片":"String",
|
||||
"团购商品简介":"Text",
|
||||
"策略id":"Long",
|
||||
"策略类型":"String",
|
||||
"结束时间":"Date",
|
||||
"状态":"String",
|
||||
"轮播图集合":
|
||||
[
|
||||
"图片":"String"
|
||||
]
|
||||
"商品规格集合":
|
||||
[
|
||||
"商品规格":
|
||||
{
|
||||
"id":"Long",
|
||||
"规格" :"String",
|
||||
// "拼团价格":"Decimal",
|
||||
// "拼团库存":"Long",
|
||||
"价格变化值":"Decimal",
|
||||
"库存变化值":"Long"
|
||||
}
|
||||
]
|
||||
"团购规格ID集合"
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
$.{
|
||||
"活动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"
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"活动ID": "Long",
|
||||
"商品ID": "Long",
|
||||
"活动名称": "String",
|
||||
"商品名称": "String",
|
||||
"商品图片": "String",
|
||||
"活动简介": "String",
|
||||
"商品单位": "String",
|
||||
"商品的轮播图": [
|
||||
"String", "String"
|
||||
],
|
||||
"活动时间": "date",
|
||||
"策略类型": "String",
|
||||
"商品规格": {
|
||||
"修改商品规格List": [ // 修改
|
||||
{
|
||||
"团购规格ID": "Long",
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
}
|
||||
],
|
||||
"删除商品规格IdList" : ["Long", "Long"],
|
||||
"添加商品规格List": [
|
||||
"商品价格": "BigDecimal",
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
]
|
||||
},
|
||||
|
||||
"详情": "String"
|
||||
}
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
@ -33,7 +33,7 @@ spring:
|
|||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
dataId: sentinel-muyu-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224: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;
|
||||
|
||||
|
@ -30,11 +32,11 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private long productId;
|
||||
private long projectId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
private String projectImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
|
@ -80,8 +82,8 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
public static ActivityTeamInfo addModelBuild(ActivityTeamInfoAddModel activityTeamInfoAddModel){
|
||||
return ActivityTeamInfo.builder()
|
||||
.name(activityTeamInfoAddModel.getName())
|
||||
.productId(activityTeamInfoAddModel.getProductId())
|
||||
.productImage(activityTeamInfoAddModel.getProductImage())
|
||||
.projectId(activityTeamInfoAddModel.getProductId())
|
||||
.projectImage(activityTeamInfoAddModel.getProductImage())
|
||||
.introduction(activityTeamInfoAddModel.getIntroduction())
|
||||
.unit(activityTeamInfoAddModel.getUnit())
|
||||
.imageList(activityTeamInfoAddModel.getImageList())
|
||||
|
@ -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())
|
||||
.projectId(activityTeamInfoSaveModel.getProductId())
|
||||
.projectImage(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())
|
||||
.projectId(activityTeamInfoUpdModel.getProductId())
|
||||
.projectImage(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,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.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
@ -58,8 +60,27 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
.productId(activityTeamProductSkuAddModel.getProductId())
|
||||
.teamId(activityTeamProductSkuAddModel.getTeamId())
|
||||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.productSku(activityTeamProductSkuAddModel.getSku())
|
||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||
.build()
|
||||
.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 updateModelBuild(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
||||
return ActivityTeamProductSkuInfo.builder()
|
||||
.id(activityTeamProductSkuUpdModel.getId())
|
||||
.teamPrice(activityTeamProductSkuUpdModel.getTeamPrice())
|
||||
.teamStock(activityTeamProductSkuUpdModel.getTeamStock())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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.getProjectId())
|
||||
.productImage(activityTeamInfo.getProjectImage())
|
||||
.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())
|
||||
);
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ package com.muyu.marketing.domain.model;
|
|||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 团购活动添加模型
|
||||
|
@ -57,7 +58,7 @@ public class ActivityTeamInfoAddModel {
|
|||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
|
@ -78,4 +79,26 @@ public class ActivityTeamInfoAddModel {
|
|||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
public static ActivityTeamInfoAddModel addReqBuild (ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
||||
return ActivityTeamInfoAddModel.builder()
|
||||
.name(activityTeamInfoSaveReq.getName())
|
||||
.productId(activityTeamInfoSaveReq.getProductId())
|
||||
.productImage(activityTeamInfoSaveReq.getProductImage())
|
||||
.introduction(activityTeamInfoSaveReq.getIntroduction())
|
||||
.unit(activityTeamInfoSaveReq.getUnit())
|
||||
.imageList(activityTeamInfoSaveReq.getImageList())
|
||||
.endTime(activityTeamInfoSaveReq.getEndTime())
|
||||
.sort(activityTeamInfoSaveReq.getSort())
|
||||
.content(activityTeamInfoSaveReq.getContent())
|
||||
.status(activityTeamInfoSaveReq.getStatus())
|
||||
.strategyType(activityTeamInfoSaveReq.getStrategyType())
|
||||
.strategyId(activityTeamInfoSaveReq.getStrategyId())
|
||||
.activityTeamProductSkuAddModelList(
|
||||
activityTeamInfoSaveReq.getTeamProjectSkuInfoAddReqList()
|
||||
.stream()
|
||||
.map(addReq -> ActivityTeamProductSkuAddModel.addReqBuild(addReq, activityTeamInfoSaveReq::getProductId))
|
||||
.toList()
|
||||
).build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ public class ActivityTeamInfoListModel {
|
|||
// .addTeamNumber(teamInTypeNumber)
|
||||
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
.productImage(activityTeamInfo.getProjectImage())
|
||||
// .teamPrice(discountPrice.getTeamPrice())
|
||||
// .productPrice(discountPrice.getProductPrice())
|
||||
// .teamStock(teamProductStockModel.getTeamStock())
|
||||
|
@ -91,7 +91,7 @@ public class ActivityTeamInfoListModel {
|
|||
.id(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
.productImage(activityTeamInfo.getProjectImage())
|
||||
.status(activityTeamInfo.getStatus())
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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,125 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 拼团活动修改模板
|
||||
*
|
||||
* @author SunLY
|
||||
* @version 1.0
|
||||
* @date 2024/11/27 17:13
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
public class ActivityTeamInfoUpdModel {
|
||||
/**
|
||||
* 拼团ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 修改商品规格list
|
||||
*/
|
||||
private List<ActivityTeamProductSkuUpdModel> TeamProductSkuUpdList;
|
||||
|
||||
/**
|
||||
* 删除商品规格IDList
|
||||
*/
|
||||
private List<Long> TeamProductSkuDelList;
|
||||
|
||||
/**
|
||||
* 修改商品信息
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> TeamProductSkuAddList;
|
||||
|
||||
|
||||
|
||||
public static ActivityTeamInfoUpdModel buildModel(ActivityTeamInfoUpdReq activityTeamInfoUpdReq) {
|
||||
return ActivityTeamInfoUpdModel.builder()
|
||||
.id(activityTeamInfoUpdReq.getId())
|
||||
.name(activityTeamInfoUpdReq.getName())
|
||||
.productId(activityTeamInfoUpdReq.getProductId())
|
||||
.productImage(activityTeamInfoUpdReq.getProductImage())
|
||||
.productName(activityTeamInfoUpdReq.getProductName())
|
||||
.introduction(activityTeamInfoUpdReq.getIntroduction())
|
||||
.unit(activityTeamInfoUpdReq.getUnit())
|
||||
.imageList(activityTeamInfoUpdReq.getImageList())
|
||||
.endTime(activityTeamInfoUpdReq.getEndTime())
|
||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||
.sort(activityTeamInfoUpdReq.getSort())
|
||||
.content(activityTeamInfoUpdReq.getContent())
|
||||
.status(activityTeamInfoUpdReq.getStatus())
|
||||
.TeamProductSkuAddList(activityTeamInfoUpdReq.getTeamProductSkuAddList())
|
||||
.TeamProductSkuDelList(activityTeamInfoUpdReq.getTeamProductSkuDelList())
|
||||
.TeamProductSkuUpdList(activityTeamInfoUpdReq.getTeamProductSkuUpdList())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,12 +1,15 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 团购spu库存添加模型
|
||||
|
@ -44,4 +47,13 @@ public class ActivityTeamProductSkuAddModel {
|
|||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
public static ActivityTeamProductSkuAddModel addReqBuild(TeamProjectSkuInfoAddReq teamProjectSkuInfoAddReq, Supplier<Long> productId){
|
||||
return ActivityTeamProductSkuAddModel.builder()
|
||||
.productId(productId.get())
|
||||
.sku(teamProjectSkuInfoAddReq.getSku())
|
||||
.teamStock(teamProjectSkuInfoAddReq.getTeamStock())
|
||||
.teamPrice(teamProjectSkuInfoAddReq.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品活动SKU信息模型
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-26 15:35
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductSkuInfoModel {
|
||||
/**
|
||||
* 团购商品SKU的ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 团ID
|
||||
*/
|
||||
private Long teamId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -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,37 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 拼团活动商品SKU
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-27 14:18
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductSkuUpdModel {
|
||||
|
||||
/**
|
||||
* 商品规格ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 团购价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 团购库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -44,7 +44,7 @@ public class TeamProductDiscountPriceModel {
|
|||
* @return 优惠力度
|
||||
*/
|
||||
public static TeamProductDiscountPriceModel of(BigDecimal productPrice, BigDecimal teamPrice) {
|
||||
TeamProductDiscountPriceModel.builder()
|
||||
return TeamProductDiscountPriceModel.builder()
|
||||
.productPrice(productPrice)
|
||||
.teamPrice(teamPrice)
|
||||
.discount(
|
||||
|
|
|
@ -51,11 +51,11 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
|||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ProjectSkuInfoAddReq> projectSkuInfoAddReqList;
|
||||
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
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 {
|
||||
/**
|
||||
* 拼团ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 修改商品规格list
|
||||
*/
|
||||
private List<ActivityTeamProductSkuUpdModel> TeamProductSkuUpdList;
|
||||
|
||||
/**
|
||||
* 删除商品规格IDList
|
||||
*/
|
||||
private List<Long> TeamProductSkuDelList;
|
||||
|
||||
/**
|
||||
* 修改商品信息
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> TeamProductSkuAddList;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
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 ActivityTeamProductSkuReq {
|
||||
private Long id;
|
||||
private Long teamId;
|
||||
private Long productId;
|
||||
private String productSku;
|
||||
private Long teamStock;
|
||||
private Long remainStock;
|
||||
private BigDecimal teamPrice;
|
||||
}
|
|
@ -3,9 +3,10 @@ package com.muyu.marketing.domain.req;
|
|||
import com.muyu.common.core.web.page.PageDomain;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
|
|
@ -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,7 +14,7 @@ import java.math.BigDecimal;
|
|||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ProjectSkuInfoAddReq {
|
||||
public class TeamProjectSkuInfoAddReq {
|
||||
|
||||
/**
|
||||
* 规格SKU
|
|
@ -0,0 +1,81 @@
|
|||
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.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ActivityTeamDetailResp extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 团购ID
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
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 Integer sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ActivityTeamProjectSkuResp> activityTeamProjectSkuList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 添加的
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ActivityTeamProjectSkuResp {
|
||||
|
||||
/**
|
||||
* 团购商品SKU的ID
|
||||
*/
|
||||
private Long productSkuId;
|
||||
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
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 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,15 +3,17 @@ 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.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoFindByIdResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -44,4 +46,37 @@ public class ActivityTeamController {
|
|||
}}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加团购活动
|
||||
* @param activityTeamInfoSaveReq 添加请求对象
|
||||
* @return 结果集
|
||||
*/
|
||||
@PostMapping
|
||||
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询团购活动详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/findById/{id}")
|
||||
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
||||
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改拼团活动信息
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/updateByTeamId")
|
||||
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||
activityTeamInfoService.updateByTeamId(ActivityTeamInfoUpdModel.buildModel(activityTeamInfoUpdReq));
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,11 +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.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
|
||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||
|
||||
|
@ -24,4 +20,17 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
|||
* @param activityTeamInfoAddModel 团购添加模型
|
||||
*/
|
||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||
|
||||
/**
|
||||
* 根据ID查询商品的详情
|
||||
* @param id 团购活动ID
|
||||
* @return 团购详情
|
||||
*/
|
||||
ActivityTeamDetailModel findDetailById(Long id);
|
||||
|
||||
|
||||
|
||||
public boolean updateByTeamId(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -36,9 +34,37 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
|
||||
|
||||
/**
|
||||
* 添加团购商品SKU
|
||||
* 批量添加团购商品SKU
|
||||
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
||||
*/
|
||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||
|
||||
/**
|
||||
* 通过拼团活动ID获取拼团下商品SKU集合
|
||||
* @param teamId 活动ID
|
||||
* @return 拼团商品SKU集合
|
||||
*/
|
||||
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
||||
|
||||
/**
|
||||
* 更新团购商品SKU
|
||||
* @param activityTeamProductSkuUpdModel 团购商品SKU更新模型
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
public boolean updateTeamProductSku(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel);
|
||||
|
||||
/**
|
||||
* 批量更新团购商品SKU
|
||||
* @param activityTeamProductSkuUpdModels
|
||||
* @return
|
||||
*/
|
||||
public boolean updateTeamProductSkuList(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModels);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除团购商品SKU
|
||||
* @param productSkuIdList
|
||||
* @return
|
||||
*/
|
||||
public boolean deleteTeamProductSkuList(List<Long> productSkuIdList);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
|
@ -15,10 +14,9 @@ import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
|||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
||||
@Service
|
||||
|
@ -75,14 +73,48 @@ 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()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateByTeamId(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel);
|
||||
|
||||
this.updateById(activityTeamInfo);
|
||||
|
||||
|
||||
activityTeamProductSkuInfoService.deleteTeamProductSkuList(
|
||||
activityTeamInfoUpdModel.getTeamProductSkuDelList()
|
||||
);
|
||||
|
||||
activityTeamProductSkuInfoService.batchSave(
|
||||
activityTeamInfoUpdModel.getTeamProductSkuAddList()
|
||||
);
|
||||
|
||||
activityTeamProductSkuInfoService.updateTeamProductSkuList(
|
||||
activityTeamInfoUpdModel.getTeamProductSkuUpdList()
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
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.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
||||
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.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
@ -20,6 +20,7 @@ import java.util.ArrayList;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||
|
@ -80,4 +81,46 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
|||
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过拼团活动ID获取拼团下商品SKU集合
|
||||
*
|
||||
* @param teamId 活动ID
|
||||
* @return 拼团商品SKU集合
|
||||
*/
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateTeamProductSku(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
||||
LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice, activityTeamProductSkuUpdModel.getTeamPrice());
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock, activityTeamProductSkuUpdModel.getTeamStock());
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getRemainStock, activityTeamProductSkuUpdModel.getTeamStock());
|
||||
updateWrapper.eq(ActivityTeamProductSkuInfo::getId, activityTeamProductSkuUpdModel.getId());
|
||||
return this.update(updateWrapper);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateTeamProductSkuList(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
||||
return this.updateBatchById(
|
||||
activityTeamProductSkuUpdModelList.stream().
|
||||
map(ActivityTeamProductSkuInfo::updateModelBuild)
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteTeamProductSkuList(List<Long> productSkuIdList) {
|
||||
return removeBatchByIds(productSkuIdList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -16,10 +16,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue