团购根据ID查询
parent
b75c102e2c
commit
a8ed2ca7d3
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"id":"Long",
|
||||
"团购名称":"String",
|
||||
"团购商品ID":"Long",
|
||||
"团购商品名称":"String",
|
||||
"团购商品图片":"String",
|
||||
"团购商品简介":"Text",
|
||||
"策略id":"Long",
|
||||
"策略类型":"String",
|
||||
"结束时间":"Date",
|
||||
"状态":"String",
|
||||
"轮播图集合":
|
||||
[
|
||||
"图片":"String"
|
||||
]
|
||||
"商品规格集合":
|
||||
[
|
||||
"商品规格":
|
||||
{
|
||||
"id":"Long",
|
||||
"规格" :"String",
|
||||
"拼团价格":"Decimal",
|
||||
"拼团库存":"Long"
|
||||
}
|
||||
]
|
||||
|
||||
}
|
|
@ -60,6 +60,6 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||
.build()
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoQueryResp;
|
||||
import com.muyu.marketing.domain.resp.TeamProjectSkuInfoSkuResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 团购活动单条回显模板
|
||||
*
|
||||
* @author SunLY
|
||||
* @version 1.0
|
||||
* @date 2024/11/26 16:49
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ActivityTeamInfoQueryModel extends BaseEntity {
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<TeamProjectSkuInfoSkuResp> projectSkuInfoAddRespList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
public static ActivityTeamInfoQueryModel buildModel(ActivityTeamInfo activityTeamInfo, String productName, List<TeamProjectSkuInfoSkuResp> projectSkuInfoAddRespList) {
|
||||
return ActivityTeamInfoQueryModel.builder()
|
||||
.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())
|
||||
.projectSkuInfoAddRespList(projectSkuInfoAddRespList)
|
||||
.productName(productName)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 团购活动商品SKU
|
||||
*
|
||||
* @author SunLY
|
||||
* @version 1.0
|
||||
* @date 2024/11/26 16:11
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamProductSkuInfoModel {
|
||||
/**
|
||||
* 商品规格表ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 团购活动修改
|
||||
*
|
||||
* @author SunLY
|
||||
* @version 1.0
|
||||
* @date 2024/11/26 11:57
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ActivityTeamInfoEditReq extends BaseEntity {
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<TeamProjectSkuInfoAddReq> projectSkuInfoAddReqList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 团购活动规格修改
|
||||
*
|
||||
* @author SunLY
|
||||
* @version 1.0
|
||||
* @date 2024/11/26 11:59
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@EqualsAndHashCode
|
||||
public class TeamProjectSkuInfoEditReq {
|
||||
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
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.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoQueryModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author SunLY
|
||||
* @version 1.0
|
||||
* @date 2024/11/26 14:22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ActivityTeamInfoQueryResp extends BaseEntity {
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<TeamProjectSkuInfoSkuResp> projectSkuInfoAddRespList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
|
||||
public static ActivityTeamInfoQueryResp buildModel(ActivityTeamInfoQueryModel activityTeamInfoQueryModel) {
|
||||
return ActivityTeamInfoQueryResp.builder()
|
||||
.name(activityTeamInfoQueryModel.getName())
|
||||
.productId(activityTeamInfoQueryModel.getProductId())
|
||||
.productImage(activityTeamInfoQueryModel.getProductImage())
|
||||
.productName(activityTeamInfoQueryModel.getProductName())
|
||||
.introduction(activityTeamInfoQueryModel.getIntroduction())
|
||||
.unit(activityTeamInfoQueryModel.getUnit())
|
||||
.imageList(activityTeamInfoQueryModel.getImageList())
|
||||
.endTime(activityTeamInfoQueryModel.getEndTime())
|
||||
.sort(activityTeamInfoQueryModel.getSort())
|
||||
.projectSkuInfoAddRespList(activityTeamInfoQueryModel.getProjectSkuInfoAddRespList())
|
||||
.content(activityTeamInfoQueryModel.getContent())
|
||||
.status(activityTeamInfoQueryModel.getStatus())
|
||||
.strategyType(activityTeamInfoQueryModel.getStrategyType())
|
||||
.strategyId(activityTeamInfoQueryModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuInfoModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 单条回显规格
|
||||
*
|
||||
* @author SunLY
|
||||
* @version 1.0
|
||||
* @date 2024/11/26 15:20
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TeamProjectSkuInfoSkuResp {
|
||||
/**
|
||||
* 商品规格表ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
public static TeamProjectSkuInfoSkuResp buildModel(ActivityTeamProductSkuInfoModel activityTeamProductSkuInfoModel) {
|
||||
return TeamProjectSkuInfoSkuResp.builder()
|
||||
.id(activityTeamProductSkuInfoModel.getId())
|
||||
.sku(activityTeamProductSkuInfoModel.getSku())
|
||||
.teamPrice(activityTeamProductSkuInfoModel.getTeamPrice())
|
||||
.teamStock(activityTeamProductSkuInfoModel.getTeamStock())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,17 +1,17 @@
|
|||
package com.muyu.marketing.team.controller;
|
||||
|
||||
|
||||
import com.dtflys.forest.annotation.Get;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoQueryModel;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoQueryResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -44,4 +44,15 @@ public class ActivityTeamController {
|
|||
}}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询活动详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getById")
|
||||
public Result<ActivityTeamInfoQueryResp> getById(@RequestParam("id") Long id) {
|
||||
ActivityTeamInfoQueryModel activityTeamInfoQueryModel = activityTeamInfoService.getDetailById(id);
|
||||
return Result.success(ActivityTeamInfoQueryResp.buildModel(activityTeamInfoQueryModel));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ import com.muyu.marketing.domain.ActivityTeamInfo;
|
|||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoQueryModel;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoQueryResp;
|
||||
|
||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||
|
||||
|
@ -24,4 +24,11 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
|||
* @param activityTeamInfoAddModel 团购添加模型
|
||||
*/
|
||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||
|
||||
/**
|
||||
* 根据id查询团购活动详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public ActivityTeamInfoQueryModel getDetailById(Long id);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuInfoModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||
|
||||
|
@ -41,4 +42,11 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
*/
|
||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||
|
||||
/**
|
||||
* 根据活动ID获取活动商品SKU列表
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public List<ActivityTeamProductSkuInfoModel> getList(Long id);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
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;
|
||||
|
@ -9,16 +8,21 @@ 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.model.*;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoQueryResp;
|
||||
import com.muyu.marketing.domain.resp.TeamProjectSkuInfoSkuResp;
|
||||
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 com.muyu.product.domain.ProjectInfo;
|
||||
import com.muyu.product.remote.RemoteProjectInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service
|
||||
|
@ -31,6 +35,9 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
@Autowired
|
||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||
|
||||
@Resource
|
||||
private RemoteProjectInfoService remoteProjectInfoService;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||
|
||||
|
@ -85,4 +92,26 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ActivityTeamInfoQueryModel getDetailById(Long id) {
|
||||
ActivityTeamInfo activityTeamInfo = this.getById(id);
|
||||
long productId = activityTeamInfo.getProductId();
|
||||
|
||||
ProjectInfo projectInfo = remoteProjectInfoService.getInfo(productId).getData();
|
||||
|
||||
List<ActivityTeamProductSkuInfoModel> activityTeamProductSkuInfoModels = activityTeamProductSkuInfoService.getList(id);
|
||||
|
||||
|
||||
return ActivityTeamInfoQueryModel.buildModel(activityTeamInfo, projectInfo.getName(),
|
||||
activityTeamProductSkuInfoModels.stream().map(
|
||||
activityTeamProductSkuInfoModel -> TeamProjectSkuInfoSkuResp.buildModel(activityTeamProductSkuInfoModel)
|
||||
).collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuInfoModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
||||
|
@ -20,6 +21,7 @@ import java.util.ArrayList;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||
|
@ -80,4 +82,24 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
|||
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActivityTeamProductSkuInfoModel> getList(Long id) {
|
||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId, id);
|
||||
|
||||
List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfoList = this.list(queryWrapper);
|
||||
|
||||
List<ActivityTeamProductSkuInfoModel> teamProductSkuInfoModels = activityTeamProductSkuInfoList.stream().map(
|
||||
activityTeamProductSkuInfo -> {
|
||||
return ActivityTeamProductSkuInfoModel.builder()
|
||||
.id(activityTeamProductSkuInfo.getId())
|
||||
.sku(activityTeamProductSkuInfo.getProductSku())
|
||||
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
||||
.teamStock(activityTeamProductSkuInfo.getTeamStock())
|
||||
.build();
|
||||
}
|
||||
).collect(Collectors.toList());
|
||||
return teamProductSkuInfoModels;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue