2204A-cyj(回显)
parent
f5d50ce2cf
commit
0514f04a43
|
@ -10,6 +10,9 @@ import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
|
|
@ -8,7 +8,9 @@ import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
/**
|
||||||
|
* 团购活动执行表
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@ -45,7 +47,7 @@ public class ActivityTeamOpenInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 商品ID
|
* 商品ID
|
||||||
*/
|
*/
|
||||||
private String productId;
|
private Long productId;
|
||||||
/**
|
/**
|
||||||
* 商品名称
|
* 商品名称
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,6 +10,9 @@ import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团规格信息表
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@ -60,6 +63,6 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||||
.build()
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
/**
|
||||||
|
* 拼团免单策略
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
|
|
@ -7,6 +7,10 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百人策略
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
|
|
@ -7,6 +7,9 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普通策略
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
|
|
@ -101,4 +101,6 @@ public class ActivityTeamInfoAddModel {
|
||||||
.toList()
|
.toList()
|
||||||
).build();
|
).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,115 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
||||||
|
import com.muyu.marketing.domain.resp.TeamProjectSkuInfoResp;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动查询模型
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-26 09:38
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamInfoSelectModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动id
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品活动图
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 轮播图
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 活动排序
|
||||||
|
*/
|
||||||
|
private Long sort;
|
||||||
|
/**
|
||||||
|
* 商品SkU集合
|
||||||
|
*/
|
||||||
|
private List<TeamProjectSkuInfoResp> teamProjectSkuInfoResp;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
|
||||||
|
/** 回显 构造 ActivityTeamInfoSelectModel*/
|
||||||
|
|
||||||
|
public static ActivityTeamInfoSelectModel getTeamInfoSelectModel(ActivityTeamInfo activityTeamInfo, List<ActivityTeamProductSkuInfo> list) {
|
||||||
|
return ActivityTeamInfoSelectModel.builder()
|
||||||
|
.teamId(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())
|
||||||
|
.teamProjectSkuInfoResp( list.stream().map(skuInfo ->
|
||||||
|
TeamProjectSkuInfoResp.getSkuInfoResp(skuInfo)
|
||||||
|
).toList())
|
||||||
|
.content(activityTeamInfo.getContent())
|
||||||
|
.status(activityTeamInfo.getStatus())
|
||||||
|
.strategyType(activityTeamInfo.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfo.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.marketing.domain.req;
|
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;
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,11 @@ import java.math.BigDecimal;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class TeamProjectSkuInfoAddReq {
|
public class TeamProjectSkuInfoAddReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*规格id
|
||||||
|
*/
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格SKU
|
* 规格SKU
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
/** 添加拼团活动*/
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoSelectModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询拼团活动信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ActivityTeamInfoResp extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动id
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品活动图
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 轮播图
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 活动排序
|
||||||
|
*/
|
||||||
|
private Long sort;
|
||||||
|
/**
|
||||||
|
* 商品SkU集合
|
||||||
|
*/
|
||||||
|
private List<TeamProjectSkuInfoResp> teamProjectSkuInfoResp;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
/** 构造ActivityTeamInfoResp */
|
||||||
|
public static ActivityTeamInfoResp select(ActivityTeamInfoSelectModel teamSelectModel) {
|
||||||
|
|
||||||
|
return ActivityTeamInfoResp.builder()
|
||||||
|
.teamId(teamSelectModel.getTeamId())
|
||||||
|
.name(teamSelectModel.getName())
|
||||||
|
.productId(teamSelectModel.getProductId())
|
||||||
|
.productImage(teamSelectModel.getProductImage())
|
||||||
|
.introduction(teamSelectModel.getIntroduction())
|
||||||
|
.unit(teamSelectModel.getUnit())
|
||||||
|
.imageList(teamSelectModel.getImageList())
|
||||||
|
.endTime(teamSelectModel.getEndTime())
|
||||||
|
.sort(teamSelectModel.getSort())
|
||||||
|
.teamProjectSkuInfoResp(teamSelectModel.getTeamProjectSkuInfoResp())
|
||||||
|
.content(teamSelectModel.getContent())
|
||||||
|
.status(teamSelectModel.getStatus())
|
||||||
|
.strategyType(teamSelectModel.getStrategyType())
|
||||||
|
.strategyId(teamSelectModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoSelectModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询 拼团活动的商品规格
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TeamProjectSkuInfoResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*规格id
|
||||||
|
*/
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
/** 构造 回显拼团活动SKU*/
|
||||||
|
public static TeamProjectSkuInfoResp getSkuInfoResp(ActivityTeamProductSkuInfo skuInfo) {
|
||||||
|
return TeamProjectSkuInfoResp.builder()
|
||||||
|
.ruleId(skuInfo.getId())
|
||||||
|
.sku(skuInfo.getProductSku())
|
||||||
|
.teamPrice(skuInfo.getTeamPrice())
|
||||||
|
.teamStock(skuInfo.getTeamStock())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -5,15 +5,14 @@ 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.ActivityTeamInfoSelectModel;
|
||||||
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.ActivityTeamInfoResp;
|
||||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -58,4 +57,18 @@ public class ActivityTeamController {
|
||||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回显拼团活动
|
||||||
|
* @teamId 拼团活动id
|
||||||
|
*/
|
||||||
|
@GetMapping("/select/{id}")
|
||||||
|
public Result<ActivityTeamInfoResp> getTeamInfo(@PathVariable Long teamId){
|
||||||
|
//调用Service方法 获取回显Model
|
||||||
|
ActivityTeamInfoSelectModel activityTeamInfoSelectModel = activityTeamInfoService.selectTeamInfo(teamId);
|
||||||
|
// 将 回显的Model 构造 成 Resp
|
||||||
|
ActivityTeamInfoResp activityTeamInfoResp = ActivityTeamInfoResp.select(activityTeamInfoSelectModel);
|
||||||
|
return Result.success(activityTeamInfoResp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,7 @@ import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoSelectModel;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
|
|
||||||
|
@ -24,4 +23,9 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
* @param activityTeamInfoAddModel 团购添加模型
|
* @param activityTeamInfoAddModel 团购添加模型
|
||||||
*/
|
*/
|
||||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询拼团活动(回显)
|
||||||
|
*/
|
||||||
|
public ActivityTeamInfoSelectModel selectTeamInfo(Long teamId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@ 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.ActivityTeamOpenInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.*;
|
import com.muyu.marketing.domain.model.*;
|
||||||
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;
|
||||||
|
@ -29,9 +31,13 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ActivityTeamInfoServiceImpl activityTeamInfoService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||||
|
|
||||||
|
@ -82,4 +88,24 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
||||||
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询拼团活动(回显)
|
||||||
|
* @param teamId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ActivityTeamInfoSelectModel selectTeamInfo(Long teamId) {
|
||||||
|
//根据拼团活动id 查询拼团活动
|
||||||
|
ActivityTeamInfo activityTeamInfo = activityTeamInfoService.getById(teamId);
|
||||||
|
//查询活动中的 商品sku集合
|
||||||
|
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(ActivityTeamProductSkuInfo::getProductId,activityTeamInfo.getProductId());
|
||||||
|
List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfoList = activityTeamProductSkuInfoService.list(queryWrapper);
|
||||||
|
|
||||||
|
//构造成 ActivityTeamInfoSelectModel
|
||||||
|
ActivityTeamInfoSelectModel teamInfoSelectModel = ActivityTeamInfoSelectModel.getTeamInfoSelectModel(activityTeamInfo, activityTeamProductSkuInfoList);
|
||||||
|
|
||||||
|
return teamInfoSelectModel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue