2204A-cyj(11.27修改)
parent
0a636c4728
commit
46a7e2e8db
|
@ -19,8 +19,10 @@
|
|||
"拼团库存": "Long"
|
||||
}
|
||||
],
|
||||
"删除商品规格IdList" : ["Long", "Long"],
|
||||
"添加商品规格List": [
|
||||
"删除商品规格IdList" : [
|
||||
"Long", "Long"
|
||||
],
|
||||
"添加商品规格List": [ //
|
||||
"商品SKU": "String",
|
||||
"商品价格": "BigDecimal",
|
||||
"拼团价格": "BigDecimal",
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
@ -71,7 +71,7 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static ActivityTeamProductSkuInfo updateModelBuild(ActivityTeamProductSkuReqModel activityTeamProductSkuReqModel) {
|
||||
public static ActivityTeamProductSkuInfo updateModelBuild(ActivityTeamProductSkuUpdModel activityTeamProductSkuReqModel) {
|
||||
return ActivityTeamProductSkuInfo.builder()
|
||||
.id(activityTeamProductSkuReqModel.getId())
|
||||
.productId(activityTeamProductSkuReqModel.getProductId())
|
||||
|
|
|
@ -1,102 +0,0 @@
|
|||
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())
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,11 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductUpdCheckReq;
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -8,49 +13,95 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 活动商品规格修改模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 19:25
|
||||
**/
|
||||
* 团购活动修改模型
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-26 09:38
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoUpdModel {
|
||||
private Long id;
|
||||
private String name;
|
||||
private Long productId;
|
||||
private String productImage;
|
||||
private String introduction;
|
||||
private String unit;
|
||||
private String imageList;
|
||||
private Date endTime;
|
||||
private Long sort;
|
||||
private String content;
|
||||
private String status;
|
||||
private String strategyType;
|
||||
private Long strategyId;
|
||||
private List<ActivityTeamProductSkuReqModel> activityTeamProductSkuModelList;
|
||||
|
||||
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private ActivityTeamProductUpdCheckModel skuList;
|
||||
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
/** 拼团活动req 构造 model*/
|
||||
public static ActivityTeamInfoUpdModel reqConvertModel(ActivityTeamProductSkuInfoUpdReq skuInfoUpdReq){
|
||||
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();
|
||||
.teamId(skuInfoUpdReq.getTeamId())
|
||||
.productId(skuInfoUpdReq.getProductId())
|
||||
.name(skuInfoUpdReq.getName())
|
||||
.introduction(skuInfoUpdReq.getIntroduction())
|
||||
.content(skuInfoUpdReq.getContent())
|
||||
.unit(skuInfoUpdReq.getUnit())
|
||||
.imageList(skuInfoUpdReq.getImageList())
|
||||
.endTime(skuInfoUpdReq.getEndTime())
|
||||
.strategyType(skuInfoUpdReq.getStrategyType())
|
||||
.skuList(ActivityTeamProductUpdCheckModel
|
||||
.reqConvertModel(skuInfoUpdReq.getSukList())) //req skuList 构造 model
|
||||
.status(skuInfoUpdReq.getStatus())
|
||||
.strategyId(skuInfoUpdReq.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,7 @@ import java.math.BigDecimal;
|
|||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 团购spu库存添加模型
|
||||
*
|
||||
* 团购sku库存添加模型
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-26 09:36
|
||||
*/
|
||||
|
|
|
@ -10,8 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 回显sku模型
|
||||
*回显sku模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 16:03
|
||||
**/
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
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;
|
||||
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +1,17 @@
|
|||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 拼团活动商品SKU
|
||||
* 拼团活动商品SKU修改模型
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-27 14:18
|
||||
|
@ -21,17 +23,46 @@ import java.math.BigDecimal;
|
|||
public class ActivityTeamProductSkuUpdModel {
|
||||
|
||||
/**
|
||||
* 商品规格ID
|
||||
* 拼团规格信息ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String productSku;
|
||||
/**
|
||||
* 团购价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
private Long teamStock;
|
||||
/**
|
||||
* 剩余库存
|
||||
*/
|
||||
private Long remainStock;
|
||||
/**
|
||||
* 团购库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**拼团活动SkuReq 构造 model */
|
||||
public static ActivityTeamProductSkuUpdModel activityTeamProductSkuReqModelBuild(ActivityTeamProductSkuReq activityTeamProductSkuReq) {
|
||||
return ActivityTeamProductSkuUpdModel.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,48 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductUpdCheckReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (团购活动修改SKU操作模型)
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-27 14:18
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductUpdCheckModel {
|
||||
|
||||
/**
|
||||
* 修改商品规格List
|
||||
*/
|
||||
private List<ActivityTeamProductSkuUpdModel> skuUpdateList;
|
||||
/**
|
||||
* 删除商品规格IdList
|
||||
*/
|
||||
private List<Long> skuByIdDeleteList;
|
||||
/**
|
||||
* 添加商品规格List
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> skuAddList;
|
||||
|
||||
|
||||
/** skuListReq 构造 skuListModel */
|
||||
public static ActivityTeamProductUpdCheckModel reqConvertModel(ActivityTeamProductUpdCheckReq sukListReq) {
|
||||
return ActivityTeamProductUpdCheckModel.builder()
|
||||
.skuUpdateList(sukListReq.getSkuUpdateList())
|
||||
.skuByIdDeleteList(sukListReq.getSkuByIdDeleteList())
|
||||
.skuAddList(sukListReq.getSkuAddList())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
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;
|
||||
}
|
|
@ -1,27 +1,29 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 团购活动修改模型
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-26 09:38
|
||||
*/
|
||||
* 活动商品规格修改入参
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoUpdateModel {
|
||||
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class ActivityTeamProductSkuInfoUpdReq {
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
|
@ -57,6 +59,10 @@ public class ActivityTeamInfoUpdateModel {
|
|||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private ActivityTeamProductUpdCheckReq sukList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
|
@ -74,6 +80,4 @@ public class ActivityTeamInfoUpdateModel {
|
|||
*/
|
||||
private Long strategyId;
|
||||
|
||||
/** 删除商品规格idList*/
|
||||
private List<Long> ids;
|
||||
}
|
|
@ -8,8 +8,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: sku修改入参
|
||||
*sku修改入参
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 19:45
|
||||
**/
|
||||
|
@ -18,11 +17,22 @@ import java.math.BigDecimal;
|
|||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamProductSkuReq {
|
||||
|
||||
/** 主键*/
|
||||
private Long id;
|
||||
/** 活动ID*/
|
||||
private Long teamId;
|
||||
/** 商品ID*/
|
||||
private Long productId;
|
||||
/** 商品SKU*/
|
||||
private String productSku;
|
||||
/** 拼团库存*/
|
||||
private Long teamStock;
|
||||
/** 剩余库存*/
|
||||
private Long remainStock;
|
||||
/** 拼团价格*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*(团购活动修改SKU参数)
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-27 14:18
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductUpdCheckReq {
|
||||
|
||||
/**
|
||||
* 修改商品规格List
|
||||
*/
|
||||
private List<ActivityTeamProductSkuUpdModel> skuUpdateList;
|
||||
/**
|
||||
* 删除商品规格IdList
|
||||
*/
|
||||
private List<Long> skuByIdDeleteList;
|
||||
/**
|
||||
* 添加商品规格List
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> skuAddList;
|
||||
|
||||
}
|
|
@ -8,7 +8,7 @@ import lombok.experimental.SuperBuilder;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 添加的Sku
|
||||
* 添加的req
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
|
|
|
@ -8,7 +8,7 @@ import lombok.experimental.SuperBuilder;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 添加的
|
||||
* 添加的resp
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
|
|
|
@ -6,7 +6,9 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSelectModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
|
@ -71,4 +73,15 @@ public class ActivityTeamController {
|
|||
ActivityTeamInfoResp activityTeamInfoResp = ActivityTeamInfoResp.select(activityTeamInfoSelectModel);
|
||||
return Result.success(activityTeamInfoResp);
|
||||
}
|
||||
|
||||
/** 修改拼团活动*/
|
||||
@PutMapping
|
||||
private Result<String> update(ActivityTeamProductSkuInfoUpdReq activityTeamProductSkuInfoUpdReq){
|
||||
//转换拼团修改Model
|
||||
ActivityTeamInfoUpdModel activityTeamInfoUpdModel = ActivityTeamInfoUpdModel.reqConvertModel(activityTeamProductSkuInfoUpdReq);
|
||||
|
||||
activityTeamInfoService.updateTeamInfo(activityTeamInfoUpdModel);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,11 +3,12 @@ package com.muyu.marketing.team.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSelectModel;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuInfoUpdReq;
|
||||
|
||||
/**
|
||||
* 拼团活动
|
||||
*/
|
||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||
|
||||
|
||||
|
@ -28,4 +29,10 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
|||
* 查询拼团活动(回显)
|
||||
*/
|
||||
public ActivityTeamInfoSelectModel selectTeamInfo(Long teamId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改活动
|
||||
*/
|
||||
void updateTeamInfo(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||
|
||||
}
|
||||
|
|
|
@ -47,6 +47,12 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
||||
|
||||
/** 修改规格SKU*/
|
||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
||||
public boolean updateBath(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuReqModelList);
|
||||
|
||||
/**
|
||||
* 删除商品规格list
|
||||
*/
|
||||
public boolean deleteById(List<Long> skuByIdDeleteList);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,30 +1,28 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuInfoUpdReq;
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
||||
/**
|
||||
* 拼团活动
|
||||
*/
|
||||
@Service
|
||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
||||
implements ActivityTeamInfoService {
|
||||
|
@ -35,8 +33,6 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
@Autowired
|
||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||
|
||||
|
@ -101,7 +97,47 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfoList = activityTeamProductSkuInfoService.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||
//构造成 ActivityTeamInfoSelectModel
|
||||
ActivityTeamInfoSelectModel teamInfoSelectModel = ActivityTeamInfoSelectModel.getTeamInfoSelectModel(activityTeamInfo, activityTeamProductSkuInfoList);
|
||||
|
||||
return teamInfoSelectModel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改拼团活动活动
|
||||
*/
|
||||
@Override
|
||||
public void updateTeamInfo(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||
//查询当前活动状态
|
||||
ActivityTeamInfo activityTeamInfo = this.getById(activityTeamInfoUpdModel.getTeamId());
|
||||
if ("Y".equals(activityTeamInfo.getStatus())){
|
||||
//当前活动运营中禁止修改
|
||||
throw new RuntimeException("当前活动运营中禁止修改");
|
||||
}
|
||||
|
||||
//修改:
|
||||
List<ActivityTeamProductSkuAddModel> skuAddList = activityTeamInfoUpdModel.getSkuList().getSkuAddList();
|
||||
//添加列表不为空并且长度大于零
|
||||
if (null != skuAddList && 0<skuAddList.size()){
|
||||
//构造 添加
|
||||
activityTeamProductSkuInfoService.batchSave(skuAddList);
|
||||
|
||||
}
|
||||
|
||||
List<ActivityTeamProductSkuUpdModel> skuUpdateList = activityTeamInfoUpdModel.getSkuList().getSkuUpdateList();
|
||||
//修改列表不为空并且长度大于零
|
||||
if (null != skuUpdateList && 0<skuUpdateList.size()){
|
||||
//构造 修改
|
||||
activityTeamProductSkuInfoService.updateBath(skuUpdateList);
|
||||
}
|
||||
|
||||
List<Long> skuByIdDeleteList = activityTeamInfoUpdModel.getSkuList().getSkuByIdDeleteList();
|
||||
if (null != skuByIdDeleteList && 0<skuByIdDeleteList.size()){
|
||||
//构造 删除
|
||||
activityTeamProductSkuInfoService.deleteById(skuByIdDeleteList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -20,9 +20,6 @@ import java.util.Comparator;
|
|||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
@Service
|
||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||
implements ActivityTeamProductSkuInfoService {
|
||||
|
@ -98,9 +95,32 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
|||
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品规格list
|
||||
* @param activityTeamProductSkuReqModelList
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList) {
|
||||
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
||||
public boolean updateBath(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuReqModelList) {
|
||||
return
|
||||
this.updateBatchById(activityTeamProductSkuReqModelList
|
||||
.stream()
|
||||
.map(ActivityTeamProductSkuInfo::updateModelBuild)
|
||||
.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品规格list
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(List<Long> skuByIdDeleteList) {
|
||||
boolean b = this.removeBatchByIds(skuByIdDeleteList);
|
||||
return b;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue