2204-11-20 (添加拼团11.24)

yingxiao
笨蛋 2024-11-24 09:22:16 +08:00
parent ddecd8e429
commit a0dae5aeb2
6 changed files with 57 additions and 15 deletions

View File

@ -10,6 +10,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.function.Function;
/**
* Model
@ -66,5 +67,4 @@ public class ActivityTeamInfoAddModel {
return build;
}
}

View File

@ -3,12 +3,16 @@ package com.muyu.marketing.domain.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.muyu.common.core.model.QueryModel;
import lombok.*;
import com.muyu.marketing.domain.ActivityTeamInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.math.BigDecimal;
import java.util.Date;
import java.util.function.Function;
/**
*
@ -58,4 +62,14 @@ public class ActivityTeamInfoListModel extends QueryModel<ActivityTeamInfoListMo
*
*/
private Long teamStock;
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModelBuilder , ActivityTeamInfoListModel> function){
return function.apply(
ActivityTeamInfoListModel.builder()
.id(activityTeamInfo.getId())
.name(activityTeamInfo.getName())
.endTime(activityTeamInfo.getEndTime())
.productImage(activityTeamInfo.getProductImage())
.status(activityTeamInfo.getStatus())
);
}
}

View File

@ -0,0 +1,27 @@
package com.muyu.marketing.domain.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author: CuiFu Bo
* @create: 2024-11-21 16:54
**/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class TeamProductStockModel {
/**
*
*/
private Long teamStock;
/**
*
*/
private Long remainStock;
}

View File

@ -3,5 +3,6 @@ package com.muyu.marketing.service;
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
public interface ActivityTeamProductSkuInfoService {
/** 商品优惠*/
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId);
}

View File

@ -38,7 +38,7 @@ implements ActivityTeamInfoService {
@Autowired
private ActivityTeamProductSkuInfoMapper activityTeamProductSkuInfoMapper;
@Autowired
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
private ActivityTeamProductSkuInfoServiceImpl activityTeamProductSkuInfoService;
/**
*
*/
@ -46,13 +46,8 @@ implements ActivityTeamInfoService {
public TableDataInfo<ActivityTeamInfoListModel> tabDateInfo(ActivityTeamInfoListQueryModel teamInfoListQueryModel) {
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotEmpty(teamInfoListQueryModel.getName()) ){
queryWrapper.like(StringUtils.isNotEmpty(teamInfoListQueryModel.getName()),ActivityTeamInfo::getName,teamInfoListQueryModel.getName());
}
if (StringUtils.isNotEmpty(teamInfoListQueryModel.getStatus()) ){
queryWrapper.like(StringUtils.isNotEmpty(teamInfoListQueryModel.getStatus()),ActivityTeamInfo::getStatus,teamInfoListQueryModel.getStatus());
}
queryWrapper.like(StringUtils.isNotEmpty(teamInfoListQueryModel.getName()),ActivityTeamInfo::getName,teamInfoListQueryModel.getName());
queryWrapper.like(StringUtils.isNotEmpty(teamInfoListQueryModel.getStatus()),ActivityTeamInfo::getStatus,teamInfoListQueryModel.getStatus());
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(teamInfoListQueryModel.buildPage(), queryWrapper);
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
@ -103,12 +98,12 @@ implements ActivityTeamInfoService {
Long goodsId = activityTeamInfo.getProductId();
List<AddProjectSkuListReq> skuList = activityTeamInfoReq.getProjectSkuList();
ArrayList<ActivityTeamProductSkuInfo> infoArrayList = new ArrayList<>();
skuList.forEach(skuInfo->{
ActivityTeamProductSkuInfoModel.saveModelBuild(projectId,goodsId,skuInfo);
ActivityTeamProductSkuInfo activityTeamProductSkuInfo = ActivityTeamProductSkuInfoModel.saveModelBuild(projectId, goodsId, skuInfo);
infoArrayList.add(activityTeamProductSkuInfo);
});
activityTeamProductSkuInfoService.saveBatch(infoArrayList);
}

View File

@ -23,6 +23,11 @@ implements ActivityTeamProductSkuInfoService {
private ProjectSkuCache projectSkuCache;
/**
*
* @param teamId
* @return
*/
@Override //
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId) {
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();