Compare commits
No commits in common. "1127/cloud-server" and "main" have entirely different histories.
1127/cloud
...
main
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"拼团活动Id": "Long",
|
||||
"商品ID": "Long",
|
||||
"商品图片": "String",
|
||||
"活动名称": "String",
|
||||
"活动简介": "String",
|
||||
"商品单位": "String",
|
||||
"商品的轮播图": [
|
||||
"String", "String"
|
||||
],
|
||||
"活动时间": "date",
|
||||
"策略类型": "String",
|
||||
"策略ID": "Long",
|
||||
"商品规格List": [{
|
||||
"规格SKUid": "Long",
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
}],
|
||||
"商品规格List": [{
|
||||
"规格SKUid": "Long"
|
||||
}],
|
||||
"商品规格List": [{
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
}],
|
||||
"排序": "Integer",
|
||||
"详情": "String",
|
||||
"活动状态":"Long"
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
$.{
|
||||
"活动ID": "Long",
|
||||
"商品ID": "Long", //activity_team_info.product_id
|
||||
"商品图片": "String",
|
||||
"活动名称": "String",
|
||||
"活动简介": "String",
|
||||
"商品单位": "String",
|
||||
"商品的轮播图": [
|
||||
"String", "String"
|
||||
],
|
||||
"活动时间": "date",
|
||||
"策略类型": "String",
|
||||
"策略ID": "Long",
|
||||
"商品规格List": [ // activity_team_product_sku_info
|
||||
{
|
||||
"活动商品规格ID": "Long",
|
||||
"规格SKU": "String", // activity_team_product_sku_info.product_sku
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
}
|
||||
],
|
||||
"排序": "Integer",
|
||||
"详情": "String"
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"拼团ID": "Long",
|
||||
"商品ID": "Long",
|
||||
"商品图片": "String",
|
||||
"活动名称": "String",
|
||||
"活动简介": "String",
|
||||
"商品单位": "String",
|
||||
"商品的轮播图": [
|
||||
"String", "String"
|
||||
],
|
||||
"活动时间": "date",
|
||||
"策略类型": "String",
|
||||
"策略ID": "Long",
|
||||
"商品规格List": [
|
||||
{
|
||||
"规格Id": "Long",
|
||||
"规格SKU": "String",
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
}
|
||||
],
|
||||
"排序": "Integer",
|
||||
"详情": "String"
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"活动ID": "Long",
|
||||
"商品ID": "Long",
|
||||
"活动名称": "String",
|
||||
"商品名称": "String",
|
||||
"商品图片": "String",
|
||||
"活动简介": "String",
|
||||
"商品单位": "String",
|
||||
"商品的轮播图": [
|
||||
"String", "String"
|
||||
],
|
||||
"活动时间": "date",
|
||||
"策略类型": "String",
|
||||
"商品规格": {
|
||||
"修改商品规格List": [ // 修改
|
||||
{
|
||||
"团购规格ID": "Long",
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
}
|
||||
],
|
||||
"删除商品规格IdList" : ["Long", "Long"],
|
||||
"添加商品规格List": [
|
||||
"商品SKU": "String",
|
||||
"商品价格": "BigDecimal",
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
]
|
||||
},
|
||||
|
||||
"详情": "String"
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
$.{
|
||||
"商品ID": "Long", //activity_team_info.product_id
|
||||
"商品图片": "String",
|
||||
"活动名称": "String",
|
||||
"活动简介": "String",
|
||||
"商品单位": "String",
|
||||
"商品的轮播图": [
|
||||
"String", "String"
|
||||
],
|
||||
"活动时间": "date",
|
||||
"策略类型": "String",
|
||||
"策略ID": "Long",
|
||||
"商品规格List": [ // activity_team_product_sku_info
|
||||
{
|
||||
"规格SKU": "String", // activity_team_product_sku_info.product_sku
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
}
|
||||
],
|
||||
"排序": "Integer",
|
||||
"详情": "String"
|
||||
}
|
||||
|
||||
activity_team_info 团购活动表 -> ActivityTeamInfo(实体类)
|
||||
activity_team_info.id(主键) -> 自增 -> 回填 -> ActivityTeamInfo.id
|
||||
activity_team_info.name(拼团名称) <- ActivityTeamInfo.name <- $.活动名称
|
||||
activity_team_info.product_id(商品ID) <- ActivityTeamInfo.productId <- $.商品ID
|
||||
activity_team_info.product_image(商品活动图) <- ActivityTeamInfo.productImage <- $.商品图片
|
||||
activity_team_info.introduction(活动简介) <- ActivityTeamInfo.introduction <- $.活动简介
|
||||
activity_team_info.unit(单位) <- ActivityTeamInfo.unit <- $.商品单位
|
||||
activity_team_info.image_list(轮播图) <- ActivityTeamInfo.imageList <- 商品的轮播图.toString(","拼接) <- $.商品的轮播图
|
||||
activity_team_info.end_time(活动结束时间) <- ActivityTeamInfo.endTime <- $.活动时间
|
||||
activity_team_info.sort(活动排序) <- ActivityTeamInfo.sort <- $.排序
|
||||
activity_team_info.content(活动详情) <- ActivityTeamInfo.content <- $.详情
|
||||
activity_team_info.status(活动状态) <- _sys_normal_disable.1(停用)
|
||||
activity_team_info.strategy_type(策略类型) <- ActivityTeamInfo.strategy_type <- $.策略类型
|
||||
activity_team_info.strategy_id(策略ID) <- ActivityTeamInfo.strategy_id <- $.策略ID
|
||||
|
||||
for(@商品规格 in 商品规格List)
|
||||
activity_team_product_sku_info 商品拼团规格信息表 -> ActivityTeamProductSkuInfo(实体类)
|
||||
activity_team_product_sku_info.id(主键) -> 自增 -> 回填 -> ActivityTeamProductSkuInfo.id
|
||||
activity_team_product_sku_info.team_id(活动ID) <- ActivityTeamProductSkuInfo.teamId <- ActivityTeamInfo.id
|
||||
activity_team_product_sku_info.product_id(商品ID) <- ActivityTeamProductSkuInfo.productId < $.商品ID
|
||||
activity_team_product_sku_info.product_sku(商品SKU) <- ActivityTeamProductSkuInfo.productSku <- @商品规格.规格SKU
|
||||
activity_team_product_sku_info.team_stock(拼团库存) <- ActivityTeamProductSkuInfo.teamStock <- @商品规格.拼团库存
|
||||
activity_team_product_sku_info.remain_stock(剩余库存) <- ActivityTeamProductSkuInfo.remainStock <- @商品规格.拼团库存
|
||||
activity_team_product_sku_info.team_price(拼团价格) <- ActivityTeamProductSkuInfo.teamPrice <- @商品规格.拼团价格
|
22
doc/拼团活动添加入参
22
doc/拼团活动添加入参
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"team": {
|
||||
"商品Id":"Long",
|
||||
"商品图片":"String",
|
||||
"拼团活动名称":"String",
|
||||
"拼团活动简介":"String",
|
||||
"商品单位":"String",
|
||||
"商品轮播图":[
|
||||
"图片路径":"String",
|
||||
],
|
||||
"活动时间":"Date",
|
||||
"策略类型":"String",
|
||||
"策略ID":"Long",
|
||||
"规格":[{
|
||||
规格SKU:"String",
|
||||
"拼团价格":"BigDecimal",
|
||||
"拼团库存":"Long"
|
||||
}],
|
||||
"排序":"Integer",
|
||||
"商品详情":"text"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
# 功能划分
|
||||
# 普通团
|
||||
商品列表
|
||||
商品详情
|
||||
去参团
|
||||
开团列表
|
||||
参团成功
|
||||
邀请参团
|
||||
拼团成功 查看订单
|
||||
拼团失败 重新开团
|
||||
开团成功
|
||||
邀请参团
|
||||
拼团成功 查看订单
|
||||
拼团失败 重新开团
|
||||
|
||||
# 百人团
|
||||
|
||||
|
||||
|
||||
1.商品详情
|
||||
2.评价接口
|
||||
3.拼团人数
|
||||
4.开团列表
|
||||
5.收藏接口
|
|
@ -1,32 +0,0 @@
|
|||
package com.muyu.common.core.enums;
|
||||
|
||||
/**
|
||||
* @program: cloud-server
|
||||
* @description: 参团类型
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-21 15:12
|
||||
**/
|
||||
|
||||
public enum TeamOpenTypeEnums {
|
||||
|
||||
|
||||
OPEN_TEAM("open_team","开团"),
|
||||
IN_TEAM("in_team","参团");
|
||||
private final String code;
|
||||
|
||||
private final String label;
|
||||
|
||||
public String code() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String label() {
|
||||
return label;
|
||||
}
|
||||
|
||||
TeamOpenTypeEnums(String code, String label) {
|
||||
this.code = code;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.muyu.common.core.enums.market.team;
|
||||
|
||||
|
||||
/**
|
||||
* 参团类型枚举类
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-21 11:20
|
||||
*/
|
||||
public enum TeamOpenTypeEnum {
|
||||
// 开团
|
||||
OPEN_TEAM("open_team", "开团"),
|
||||
// 参团
|
||||
IN_TEAM("in_team", "参团")
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String label;
|
||||
|
||||
TeamOpenTypeEnum(String code, String label) {
|
||||
this.code = code;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String code() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String label() {
|
||||
return label;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.common.core.web.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.muyu.common.core.web.page.PageDomain;
|
||||
|
@ -11,17 +12,17 @@ import lombok.experimental.SuperBuilder;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: cloud-server
|
||||
* @description: 列表查询模型
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 20:27
|
||||
**/
|
||||
|
||||
* 列表查询模型
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-20 14:18
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QueryModel<T> {
|
||||
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
|
@ -40,18 +41,18 @@ public class QueryModel<T> {
|
|||
/**
|
||||
* 排序的方向desc或者asc
|
||||
*/
|
||||
private Boolean isAsc = true;
|
||||
private boolean isAsc = true;
|
||||
|
||||
/**
|
||||
* 构建模型分页对象
|
||||
* @param pageDomain 分页参数
|
||||
* @return 返回模型分页参数
|
||||
* @return 模型分页对象
|
||||
*/
|
||||
public T domainBuild(PageDomain pageDomain){
|
||||
public T domainBuild(PageDomain pageDomain) {
|
||||
this.pageNum = pageDomain.getPageNum();
|
||||
this.pageSize = pageDomain.getPageSize();
|
||||
this.orderByColumn = pageDomain.getOrderByColumn();
|
||||
this.isAsc = "ase".equals(pageDomain.getIsAsc());
|
||||
this.isAsc = "asc".equals(pageDomain.getIsAsc());
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
|
@ -59,12 +60,10 @@ public class QueryModel<T> {
|
|||
* 构建查询分页对象
|
||||
* @return 查询分页对象
|
||||
*/
|
||||
public <I> Page<I> bulidPage(){
|
||||
public <I> Page<I> buildPage(){
|
||||
Page<I> page = Page.of(this.getPageNum(), this.getPageSize());
|
||||
page.setOrders(List.of(this.isAsc
|
||||
? OrderItem.asc(this.getOrderByColumn()):OrderItem.desc(this.getOrderByColumn())));
|
||||
return page;
|
||||
page.setOrders(List.of(this.isAsc()
|
||||
? OrderItem.asc(this.getOrderByColumn()) : OrderItem.desc(this.getOrderByColumn())));
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package com.muyu.common.core.web.page;
|
||||
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.web.model.QueryModel;
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
|
@ -12,8 +13,8 @@ import lombok.experimental.SuperBuilder;
|
|||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageDomain {
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
|
@ -47,9 +48,6 @@ public class PageDomain {
|
|||
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
||||
}
|
||||
|
||||
public String getIsAsc () {
|
||||
return isAsc;
|
||||
}
|
||||
|
||||
public void setIsAsc (String isAsc) {
|
||||
if (StringUtils.isNotEmpty(isAsc)) {
|
||||
|
@ -70,7 +68,4 @@ public class PageDomain {
|
|||
return reasonable;
|
||||
}
|
||||
|
||||
public void setReasonable (Boolean reasonable) {
|
||||
this.reasonable = reasonable;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package com.muyu.common.core.web.page;
|
||||
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.muyu.common.security.config.mybatisplus;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实体类字段填充
|
||||
*/
|
||||
@Log4j2
|
||||
@Component
|
||||
public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||
|
||||
public MyMetaObjectHandler () {
|
||||
log.info("mybatis-plus 系统字段填充拦截器 初始化成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
this.setFieldValByName("createBy", SecurityUtils.getUsername(), metaObject);
|
||||
this.setFieldValByName("createTime", new Date(), metaObject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
this.setFieldValByName("updateBy", SecurityUtils.getUsername(), metaObject);
|
||||
this.setFieldValByName("updateTime", new Date(),metaObject);
|
||||
}
|
||||
}
|
|
@ -3,7 +3,6 @@ package com.muyu.common.security.config.mybatisplus;
|
|||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
@ -16,7 +15,8 @@ public class MybatisPlusConfig {
|
|||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2));
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); // 如果配置多个插件, 切记分页最后添加
|
||||
// 如果有多数据源可以不配具体类型, 否则都建议配上具体的 DbType
|
||||
return interceptor;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.gateway.config.properties;
|
||||
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
|
@ -57,4 +56,3 @@ public class CorsConfig
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -9,17 +9,21 @@
|
|||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-marketing-common</artifactId>
|
||||
<artifactId>marketing-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 系统公共core -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,25 +1,24 @@
|
|||
package com.muyu.domain;
|
||||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.domain.model.ActivityTeamInfoSaveModel;
|
||||
import com.muyu.domain.model.ActivityTeamInfoUpdModel;
|
||||
import com.muyu.domain.req.ActivityTeamInfoSaveReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
||||
public class ActivityTeamInfo {
|
||||
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "activity_team_info", autoResultMap = true)
|
||||
public class ActivityTeamInfo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
|
@ -96,21 +95,6 @@ public class ActivityTeamInfo {
|
|||
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
public static ActivityTeamInfo buildModel(ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
||||
String images = activityTeamInfoSaveReq.getImageList().toString();
|
||||
return ActivityTeamInfo.builder()
|
||||
.productId(activityTeamInfoSaveReq.getProjectId())
|
||||
.productImage(activityTeamInfoSaveReq.getProjectImage())
|
||||
.unit(activityTeamInfoSaveReq.getUnit())
|
||||
.imageList(images)
|
||||
.name(activityTeamInfoSaveReq.getName())
|
||||
.introduction(activityTeamInfoSaveReq.getIntroduction())
|
||||
.endTime(activityTeamInfoSaveReq.getEndTime())
|
||||
.strategyId(activityTeamInfoSaveReq.getStrategyId())
|
||||
.strategyType(activityTeamInfoSaveReq.getStrategyType())
|
||||
.sort(activityTeamInfoSaveReq.getSort())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ActivityTeamInfo teamSaveBuild(ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
||||
return ActivityTeamInfo.builder()
|
|
@ -0,0 +1,87 @@
|
|||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamOpenInfoAddModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "activity_team_open_info", autoResultMap = true)
|
||||
public class ActivityTeamOpenInfo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private long id;
|
||||
/**
|
||||
* 团购活动ID
|
||||
*/
|
||||
private long teamId;
|
||||
/**
|
||||
* 团购类型
|
||||
*/
|
||||
private String teamType;
|
||||
/**
|
||||
* 团购策略
|
||||
*/
|
||||
private String teamStrategyId;
|
||||
/**
|
||||
* 参团类型
|
||||
*/
|
||||
private String executiveType;
|
||||
/**
|
||||
* 结束团购时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private String productSku;
|
||||
/**
|
||||
* 开团标识
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 开团状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
public static ActivityTeamOpenInfo addBuildModel(ActivityTeamOpenInfoAddModel activityTeamOpenInfoAddModel){
|
||||
return ActivityTeamOpenInfo.builder()
|
||||
.id(activityTeamOpenInfoAddModel.getId())
|
||||
.teamId(activityTeamOpenInfoAddModel.getTeamId())
|
||||
.teamType(activityTeamOpenInfoAddModel.getTeamType())
|
||||
.teamStrategyId(activityTeamOpenInfoAddModel.getTeamStrategyId())
|
||||
.executiveType(activityTeamOpenInfoAddModel.getExecutiveType())
|
||||
.endTime(activityTeamOpenInfoAddModel.getEndTime())
|
||||
.productId(activityTeamOpenInfoAddModel.getProductId())
|
||||
.productName(activityTeamOpenInfoAddModel.getProductName())
|
||||
.productSku(activityTeamOpenInfoAddModel.getProductSku())
|
||||
.key(activityTeamOpenInfoAddModel.getKey())
|
||||
.orderId(activityTeamOpenInfoAddModel.getOrderId())
|
||||
.status(activityTeamOpenInfoAddModel.getStatus())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,22 +1,26 @@
|
|||
package com.muyu.domain;
|
||||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.domain.model.ActivityTeamProductSkuReqModel;
|
||||
import com.muyu.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
public class ActivityTeamProductSkuInfo {
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "activity_team_product_sku_info", autoResultMap = true)
|
||||
public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
|
@ -1,19 +1,24 @@
|
|||
package com.muyu.domain;
|
||||
package com.muyu.marketing.domain;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
public class TeamStrategyExemption {
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "team_strategy_exemption", autoResultMap = true)
|
||||
public class TeamStrategyExemption extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private long id;
|
||||
/**
|
||||
* 持续时间
|
||||
|
@ -47,5 +52,4 @@ public class TeamStrategyExemption {
|
|||
* 策略状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "team_strategy_exemption_hundred", autoResultMap = true)
|
||||
public class TeamStrategyHundred extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private long id;
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private long duration;
|
||||
/**
|
||||
* 最大购买量
|
||||
*/
|
||||
private long maxBuy;
|
||||
/**
|
||||
* 单次购买量
|
||||
*/
|
||||
private long oneBuy;
|
||||
/**
|
||||
* 虚拟人数
|
||||
*/
|
||||
private long virtualNumber;
|
||||
/**
|
||||
* 策略状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 规则信息
|
||||
*/
|
||||
private String ruleInfo;
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.muyu.marketing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "team_strategy_exemption_ordinary", autoResultMap = true)
|
||||
public class TeamStrategyOrdinary extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private long id;
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private long duration;
|
||||
/**
|
||||
* 成团人数
|
||||
*/
|
||||
private long teamNumber;
|
||||
/**
|
||||
* 最大购买量
|
||||
*/
|
||||
private long maxBuy;
|
||||
/**
|
||||
* 单次购买量
|
||||
*/
|
||||
private long oneBuy;
|
||||
/**
|
||||
* 虚拟人数
|
||||
*/
|
||||
private long virtualNumber;
|
||||
/**
|
||||
* 策略状态
|
||||
*/
|
||||
private String status;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -82,7 +82,7 @@ public class ActivityTeamDetailModel {
|
|||
*/
|
||||
private Long strategyId;
|
||||
public static ActivityTeamDetailModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
||||
Function<ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
||||
Function<ActivityTeamDetailModel.ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
||||
return function.apply(ActivityTeamDetailModel.builder()
|
||||
.id(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
|
@ -1,14 +1,17 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.domain.ActivityTeamInfo;
|
||||
import com.muyu.domain.resp.TeamInfoProductSkuIdByIdResp;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoProductSkuIdByIdResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.web.context.annotation.ApplicationScope;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -38,6 +41,10 @@ public class ActivityTeamFindByIdModel {
|
|||
* 商品ID
|
||||
*/
|
||||
private long productId;
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
|
@ -84,7 +91,7 @@ public class ActivityTeamFindByIdModel {
|
|||
private List<TeamInfoProductSkuIdByIdResp> teamProjectSkuInfoAddReqList;
|
||||
|
||||
|
||||
public static ActivityTeamFindByIdModel findByIdModel(ActivityTeamInfo activityTeamInfo, List<TeamInfoProductSkuIdByIdResp> teamProjectSkuInfoAddReqList){
|
||||
public static ActivityTeamFindByIdModel findByIdModel(ActivityTeamInfo activityTeamInfo,List<TeamInfoProductSkuIdByIdResp> teamProjectSkuInfoAddReqList){
|
||||
return ActivityTeamFindByIdModel.builder()
|
||||
.id(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
|
@ -0,0 +1,104 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 团购活动添加模型
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-26 09:38
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoAddModel {
|
||||
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
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<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
public static ActivityTeamInfoAddModel addReqBuild (ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
||||
return ActivityTeamInfoAddModel.builder()
|
||||
.name(activityTeamInfoSaveReq.getName())
|
||||
.productId(activityTeamInfoSaveReq.getProductId())
|
||||
.productImage(activityTeamInfoSaveReq.getProductImage())
|
||||
.introduction(activityTeamInfoSaveReq.getIntroduction())
|
||||
.unit(activityTeamInfoSaveReq.getUnit())
|
||||
.imageList(activityTeamInfoSaveReq.getImageList())
|
||||
.endTime(activityTeamInfoSaveReq.getEndTime())
|
||||
.sort(activityTeamInfoSaveReq.getSort())
|
||||
.content(activityTeamInfoSaveReq.getContent())
|
||||
.status(activityTeamInfoSaveReq.getStatus())
|
||||
.strategyType(activityTeamInfoSaveReq.getStrategyType())
|
||||
.strategyId(activityTeamInfoSaveReq.getStrategyId())
|
||||
.activityTeamProductSkuAddModelList(
|
||||
activityTeamInfoSaveReq.getTeamProjectSkuInfoAddReqList()
|
||||
.stream()
|
||||
.map(addReq -> ActivityTeamProductSkuAddModel.addReqBuild(addReq, activityTeamInfoSaveReq::getProductId))
|
||||
.toList()
|
||||
).build();
|
||||
}
|
||||
}
|
|
@ -1,30 +1,28 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.domain.ActivityTeamInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import com.muyu.common.core.web.model.QueryModel;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Date;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* 团购活动列表查询结果模型
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 19:59
|
||||
**/
|
||||
* 团购活动雷彪查询结果模型
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-20 14:18:10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoListModel {
|
||||
|
||||
/**
|
||||
* ID 编号
|
||||
* 拼团活动ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
|
@ -32,44 +30,62 @@ public class ActivityTeamInfoListModel {
|
|||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 拼团商品图片
|
||||
* 参团人数
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
private Long addTeamNumber;
|
||||
/**
|
||||
* 拼团人数
|
||||
*/
|
||||
private Long attendNumber;
|
||||
/**
|
||||
* 团购结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 开团人数
|
||||
*/
|
||||
private Long openTeamNumber;
|
||||
/**
|
||||
* 参团人数
|
||||
* 拼团商品图片
|
||||
*/
|
||||
private Long addTeamNumber;
|
||||
private String productImage;
|
||||
/**
|
||||
* 团购库存
|
||||
* 商品价格
|
||||
*/
|
||||
private Long teamStock;
|
||||
private BigDecimal productPrice;
|
||||
/**
|
||||
* 剩余库存
|
||||
*/
|
||||
private Long remainStock;
|
||||
/**
|
||||
* 团购结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 团购状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
/**
|
||||
* 团购库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
|
||||
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModel.ActivityTeamInfoListModelBuilder , ActivityTeamInfoListModel> function){
|
||||
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModel.ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) {
|
||||
ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
||||
.id(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
||||
// .openTeamNumber(teamOpenTypeNumber)
|
||||
// .addTeamNumber(teamInTypeNumber)
|
||||
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
// .teamPrice(discountPrice.getTeamPrice())
|
||||
// .productPrice(discountPrice.getProductPrice())
|
||||
// .teamStock(teamProductStockModel.getTeamStock())
|
||||
// .remainStock(teamProductStockModel.getRemainStock())
|
||||
.status(activityTeamInfo.getStatus())
|
||||
.build();
|
||||
return function.apply(
|
||||
ActivityTeamInfoListModel.builder()
|
||||
.id(activityTeamInfo.getId())
|
||||
|
@ -79,4 +95,5 @@ public class ActivityTeamInfoListModel {
|
|||
.status(activityTeamInfo.getStatus())
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,18 +1,21 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.common.core.web.model.QueryModel;
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 团购活动列表查询模型
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 20:05
|
||||
**/
|
||||
* 团购活动雷彪查询模型
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-20 14:18:10
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ActivityTeamInfoListQueryModel extends QueryModel<ActivityTeamInfoListQueryModel> {
|
||||
|
||||
|
@ -20,8 +23,10 @@ public class ActivityTeamInfoListQueryModel extends QueryModel<ActivityTeamInfoL
|
|||
* 搜索关键词
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -1,12 +1,14 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
|
@ -1,12 +1,17 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.domain.req.ActivityTeamInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoUpdReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
|
@ -0,0 +1,91 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamOpenInfoAdReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 团购策略类型模板
|
||||
*
|
||||
* @author CuiFu Bo
|
||||
* @create 2024-12-01 20:24
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ActivityTeamOpenInfoAddModel {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private long id;
|
||||
/**
|
||||
* 团购活动ID
|
||||
*/
|
||||
private long teamId;
|
||||
/**
|
||||
* 团购类型
|
||||
*/
|
||||
private String teamType;
|
||||
/**
|
||||
* 团购策略
|
||||
*/
|
||||
private String teamStrategyId;
|
||||
/**
|
||||
* 参团类型
|
||||
*/
|
||||
private String executiveType;
|
||||
/**
|
||||
* 结束团购时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private String productSku;
|
||||
/**
|
||||
* 开团标识
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 开团状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
public static ActivityTeamOpenInfoAddModel addOpenBuild(ActivityTeamOpenInfoAdReq activityTeamOpenInfoAdReq){
|
||||
return ActivityTeamOpenInfoAddModel.builder()
|
||||
.id(activityTeamOpenInfoAdReq.getId())
|
||||
.teamId(activityTeamOpenInfoAdReq.getTeamId())
|
||||
.teamType(activityTeamOpenInfoAdReq.getTeamType())
|
||||
.teamStrategyId(activityTeamOpenInfoAdReq.getTeamStrategyId())
|
||||
.executiveType(activityTeamOpenInfoAdReq.getExecutiveType())
|
||||
.endTime(activityTeamOpenInfoAdReq.getEndTime())
|
||||
.productId(activityTeamOpenInfoAdReq.getProductId())
|
||||
.productName(activityTeamOpenInfoAdReq.getProductName())
|
||||
.productSku(activityTeamOpenInfoAdReq.getProductSku())
|
||||
.key(activityTeamOpenInfoAdReq.getKey())
|
||||
.orderId(activityTeamOpenInfoAdReq.getOrderId())
|
||||
.status(activityTeamOpenInfoAdReq.getStatus())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,13 +1,14 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.domain.req.TeamProjectSkuInfoAddReq;
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
|
@ -1,7 +1,7 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.resp.ProjectFindSkuInfoResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
|
@ -1,6 +1,6 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.domain.req.ActivityTeamProductSkuReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
|
@ -1,7 +1,7 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.domain.req.ActivityTeamProductSkuSettingReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
|
@ -1,7 +1,7 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.domain.req.TeamProjectSkuInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoUpdReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
|
@ -0,0 +1,55 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
/**
|
||||
* 团购商品优惠力度模型
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-21 11:57
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TeamProductDiscountPriceModel {
|
||||
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private BigDecimal productPrice;
|
||||
|
||||
/**
|
||||
* 团购优惠价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 优惠力度 (商品价格 - 团购优惠价格) / 商品价格
|
||||
*/
|
||||
private double discount;
|
||||
|
||||
/**
|
||||
* 通过 商品价格和团购价格 生成优惠力度
|
||||
* @param productPrice 商品价格
|
||||
* @param teamPrice 团购加
|
||||
* @return 优惠力度
|
||||
*/
|
||||
public static TeamProductDiscountPriceModel of(BigDecimal productPrice, BigDecimal teamPrice) {
|
||||
return TeamProductDiscountPriceModel.builder()
|
||||
.productPrice(productPrice)
|
||||
.teamPrice(teamPrice)
|
||||
.discount(
|
||||
Double.valueOf(productPrice.subtract(teamPrice).divide(productPrice, 2, RoundingMode.HALF_UP).doubleValue())
|
||||
)
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
@ -6,22 +7,25 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 商品库存
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-21 16:54
|
||||
**/
|
||||
|
||||
* 团购商品库存模型
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-21 14:04
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TeamProductStockModel {
|
||||
|
||||
/**
|
||||
* 团购库存
|
||||
* 拼团总库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
/**
|
||||
* 剩余库存
|
||||
* 拼团剩余库存
|
||||
*/
|
||||
private Long remainStock;
|
||||
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
package com.muyu.domain.req;
|
||||
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;
|
||||
|
@ -23,11 +24,11 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
|||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long projectId;
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String projectImage;
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
|
@ -54,7 +55,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
|||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ActivityInfoSkuAddReq> teamProjectSkuInfoAddReqList;
|
||||
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.domain.req;
|
||||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
|
@ -0,0 +1,76 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamOpenInfoAddModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 团购策略类型
|
||||
*
|
||||
* @author CuiFu Bo
|
||||
* @create 2024-12-01 20:28
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ActivityTeamOpenInfoAdReq {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private long id;
|
||||
/**
|
||||
* 团购活动ID
|
||||
*/
|
||||
private long teamId;
|
||||
/**
|
||||
* 团购类型
|
||||
*/
|
||||
private String teamType;
|
||||
/**
|
||||
* 团购策略
|
||||
*/
|
||||
private String teamStrategyId;
|
||||
/**
|
||||
* 参团类型
|
||||
*/
|
||||
private String executiveType;
|
||||
/**
|
||||
* 结束团购时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private String productSku;
|
||||
/**
|
||||
* 开团标识
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 开团状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.domain.req;
|
||||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.domain.req;
|
||||
package com.muyu.marketing.domain.req;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
|
@ -1,18 +1,14 @@
|
|||
package com.muyu.domain.req;
|
||||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.muyu.common.core.web.page.PageDomain;
|
||||
import com.muyu.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
* @Date:2024.11.20 19:49
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TeamInfoListReq extends PageDomain {
|
||||
|
||||
|
@ -20,16 +16,18 @@ public class TeamInfoListReq extends PageDomain {
|
|||
* 搜索关键词
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
/**
|
||||
* 通过当前对象构建业务查询模型
|
||||
* @return 业务查询模型
|
||||
*/
|
||||
public ActivityTeamInfoListQueryModel buildQueryModel(){
|
||||
public ActivityTeamInfoListQueryModel buildQueryModel() {
|
||||
return ActivityTeamInfoListQueryModel.builder()
|
||||
.keyWord(this.keyWord)
|
||||
.status(this.status)
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.domain.req;
|
||||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.domain.req;
|
||||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
|
@ -1,7 +1,8 @@
|
|||
package com.muyu.domain.resp;
|
||||
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;
|
|
@ -1,28 +1,35 @@
|
|||
package com.muyu.domain.model;
|
||||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 团购策略类型
|
||||
*
|
||||
* @author CuiFu Bo
|
||||
* @create 2024-12-04 19:05
|
||||
* @create 2024-12-01 20:27
|
||||
**/
|
||||
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ActivityTeamOpenInfoAddModel {
|
||||
public class ActivityTeamOpenInfoAddResp {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private long id;
|
||||
/**
|
||||
* 团购活动ID
|
||||
*/
|
||||
private Long teamId;
|
||||
private long teamId;
|
||||
/**
|
||||
* 团购类型
|
||||
*/
|
||||
|
@ -30,7 +37,7 @@ public class ActivityTeamOpenInfoAddModel {
|
|||
/**
|
||||
* 团购策略
|
||||
*/
|
||||
private Long teamStrategyId;
|
||||
private String teamStrategyId;
|
||||
/**
|
||||
* 参团类型
|
||||
*/
|
||||
|
@ -38,12 +45,11 @@ public class ActivityTeamOpenInfoAddModel {
|
|||
/**
|
||||
* 结束团购时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
private String productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
|
@ -55,15 +61,13 @@ public class ActivityTeamOpenInfoAddModel {
|
|||
/**
|
||||
* 开团标识
|
||||
*/
|
||||
private String openkey;
|
||||
private String key;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
private String orderId;
|
||||
/**
|
||||
* 开团状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.domain.resp;
|
||||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
|
@ -1,6 +1,8 @@
|
|||
package com.muyu.domain.resp;
|
||||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.muyu.domain.model.ActivityTeamProductSkuModel;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
|
@ -1,8 +1,7 @@
|
|||
package com.muyu.domain.resp;
|
||||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import com.muyu.domain.model.ActivityTeamDetailModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
|
@ -1,12 +1,14 @@
|
|||
package com.muyu.domain.resp;
|
||||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.domain.model.ActivityTeamFindByIdModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamFindByIdModel;
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.muyu.domain.resp;
|
||||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.muyu.common.core.web.page.PageDomain;
|
||||
import com.muyu.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -10,17 +10,14 @@ import lombok.NoArgsConstructor;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*TeamInfoListResp
|
||||
* @Date:2024.11.20 19:47
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TeamInfoListResp {
|
||||
@AllArgsConstructor
|
||||
public class TeamInfoListResp {
|
||||
|
||||
/**
|
||||
* ID编号
|
||||
* 拼团活动ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
|
@ -28,56 +25,66 @@ public class TeamInfoListResp {
|
|||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 拼团商品图片
|
||||
* 参团人数
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
private Long addTeamNumber;
|
||||
/**
|
||||
* 拼团人数
|
||||
*/
|
||||
private Long attendNumber;
|
||||
/**
|
||||
* 团购结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 开团人数
|
||||
*/
|
||||
private Long openTeamNumber;
|
||||
/**
|
||||
* 参团人数
|
||||
* 拼团商品图片
|
||||
*/
|
||||
private Long addTeamNumber;
|
||||
private String productImage;
|
||||
/**
|
||||
* 团购库存
|
||||
* 商品价格
|
||||
*/
|
||||
private Long teamStock;
|
||||
private BigDecimal productPrice;
|
||||
/**
|
||||
* 剩余库存
|
||||
*/
|
||||
private Long remainStock;
|
||||
/**
|
||||
* 团购结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 团购状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
/**
|
||||
* 团购库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
public static TeamInfoListResp listModerBuild(ActivityTeamInfoListModel activityTeamInfoListModel){
|
||||
/**
|
||||
* 列表查询结果,构建为响应对象
|
||||
* @param activityTeamInfoListModel 列表数据查询结果
|
||||
* @return 响应对象
|
||||
*/
|
||||
public static TeamInfoListResp listModelBuild(ActivityTeamInfoListModel activityTeamInfoListModel) {
|
||||
return TeamInfoListResp.builder()
|
||||
.id(activityTeamInfoListModel.getId())
|
||||
.name(activityTeamInfoListModel.getName())
|
||||
.productImage(activityTeamInfoListModel.getProductImage())
|
||||
.teamPrice(activityTeamInfoListModel.getTeamPrice())
|
||||
.attendNumber(activityTeamInfoListModel.getAttendNumber())
|
||||
.openTeamNumber(activityTeamInfoListModel.getOpenTeamNumber())
|
||||
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
||||
.teamStock(activityTeamInfoListModel.getTeamStock())
|
||||
.remainStock(activityTeamInfoListModel.getRemainStock())
|
||||
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
||||
.attendNumber(activityTeamInfoListModel.getAttendNumber())
|
||||
.endTime(activityTeamInfoListModel.getEndTime())
|
||||
.teamPrice(activityTeamInfoListModel.getTeamPrice())
|
||||
.productImage(activityTeamInfoListModel.getProductImage())
|
||||
.productPrice(activityTeamInfoListModel.getProductPrice())
|
||||
.remainStock(activityTeamInfoListModel.getRemainStock())
|
||||
.status(activityTeamInfoListModel.getStatus())
|
||||
.teamStock(activityTeamInfoListModel.getTeamStock())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,14 +1,16 @@
|
|||
package com.muyu.domain.resp;
|
||||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.domain.model.ActivityTeamProductSkuIdModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamFindByIdModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuIdModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 团购活动规格回显
|
|
@ -9,7 +9,7 @@
|
|||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-marketing-remote</artifactId>
|
||||
<artifactId>marketing-remote</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
|
@ -17,4 +17,10 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>marketing-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -9,7 +9,7 @@
|
|||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-marketing-server</artifactId>
|
||||
<artifactId>marketing-server</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
|
@ -17,16 +17,7 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-product-cache</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-marketing-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
|
@ -92,12 +83,18 @@
|
|||
<groupId>com.dtflys.forest</groupId>
|
||||
<artifactId>forest-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 远程调用 -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.3</version>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>marketing-remote</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 商品服务 缓存依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-product-cache</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -124,5 +121,4 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.system.team;
|
||||
package com.muyu.marketing;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
|
@ -0,0 +1,81 @@
|
|||
package com.muyu.marketing.team.controller;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
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.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoFindByIdResp;
|
||||
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.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 营销团购活动控制层
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-20 14:25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/team")
|
||||
public class ActivityTeamController {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamInfoService activityTeamInfoService;;
|
||||
|
||||
/**
|
||||
* 查询营销团购活动列表
|
||||
* @param teamInfoListReq 活动查询入参
|
||||
* @return 活动响应结果
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public Result<TableDataInfo<TeamInfoListResp>> list(@RequestBody TeamInfoListReq teamInfoListReq) {
|
||||
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = activityTeamInfoService.query(teamInfoListReq.buildQueryModel());
|
||||
List<TeamInfoListResp> respList = tableDataInfo.getRows().stream().map(TeamInfoListResp::listModelBuild).toList();
|
||||
return Result.success(
|
||||
new TableDataInfo<>(){{
|
||||
setRows(respList);
|
||||
setTotal(tableDataInfo.getTotal());
|
||||
}}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加团购活动
|
||||
* @param activityTeamInfoSaveReq 添加请求对象
|
||||
* @return 结果集
|
||||
*/
|
||||
@PostMapping
|
||||
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/findById/{id}")
|
||||
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
||||
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
||||
}
|
||||
@PutMapping("/updateByTeamId")
|
||||
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||
return Result.success();
|
||||
}
|
||||
/**
|
||||
* 根据活动id查找
|
||||
*/
|
||||
@GetMapping("/teamList/{id}")
|
||||
public Result<List<ActivityTeamInfo>> teamList(@PathVariable("id") Long id){
|
||||
List<ActivityTeamInfo> activityTeamInfoList= activityTeamInfoService.teamList(id);
|
||||
return Result.success(activityTeamInfoList);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.muyu.marketing.team.controller;
|
||||
|
||||
import com.dtflys.forest.annotation.Post;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamOpenInfoAddModel;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamOpenInfoAdReq;
|
||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 营销团购活动策略类型控制层
|
||||
*
|
||||
* @author CuiFu Bo
|
||||
* @create 2024-12-01 20:32
|
||||
**/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/open")
|
||||
public class ActivityTeamOpenInfoController {
|
||||
@Autowired
|
||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||
@PostMapping("/install")
|
||||
public Result<String> save(ActivityTeamOpenInfoAdReq activityTeamOpenInfoAdReq){
|
||||
activityTeamOpenInfoService.save(ActivityTeamOpenInfoAddModel.addOpenBuild(activityTeamOpenInfoAdReq));
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo> {
|
||||
|
||||
}
|
|
@ -1,15 +1,10 @@
|
|||
package com.muyu.system.team.mapper;
|
||||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.ActivityTeamOpenInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
团购活动执行表
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 20:44
|
||||
**/
|
||||
|
||||
@Mapper
|
||||
public interface ActivityTeamOpenInfoMapper extends BaseMapper<ActivityTeamOpenInfo> {
|
||||
|
||||
}
|
|
@ -1,17 +1,11 @@
|
|||
package com.muyu.system.team.mapper;
|
||||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
商品拼团规格信息表
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 20:45
|
||||
**/
|
||||
@Mapper
|
||||
public interface ActivityTeamProductSkuInfoMapper extends BaseMapper<ActivityTeamProductSkuInfo> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,17 +1,11 @@
|
|||
package com.muyu.system.team.mapper;
|
||||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.TeamStrategyExemption;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
拼团免单策略
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 20:46
|
||||
**/
|
||||
@Mapper
|
||||
public interface TeamStrategyExemptionMapper extends BaseMapper<TeamStrategyExemption> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TeamStrategyHundredMapper extends BaseMapper<TeamStrategyHundred> {
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TeamStrategyOrdinaryMapper extends BaseMapper<TeamStrategyOrdinary> {
|
||||
|
||||
}
|
|
@ -1,30 +1,27 @@
|
|||
package com.muyu.system.team.service;
|
||||
package com.muyu.marketing.team.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.domain.ActivityTeamInfo;
|
||||
import com.muyu.domain.model.*;
|
||||
import com.muyu.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.product.domain.req.ProjectInfoSaveReq;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
商品拼团信息
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 20:49
|
||||
**/
|
||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||
|
||||
|
||||
/**
|
||||
* 通过查询模型查询团购活动列表
|
||||
* @param activityTeamInfoListQueryModel 团购活动查询模型
|
||||
* @param activityTeamInfoListQueryModel 团购活动查询模型
|
||||
* @return 团购活动列表
|
||||
*/
|
||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
||||
|
||||
|
||||
Result<String> save(ActivityTeamInfoSaveReq activityTeamInfoSaveReq);
|
||||
/**
|
||||
* 通过添加模型,去进行商品拼团活动的操作
|
||||
* @param activityTeamInfoAddModel 团购添加模型
|
||||
*/
|
||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||
|
||||
/**
|
||||
* 根据ID查询商品的详情
|
||||
|
@ -40,13 +37,9 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
|||
*/
|
||||
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||
|
||||
/**
|
||||
* 根据活动ID查询商品拼团信息
|
||||
* @param id 活动ID
|
||||
* @return 商品拼团信息
|
||||
*/
|
||||
List<ActivityTeamInfo> ActivityTeamList(Long id);
|
||||
|
||||
List<ActivityTeamInfo> teamList(Long id);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamOpenInfoAddModel;
|
||||
|
||||
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
||||
|
||||
/**
|
||||
* 通过活动ID和开团类型查询开团数量
|
||||
* @param teamId 活动ID
|
||||
* @param teamOpenType 开团类型
|
||||
* @return 开团数量
|
||||
*/
|
||||
public Long getTeamOpenNumberByTeamIdAndType(Long teamId, TeamOpenTypeEnum teamOpenType);
|
||||
|
||||
/**
|
||||
* 根据活动ID获取开团数量
|
||||
* @param teamId 团购活动ID
|
||||
* @return 开团数量
|
||||
*/
|
||||
public default Long getTeamOpenTypeNumberByTeamId(Long teamId){
|
||||
return this.getTeamOpenNumberByTeamIdAndType(teamId, TeamOpenTypeEnum.OPEN_TEAM);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据活动ID获取参团数量
|
||||
* @param teamId 团购活动ID
|
||||
* @return 参团数量
|
||||
*/
|
||||
public default Long getTeamInTypeNumberByTeamId(Long teamId){
|
||||
return this.getTeamOpenNumberByTeamIdAndType(teamId, TeamOpenTypeEnum.IN_TEAM);
|
||||
}
|
||||
|
||||
public void save(ActivityTeamOpenInfoAddModel activityTeamOpenInfoAddModel);
|
||||
}
|
|
@ -1,17 +1,12 @@
|
|||
package com.muyu.system.team.service;
|
||||
package com.muyu.marketing.team.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.domain.model.*;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品拼团规格信息表
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 20:50
|
||||
**/
|
||||
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
||||
|
||||
public default List<ActivityTeamProductSkuInfo> getActivityTeamProductSkuInfoByTeamId(Long teamId){
|
||||
|
@ -22,19 +17,21 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
|
||||
|
||||
/**
|
||||
* 通过活动ID获取商品最优惠的价格
|
||||
* @param teamId 活动Id
|
||||
* 通过团购活动ID获取团购中最优惠的价格
|
||||
* @param teamId 团购ID
|
||||
* @return 优惠价格
|
||||
*/
|
||||
public TeamDiscountPriceModel getDiscountPrice(Long teamId);
|
||||
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId);
|
||||
|
||||
|
||||
/**
|
||||
* 通过活动ID 获取剩余库存
|
||||
* @param teamId 活动Id
|
||||
* @return 剩余库存
|
||||
* 通过活动ID获取 剩余库存
|
||||
* @param teamId 活动ID
|
||||
* @return 库存
|
||||
*/
|
||||
public TeamProductStockModel getStock(Long teamId);
|
||||
|
||||
|
||||
/**
|
||||
* 添加团购商品SKU
|
||||
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
||||
|
@ -74,6 +71,3 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
this.removeByIds(activityTeamProductSkuSettingModel.getRemoveIds());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
|
||||
/**
|
||||
* 免单
|
||||
*/
|
||||
public interface TeamStrategyExemptionService extends ActivityTeamStrategy, IService<TeamStrategyExemption> {
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
|
||||
/**
|
||||
* 百人
|
||||
*/
|
||||
public interface TeamStrategyHundredService extends ActivityTeamStrategy, IService<TeamStrategyHundred> {
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
|
||||
/**
|
||||
* 普通
|
||||
*/
|
||||
public interface TeamStrategyOrdinaryService extends ActivityTeamStrategy, IService<TeamStrategyOrdinary> {
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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.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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
||||
implements ActivityTeamInfoService {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||
|
||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getKeyWord()), ActivityTeamInfo::getName, activityTeamInfoListQueryModel.getKeyWord());
|
||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getStatus()), ActivityTeamInfo::getStatus, activityTeamInfoListQueryModel.getStatus());
|
||||
|
||||
/**
|
||||
* Object<T> -> 创建对象的时候进行的占用
|
||||
* <T> Result<T> 以方法返回值为占用
|
||||
*/
|
||||
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(activityTeamInfoListQueryModel.buildPage(), queryWrapper);
|
||||
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
||||
List<ActivityTeamInfoListModel> activityTeamInfoListModels = activityTeamInfoList.stream()
|
||||
.map(activityTeamInfo -> ActivityTeamInfoListModel.infoBuild(activityTeamInfo,
|
||||
(activityTeamInfoListModelBuilder) -> {
|
||||
TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
|
||||
TeamProductStockModel teamProductStockModel = activityTeamProductSkuInfoService.getStock(activityTeamInfo.getId());
|
||||
Long teamOpenTypeNumber = activityTeamOpenInfoService.getTeamOpenTypeNumberByTeamId(activityTeamInfo.getId());
|
||||
Long teamInTypeNumber = activityTeamOpenInfoService.getTeamInTypeNumberByTeamId(activityTeamInfo.getId());
|
||||
|
||||
return activityTeamInfoListModelBuilder
|
||||
.openTeamNumber(teamOpenTypeNumber)
|
||||
.addTeamNumber(teamInTypeNumber)
|
||||
.attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||
.teamPrice(discountPrice.getTeamPrice())
|
||||
.productPrice(discountPrice.getProductPrice())
|
||||
.teamStock(teamProductStockModel.getTeamStock())
|
||||
.remainStock(teamProductStockModel.getRemainStock())
|
||||
.build();
|
||||
})).toList();
|
||||
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>();
|
||||
tableDataInfo.setTotal(activityTeamInfoPage.getTotal());
|
||||
tableDataInfo.setRows(activityTeamInfoListModels);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过添加模型,去进行商品拼团活动的操作
|
||||
*
|
||||
* @param activityTeamInfoAddModel 团购添加模型
|
||||
*/
|
||||
@Override
|
||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel) {
|
||||
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.addModelBuild(activityTeamInfoAddModel);
|
||||
Assert.isTrue(this.save(activityTeamInfo), StringUtils.format("团购活动添加失败:[{}]", activityTeamInfoAddModel));
|
||||
List<ActivityTeamProductSkuAddModel> teamProductSkuAddModelList = activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList();
|
||||
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
||||
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询商品的详情
|
||||
* @param id 团购活动ID
|
||||
* @return 团购详情
|
||||
*/
|
||||
@Override
|
||||
public ActivityTeamDetailModel findDetailById(Long id) {
|
||||
ActivityTeamInfo activityTeamInfo = this.getById(id);
|
||||
List<ActivityTeamProductSkuModel> activityTeamProductSkuModelList = activityTeamProductSkuInfoService.findListByTeamId(id);
|
||||
return ActivityTeamDetailModel.findSkuSumList(activityTeamInfo,
|
||||
(teamInfoFindByIdRespModelBuilder) -> teamInfoFindByIdRespModelBuilder.projectSkuInfoAddReqList(activityTeamProductSkuModelList).build()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改团购活动信息
|
||||
* @param activityTeamInfoUpdModel 团购活动信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
||||
Assert.isTrue(update,"修改失败");
|
||||
activityTeamProductSkuInfoService.setting(activityTeamInfoUpdModel.getActivityTeamProductSkuSettingModel());
|
||||
return update;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据活动id查找拼团
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ActivityTeamInfo> teamList(Long id) {
|
||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActivityTeamInfo::getId,id);
|
||||
List<ActivityTeamInfo> list = this.list(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Assert;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.util.StringUtil;
|
||||
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamOpenInfoAddModel;
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamOpenInfoMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
|
||||
implements ActivityTeamOpenInfoService {
|
||||
|
||||
/**
|
||||
* 通过活动ID和开团类型查询开团数量
|
||||
*
|
||||
* @param teamId 活动ID
|
||||
* @param teamOpenType 开团类型
|
||||
* @return 开团数量
|
||||
*/
|
||||
@Override
|
||||
public Long getTeamOpenNumberByTeamIdAndType(Long teamId, TeamOpenTypeEnum teamOpenType) {
|
||||
LambdaQueryWrapper<ActivityTeamOpenInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActivityTeamOpenInfo::getTeamId, teamId);
|
||||
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType, teamOpenType.code());
|
||||
return this.count(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(ActivityTeamOpenInfoAddModel activityTeamOpenInfoAddModel) {
|
||||
ActivityTeamOpenInfo activityTeamOpenInfo = ActivityTeamOpenInfo.addBuildModel(activityTeamOpenInfoAddModel);
|
||||
Assert.isTrue(this.save(activityTeamOpenInfo), StringUtils.format("团购活动添加失败[{}]",activityTeamOpenInfo));
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,64 +1,68 @@
|
|||
package com.muyu.system.team.service.impl;
|
||||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.domain.model.*;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
import com.muyu.product.cache.ProjectSkuCache;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
import com.muyu.system.team.mapper.ActivityTeamProductSkuInfoMapper;
|
||||
import com.muyu.system.team.service.ActivityTeamProductSkuInfoService;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.rmi.server.ServerCloneException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
商品拼团规格信息表
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 21:41
|
||||
**/
|
||||
|
||||
|
||||
@Service
|
||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo> implements ActivityTeamProductSkuInfoService {
|
||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||
implements ActivityTeamProductSkuInfoService {
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private ProjectSkuCache projectSkuCache;
|
||||
|
||||
@SneakyThrows
|
||||
/**
|
||||
* 通过团购活动ID获取团购中最优惠的价格
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
* @return 优惠价格
|
||||
*/
|
||||
@Override
|
||||
public TeamDiscountPriceModel getDiscountPrice(Long teamId) {
|
||||
List<ActivityTeamProductSkuInfo> productSkuInfoList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||
if(productSkuInfoList.size()>0){
|
||||
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId) {
|
||||
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||
if(teamProductSkuInfoList.size()>0){
|
||||
// 优惠模型集合
|
||||
Optional<TeamProductDiscountPriceModel> discountPriceModelOptional = teamProductSkuInfoList.stream()
|
||||
.map(activityTeamProductSkuInfo -> {
|
||||
ProjectSkuInfo projectSkuInfo = projectSkuCache.get(activityTeamProductSkuInfo.getProductId(), activityTeamProductSkuInfo.getProductSku());
|
||||
return TeamProductDiscountPriceModel.of(projectSkuInfo.getPrice(), activityTeamProductSkuInfo.getTeamPrice());
|
||||
}).min((o1, o2) -> Double.valueOf(o1.getDiscount() * 100 - o2.getDiscount() * 100).intValue());
|
||||
|
||||
|
||||
Optional<TeamDiscountPriceModel> discountPrice = productSkuInfoList.stream()
|
||||
.map(activityTeamProductSkuInfo -> {
|
||||
ProjectSkuInfo productPriceList = projectSkuCache.get(activityTeamProductSkuInfo.getProductId(), activityTeamProductSkuInfo.getProductSku());
|
||||
return TeamDiscountPriceModel.of(productPriceList.getPrice(), activityTeamProductSkuInfo.getTeamPrice());
|
||||
}).min((o1, o2) -> Double.valueOf(o1.getDiscount() * 100 - o2.getDiscount() * 100).intValue());
|
||||
if (discountPrice.isEmpty()) {
|
||||
throw new ServerCloneException("团购活动下没有商品绑定");
|
||||
if (discountPriceModelOptional.isEmpty()){
|
||||
throw new ServiceException("团购活动下没有商品绑定");
|
||||
}
|
||||
return discountPriceModelOptional.get();
|
||||
}
|
||||
return discountPrice.get();
|
||||
}
|
||||
return TeamDiscountPriceModel.builder()
|
||||
return TeamProductDiscountPriceModel.builder()
|
||||
.productPrice(BigDecimal.valueOf(0))
|
||||
.teamPrice(BigDecimal.valueOf(0))
|
||||
.discount(0.00)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过活动ID获取 剩余库存
|
||||
*
|
||||
* @param teamId 活动ID
|
||||
* @return 库存
|
||||
*/
|
||||
@Override
|
||||
public TeamProductStockModel getStock(Long teamId) {
|
||||
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||
|
@ -67,6 +71,7 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
|||
.remainStock(teamProductSkuInfoList.stream().map(ActivityTeamProductSkuInfo::getRemainStock).reduce(0L, Long::sum))
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加团购商品SKU
|
||||
*
|
|
@ -0,0 +1,69 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Log4j2
|
||||
@Service("team-strategy-exemption")
|
||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||
implements TeamStrategyExemptionService {
|
||||
|
||||
/**
|
||||
* 开团
|
||||
*
|
||||
* @param activityTeamId 团购活动ID
|
||||
*/
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
log.info("参加 - 免单团 - [{}]", activityTeamId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
*
|
||||
* @param teamId 团ID
|
||||
*/
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 参团
|
||||
*
|
||||
* @param teamId 加团ID
|
||||
* @param orderNumber 订单编号
|
||||
*/
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyHundredMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import com.muyu.marketing.team.service.TeamStrategyHundredService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Log4j2
|
||||
@Service("team-strategy-hundred")
|
||||
public class TeamStrategyHundredServiceImpl extends ServiceImpl<TeamStrategyHundredMapper, TeamStrategyHundred>
|
||||
implements TeamStrategyHundredService {
|
||||
@Autowired
|
||||
private ActivityTeamInfoService activityTeamInfoService;
|
||||
|
||||
/**
|
||||
* 开团
|
||||
*
|
||||
* @param activityTeamId 团购活动ID
|
||||
*/
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
log.info("参加 - 百人团 - [{}]", activityTeamId);
|
||||
ActivityTeamOpenInfo activityTeamOpenInfo = new ActivityTeamOpenInfo();
|
||||
activityTeamOpenInfo.setTeamId(activityTeamId);
|
||||
activityTeamOpenInfo.setTeamType("百人团");
|
||||
ActivityTeamInfo byId = activityTeamInfoService.getById(activityTeamId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
*
|
||||
* @param teamId 团ID
|
||||
*/
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 参团
|
||||
*
|
||||
* @param teamId 加团ID
|
||||
* @param orderNumber 订单编号
|
||||
*/
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyOrdinaryMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyOrdinaryService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Log4j2
|
||||
@Service("team-strategy-ordinary")
|
||||
public class TeamStrategyOrdinaryServiceImpl extends ServiceImpl<TeamStrategyOrdinaryMapper, TeamStrategyOrdinary>
|
||||
implements TeamStrategyOrdinaryService {
|
||||
|
||||
/**
|
||||
* 开团
|
||||
*
|
||||
* @param activityTeamId 团购活动ID
|
||||
*/
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
|
||||
log.info("参加 - 普通团 - [{}]", activityTeamId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
*
|
||||
* @param teamId 团ID
|
||||
*/
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 参团
|
||||
*
|
||||
* @param teamId 加团ID
|
||||
* @param orderNumber 订单编号
|
||||
*/
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,7 +1,13 @@
|
|||
package com.muyu.system.team.strategy;
|
||||
package com.muyu.marketing.team.strategy;
|
||||
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 团活动策略
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-29 15:03
|
||||
*/
|
||||
public interface ActivityTeamStrategy {
|
||||
|
||||
|
@ -11,23 +17,18 @@ public interface ActivityTeamStrategy {
|
|||
*/
|
||||
public void openTeam(Long activityTeamId);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
* @param teamId 团ID
|
||||
* @return 申请成功code
|
||||
* @param teamId 团ID
|
||||
*/
|
||||
public String applyTeam(Long teamId);
|
||||
|
||||
public void applyTeam(Long teamId);
|
||||
|
||||
/**
|
||||
* 参团
|
||||
* @param teamId 加团ID
|
||||
* @param orderNumber 订单编号
|
||||
* @param orderNumber 订单编号
|
||||
*/
|
||||
public void addTeam(Long teamId,String orderNumber);
|
||||
|
||||
public void addTeam(Long teamId, String orderNumber);
|
||||
|
||||
/**
|
||||
* 退团
|
||||
|
@ -35,11 +36,9 @@ public interface ActivityTeamStrategy {
|
|||
*/
|
||||
public void backTeam(Long teamId);
|
||||
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
* @param teamId 团购ID
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
public void settle(Long teamId);
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package com.muyu.marketing.team.strategy.impl;
|
||||
|
||||
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.core.utils.SpringUtils;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 团购执行器
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-29 15:28
|
||||
*/
|
||||
@Service
|
||||
@Primary
|
||||
public class ActivityTeamStrategyImpl implements ActivityTeamStrategy {
|
||||
/**
|
||||
* 开团
|
||||
*
|
||||
* @param activityTeamId 团购活动ID
|
||||
*/
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
// 假设这里是通过方法获取的type,activityTeamId.toString()
|
||||
// "team-strategy-exemption"
|
||||
// "team-strategy-hundred"
|
||||
// "team-strategy-ordinary"
|
||||
|
||||
String activityTeamType = null;
|
||||
if (activityTeamId == null) {
|
||||
throw new ServiceException("activityTeamId is null");
|
||||
}else if (activityTeamId == 0) {
|
||||
activityTeamType = "team-strategy-exemption";
|
||||
}else if (activityTeamId == 1) {
|
||||
activityTeamType = "team-strategy-hundred";
|
||||
}else if (activityTeamId == 2) {
|
||||
activityTeamType = "team-strategy-ordinary";
|
||||
}
|
||||
ActivityTeamStrategy activityTeamStrategy = SpringUtils.getBean(activityTeamType);
|
||||
activityTeamStrategy.openTeam(activityTeamId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
*
|
||||
* @param teamId 团ID
|
||||
*/
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 参团
|
||||
*
|
||||
* @param teamId 加团ID
|
||||
* @param orderNumber 订单编号
|
||||
*/
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
*
|
||||
* @param teamId 团购ID
|
||||
*/
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9219
|
||||
port: 9209
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
@ -25,4 +25,4 @@ spring:
|
|||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
logging:
|
||||
level:
|
||||
com.muyu.system.mapper: DEBUG
|
||||
com.muyu.marketing.mapper: DEBUG
|
|
@ -0,0 +1,28 @@
|
|||
package com.muyu.test;
|
||||
|
||||
|
||||
import com.muyu.marketing.MuYuMarketingApplication;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
/**
|
||||
* 测试
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-29 15:40
|
||||
*/
|
||||
@SpringBootTest(classes = MuYuMarketingApplication.class)
|
||||
public class TeamStrategyTest {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamStrategy activityTeamStrategy;
|
||||
|
||||
@Test
|
||||
public void testStrategy() {
|
||||
activityTeamStrategy.openTeam(0L);
|
||||
activityTeamStrategy.openTeam(1L);
|
||||
activityTeamStrategy.openTeam(2L);
|
||||
}
|
||||
}
|
|
@ -1,80 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.domain.model.ActivityTeamOpenInfoAddModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ActivityTeamOpenInfo {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 团购活动ID
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
* 团购类型
|
||||
*/
|
||||
private String teamType;
|
||||
/**
|
||||
* 团购策略
|
||||
*/
|
||||
private Long teamStrategyId;
|
||||
/**
|
||||
* 参团类型
|
||||
*/
|
||||
private String executiveType;
|
||||
/**
|
||||
* 结束团购时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private String productSku;
|
||||
/**
|
||||
* 开团标识
|
||||
*/
|
||||
private String openkey;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 开团状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
public static ActivityTeamOpenInfo add(ActivityTeamOpenInfoAddModel addModel){
|
||||
return ActivityTeamOpenInfo.builder()
|
||||
.teamId(addModel.getTeamId())
|
||||
.teamType(addModel.getTeamType())
|
||||
.teamStrategyId(addModel.getTeamStrategyId())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TeamStrategyExemptionHundred {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private long id;
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private long duration;
|
||||
/**
|
||||
* 最大购买量
|
||||
*/
|
||||
private long maxBuy;
|
||||
/**
|
||||
* 单次购买量
|
||||
*/
|
||||
private long oneBuy;
|
||||
/**
|
||||
* 虚拟人数
|
||||
*/
|
||||
private long virtualNumber;
|
||||
/**
|
||||
* 策略状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 规则信息
|
||||
*/
|
||||
private String ruleInfo;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TeamStrategyExemptionOrdinary {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private long id;
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private long duration;
|
||||
/**
|
||||
* 成团人数
|
||||
*/
|
||||
private long teamNumber;
|
||||
/**
|
||||
* 最大购买量
|
||||
*/
|
||||
private long maxBuy;
|
||||
/**
|
||||
* 单次购买量
|
||||
*/
|
||||
private long oneBuy;
|
||||
/**
|
||||
* 虚拟人数
|
||||
*/
|
||||
private long virtualNumber;
|
||||
/**
|
||||
* 策略状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package com.muyu.domain.model;
|
||||
|
||||
|
||||
import com.muyu.domain.req.ActivityInfoAddReq;
|
||||
import com.muyu.domain.req.ActivityInfoSkuAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 拼团规格添加模板
|
||||
*
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-22 20:37
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ActivitySkuModel {
|
||||
|
||||
List<ActivityInfoSkuAddReq> activityInfoAdd;
|
||||
|
||||
public static ActivitySkuModel activitySkuModel(ActivityInfoAddReq req){
|
||||
return ActivitySkuModel.builder()
|
||||
.activityInfoAdd(req.getSkuList())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,110 +0,0 @@
|
|||
package com.muyu.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.domain.ActivityTeamInfo;
|
||||
import com.muyu.domain.req.ActivityInfoAddReq;
|
||||
import lombok.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Null;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 团购活动添加模型
|
||||
*
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-22 16:48
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ActivityTeamInfoAddModel {
|
||||
/**
|
||||
* 商品iD
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
*商品图片
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 商品轮播图
|
||||
*/
|
||||
private String imageList;
|
||||
/**
|
||||
*活动名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
*活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
*商品单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
*商品的轮番图
|
||||
*/
|
||||
private String imagesList;
|
||||
/**
|
||||
*活动时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
*策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
*策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
/**
|
||||
*排序
|
||||
*/
|
||||
private long sort;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
*详情
|
||||
*/
|
||||
private String content;
|
||||
|
||||
|
||||
public static ActivityTeamInfoAddModel activityTeamInfoAddModel (ActivityInfoAddReq req){
|
||||
return ActivityTeamInfoAddModel.builder()
|
||||
.productImage(req.getProductImage())
|
||||
.name(req.getName())
|
||||
.introduction(req.getIntroduction())
|
||||
.unit(req.getUnit())
|
||||
.imagesList(req.getImagesList())
|
||||
.endTime(req.getEndTime())
|
||||
.strategyType(req.getStrategyType())
|
||||
.strategyId(req.getStrategyId())
|
||||
.sort(req.getSort())
|
||||
.content(req.getContent())
|
||||
.build();
|
||||
}
|
||||
|
||||
public ActivityTeamInfo activityTeamInfoAdd(){
|
||||
return ActivityTeamInfo.builder()
|
||||
.productImage(this.getProductImage())
|
||||
.name(this.getName())
|
||||
.introduction(this.getIntroduction())
|
||||
.unit(this.getUnit())
|
||||
.imageList(this.getImagesList())
|
||||
.endTime(this.getEndTime())
|
||||
.strategyType(this.getStrategyType())
|
||||
.strategyId(this.getStrategyId())
|
||||
.sort(this.getSort())
|
||||
.content(this.getContent())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package com.muyu.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
/**
|
||||
* 团购活动价格模型
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-21 16:07
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TeamDiscountPriceModel {
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private BigDecimal productPrice;
|
||||
/**
|
||||
* 优惠力度
|
||||
*/
|
||||
private Double discount;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @param teamPrice
|
||||
* @return
|
||||
*/
|
||||
public static TeamDiscountPriceModel of(BigDecimal price, BigDecimal teamPrice){
|
||||
return TeamDiscountPriceModel.builder()
|
||||
.productPrice(price)
|
||||
.teamPrice(teamPrice)
|
||||
.discount(price.subtract(teamPrice).divide(price,2, RoundingMode.HALF_EVEN).doubleValue())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import com.muyu.domain.model.ActivitySkuModel;
|
||||
import com.muyu.domain.model.ActivityTeamInfoAddModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 拼团活动添加
|
||||
*
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-22 20:48
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ActivityInfoAddReq {
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
*商品图片
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
*活动名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
*活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
*商品单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
*商品的轮番图
|
||||
*/
|
||||
private String imagesList;
|
||||
/**
|
||||
*活动时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
*策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
*策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
/**
|
||||
*排序
|
||||
*/
|
||||
private long sort;
|
||||
/**
|
||||
*详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private List<ActivityInfoSkuAddReq> skuList;
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品Sku
|
||||
*
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-23 01:18
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
|
||||
public class ActivityInfoSkuAddReq {
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private String productSku;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
package com.muyu.system.team.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.dtflys.forest.annotation.Post;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.domain.ActivityTeamInfo;
|
||||
import com.muyu.domain.model.ActivitySkuModel;
|
||||
import com.muyu.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.domain.model.ActivityTeamInfoUpdModel;
|
||||
import com.muyu.domain.req.ActivityInfoAddReq;
|
||||
import com.muyu.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.domain.req.ActivityTeamInfoUpdReq;
|
||||
import com.muyu.domain.req.TeamInfoListReq;
|
||||
import com.muyu.domain.resp.TeamInfoFindByIdResp;
|
||||
import com.muyu.domain.resp.TeamInfoListResp;
|
||||
import com.muyu.system.team.service.ActivityTeamInfoService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品拼团信息
|
||||
* @program: cloud-server
|
||||
* @description: 商品拼团信息
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 21:49
|
||||
**/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/team")
|
||||
public class ActivityTeamInfoController {
|
||||
|
||||
@Resource
|
||||
private ActivityTeamInfoService activityTeamInfoService;
|
||||
|
||||
/**
|
||||
* 团购活动列表查询
|
||||
* @param teamInfoListReq 分页
|
||||
* @return 列表数据
|
||||
*/
|
||||
@RequiresPermissions("marketing:marketing:list")
|
||||
@PostMapping("/list")
|
||||
public Result<TableDataInfo<TeamInfoListResp>> list(@RequestBody TeamInfoListReq teamInfoListReq){
|
||||
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = activityTeamInfoService.query(teamInfoListReq.buildQueryModel());
|
||||
List<TeamInfoListResp> listResp = tableDataInfo.getRows().stream().map(TeamInfoListResp::listModerBuild).toList();
|
||||
return Result.success(
|
||||
new TableDataInfo<>(){{
|
||||
setRows(listResp);
|
||||
setTotal(tableDataInfo.getTotal());
|
||||
}}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增团购活动
|
||||
* @param activityTeamInfoSaveReq 团购参数
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("marketing:marketing:save")
|
||||
@PostMapping("/save")
|
||||
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq ) throws ParseException {
|
||||
return activityTeamInfoService.save(activityTeamInfoSaveReq);
|
||||
}
|
||||
|
||||
@PostMapping("/findById/{id}")
|
||||
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
||||
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
||||
}
|
||||
@PutMapping("/updateByTeamId")
|
||||
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据活动ID查询商品拼团信息
|
||||
* @param id 活动ID
|
||||
* @return 商品拼团信息
|
||||
*/
|
||||
@GetMapping("/ActivityTeamList/{id}")
|
||||
public Result<List<ActivityTeamInfo>> teamList(@PathVariable("id") Long id){
|
||||
List<ActivityTeamInfo> activityTeamInfoList= activityTeamInfoService.ActivityTeamList(id);
|
||||
return Result.success(activityTeamInfoList);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package com.muyu.system.team.controller;
|
||||
|
||||
import com.muyu.system.team.service.ActivityTeamOpenInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 团购活动执行表
|
||||
* @program: cloud-server
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 21:50
|
||||
**/
|
||||
@Api(tags = "团购活动执行")
|
||||
@RestController
|
||||
@RequestMapping("/open")
|
||||
|
||||
public class ActivityTeamOpenInfoController {
|
||||
@Autowired(required=true)
|
||||
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package com.muyu.system.team.controller;
|
||||
|
||||
/**
|
||||
* 商品拼团规格信息表
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 21:50
|
||||
**/
|
||||
|
||||
|
||||
public class ActivityTeamProductSkuInfoController {
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.muyu.system.team.controller;
|
||||
|
||||
/**
|
||||
* 拼团免单策略
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 21:51
|
||||
**/
|
||||
|
||||
|
||||
public class TeamStrategyExemptionController {
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.muyu.system.team.controller;
|
||||
|
||||
/**
|
||||
* 百人策略
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 21:51
|
||||
**/
|
||||
|
||||
|
||||
public class TeamStrategyExemptionHundredController {
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.muyu.system.team.controller;
|
||||
|
||||
/**
|
||||
* 普通策略
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 21:51
|
||||
**/
|
||||
|
||||
|
||||
public class TeamStrategyExemptionOrdinaryController {
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.muyu.system.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.ActivityTeamInfo;
|
||||
import net.minidev.json.writer.BeansMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
商品拼团信息
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 20:41
|
||||
**/
|
||||
@Mapper
|
||||
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo> {
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.muyu.system.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.TeamStrategyExemptionHundred;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
百人策略
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-20 20:47
|
||||
**/
|
||||
@Mapper
|
||||
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyExemptionHundred> {
|
||||
}
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue