完成回显和修改
parent
168e7c9974
commit
7b02cd2513
|
@ -1,47 +0,0 @@
|
||||||
$.{
|
|
||||||
"商品ID": "Long", //activity_team_info.product_id
|
|
||||||
"商品图片": "String",
|
|
||||||
"活动名称": "String",
|
|
||||||
"活动简介": "String",
|
|
||||||
"商品单位": "String",
|
|
||||||
"商品的轮播图": [
|
|
||||||
"String", "String"
|
|
||||||
],
|
|
||||||
"活动时间": "date",
|
|
||||||
"策略类型": "String",
|
|
||||||
"策略ID": "Long",
|
|
||||||
"商品规格List": [ // activity_team_product_sku_info
|
|
||||||
{
|
|
||||||
"规格SKU": "String", // activity_team_product_sku_info.product_sku
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"排序": "Integer",
|
|
||||||
"详情": "String"
|
|
||||||
}
|
|
||||||
|
|
||||||
activity_team_info 团购活动表 -> ActivityTeamInfo(实体类)
|
|
||||||
activity_team_info.id(主键) -> 自增 -> 回填 -> ActivityTeamInfo.id
|
|
||||||
activity_team_info.name(拼团名称) <- ActivityTeamInfo.name <- $.活动名称
|
|
||||||
activity_team_info.product_id(商品ID) <- ActivityTeamInfo.productId <- $.商品ID
|
|
||||||
activity_team_info.product_image(商品活动图) <- ActivityTeamInfo.productImage <- $.商品图片
|
|
||||||
activity_team_info.introduction(活动简介) <- ActivityTeamInfo.introduction <- $.活动简介
|
|
||||||
activity_team_info.unit(单位) <- ActivityTeamInfo.unit <- $.商品单位
|
|
||||||
activity_team_info.image_list(轮播图) <- ActivityTeamInfo.imageList <- 商品的轮播图.toString(","拼接) <- $.商品的轮播图
|
|
||||||
activity_team_info.end_time(活动结束时间) <- ActivityTeamInfo.endTime <- $.活动时间
|
|
||||||
activity_team_info.sort(活动排序) <- ActivityTeamInfo.sort <- $.排序
|
|
||||||
activity_team_info.content(活动详情) <- ActivityTeamInfo.content <- $.详情
|
|
||||||
activity_team_info.status(活动状态) <- _sys_normal_disable.1(停用)
|
|
||||||
activity_team_info.strategy_type(策略类型) <- ActivityTeamInfo.strategy_type <- $.策略类型
|
|
||||||
activity_team_info.strategy_id(策略ID) <- ActivityTeamInfo.strategy_id <- $.策略ID
|
|
||||||
|
|
||||||
for(@商品规格 in 商品规格List)
|
|
||||||
activity_team_product_sku_info 商品拼团规格信息表 -> ActivityTeamProductSkuInfo(实体类)
|
|
||||||
activity_team_product_sku_info.id(主键) -> 自增 -> 回填 -> ActivityTeamProductSkuInfo.id
|
|
||||||
activity_team_product_sku_info.team_id(活动ID) <- ActivityTeamProductSkuInfo.teamId <- ActivityTeamInfo.id
|
|
||||||
activity_team_product_sku_info.product_id(商品ID) <- ActivityTeamProductSkuInfo.productId < $.商品ID
|
|
||||||
activity_team_product_sku_info.product_sku(商品SKU) <- ActivityTeamProductSkuInfo.productSku <- @商品规格.规格SKU
|
|
||||||
activity_team_product_sku_info.team_stock(拼团库存) <- ActivityTeamProductSkuInfo.teamStock <- @商品规格.拼团库存
|
|
||||||
activity_team_product_sku_info.remain_stock(剩余库存) <- ActivityTeamProductSkuInfo.remainStock <- @商品规格.拼团库存
|
|
||||||
activity_team_product_sku_info.team_price(拼团价格) <- ActivityTeamProductSkuInfo.teamPrice <- @商品规格.拼团价格
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"活动ID": "Long",
|
||||||
|
"活动名称": "String",
|
||||||
|
"商品名称": "String",
|
||||||
|
"商品图片": "String",
|
||||||
|
"活动简介": "String",
|
||||||
|
"商品单位": "String",
|
||||||
|
"商品的轮播图": [
|
||||||
|
"String", "String"
|
||||||
|
],
|
||||||
|
"活动时间": "date",
|
||||||
|
"策略类型": "String",
|
||||||
|
"商品规格List": [
|
||||||
|
{
|
||||||
|
"规格ID": "Long",
|
||||||
|
"规格SKU": "String",
|
||||||
|
"商品价格": "BigDecimal",
|
||||||
|
"商品库存": "Long",
|
||||||
|
"拼团价格": "BigDecimal",
|
||||||
|
"拼团库存": "Long"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"详情": "String"
|
||||||
|
}
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -33,7 +33,7 @@ spring:
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
dataId: sentinel-muyu-gateway
|
dataId: sentinel-muyu-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdReqModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@ -53,7 +55,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private long sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 活动详情
|
* 活动详情
|
||||||
*/
|
*/
|
||||||
|
@ -70,4 +72,37 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
* 策略ID
|
* 策略ID
|
||||||
*/
|
*/
|
||||||
private long strategyId;
|
private long strategyId;
|
||||||
|
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 (ActivityTeamInfoUpdReqModel activityTeamInfoUpdReqModel){
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.id(activityTeamInfoUpdReqModel.getId())
|
||||||
|
.name(activityTeamInfoUpdReqModel.getName())
|
||||||
|
.productId(activityTeamInfoUpdReqModel.getProductId())
|
||||||
|
.productImage(activityTeamInfoUpdReqModel.getProductImage())
|
||||||
|
.introduction(activityTeamInfoUpdReqModel.getIntroduction())
|
||||||
|
.unit(activityTeamInfoUpdReqModel.getUnit())
|
||||||
|
.imageList(activityTeamInfoUpdReqModel.getImageList())
|
||||||
|
.endTime(activityTeamInfoUpdReqModel.getEndTime())
|
||||||
|
.sort(activityTeamInfoUpdReqModel.getSort())
|
||||||
|
.content(activityTeamInfoUpdReqModel.getContent())
|
||||||
|
.status(activityTeamInfoUpdReqModel.getStatus())
|
||||||
|
.strategyType(activityTeamInfoUpdReqModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoUpdReqModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@ -58,8 +59,19 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
.productId(activityTeamProductSkuAddModel.getProductId())
|
.productId(activityTeamProductSkuAddModel.getProductId())
|
||||||
.teamId(activityTeamProductSkuAddModel.getTeamId())
|
.teamId(activityTeamProductSkuAddModel.getTeamId())
|
||||||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||||
|
.productSku(activityTeamProductSkuAddModel.getSku())
|
||||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
.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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
@ -10,6 +11,7 @@ import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购活动添加模型
|
* 团购活动添加模型
|
||||||
|
@ -57,7 +59,7 @@ public class ActivityTeamInfoAddModel {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
@ -78,4 +80,21 @@ public class ActivityTeamInfoAddModel {
|
||||||
* 策略ID
|
* 策略ID
|
||||||
*/
|
*/
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
|
|
||||||
|
public static ActivityTeamInfoAddModel activityTeamInfoAddModelBuild (ActivityTeamInfoSaveReq activityTeamInfoSaveReq,
|
||||||
|
Function<ActivityTeamInfoAddModel.ActivityTeamInfoAddModelBuilder,ActivityTeamInfoAddModel> function){
|
||||||
|
return function.apply(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()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,57 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuReq;
|
||||||
|
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 ActivityTeamInfoUpdReqModel {
|
||||||
|
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 List<ActivityTeamProductSkuReqModel> activityTeamProductSkuModelList;
|
||||||
|
|
||||||
|
public static ActivityTeamInfoUpdReqModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
|
return ActivityTeamInfoUpdReqModel.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())
|
||||||
|
.activityTeamProductSkuModelList(activityTeamInfoUpdReq.getActivityTeamProductSkuList().stream().map(ActivityTeamProductSkuReqModel::activityTeamProductSkuReqModelBuild).toList())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -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,103 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
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;
|
||||||
|
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 TeamInfoFindByIdRespModel {
|
||||||
|
/**
|
||||||
|
* 拼团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 TeamInfoFindByIdRespModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
||||||
|
Function<TeamInfoFindByIdRespModel.TeamInfoFindByIdRespModelBuilder,TeamInfoFindByIdRespModel> function){
|
||||||
|
return function.apply(TeamInfoFindByIdRespModel.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())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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(
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.marketing.domain.req;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
@ -51,7 +52,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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 List<ActivityTeamProductSkuReq> activityTeamProductSkuList;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -16,7 +16,6 @@ import java.math.BigDecimal;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ProjectSkuInfoAddReq {
|
public class ProjectSkuInfoAddReq {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格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,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.TeamInfoFindByIdRespModel;
|
||||||
|
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 (TeamInfoFindByIdRespModel teamInfoFindByIdRespModel){
|
||||||
|
return TeamInfoFindByIdResp.builder()
|
||||||
|
.id(teamInfoFindByIdRespModel.getId())
|
||||||
|
.name(teamInfoFindByIdRespModel.getName())
|
||||||
|
.productId(teamInfoFindByIdRespModel.getProductId())
|
||||||
|
.productImage(teamInfoFindByIdRespModel.getProductImage())
|
||||||
|
.introduction(teamInfoFindByIdRespModel.getIntroduction())
|
||||||
|
.unit(teamInfoFindByIdRespModel.getUnit())
|
||||||
|
.imageList(teamInfoFindByIdRespModel.getImageList())
|
||||||
|
.endTime(teamInfoFindByIdRespModel.getEndTime())
|
||||||
|
.sort(teamInfoFindByIdRespModel.getSort())
|
||||||
|
.projectSkuInfoAddList(teamInfoFindByIdRespModel.getProjectSkuInfoAddReqList().stream().map(ProjectFindSkuInfoResp::projectFindSkuInfoBuild).toList())
|
||||||
|
// .projectSkuInfoAddList(
|
||||||
|
// teamInfoFindByIdRespModel.getProjectSkuInfoAddReqList().stream().map(activityTeamProductSkuModel ->
|
||||||
|
// ProjectFindSkuInfoResp.projectFindSkuInfoBuild(activityTeamProductSkuModel)).toList()
|
||||||
|
// )
|
||||||
|
.content(teamInfoFindByIdRespModel.getContent())
|
||||||
|
.status(teamInfoFindByIdRespModel.getStatus())
|
||||||
|
.strategyType(teamInfoFindByIdRespModel.getStrategyType())
|
||||||
|
.strategyId(teamInfoFindByIdRespModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,19 +1,25 @@
|
||||||
package com.muyu.marketing.team.controller;
|
package com.muyu.marketing.team.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.dtflys.forest.annotation.Put;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||||
|
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||||
|
import com.muyu.marketing.domain.resp.ProjectFindSkuInfoResp;
|
||||||
|
import com.muyu.marketing.domain.resp.TeamInfoFindByIdResp;
|
||||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.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.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 营销团购活动控制层
|
* 营销团购活动控制层
|
||||||
|
@ -44,4 +50,33 @@ public class ActivityTeamController {
|
||||||
}}
|
}}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/saveTeam")
|
||||||
|
public boolean saveTeam (@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
||||||
|
List<ProjectSkuInfoAddReq> projectSkuInfoAddReqList = activityTeamInfoSaveReq.getProjectSkuInfoAddReqList();
|
||||||
|
|
||||||
|
return activityTeamInfoService.saveActivityTeamInfo(
|
||||||
|
ActivityTeamInfoAddModel.activityTeamInfoAddModelBuild(activityTeamInfoSaveReq, (activityTeamInfoAddModelBuilder) -> {
|
||||||
|
List<ActivityTeamProductSkuAddModel> collect = projectSkuInfoAddReqList.stream().map(projectSkuInfoAddReq -> {
|
||||||
|
return ActivityTeamProductSkuAddModel.builder()
|
||||||
|
.teamStock(projectSkuInfoAddReq.getTeamStock())
|
||||||
|
.teamPrice(projectSkuInfoAddReq.getTeamPrice())
|
||||||
|
.sku(projectSkuInfoAddReq.getSku())
|
||||||
|
.productId(activityTeamInfoSaveReq.getProductId())
|
||||||
|
.build();
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
return activityTeamInfoAddModelBuilder
|
||||||
|
.activityTeamProductSkuAddModelList(collect)
|
||||||
|
.build();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@PostMapping("/findById/{id}")
|
||||||
|
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
||||||
|
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findTeamById(id)));
|
||||||
|
}
|
||||||
|
@PutMapping("/updateByTeamId")
|
||||||
|
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
|
activityTeamInfoService.updateByTeamId(ActivityTeamInfoUpdReqModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,7 @@ package com.muyu.marketing.team.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.common.core.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.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
|
|
||||||
|
@ -17,4 +14,10 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
* @return 团购活动列表
|
* @return 团购活动列表
|
||||||
*/
|
*/
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
||||||
|
|
||||||
|
public boolean saveActivityTeamInfo(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||||
|
|
||||||
|
TeamInfoFindByIdRespModel findTeamById(Long id);
|
||||||
|
|
||||||
|
boolean updateByTeamId(ActivityTeamInfoUpdReqModel activityTeamInfoUpdReqModel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,8 @@ 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.resp.ProjectFindSkuInfoResp;
|
||||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -40,5 +39,8 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
||||||
*/
|
*/
|
||||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||||
|
public List<ActivityTeamProductSkuModel> findSkuByTeamId(Long teamId);
|
||||||
|
|
||||||
|
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,25 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.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.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
|
||||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
|
||||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
|
||||||
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||||
|
import io.jsonwebtoken.lang.Assert;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo> implements ActivityTeamInfoService {
|
||||||
implements ActivityTeamInfoService {
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||||
|
@ -69,4 +63,32 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
tableDataInfo.setRows(activityTeamInfoListModels);
|
tableDataInfo.setRows(activityTeamInfoListModels);
|
||||||
return tableDataInfo;
|
return tableDataInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean saveActivityTeamInfo(ActivityTeamInfoAddModel activityTeamInfoAddModel) {
|
||||||
|
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.TeamSaveBuild(ActivityTeamInfoSaveModel.activityTeamInfoSaveModelBuild(activityTeamInfoAddModel));
|
||||||
|
boolean save = this.save(activityTeamInfo);
|
||||||
|
Assert.isTrue(save,"添加失败");
|
||||||
|
activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList().forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
||||||
|
activityTeamProductSkuInfoService.batchSave(activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList());
|
||||||
|
return save;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TeamInfoFindByIdRespModel findTeamById(Long id) {
|
||||||
|
ActivityTeamInfo byId = this.getById(id);
|
||||||
|
List<ActivityTeamProductSkuModel> skuByTeamId = activityTeamProductSkuInfoService.findSkuByTeamId(id);
|
||||||
|
return TeamInfoFindByIdRespModel.findSkuSumList(byId, (teamInfoFindByIdRespModelBuilder) -> {
|
||||||
|
return teamInfoFindByIdRespModelBuilder.projectSkuInfoAddReqList(skuByTeamId)
|
||||||
|
.build();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateByTeamId(ActivityTeamInfoUpdReqModel activityTeamInfoUpdReqModel) {
|
||||||
|
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdReqModel));
|
||||||
|
Assert.isTrue(update,"修改失败");
|
||||||
|
activityTeamProductSkuInfoService.updateBath(activityTeamInfoUpdReqModel.getActivityTeamProductSkuModelList());
|
||||||
|
return update;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,15 +4,15 @@ 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.resp.ProjectFindSkuInfoResp;
|
||||||
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;
|
||||||
import com.muyu.product.domain.ProjectSkuInfo;
|
import com.muyu.product.domain.ProjectSkuInfo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
@ -80,4 +80,18 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
|
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ActivityTeamProductSkuModel> findSkuByTeamId(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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-marketing
|
name: muyu-buy
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -16,10 +16,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
Loading…
Reference in New Issue