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

yingxiao
笨蛋 2024-11-23 17:08:31 +08:00
parent e09cb28b9c
commit ddecd8e429
5 changed files with 25 additions and 14 deletions

View File

@ -10,7 +10,9 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.apache.poi.hpsf.Decimal;
import java.math.BigDecimal;
/** 商品拼团规格信息*/
@Data
@SuperBuilder
@ -32,7 +34,7 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
/** 拼团库存*/
private Long teamStock;
/** 拼团价格*/
private Decimal teamPrice;
private BigDecimal teamPrice;
}

View File

@ -7,6 +7,7 @@ import lombok.*;
import lombok.experimental.SuperBuilder;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -37,7 +38,7 @@ public class ActivityTeamInfoListModel extends QueryModel<ActivityTeamInfoListMo
/**
*
*/
private Double productPrice;
private BigDecimal productPrice;
/**
*
@ -51,7 +52,7 @@ public class ActivityTeamInfoListModel extends QueryModel<ActivityTeamInfoListMo
/**
*
*/
private Double teamPrice;
private BigDecimal teamPrice;
/**
*

View File

@ -6,6 +6,8 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.poi.hpsf.Decimal;
import java.math.BigDecimal;
/** 添加拼团(商品规格List)Resp*/
@Data
@AllArgsConstructor
@ -15,7 +17,7 @@ public class AddProjectSkuListReq {
/** 商品sku*/
private String productSku;
/** 拼团价格*/
private Decimal teamPrice;
private BigDecimal teamPrice;
/** 库存库存*/
private Integer teamStock;
}

View File

@ -33,7 +33,7 @@ public class ActivityTeamInfoController {
*/
@ApiOperation("获取拼团列表")
@PostMapping("/list")
public Result<TableDataInfo<ActivityTeamInfoListModel>> ActivityTeamInfoList(TeamInfoListReq teamInfoListReq){
public Result<TableDataInfo<ActivityTeamInfoListModel>> ActivityTeamInfoList(@RequestBody TeamInfoListReq teamInfoListReq){
ActivityTeamInfoListQueryModel queryModel = ActivityTeamInfoListQueryModel.builder()
.name(teamInfoListReq.getName())
.status(teamInfoListReq.getStatus())

View File

@ -7,16 +7,14 @@ 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.ActivityTeamProductSkuInfo;
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.ActivityTeamProductSkuInfoModel;
import com.muyu.marketing.domain.model.*;
import com.muyu.marketing.domain.req.ActivityTeamInfoReq;
import com.muyu.marketing.domain.req.AddProjectSkuListReq;
import com.muyu.marketing.mapper.ActivityTeamInfoMapper;
import com.muyu.marketing.mapper.ActivityTeamProductSkuInfoMapper;
import com.muyu.marketing.service.ActivityTeamInfoService;
import com.muyu.marketing.service.ActivityTeamOpenInfoService;
import com.muyu.marketing.service.ActivityTeamProductSkuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -39,6 +37,8 @@ implements ActivityTeamInfoService {
@Autowired
private ActivityTeamProductSkuInfoMapper activityTeamProductSkuInfoMapper;
@Autowired
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
/**
*
*/
@ -46,8 +46,13 @@ 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());
}
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(teamInfoListQueryModel.buildPage(), queryWrapper);
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
@ -65,10 +70,11 @@ implements ActivityTeamInfoService {
activityTeamInfoListModel.setEndTime(activityTeamInfo.getEndTime());//活动结束时间
activityTeamInfoListModel.setProductImage(activityTeamInfo.getProductImage());//拼团商品图片
activityTeamInfoListModel.setProductPrice(0.00);//商品价格
TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
activityTeamInfoListModel.setProductPrice(discountPrice.getProductPrice());//商品价格
activityTeamInfoListModel.setRemainStock(0L);//商品库存
activityTeamInfoListModel.setStatus(activityTeamInfo.getStatus());//团购状态
activityTeamInfoListModel.setTeamPrice(0.00);//拼团价格
activityTeamInfoListModel.setTeamPrice(discountPrice.getTeamPrice());//拼团价格
activityTeamInfoListModel.setTeamStock(0L);//拼团库存
activityTeamInfoListModels.add(activityTeamInfoListModel);