2204-11-20 (添加拼团1.0)
parent
e09cb28b9c
commit
ddecd8e429
|
@ -10,7 +10,9 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.poi.hpsf.Decimal;
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/** 商品拼团规格信息*/
|
/** 商品拼团规格信息*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
|
@ -32,7 +34,7 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
/** 拼团库存*/
|
/** 拼团库存*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
/** 拼团价格*/
|
/** 拼团价格*/
|
||||||
private Decimal teamPrice;
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团库存
|
* 拼团库存
|
||||||
|
|
|
@ -6,6 +6,8 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.apache.poi.hpsf.Decimal;
|
import org.apache.poi.hpsf.Decimal;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/** 添加拼团(商品规格List)Resp*/
|
/** 添加拼团(商品规格List)Resp*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@ -15,7 +17,7 @@ public class AddProjectSkuListReq {
|
||||||
/** 商品sku*/
|
/** 商品sku*/
|
||||||
private String productSku;
|
private String productSku;
|
||||||
/** 拼团价格*/
|
/** 拼团价格*/
|
||||||
private Decimal teamPrice;
|
private BigDecimal teamPrice;
|
||||||
/** 库存库存*/
|
/** 库存库存*/
|
||||||
private Integer teamStock;
|
private Integer teamStock;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class ActivityTeamInfoController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取拼团列表")
|
@ApiOperation("获取拼团列表")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public Result<TableDataInfo<ActivityTeamInfoListModel>> ActivityTeamInfoList(TeamInfoListReq teamInfoListReq){
|
public Result<TableDataInfo<ActivityTeamInfoListModel>> ActivityTeamInfoList(@RequestBody TeamInfoListReq teamInfoListReq){
|
||||||
ActivityTeamInfoListQueryModel queryModel = ActivityTeamInfoListQueryModel.builder()
|
ActivityTeamInfoListQueryModel queryModel = ActivityTeamInfoListQueryModel.builder()
|
||||||
.name(teamInfoListReq.getName())
|
.name(teamInfoListReq.getName())
|
||||||
.status(teamInfoListReq.getStatus())
|
.status(teamInfoListReq.getStatus())
|
||||||
|
|
|
@ -7,16 +7,14 @@ 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.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
import com.muyu.marketing.domain.model.*;
|
||||||
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.req.ActivityTeamInfoReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoReq;
|
||||||
import com.muyu.marketing.domain.req.AddProjectSkuListReq;
|
import com.muyu.marketing.domain.req.AddProjectSkuListReq;
|
||||||
import com.muyu.marketing.mapper.ActivityTeamInfoMapper;
|
import com.muyu.marketing.mapper.ActivityTeamInfoMapper;
|
||||||
import com.muyu.marketing.mapper.ActivityTeamProductSkuInfoMapper;
|
import com.muyu.marketing.mapper.ActivityTeamProductSkuInfoMapper;
|
||||||
import com.muyu.marketing.service.ActivityTeamInfoService;
|
import com.muyu.marketing.service.ActivityTeamInfoService;
|
||||||
import com.muyu.marketing.service.ActivityTeamOpenInfoService;
|
import com.muyu.marketing.service.ActivityTeamOpenInfoService;
|
||||||
|
import com.muyu.marketing.service.ActivityTeamProductSkuInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -39,6 +37,8 @@ implements ActivityTeamInfoService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActivityTeamProductSkuInfoMapper activityTeamProductSkuInfoMapper;
|
private ActivityTeamProductSkuInfoMapper activityTeamProductSkuInfoMapper;
|
||||||
|
@Autowired
|
||||||
|
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||||
/**
|
/**
|
||||||
* 团购活动列表
|
* 团购活动列表
|
||||||
*/
|
*/
|
||||||
|
@ -46,8 +46,13 @@ implements ActivityTeamInfoService {
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> tabDateInfo(ActivityTeamInfoListQueryModel teamInfoListQueryModel) {
|
public TableDataInfo<ActivityTeamInfoListModel> tabDateInfo(ActivityTeamInfoListQueryModel teamInfoListQueryModel) {
|
||||||
|
|
||||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
if (StringUtils.isNotEmpty(teamInfoListQueryModel.getName()) ){
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(teamInfoListQueryModel.getName()),ActivityTeamInfo::getName,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.getStatus()),ActivityTeamInfo::getStatus,teamInfoListQueryModel.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(teamInfoListQueryModel.buildPage(), queryWrapper);
|
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(teamInfoListQueryModel.buildPage(), queryWrapper);
|
||||||
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
||||||
|
@ -65,10 +70,11 @@ implements ActivityTeamInfoService {
|
||||||
activityTeamInfoListModel.setEndTime(activityTeamInfo.getEndTime());//活动结束时间
|
activityTeamInfoListModel.setEndTime(activityTeamInfo.getEndTime());//活动结束时间
|
||||||
|
|
||||||
activityTeamInfoListModel.setProductImage(activityTeamInfo.getProductImage());//拼团商品图片
|
activityTeamInfoListModel.setProductImage(activityTeamInfo.getProductImage());//拼团商品图片
|
||||||
activityTeamInfoListModel.setProductPrice(0.00);//商品价格
|
TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
|
||||||
|
activityTeamInfoListModel.setProductPrice(discountPrice.getProductPrice());//商品价格
|
||||||
activityTeamInfoListModel.setRemainStock(0L);//商品库存
|
activityTeamInfoListModel.setRemainStock(0L);//商品库存
|
||||||
activityTeamInfoListModel.setStatus(activityTeamInfo.getStatus());//团购状态
|
activityTeamInfoListModel.setStatus(activityTeamInfo.getStatus());//团购状态
|
||||||
activityTeamInfoListModel.setTeamPrice(0.00);//拼团价格
|
activityTeamInfoListModel.setTeamPrice(discountPrice.getTeamPrice());//拼团价格
|
||||||
activityTeamInfoListModel.setTeamStock(0L);//拼团库存
|
activityTeamInfoListModel.setTeamStock(0L);//拼团库存
|
||||||
|
|
||||||
activityTeamInfoListModels.add(activityTeamInfoListModel);
|
activityTeamInfoListModels.add(activityTeamInfoListModel);
|
||||||
|
|
Loading…
Reference in New Issue