Merge branch 'master' into 1127/shangzhihao
# Conflicts: # doc/团购查询单条数据结构.java # muyu-auth/src/main/resources/bootstrap.yml # muyu-gateway/src/main/resources/bootstrap.yml # muyu-modules/muyu-file/src/main/resources/bootstrap.yml # muyu-modules/muyu-gen/src/main/resources/bootstrap.yml # muyu-modules/muyu-job/src/main/resources/bootstrap.yml # muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamInfoUpdModel.java # muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamProductSkuInfoModel.java # muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/TeamProductDiscountPriceModel.java # muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamDetailResp.java # muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamProjectSkuResp.java # muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/controller/ActivityTeamController.java # muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/ActivityTeamInfoService.java # muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/ActivityTeamProductSkuInfoService.java # muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamInfoServiceImpl.java # muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamProductSkuInfoServiceImpl.java # muyu-modules/muyu-marketing/marketing-server/src/main/resources/bootstrap.yml # muyu-modules/muyu-product/muyu-product-server/src/main/resources/bootstrap.yml # muyu-modules/muyu-shop-cart/muyu-shop-cart-server/src/main/resources/bootstrap.yml # muyu-modules/muyu-system/src/main/resources/bootstrap.yml # muyu-visual/muyu-monitor/src/main/resources/bootstrap.yml1127/shangzhihao
commit
47def732f2
|
@ -1,5 +1,5 @@
|
||||||
$.{
|
$.{
|
||||||
"团购ID": "Long",
|
"活动ID": "Long",
|
||||||
"商品ID": "Long", //activity_team_info.product_id
|
"商品ID": "Long", //activity_team_info.product_id
|
||||||
"商品图片": "String",
|
"商品图片": "String",
|
||||||
"活动名称": "String",
|
"活动名称": "String",
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"活动ID": "Long",
|
||||||
|
"商品ID": "Long",
|
||||||
|
"活动名称": "String",
|
||||||
|
"商品名称": "String",
|
||||||
|
"商品图片": "String",
|
||||||
|
"活动简介": "String",
|
||||||
|
"商品单位": "String",
|
||||||
|
"商品的轮播图": [
|
||||||
|
"String", "String"
|
||||||
|
],
|
||||||
|
"活动时间": "date",
|
||||||
|
"策略类型": "String",
|
||||||
|
"商品规格": {
|
||||||
|
"修改商品规格List": [ // 修改
|
||||||
|
{
|
||||||
|
"团购规格ID": "Long",
|
||||||
|
"拼团价格": "BigDecimal",
|
||||||
|
"拼团库存": "Long"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"删除商品规格IdList" : ["Long", "Long"],
|
||||||
|
"添加商品规格List": [
|
||||||
|
"商品SKU": "String",
|
||||||
|
"商品价格": "BigDecimal",
|
||||||
|
"拼团价格": "BigDecimal",
|
||||||
|
"拼团库存": "Long"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"详情": "String"
|
||||||
|
}
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -30,13 +28,12 @@ spring:
|
||||||
eager: true
|
eager: true
|
||||||
transport:
|
transport:
|
||||||
# 控制台地址
|
# 控制台地址
|
||||||
dashboard: 150.158.86.96:8718
|
dashboard: 127.0.0.1:8718
|
||||||
# nacos配置持久化
|
# nacos配置持久化
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
dataId: sentinel-muyu-gateway
|
dataId: sentinel-muyu-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@ -93,4 +95,38 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ActivityTeamInfo teamSaveBuild(ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.name(activityTeamInfoSaveModel.getName())
|
||||||
|
.productId(activityTeamInfoSaveModel.getProductId())
|
||||||
|
.productImage(activityTeamInfoSaveModel.getProductImage())
|
||||||
|
.introduction(activityTeamInfoSaveModel.getIntroduction())
|
||||||
|
.unit(activityTeamInfoSaveModel.getUnit())
|
||||||
|
.imageList(activityTeamInfoSaveModel.getImageList())
|
||||||
|
.endTime(activityTeamInfoSaveModel.getEndTime())
|
||||||
|
.sort(activityTeamInfoSaveModel.getSort())
|
||||||
|
.content(activityTeamInfoSaveModel.getContent())
|
||||||
|
.status(activityTeamInfoSaveModel.getStatus())
|
||||||
|
.strategyType(activityTeamInfoSaveModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoSaveModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
public static ActivityTeamInfo TeamUpdateBuild (ActivityTeamInfoUpdModel activityTeamInfoUpdModel){
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.id(activityTeamInfoUpdModel.getId())
|
||||||
|
.name(activityTeamInfoUpdModel.getName())
|
||||||
|
.productId(activityTeamInfoUpdModel.getProductId())
|
||||||
|
.productImage(activityTeamInfoUpdModel.getProductImage())
|
||||||
|
.introduction(activityTeamInfoUpdModel.getIntroduction())
|
||||||
|
.unit(activityTeamInfoUpdModel.getUnit())
|
||||||
|
.imageList(activityTeamInfoUpdModel.getImageList())
|
||||||
|
.endTime(activityTeamInfoUpdModel.getEndTime())
|
||||||
|
.sort(activityTeamInfoUpdModel.getSort())
|
||||||
|
.content(activityTeamInfoUpdModel.getContent())
|
||||||
|
.status(activityTeamInfoUpdModel.getStatus())
|
||||||
|
.strategyType(activityTeamInfoUpdModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoUpdModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,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;
|
||||||
|
|
||||||
|
@ -57,8 +58,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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,102 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 活动回显总模型
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 16:00
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamDetailModel {
|
||||||
|
/**
|
||||||
|
* 拼团id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品活动图
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 轮播图
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 活动排序
|
||||||
|
*/
|
||||||
|
private Long sort;
|
||||||
|
/**
|
||||||
|
* 商品SkU集合
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuModel> projectSkuInfoAddReqList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
public static ActivityTeamDetailModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
||||||
|
Function<ActivityTeamDetailModel.ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
||||||
|
return function.apply(ActivityTeamDetailModel.builder()
|
||||||
|
.id(activityTeamInfo.getId())
|
||||||
|
.name(activityTeamInfo.getName())
|
||||||
|
.productId(activityTeamInfo.getProductId())
|
||||||
|
.productImage(activityTeamInfo.getProductImage())
|
||||||
|
.introduction(activityTeamInfo.getIntroduction())
|
||||||
|
.unit(activityTeamInfo.getUnit())
|
||||||
|
.imageList(activityTeamInfo.getImageList())
|
||||||
|
.endTime(activityTeamInfo.getEndTime())
|
||||||
|
.sort(activityTeamInfo.getSort())
|
||||||
|
.content(activityTeamInfo.getContent())
|
||||||
|
.status(activityTeamInfo.getStatus())
|
||||||
|
.strategyType(activityTeamInfo.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfo.getStrategyId())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,40 +1,56 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购活动添加模型
|
* @program: 2204a-cloud-server
|
||||||
*
|
* @description: 活动商品规格修改模型
|
||||||
* @author DongZeLiang
|
* @author: AoCi Tian
|
||||||
* @date 2024-11-26 09:38
|
* @create: 2024-11-26 19:25
|
||||||
*/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
public class ActivityTeamInfoUpdModel {
|
public class ActivityTeamInfoUpdModel {
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品规格ID
|
|
||||||
*/
|
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
private String name;
|
||||||
* 团购价格
|
private Long productId;
|
||||||
*/
|
private String productImage;
|
||||||
private BigDecimal teamPrice;
|
private String introduction;
|
||||||
/**
|
private String unit;
|
||||||
* 团购库存
|
private String imageList;
|
||||||
*/
|
private Date endTime;
|
||||||
private Long teamStock;
|
private Long sort;
|
||||||
|
private String content;
|
||||||
|
private String status;
|
||||||
|
private String strategyType;
|
||||||
|
private Long strategyId;
|
||||||
|
private List<ActivityTeamProductSkuReqModel> activityTeamProductSkuModelList;
|
||||||
|
|
||||||
|
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
|
return ActivityTeamInfoUpdModel.builder()
|
||||||
|
.id(activityTeamInfoUpdReq.getId())
|
||||||
|
.name(activityTeamInfoUpdReq.getName())
|
||||||
|
.productId(activityTeamInfoUpdReq.getProductId())
|
||||||
|
.productImage(activityTeamInfoUpdReq.getProductImage())
|
||||||
|
.introduction(activityTeamInfoUpdReq.getIntroduction())
|
||||||
|
.unit(activityTeamInfoUpdReq.getUnit())
|
||||||
|
.imageList(activityTeamInfoUpdReq.getImageList())
|
||||||
|
.endTime(activityTeamInfoUpdReq.getEndTime())
|
||||||
|
.sort(activityTeamInfoUpdReq.getSort())
|
||||||
|
.content(activityTeamInfoUpdReq.getContent())
|
||||||
|
.status(activityTeamInfoUpdReq.getStatus())
|
||||||
|
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||||
|
.activityTeamProductSkuModelList(activityTeamInfoUpdReq.getActivityTeamProductSkuList().stream().map(ActivityTeamProductSkuReqModel::activityTeamProductSkuReqModelBuild).toList())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
package com.muyu.marketing.domain.model;/**
|
package com.muyu.marketing.domain.model;
|
||||||
* @Author:尚志豪
|
|
||||||
* @Package:com.muyu.marketing.domain.model
|
|
||||||
* @Project:2204a-cloud-server-DongZeLiang
|
|
||||||
* @name:ActivityTeamProductSkuInfoModel
|
|
||||||
* @Date:2024/11/26 16:03
|
|
||||||
*/
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
@ -14,37 +9,41 @@ import lombok.NoArgsConstructor;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: 2204a-cloud-server-DongZeLiang
|
* 商品活动SKU信息模型
|
||||||
* @description: 商品活动SKU信息模型
|
*
|
||||||
* @author: CuiFu Bo
|
* @author DongZeLiang
|
||||||
* @create: 2024-11-26 16:03
|
* @date 2024-11-26 15:35
|
||||||
**/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ActivityTeamProductSkuInfoModel {
|
public class ActivityTeamProductSkuInfoModel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团购商品SKU的ID
|
* 团购商品SKU的ID
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团Id
|
* 团ID
|
||||||
*/
|
*/
|
||||||
private Long teamId;
|
private Long teamId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品Id
|
* 商品ID
|
||||||
*/
|
*/
|
||||||
private Long productId;
|
private Long productId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格SKU
|
* 规格SKU
|
||||||
*/
|
*/
|
||||||
private String sku;
|
private String sku;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团价格
|
* 拼团价格
|
||||||
*/
|
*/
|
||||||
private BigDecimal teamPrice;
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团库存
|
* 拼团库存
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -17,9 +17,10 @@ import java.math.BigDecimal;
|
||||||
public class ActivityTeamProjectSkuResp {
|
public class ActivityTeamProjectSkuResp {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* id
|
* 团购商品SKU的ID
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long productSkuId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格SKU
|
* 规格SKU
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回显resp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ProjectFindSkuInfoResp {
|
||||||
|
/**
|
||||||
|
* 规格id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
public static ProjectFindSkuInfoResp projectFindSkuInfoBuild (ActivityTeamProductSkuModel activityTeamProductSkuModel) {
|
||||||
|
return ProjectFindSkuInfoResp.builder()
|
||||||
|
.teamStock(activityTeamProductSkuModel.getTeamStock())
|
||||||
|
.teamPrice(activityTeamProductSkuModel.getTeamPrice())
|
||||||
|
.id(activityTeamProductSkuModel.getId())
|
||||||
|
.sku(activityTeamProductSkuModel.getSku())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,107 @@
|
||||||
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
||||||
|
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 团购活动回显响应
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 15:19
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class TeamInfoFindByIdResp {
|
||||||
|
/**
|
||||||
|
* 拼团id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品活动图
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 轮播图
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 活动排序
|
||||||
|
*/
|
||||||
|
private Long sort;
|
||||||
|
/**
|
||||||
|
* 商品SkU集合
|
||||||
|
*/
|
||||||
|
private List<ProjectFindSkuInfoResp> projectSkuInfoAddList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
public static TeamInfoFindByIdResp teamInfoFindByIdBuild (ActivityTeamDetailModel activityTeamDetailModel){
|
||||||
|
return TeamInfoFindByIdResp.builder()
|
||||||
|
.id(activityTeamDetailModel.getId())
|
||||||
|
.name(activityTeamDetailModel.getName())
|
||||||
|
.productId(activityTeamDetailModel.getProductId())
|
||||||
|
.productImage(activityTeamDetailModel.getProductImage())
|
||||||
|
.introduction(activityTeamDetailModel.getIntroduction())
|
||||||
|
.unit(activityTeamDetailModel.getUnit())
|
||||||
|
.imageList(activityTeamDetailModel.getImageList())
|
||||||
|
.endTime(activityTeamDetailModel.getEndTime())
|
||||||
|
.sort(activityTeamDetailModel.getSort())
|
||||||
|
.projectSkuInfoAddList(activityTeamDetailModel.getProjectSkuInfoAddReqList().stream().map(ProjectFindSkuInfoResp::projectFindSkuInfoBuild).toList())
|
||||||
|
// .projectSkuInfoAddList(
|
||||||
|
// teamInfoFindByIdRespModel.getProjectSkuInfoAddReqList().stream().map(activityTeamProductSkuModel ->
|
||||||
|
// ProjectFindSkuInfoResp.projectFindSkuInfoBuild(activityTeamProductSkuModel)).toList()
|
||||||
|
// )
|
||||||
|
.content(activityTeamDetailModel.getContent())
|
||||||
|
.status(activityTeamDetailModel.getStatus())
|
||||||
|
.strategyType(activityTeamDetailModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamDetailModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,15 +5,15 @@ import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuInfoModel;
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||||
import com.muyu.marketing.domain.resp.ActivityTeamDetailResp;
|
|
||||||
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 com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -28,9 +28,7 @@ import java.util.List;
|
||||||
public class ActivityTeamController {
|
public class ActivityTeamController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamInfoService activityTeamInfoService;
|
private ActivityTeamInfoService activityTeamInfoService;;
|
||||||
@Autowired
|
|
||||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询营销团购活动列表
|
* 查询营销团购活动列表
|
||||||
|
@ -48,13 +46,6 @@ public class ActivityTeamController {
|
||||||
}}
|
}}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// "msg": "\r\n### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column 'remain_stock' in 'field list'" +
|
|
||||||
// "\r\n### The error may exist in com/muyu/marketing/team/mapper/ActivityTeamProductSkuInfoMapper.java (best guess)" +
|
|
||||||
// "\r\n### The error may involve defaultParameterMap" +
|
|
||||||
// "\r\n### The error occurred while setting parameters" +
|
|
||||||
// "\r\n### SQL: SELECT id,team_id,product_id,product_sku,team_stock,remain_stock,team_price,create_by,create_time,update_by,update_time,remark FROM activity_team_product_sku_info WHERE id=?" +
|
|
||||||
// "\r\n### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'remain_stock' in 'field list'" +
|
|
||||||
// "\n; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'remain_stock' in 'field list'",
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,17 +53,9 @@ public class ActivityTeamController {
|
||||||
* @param activityTeamInfoSaveReq 添加请求对象
|
* @param activityTeamInfoSaveReq 添加请求对象
|
||||||
* @return 结果集
|
* @return 结果集
|
||||||
*/
|
*/
|
||||||
@PostMapping("/add")
|
@PostMapping
|
||||||
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
||||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 回显团购活动
|
|
||||||
*/
|
|
||||||
@PostMapping("/detail")
|
|
||||||
public Result<ActivityTeamDetailResp> findListByTeamId(@RequestParam Long teamId) {
|
|
||||||
ActivityTeamDetailResp activityTeamDetailResp = activityTeamInfoService.findListByTeamId(teamId);
|
|
||||||
return Result.success(activityTeamDetailResp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +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.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
|
||||||
import com.muyu.marketing.domain.resp.ActivityTeamDetailResp;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
|
|
||||||
|
@ -25,8 +20,20 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
* @param activityTeamInfoAddModel 团购添加模型
|
* @param activityTeamInfoAddModel 团购添加模型
|
||||||
*/
|
*/
|
||||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回显团购活动
|
* 根据ID查询商品的详情
|
||||||
|
* @param id 团购活动ID
|
||||||
|
* @return 团购详情
|
||||||
*/
|
*/
|
||||||
ActivityTeamDetailResp findListByTeamId(Long teamId);
|
ActivityTeamDetailModel findDetailById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改团购活动信息
|
||||||
|
* @param activityTeamInfoUpdModel 团购活动信息
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
|
||||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
|
||||||
import com.muyu.marketing.domain.resp.ActivityTeamDetailResp;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -42,4 +39,13 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
*/
|
*/
|
||||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过拼团活动ID获取拼团下商品SKU集合
|
||||||
|
* @param teamId 活动ID
|
||||||
|
* @return 拼团商品SKU集合
|
||||||
|
*/
|
||||||
|
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
||||||
|
|
||||||
|
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,21 @@
|
||||||
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.exception.ServiceException;
|
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.domain.resp.ActivityTeamDetailResp;
|
|
||||||
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 org.springframework.beans.BeanUtils;
|
|
||||||
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.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@ -86,21 +78,31 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
||||||
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询商品的详情
|
||||||
|
* @param id 团购活动ID
|
||||||
|
* @return 团购详情
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ActivityTeamDetailResp findListByTeamId(Long teamId) {
|
public ActivityTeamDetailModel findDetailById(Long id) {
|
||||||
ActivityTeamDetailResp activityTeamDetailResp = new ActivityTeamDetailResp();
|
ActivityTeamInfo activityTeamInfo = this.getById(id);
|
||||||
ActivityTeamInfo teamInfo = getById(teamId);
|
List<ActivityTeamProductSkuModel> activityTeamProductSkuModelList = activityTeamProductSkuInfoService.findListByTeamId(id);
|
||||||
if (null != teamInfo){
|
return ActivityTeamDetailModel.findSkuSumList(activityTeamInfo,
|
||||||
BeanUtils.copyProperties(teamInfo,activityTeamDetailResp);
|
(teamInfoFindByIdRespModelBuilder) -> teamInfoFindByIdRespModelBuilder.projectSkuInfoAddReqList(activityTeamProductSkuModelList).build()
|
||||||
List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfoList = activityTeamProductSkuInfoService.getActivityTeamProductSkuInfoByTeamId(teamId);
|
);
|
||||||
activityTeamDetailResp.setActivityTeamProjectSkuRespList(activityTeamProductSkuInfoList.stream().map(item ->{
|
|
||||||
ActivityTeamDetailResp.ActivityTeamProjectSkuResp activityTeamProjectSkuResp = new ActivityTeamDetailResp.ActivityTeamProjectSkuResp();
|
|
||||||
BeanUtils.copyProperties(item,activityTeamProjectSkuResp);
|
|
||||||
activityTeamProjectSkuResp.setTeamStock(item.getTeamStock());
|
|
||||||
activityTeamProjectSkuResp.setTeamPrice(item.getTeamPrice());
|
|
||||||
return activityTeamProjectSkuResp;
|
|
||||||
}).collect(Collectors.toList()));
|
|
||||||
}
|
}
|
||||||
return activityTeamDetailResp;
|
|
||||||
|
/**
|
||||||
|
* 修改团购活动信息
|
||||||
|
* @param activityTeamInfoUpdModel 团购活动信息
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||||
|
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
||||||
|
io.jsonwebtoken.lang.Assert.isTrue(update,"修改失败");
|
||||||
|
activityTeamProductSkuInfoService.updateBath(activityTeamInfoUpdModel.getActivityTeamProductSkuModelList());
|
||||||
|
return update;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,19 +3,15 @@ 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.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.ActivityTeamInfo;
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
|
||||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
|
||||||
import com.muyu.marketing.domain.resp.ActivityTeamDetailResp;
|
|
||||||
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.BeanUtils;
|
|
||||||
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;
|
||||||
|
@ -23,7 +19,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||||
|
@ -31,8 +26,6 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectSkuCache projectSkuCache;
|
private ProjectSkuCache projectSkuCache;
|
||||||
@Autowired
|
|
||||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过团购活动ID获取团购中最优惠的价格
|
* 通过团购活动ID获取团购中最优惠的价格
|
||||||
|
@ -87,5 +80,24 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过拼团活动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();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList) {
|
||||||
|
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,9 @@ server:
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
main:
|
|
||||||
allow-circular-references: true
|
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-marketing
|
name: muyu-buy
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -16,12 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -16,10 +16,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,12 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
namespace: 2204a
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 150.158.86.96:8848
|
server-addr: 120.46.147.226:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
Loading…
Reference in New Issue