feat():团购商品-团购添加完成了
parent
e8a433bacd
commit
49be23d2b6
|
@ -45,3 +45,30 @@ activity_team_product_sku_info.product_sku(商品SKU) <- ActivityTeamProductSkuI
|
||||||
activity_team_product_sku_info.team_stock(拼团库存) <- ActivityTeamProductSkuInfo.teamStock <- @商品规格.拼团库存
|
activity_team_product_sku_info.team_stock(拼团库存) <- ActivityTeamProductSkuInfo.teamStock <- @商品规格.拼团库存
|
||||||
activity_team_product_sku_info.remain_stock(剩余库存) <- ActivityTeamProductSkuInfo.remainStock <- @商品规格.拼团库存
|
activity_team_product_sku_info.remain_stock(剩余库存) <- ActivityTeamProductSkuInfo.remainStock <- @商品规格.拼团库存
|
||||||
activity_team_product_sku_info.team_price(拼团价格) <- ActivityTeamProductSkuInfo.teamPrice <- @商品规格.拼团价格
|
activity_team_product_sku_info.team_price(拼团价格) <- ActivityTeamProductSkuInfo.teamPrice <- @商品规格.拼团价格
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"msg": "string",
|
||||||
|
"data": {
|
||||||
|
"rows": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"name": "string",
|
||||||
|
"productImage": "string",
|
||||||
|
"productPrice": "string",
|
||||||
|
"teamPrice": "string",
|
||||||
|
"attendNumber": "string",
|
||||||
|
"openTeamNumber": "string",
|
||||||
|
"teamStock": "string",
|
||||||
|
"remainStock": "string",
|
||||||
|
"endTime": "string",
|
||||||
|
"status": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Tomcat
|
# Tomcat
|
||||||
server:
|
server:
|
||||||
port: 8080
|
port: 18080
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
|
@ -80,7 +80,6 @@ public class ActivityTeamInfoAddModel {
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
|
|
||||||
public static ActivityTeamInfoAddModel saveTeamInfoBuild(ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
public static ActivityTeamInfoAddModel saveTeamInfoBuild(ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
||||||
|
|
||||||
return ActivityTeamInfoAddModel.builder()
|
return ActivityTeamInfoAddModel.builder()
|
||||||
.name(activityTeamInfoSaveReq.getName())
|
.name(activityTeamInfoSaveReq.getName())
|
||||||
.productId(activityTeamInfoSaveReq.getProductId())
|
.productId(activityTeamInfoSaveReq.getProductId())
|
||||||
|
@ -97,7 +96,7 @@ public class ActivityTeamInfoAddModel {
|
||||||
.activityTeamProductSkuAddModelList(
|
.activityTeamProductSkuAddModelList(
|
||||||
activityTeamInfoSaveReq.getProjectSkuInfoAddReqList()
|
activityTeamInfoSaveReq.getProjectSkuInfoAddReqList()
|
||||||
.stream()
|
.stream()
|
||||||
.map(projectSkuInfoAddReq ->ActivityTeamProductSkuAddModel.addReqBulid(projectSkuInfoAddReq,activityTeamInfoSaveReq::getProductId)).toList()
|
.map(projectSkuInfoAddReq ->ActivityTeamProductSkuAddModel.addReqBulid(projectSkuInfoAddReq, activityTeamInfoSaveReq::getProductId)).toList()
|
||||||
).build();
|
).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
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.req.TeamProjectSkuInfoAddReq;
|
||||||
|
import com.muyu.marketing.domain.resp.ActivityTeamInfoDaitlResp;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamInfoDaitlRespModel extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 活动id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
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> projectSkuInfoAddReqList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
//
|
||||||
|
// public static ActivityTeamInfoDaitlRespModel findById(ActivityTeamInfo activityTeamInfo, List<ActivityTeamProductSkuInfoModel> teamProductSkuInfoModelList){
|
||||||
|
// return ActivityTeamInfoDaitlRespModel.builder()
|
||||||
|
// .id(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())
|
||||||
|
// .projectSkuInfoAddReqList(teamProductSkuInfoModelList)
|
||||||
|
// .content(activityTeamInfo.getContent())
|
||||||
|
// .status(activityTeamInfo.getStatus())
|
||||||
|
// .strategyType(activityTeamInfo.getStrategyType())
|
||||||
|
// .strategyId(activityTeamInfo.getStrategyId())
|
||||||
|
// .build();
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,36 +1,34 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import jdk.jfr.Name;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
|
||||||
* 回显的
|
|
||||||
*/
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ProjectSkuInfoFindeModel {
|
@Builder
|
||||||
|
public class ActivityTeamProductSkuInfoModel extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 编号
|
* 编号
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Integer id;
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品id
|
|
||||||
*/
|
|
||||||
private Long product_id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 活动id
|
* 活动id
|
||||||
*/
|
*/
|
||||||
private Long teamId;
|
private Long teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品id
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格SKU
|
* 规格SKU
|
||||||
*/
|
*/
|
|
@ -0,0 +1,89 @@
|
||||||
|
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.req.TeamProjectSkuInfoAddReq;
|
||||||
|
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 ActivityTeamInfoDaitlResp 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 Integer sort;
|
||||||
|
/**
|
||||||
|
* 商品SkU集合
|
||||||
|
*/
|
||||||
|
private List<TeamProjectSkuInfoAddReq> projectSkuInfoAddReqList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
public static ActivityTeamInfoDaitlResp saveSkuInfosBuild(ActivityTeamInfoDaitlResp activityTeamInfoSaveReq){
|
||||||
|
return ActivityTeamInfoDaitlResp.builder()
|
||||||
|
.projectSkuInfoAddReqList(activityTeamInfoSaveReq.getProjectSkuInfoAddReqList())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TeamProjectSkuInfoResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动id
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品id
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
}
|
|
@ -3,7 +3,6 @@ package com.muyu.marketing.team.controller;
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
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.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.req.ActivityTeamInfoSaveReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
|
|
@ -3,9 +3,8 @@ package com.muyu.marketing.team.service;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
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.ActivityTeamProductSkuAddModel;
|
||||||
import com.muyu.marketing.domain.model.ProjectSkuInfoFindeModel;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuInfoModel;
|
||||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
||||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||||
|
|
||||||
|
@ -41,7 +40,11 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
||||||
*/
|
*/
|
||||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||||
//
|
|
||||||
//
|
// /**
|
||||||
// public List<ProjectSkuInfoFindeModel> findById(Long teamId);
|
// * 添加规格
|
||||||
|
// * @param teamId
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public List<ActivityTeamProductSkuInfoModel> findByIdSku(Long teamId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
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.TeamProductDiscountPriceModel;
|
||||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||||
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
||||||
|
@ -80,4 +81,15 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
|
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public List<ActivityTeamProductSkuInfoModel> findByIdSku(Long teamId) {
|
||||||
|
// LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
// queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,teamId);
|
||||||
|
// List<ActivityTeamProductSkuInfo> list = this.list();
|
||||||
|
// list.stream().map(ActivityTeamProductSkuInfo->{
|
||||||
|
// ActivityTeamProductSkuAddModel builder = ActivityTeamProductSkuAddModel.builder(ActivityTeamProductSkuInfo);
|
||||||
|
// })
|
||||||
|
//
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue